init
- 框架初始化 - 安装插件 - 修复PHP8.4报错
This commit is contained in:
178
application/admin/view/shopro/dispatch/dispatch/add.html
Normal file
178
application/admin/view/shopro/dispatch/dispatch/add.html
Normal file
@@ -0,0 +1,178 @@
|
||||
{include file="/shopro/common/script" /}
|
||||
|
||||
<style>
|
||||
.dispatch-form .sa-template-wrap {
|
||||
width: 100%;
|
||||
max-width: unset;
|
||||
}
|
||||
|
||||
.dispatch-form .sa-template-wrap .item {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.dispatch-form .sa-template-wrap .el-form-item .el-form-item__content {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.dispatch-form .sa-template-wrap .express {
|
||||
flex: unset !important;
|
||||
width: 110px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="addEdit" class="dispatch-form" v-cloak>
|
||||
<el-container class="panel-block">
|
||||
<el-main>
|
||||
<el-scrollbar height="100%">
|
||||
<el-form :model="form.model" :rules="form.rules" ref="formRef" label-width="100px">
|
||||
<el-form-item label="模板名称" prop="name">
|
||||
<el-input class="sa-w-360" v-model="form.model.name" placeholder="请输入模板名称"></el-input>
|
||||
</el-form-item>
|
||||
<template v-if="form.model.type=='express'">
|
||||
<el-form-item label="计价方式">
|
||||
<el-radio-group v-model="state.priceType">
|
||||
<el-radio label="number">按件数</el-radio>
|
||||
<el-radio label="weight">按重量</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div class="sa-template-wrap">
|
||||
<div class="header sa-flex">
|
||||
<div class="key area">可配送区域</div>
|
||||
<div v-if="state.priceType == 'number'" class="express key">首件</div>
|
||||
<div v-if="state.priceType == 'weight'" class="express key">首重(kg)</div>
|
||||
<div class="express key">运费(元)</div>
|
||||
<div v-if="state.priceType == 'number'" class="express key">续件</div>
|
||||
<div v-if="state.priceType == 'weight'" class="express key">续重(kg)</div>
|
||||
<div class="express key">续费(元)</div>
|
||||
<div class="oper">操作</div>
|
||||
</div>
|
||||
<draggable v-model="form.model.express" :animation="300" handle=".sortable-drag"
|
||||
item-key="element">
|
||||
<template #item="{ element, index }">
|
||||
<div class="item">
|
||||
<el-form-item class="key area" :prop="'express.' + index + '.district_text'"
|
||||
:rules="form.rules.express.district_text">
|
||||
<el-button v-if="!element.district_text" type="primary"
|
||||
@click="onSelectArea(index)">选择地址</el-button>
|
||||
<div v-if="element.district_text" class="sa-flex sa-row-between area-edit">
|
||||
<div>{{ element.district_text }}</div>
|
||||
<el-button class="ml-1" type="primary" link
|
||||
@click="onSelectArea(index)">选择
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="state.priceType == 'number'" class="express key"
|
||||
:prop="'express.' + index + '.first_num'"
|
||||
:rules="form.rules.express.first_num">
|
||||
<el-input placeholder="请输入首件" type="number" min="0"
|
||||
v-model="element.first_num">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="state.priceType == 'weight'" class="express key"
|
||||
:prop="'express.' + index + '.first_num'"
|
||||
:rules="form.rules.express.first_num">
|
||||
<el-input placeholder="请输入首重" type="number" min="0"
|
||||
v-model="element.first_num">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="express key" :prop="'express.' + index + '.first_price'"
|
||||
:rules="form.rules.express.first_price">
|
||||
<el-input placeholder="请输入运费" type="number" min="0" :step="0.01"
|
||||
v-model="element.first_price">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="state.priceType == 'number'" class="express key"
|
||||
:prop="'express.' + index + '.additional_num'"
|
||||
:rules="form.rules.express.additional_num">
|
||||
<el-input placeholder="请输入续件" type="number" min="0"
|
||||
v-model="element.additional_num">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="state.priceType == 'weight'" class="express key"
|
||||
:prop="'express.' + index + '.additional_num'"
|
||||
:rules="form.rules.express.additional_num">
|
||||
<el-input placeholder="请输入续重" type="number" min="0"
|
||||
v-model="element.additional_num">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="express key"
|
||||
:prop="'express.' + index + '.additional_price'"
|
||||
:rules="form.rules.express.additional_price">
|
||||
<el-input placeholder="请输入续费" type="number" min="0" :step="0.01"
|
||||
v-model="element.additional_price">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="oper">
|
||||
<el-popconfirm width="fit-content" confirm-button-text="确认"
|
||||
cancel-button-text="取消" title="确认删除这条记录?"
|
||||
@confirm="onDeleteTemplate(index)">
|
||||
<template #reference>
|
||||
<el-button type="danger" link @click.stop>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<i class="iconfont iconmove sortable-drag"></i>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
<el-button class="add-params" type="primary" plain icon="Plus" @click="onAddTemplate">添加
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="form.model.type=='autosend'">
|
||||
<el-form-item label="发货类型:">
|
||||
<el-radio-group v-model="form.model.autosend.type" @change="onChangeAutosendType">
|
||||
<el-radio label="text">固定内容</el-radio>
|
||||
<el-radio label="params">自定义内容</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.model.autosend.type=='text'" label="发货内容:">
|
||||
<el-input v-model="form.model.autosend.content" placeholder="请输入自动发货内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.model.autosend.type=='params'" label="发货内容:">
|
||||
<div class="sa-template-wrap">
|
||||
<div class="header sa-flex">
|
||||
<div class="key">参数名称</div>
|
||||
<div class="key">内容</div>
|
||||
<div class="oper">操作</div>
|
||||
</div>
|
||||
<draggable v-model="form.model.autosend.content" :animation="300"
|
||||
handle=".sortable-drag" item-key="element">
|
||||
<template #item="{ element, index }">
|
||||
<div class="item">
|
||||
<el-form-item class="key">
|
||||
<el-input placeholder="请输入" v-model="element.title">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="key">
|
||||
<el-input placeholder="请输入" v-model="element.content">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="oper">
|
||||
<el-popconfirm width="fit-content" confirm-button-text="确认"
|
||||
cancel-button-text="取消" title="确认删除这条记录?"
|
||||
@confirm="onDeleteContent(index)">
|
||||
<template #reference>
|
||||
<el-button type="danger" link @click.stop>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<i class="iconfont iconmove sortable-drag"></i>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
<el-button class="add-params" type="primary" plain icon="Plus" @click="onAddContent">添加
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</el-main>
|
||||
<el-footer class="sa-footer--submit sa-flex sa-row-right">
|
||||
<el-button type="primary" @click="onConfirm">确定</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</div>
|
||||
180
application/admin/view/shopro/dispatch/dispatch/index.html
Normal file
180
application/admin/view/shopro/dispatch/dispatch/index.html
Normal file
@@ -0,0 +1,180 @@
|
||||
{include file="/shopro/common/script" /}
|
||||
|
||||
<style>
|
||||
.dispatch-index {
|
||||
font-size: 14px;
|
||||
color: var(--sa-font);
|
||||
}
|
||||
|
||||
.dispatch-index .dispatch-item {
|
||||
min-width: 100%;
|
||||
display: inline-block;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--sa-space);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.dispatch-index .template-header {
|
||||
height: 40px;
|
||||
background: var(--t-bg-disabled);
|
||||
border-radius: 4px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.dispatch-index .template-header .name {
|
||||
min-width: 570px;
|
||||
}
|
||||
|
||||
.dispatch-index .template-header .right {
|
||||
flex-shrink: 0;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.dispatch-index .template-body .template-item {
|
||||
border-bottom: 1px solid var(--sa-space);
|
||||
padding: 10px 0 10px 16px;
|
||||
font-size: 14px;
|
||||
color: var(--sa-font);
|
||||
}
|
||||
|
||||
.dispatch-index .template-body .template-item:first-of-type {
|
||||
border-bottom: none;
|
||||
box-shadow: 0 2px 6px #8c8c8c1f;
|
||||
}
|
||||
|
||||
.dispatch-index .template-body .template-item .area {
|
||||
min-width: 600px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.dispatch-index .template-body .template-item .district {
|
||||
min-width: 88px;
|
||||
padding: 0 18px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="index" class="dispatch-index panel panel-default panel-intro" v-cloak>
|
||||
<el-container class="panel-block">
|
||||
<el-header class="sa-header">
|
||||
<el-tabs class="sa-tabs" v-model="state.dispatch_type" @tab-change="onChangeTab">
|
||||
<el-tab-pane label="物流快递" name="express"></el-tab-pane>
|
||||
<el-tab-pane label="自动发货" name="autosend"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="sa-title sa-flex sa-row-between">
|
||||
<div class="sa-title-left">
|
||||
<div class="left-name">配送设置</div>
|
||||
</div>
|
||||
<div class="sa-title-right">
|
||||
<el-button class="sa-button-refresh" icon="RefreshRight" @click="getData"></el-button>
|
||||
{if $auth->check('shopro/dispatch/dispatch/add')}
|
||||
<el-button icon="Plus" type="primary" @click="onAdd">添加</el-button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="sa-main">
|
||||
<el-scrollbar v-if="state.dispatch_type=='express'">
|
||||
<div class="dispatch-item" v-for="item in state.data" :key="item">
|
||||
<div class="template-header sa-flex sa-row-between">
|
||||
<div class="name sa-flex">
|
||||
<div class="mr-2">#{{ item.id }}</div>
|
||||
<div>{{ item.name }}</div>
|
||||
</div>
|
||||
<div class="right sa-flex">
|
||||
<div class="mr-1">最后编辑时间:{{ item.updatetime }}</div>
|
||||
{if $auth->check('shopro/dispatch/dispatch/edit')}
|
||||
<el-button type="primary" class="is-link" @click="onEdit(item.id)">编辑</el-button>
|
||||
{/if}
|
||||
{if $auth->check('shopro/dispatch/dispatch/add')}
|
||||
<el-button type="info" link @click="onCopy(item.id)">复制</el-button>
|
||||
{/if}
|
||||
<el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
|
||||
title="确认删除这条记录?" @confirm="onDelete(item.id)">
|
||||
<template #reference>
|
||||
{if $auth->check('shopro/dispatch/dispatch/delete')}
|
||||
<el-button type="danger" link> 删除</el-button>
|
||||
{/if}
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</div>
|
||||
<div class="template-body">
|
||||
<template v-for="(inneritem, index) in item.express" :key="index">
|
||||
<div v-if="index == 0" class="template-item sa-flex sa-row-between">
|
||||
<div class="area">可配送区域</div>
|
||||
<div class="sa-flex">
|
||||
<div class="district">
|
||||
{{ inneritem.type == 'weight' ? '首重(kg)' : '首件' }}
|
||||
</div>
|
||||
<div class="district">运费(元)</div>
|
||||
<div class="district">
|
||||
{{ inneritem.type == 'weight' ? '续重(kg)' : '续件' }}
|
||||
</div>
|
||||
<div class="district">续费(元)</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="template-item sa-flex sa-row-between">
|
||||
<div class="area">{{ inneritem.district_text || '-' }}</div>
|
||||
<div class="sa-flex">
|
||||
<div class="district">{{ inneritem.first_num }}</div>
|
||||
<div class="district">{{ inneritem.first_price }}</div>
|
||||
<div class="district">{{ inneritem.additional_num }}</div>
|
||||
<div class="district">{{ inneritem.additional_price }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<el-table v-if="state.dispatch_type=='autosend'" class="sa-table" :data="state.data">
|
||||
<el-table-column prop="id" label="ID" min-width="90">
|
||||
</el-table-column>
|
||||
<el-table-column label="模板名称" min-width="140">
|
||||
<template #default="scope">
|
||||
<div class="sa-line-1">
|
||||
{{scope.row.name}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="自动发货内容" min-width="400">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<div v-if="scope.row.autosend?.type=='text'">
|
||||
{{scope.row.autosend?.content}}</div>
|
||||
<div v-else>
|
||||
<template v-for="(item,index) in scope.row.autosend?.content">
|
||||
{{item.title}}:{{item.content}}
|
||||
<span v-if="index!=scope.row.autosend?.content.length-1" class="sa-m-r-4">;</span>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="updatetime" label="最后编辑时间" min-width="172">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="180">
|
||||
<template #default="scope">
|
||||
{if $auth->check('shopro/dispatch/dispatch/edit')}
|
||||
<el-button type="primary" class="is-link" @click="onEdit(scope.row.id)">编辑</el-button>
|
||||
{/if}
|
||||
{if $auth->check('shopro/dispatch/dispatch/add')}
|
||||
<el-button type="info" link @click="onCopy(scope.row.id)">复制</el-button>
|
||||
{/if}
|
||||
<el-popconfirm width="fit-content" confirm-button-text="确认" cancel-button-text="取消"
|
||||
title="确认删除这条记录?" @confirm="onDelete(scope.row.id)">
|
||||
<template #reference>
|
||||
{if $auth->check('shopro/dispatch/dispatch/delete')}
|
||||
<el-button type="danger" link> 删除</el-button>
|
||||
{/if}
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-main>
|
||||
<el-footer class="sa-footer sa-flex sa-row-right">
|
||||
<sa-pagination v-model="pagination" @pagination-change="getData"></sa-pagination>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</div>
|
||||
Reference in New Issue
Block a user