Browse Source

修改物流方案为根据仓库设置

master
xh-pan1 3 years ago
parent
commit
d388e2f146
  1. 26
      src/views/system/logistics/Edit.vue
  2. 1
      src/views/system/logistics/index.vue

26
src/views/system/logistics/Edit.vue

@ -19,6 +19,20 @@
onblur="value=value.replace(/(^\s*)|(\s*$)/g, '')" onblur="value=value.replace(/(^\s*)|(\s*$)/g, '')"
/> />
</el-form-item> </el-form-item>
<el-form-item label="仓库">
<template slot-scope="scope">
<el-select v-model="params.storehouseId" placeholder="请选择具体仓库" clearable>
<el-option
v-for="(item,index) in storehouseList"
:key="index"
:label="item.storehouseName"
:value="item.storehouseId"
/>
</el-select>
</template>
</el-form-item>
<el-form-item label="计费方式"> <el-form-item label="计费方式">
<el-radio-group v-model="params.chargeType"> <el-radio-group v-model="params.chargeType">
<el-radio :disabled="isDisabled" :label="1">按件数</el-radio> <el-radio :disabled="isDisabled" :label="1">按件数</el-radio>
@ -145,6 +159,7 @@
// import Setting from "@/api/Setting"; // import Setting from "@/api/Setting";
import { logisticsGetById, logisticsAdd, logisticsUpdate } from '@/api/shopSys' import { logisticsGetById, logisticsAdd, logisticsUpdate } from '@/api/shopSys'
import areaJSON from '@/assets/area' import areaJSON from '@/assets/area'
import { storehouseGetAll } from '@/api/shopSys'
export default { export default {
props: { props: {
@ -168,6 +183,7 @@ export default {
}, },
params: { params: {
logisticsName: '', logisticsName: '',
storehouseId: 0,
chargeType: 1, chargeType: 1,
charges: [ charges: [
{ {
@ -179,6 +195,7 @@ export default {
} }
] ]
}, },
storehouseList: [],
selectArea: [], selectArea: [],
areaVisible: false, areaVisible: false,
areaList: [], areaList: [],
@ -228,8 +245,15 @@ export default {
} }
}, },
created() { created() {
this.getStorehouseList();
}, },
methods: { methods: {
//
async getStorehouseList() {
const res = await storehouseGetAll({ page: 1, pageSize: 100
})
this.storehouseList = res.data.list
},
// //
initArea() { initArea() {
const { province_list, city_list } = areaJSON const { province_list, city_list } = areaJSON
@ -431,6 +455,8 @@ export default {
async onSubmit() { async onSubmit() {
if (this.params.logisticsName === '') { if (this.params.logisticsName === '') {
this.$message.error('请输入方案名称') this.$message.error('请输入方案名称')
} else if (this.params.storehouseId === null ||this.params.storehouseId === '' || this.params.storehouseId === 0) {
this.$message.error('请选择仓库')
} else if (this.type === 'add') { } else if (this.type === 'add') {
this.add() this.add()
} else if (this.type === 'edit') { } else if (this.type === 'edit') {

1
src/views/system/logistics/index.vue

@ -30,6 +30,7 @@
<el-table-column label="方案名称" width="220"> <el-table-column label="方案名称" width="220">
<template slot-scope="scope">{{ scope.row.logisticsName }}</template> <template slot-scope="scope">{{ scope.row.logisticsName }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="storehouseName" label="仓库" width="220" />
<el-table-column prop="regions" label="可配送范围" width="420" /> <el-table-column prop="regions" label="可配送范围" width="420" />
<el-table-column prop="name" label="计费方式" width="220"> <el-table-column prop="name" label="计费方式" width="220">
<template slot-scope="scope"> <template slot-scope="scope">

Loading…
Cancel
Save