|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
<template> |
|
|
|
|
<basic-container> |
|
|
|
|
<div class="avue-crud"> |
|
|
|
|
<!-- 查询模块 --> |
|
|
|
|
<el-row v-if="!search"> |
|
|
|
|
<!-- 查询模块 --> |
|
|
|
|
<el-form :inline="true" :model="query"> |
|
|
|
|
<div class="fo-rl"> |
|
|
|
|
<el-form-item label="货物名称:"> |
|
|
|
@ -22,6 +22,8 @@
|
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<!-- 控件区 --> |
|
|
|
|
<el-row> |
|
|
|
|
<div class="avue-crud__header"> |
|
|
|
|
<!-- 头部左侧按钮模块 --> |
|
|
|
@ -29,6 +31,9 @@
|
|
|
|
|
<el-button icon="el-icon-plus" type="primary" @click="createCheckTask" |
|
|
|
|
>创建盘点任务</el-button |
|
|
|
|
> |
|
|
|
|
<el-button icon="el-icon-delete" type="primary" @click="handleBatchDelete"> |
|
|
|
|
批量删除 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
<!-- 头部右侧按钮模块 --> |
|
|
|
|
<div class="avue-crud__right"> |
|
|
|
@ -38,8 +43,9 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<!-- 列表模块 --> |
|
|
|
|
<el-row> |
|
|
|
|
<!-- 列表模块 --> |
|
|
|
|
<tablecmt |
|
|
|
|
:columnList="columnList" |
|
|
|
|
:tableData="data" |
|
|
|
@ -55,30 +61,32 @@
|
|
|
|
|
type="primary" |
|
|
|
|
text |
|
|
|
|
icon="el-icon-view" |
|
|
|
|
@click="handleViewCheck(slotProps.scope)" |
|
|
|
|
@click="handleViewCheck(slotProps.scope.row)" |
|
|
|
|
>查 看</el-text |
|
|
|
|
> |
|
|
|
|
<el-text |
|
|
|
|
type="primary" |
|
|
|
|
text |
|
|
|
|
icon="el-icon-view" |
|
|
|
|
@click="handleEditCheck(slotProps.scope)" |
|
|
|
|
@click="handleEditCheck(slotProps.scope.row)" |
|
|
|
|
>编 辑</el-text |
|
|
|
|
> |
|
|
|
|
<el-text |
|
|
|
|
type="primary" |
|
|
|
|
text |
|
|
|
|
icon="el-icon-view" |
|
|
|
|
@click="handleDeleteCheck(slotProps.scope)" |
|
|
|
|
@click="handleDeleteCheck(slotProps.scope.row)" |
|
|
|
|
>删 除</el-text |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</tablecmt> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<!-- 分页模块 --> |
|
|
|
|
<el-row> |
|
|
|
|
<div class="avue-crud__pagination flex-c-sb" style="width: 100%"> |
|
|
|
|
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div> |
|
|
|
|
<!-- 分页模块 --> |
|
|
|
|
<!-- 分页 --> |
|
|
|
|
<el-pagination |
|
|
|
|
align="right" |
|
|
|
|
background |
|
|
|
@ -102,14 +110,12 @@
|
|
|
|
|
center |
|
|
|
|
:before-close="beforeClose" |
|
|
|
|
append-to-body |
|
|
|
|
:disabled="view" |
|
|
|
|
> |
|
|
|
|
<el-form :disabled="view" ref="form" :model="form" label-width="120px"> |
|
|
|
|
<!-- 表单字段 --> |
|
|
|
|
<el-form-item label="订单自编号" prop="orderCode"> |
|
|
|
|
<el-input v-model="form.orderCode" placeholder="请输入订单自编号" clearable /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="商场名称" prop="orderCode"> |
|
|
|
|
<el-select v-model="form.region" multiple placeholder="请选择商场" clearable> |
|
|
|
|
<!-- 商场名称 --> |
|
|
|
|
<el-form-item label="商场名称"> |
|
|
|
|
<el-select v-model="form.clientList" multiple placeholder="请选择商场" clearable> |
|
|
|
|
<template v-if="form.selectList && form.selectList.length !== 0"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in form.selectList" |
|
|
|
@ -119,10 +125,14 @@
|
|
|
|
|
</template> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="品牌" prop="orderCode"> |
|
|
|
|
|
|
|
|
|
<!-- 品牌 --> |
|
|
|
|
<el-form-item label="品牌"> |
|
|
|
|
<el-input v-model="form.brandName" placeholder="品牌名称" disabled /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="订单时间"> |
|
|
|
|
|
|
|
|
|
<!-- 盘点时间 --> |
|
|
|
|
<el-form-item label="盘点时间"> |
|
|
|
|
<div class="block" prop="time"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="form.time" |
|
|
|
@ -134,6 +144,21 @@
|
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<!-- 盘点订单状态 --> |
|
|
|
|
<template v-if="isEdit"> |
|
|
|
|
<el-form-item label="盘点订单状态"> |
|
|
|
|
<el-select v-model="form.dictKey" placeholder="请选择订单状态" clearable> |
|
|
|
|
<template v-if="this.typeData.length !== 0"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in this.typeData" |
|
|
|
|
:label="item.dictValue" |
|
|
|
|
:value="item.dictKey" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
</el-form> |
|
|
|
|
<!-- 表单按钮 --> |
|
|
|
|
<template #footer> |
|
|
|
@ -163,7 +188,13 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getDictList } from '@/api/distribution/createTask'; |
|
|
|
|
import { |
|
|
|
|
getDictList, |
|
|
|
|
postAddtaskQuest, |
|
|
|
|
getTaskQuestPage, |
|
|
|
|
postEditTaskQuestUpdate, |
|
|
|
|
postBatchDelete, |
|
|
|
|
} from '@/api/distribution/createTask'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
import dayjs from 'dayjs'; |
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; |
|
|
|
@ -185,52 +216,71 @@ export default {
|
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: true, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
prop: 'serviceNumber', |
|
|
|
|
prop: 'questNum', |
|
|
|
|
label: '任务编号', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '130', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
prop: 'warehouseName', |
|
|
|
|
label: '仓库名称', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '130', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: true, |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
head: false, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
prop: 'serviceNumber', |
|
|
|
|
prop: 'marketName', |
|
|
|
|
label: '商城名称', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '130', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: true, |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
head: false, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
prop: 'serviceNumber', |
|
|
|
|
prop: 'brandName', |
|
|
|
|
label: '品牌名称', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '130', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
prop: 'startTime', |
|
|
|
|
label: '任务开始时间', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '130', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: true, |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
head: false, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
prop: 'serviceNumber', |
|
|
|
|
prop: 'endTime', |
|
|
|
|
label: '任务结束时间', |
|
|
|
|
type: 2, |
|
|
|
|
values: '', |
|
|
|
|
width: '130', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: true, |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
head: false, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
@ -240,26 +290,25 @@ export default {
|
|
|
|
|
values: '', |
|
|
|
|
width: '130', |
|
|
|
|
checkarr: [], |
|
|
|
|
fixed: true, |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
|
head: false, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
prop: 'unpack', |
|
|
|
|
label: '拆包状态', |
|
|
|
|
prop: 'questStatusName', |
|
|
|
|
label: '状态', |
|
|
|
|
type: 1, |
|
|
|
|
values: '', |
|
|
|
|
width: '130', |
|
|
|
|
checkarr: [ |
|
|
|
|
{ |
|
|
|
|
value: `true`, |
|
|
|
|
label: '是', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
value: `false`, |
|
|
|
|
label: '否', |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// value: `true`, |
|
|
|
|
// label: '是', |
|
|
|
|
// }, |
|
|
|
|
// { |
|
|
|
|
// value: `false`, |
|
|
|
|
// label: '否', |
|
|
|
|
// }, |
|
|
|
|
], |
|
|
|
|
fixed: false, |
|
|
|
|
sortable: true, |
|
|
|
@ -282,11 +331,6 @@ export default {
|
|
|
|
|
|
|
|
|
|
// 弹框标题 |
|
|
|
|
title: '', |
|
|
|
|
stockList: {}, //拆包对象 |
|
|
|
|
// stockId: '', //拆包id |
|
|
|
|
// materialId: '', //物料id |
|
|
|
|
// marketId: '', //客户id |
|
|
|
|
// storeId: '', //客户id |
|
|
|
|
// 是否展示弹框 |
|
|
|
|
box: false, |
|
|
|
|
// 是否显示查询 |
|
|
|
@ -313,6 +357,9 @@ export default {
|
|
|
|
|
selectionList: [], |
|
|
|
|
// 表单列表 |
|
|
|
|
data: [], |
|
|
|
|
|
|
|
|
|
// 字典表 |
|
|
|
|
typeData: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
@ -401,15 +448,47 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
/** |
|
|
|
|
* 表单事件选择器改变时触发回调 |
|
|
|
|
*/ |
|
|
|
|
timeChange(value) { |
|
|
|
|
console.log('value :>> ', value); |
|
|
|
|
value.forEach((item)=>{ |
|
|
|
|
console.log('item :>> ', item); |
|
|
|
|
item.getFullYear() |
|
|
|
|
console.log('item.getFullYear() :>> ', item.getFullYear()); |
|
|
|
|
// const date = new Date(item) |
|
|
|
|
// console.log('date :>> ', date); |
|
|
|
|
}) |
|
|
|
|
// 当前时间戳 |
|
|
|
|
const _time = new Date().getTime(); |
|
|
|
|
// 检测时间是否小于当前时间 |
|
|
|
|
const _isTime = value.every(item => { |
|
|
|
|
console.log('item.toLocaleString() :>> ', item.toLocaleString()); |
|
|
|
|
return _time < item.getTime(); |
|
|
|
|
}); |
|
|
|
|
if (!_isTime) { |
|
|
|
|
this.form.time = []; |
|
|
|
|
return this.$message({ |
|
|
|
|
type: 'error', |
|
|
|
|
message: '开始时间不能小于当前时间', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// _time.toLocaleTimeString() |
|
|
|
|
// console.log('_time.toLocaleTimeString() :>> ', _time.toLocaleString()); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 过滤时间格式 |
|
|
|
|
filterTime(time) { |
|
|
|
|
const y = time.getFullYear(); |
|
|
|
|
const m = time; |
|
|
|
|
|
|
|
|
|
myDate.getYear(); //获取当前年份(2位) |
|
|
|
|
myDate.getFullYear(); //获取完整的年份(4位,1970-????) |
|
|
|
|
myDate.getMonth(); //获取当前月份(0-11,0代表1月) |
|
|
|
|
myDate.getDate(); //获取当前日(1-31) |
|
|
|
|
myDate.getDay(); //获取当前星期X(0-6,0代表星期天) |
|
|
|
|
myDate.getTime(); //获取当前时间(从1970.1.1开始的毫秒数) |
|
|
|
|
myDate.getHours(); //获取当前小时数(0-23) |
|
|
|
|
myDate.getMinutes(); //获取当前分钟数(0-59) |
|
|
|
|
myDate.getSeconds(); //获取当前秒数(0-59) |
|
|
|
|
myDate.getMilliseconds(); //获取当前毫秒数(0-999) |
|
|
|
|
myDate.toLocaleDateString(); //获取当前日期 |
|
|
|
|
var mytime = myDate.toLocaleTimeString(); //获取当前时间 |
|
|
|
|
myDate.toLocaleString(); //获取日期与时间 |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
showdrawer(value) { |
|
|
|
@ -433,6 +512,40 @@ export default {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量删除 |
|
|
|
|
*/ |
|
|
|
|
handleBatchDelete() { |
|
|
|
|
if (this.selectionList.length === 0) |
|
|
|
|
return this.$message({ |
|
|
|
|
type: 'error', |
|
|
|
|
message: '最少选择一条数据', |
|
|
|
|
}); |
|
|
|
|
const ids = this.selectionList.map(item => item.id).join(','); |
|
|
|
|
|
|
|
|
|
this.$confirm('确定将选择数据删除?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
.then(async () => { |
|
|
|
|
return postBatchDelete({ ids }); |
|
|
|
|
}) |
|
|
|
|
.then((res) => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
if (code === 200) { |
|
|
|
|
return this.$message({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: msg, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
btnsc(index, row) { |
|
|
|
|
console.log(index, row); |
|
|
|
|
}, |
|
|
|
@ -540,45 +653,104 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 提交 |
|
|
|
|
handleSubmit() {}, |
|
|
|
|
async handleSubmit() { |
|
|
|
|
// 检测是否选择时间 |
|
|
|
|
if (!this.form.time || this.form.time.length === 0) { |
|
|
|
|
return this.$message({ |
|
|
|
|
type: 'error', |
|
|
|
|
message: '请选择盘点时间', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 修改提交 |
|
|
|
|
handleEditSubmit() {}, |
|
|
|
|
const formData = {}; |
|
|
|
|
formData.list = []; |
|
|
|
|
|
|
|
|
|
handleDelete() { |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
this.$message.warning('请选择至少一条数据'); |
|
|
|
|
return; |
|
|
|
|
// 商场名称列表 |
|
|
|
|
this.form.selectList.forEach(val => { |
|
|
|
|
if (this.form.clientList.includes(val.id)) |
|
|
|
|
formData.list.push({ |
|
|
|
|
refId: val.id, |
|
|
|
|
refName: val.clientName, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
// 开始时间 |
|
|
|
|
formData.startTime = this.form.time[0].toLocaleString(); |
|
|
|
|
// 结束时间 |
|
|
|
|
formData.endTime = this.form.time[1].toLocaleString(); |
|
|
|
|
console.log('formData :>> ', formData); |
|
|
|
|
|
|
|
|
|
const res = await postAddtaskQuest(formData); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
|
|
|
|
|
if (code === 200) |
|
|
|
|
this.$message({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
// 初始化页面 |
|
|
|
|
this.onLoad(); |
|
|
|
|
// 关闭弹窗 |
|
|
|
|
this.box = false; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 修改提交 |
|
|
|
|
async handleEditSubmit() { |
|
|
|
|
console.log('this.form :>> ', this.form); |
|
|
|
|
// 检测是否选择时间 |
|
|
|
|
if (!this.form.time || this.form.time.length === 0) { |
|
|
|
|
return this.$message({ |
|
|
|
|
type: 'error', |
|
|
|
|
message: '请选择盘点时间', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.$confirm('确定将选择数据删除?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return; |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.selectionClear(); |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功!', |
|
|
|
|
|
|
|
|
|
const formData = {}; |
|
|
|
|
formData.list = []; |
|
|
|
|
|
|
|
|
|
// 商场名称列表 |
|
|
|
|
this.form.selectList.forEach(val => { |
|
|
|
|
if (this.form.clientList.includes(val.id)) |
|
|
|
|
formData.list.push({ |
|
|
|
|
refId: val.id, |
|
|
|
|
refName: val.clientName, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
// 开始时间 |
|
|
|
|
formData.startTime = this.form.time[0].toLocaleString(); |
|
|
|
|
// 结束时间 |
|
|
|
|
formData.endTime = this.form.time[1].toLocaleString(); |
|
|
|
|
console.log('formData :>> ', formData); |
|
|
|
|
formData.questStatus = this.form.dictKey; |
|
|
|
|
formData.id = this.form.id; |
|
|
|
|
|
|
|
|
|
const res = await postEditTaskQuestUpdate(formData); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
console.log('msg :>> ', msg); |
|
|
|
|
|
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
|
|
|
|
|
if (code === 200) |
|
|
|
|
this.$message({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
// 初始化页面 |
|
|
|
|
this.onLoad(); |
|
|
|
|
// 关闭弹窗 |
|
|
|
|
this.box = false; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 删除单个任务 |
|
|
|
|
*/ |
|
|
|
|
handleDeleteCheck() { |
|
|
|
|
handleDeleteCheck(row) { |
|
|
|
|
this.$confirm('确定将选择数据删除?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return; |
|
|
|
|
return postBatchDelete({ids: row.id}); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
@ -601,11 +773,36 @@ export default {
|
|
|
|
|
/** |
|
|
|
|
* 编辑单个任务 |
|
|
|
|
*/ |
|
|
|
|
handleEditCheck(row) { |
|
|
|
|
async handleEditCheck(row) { |
|
|
|
|
this.title = '编辑盘点任务'; |
|
|
|
|
this.isEdit = true; // 此次为修改提交 |
|
|
|
|
this.box = true; // 开启弹窗 |
|
|
|
|
console.log('row :>> ', row); |
|
|
|
|
this.form.brandName = row.brandName; |
|
|
|
|
this.form.time = [row.startTime, row.endTime]; |
|
|
|
|
this.form.clientList = row.list.map(val => val.refId); |
|
|
|
|
this.form.dictKey = row.questStatus; |
|
|
|
|
this.form.selectList = []; |
|
|
|
|
this.form.id = row.id; |
|
|
|
|
|
|
|
|
|
console.log('this.form :>> ', this.form); |
|
|
|
|
|
|
|
|
|
// 请求商场名称 |
|
|
|
|
const res = await getDictList(); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code === 200 && !!data) { |
|
|
|
|
console.log('data :>> ', data); |
|
|
|
|
this.form.selectList = data.map(item => { |
|
|
|
|
return { |
|
|
|
|
// 商城名称 |
|
|
|
|
clientName: item.clientName, |
|
|
|
|
// 商场id |
|
|
|
|
id: item.id, |
|
|
|
|
// 商场下品牌名 |
|
|
|
|
brandName: item.brandName, |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
beforeClose(done) { |
|
|
|
@ -615,6 +812,7 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
selectionChange(list) { |
|
|
|
|
this.selectionList = list; |
|
|
|
|
console.log('this.selectionList :>> ', this.selectionList); |
|
|
|
|
}, |
|
|
|
|
selectionClear() { |
|
|
|
|
this.selectionList = []; |
|
|
|
@ -627,31 +825,60 @@ export default {
|
|
|
|
|
this.page.pageSize = pageSize; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}, |
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
|
async onLoad(page, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
this.query.serviceType = '3'; |
|
|
|
|
const postData = { ...page, ...params }; |
|
|
|
|
const res = await getTaskQuestPage(postData); |
|
|
|
|
const { |
|
|
|
|
code, |
|
|
|
|
data: { records }, |
|
|
|
|
} = res.data; |
|
|
|
|
this.data = []; |
|
|
|
|
if (code === 200) this.data = records; |
|
|
|
|
console.log('records :>> ', records); |
|
|
|
|
|
|
|
|
|
this.data.forEach(val => { |
|
|
|
|
val.brandName = ''; |
|
|
|
|
val.marketName = ''; |
|
|
|
|
val.list.forEach(item => { |
|
|
|
|
if (item.brandName) val.brandName += item.brandName + ','; |
|
|
|
|
if (item.refName) val.marketName += item.refName + ','; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.loading = false; |
|
|
|
|
|
|
|
|
|
// 请求字典 |
|
|
|
|
getDictionaryBiz('warehouse_quest_status').then(res => { |
|
|
|
|
this.typeData = res.data.data.map(val => { |
|
|
|
|
return { |
|
|
|
|
dictKey: val.dictKey, |
|
|
|
|
dictValue: val.dictValue, |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
// 监听商场名称的选择变化 |
|
|
|
|
'form.region'(newVal) { |
|
|
|
|
'form.clientList'(newVal) { |
|
|
|
|
let _newVal = Array.from(newVal); |
|
|
|
|
let _value = ''; |
|
|
|
|
// 当没选择商场时, 品牌清空 |
|
|
|
|
if (newVal.length === 0) return (this.form.brandName = _value); |
|
|
|
|
if (_newVal.length === 0) return (this.form.brandName = _value); |
|
|
|
|
|
|
|
|
|
console.log('this.form.selectList :>> ', this.form.selectList); |
|
|
|
|
// 循环获取品牌名称 |
|
|
|
|
this.form.brandName = newVal.reduce((curr, item)=> { |
|
|
|
|
const _brandName = this.form.selectList.find(val => val.id === item).brandName; |
|
|
|
|
if (_brandName) return curr += _brandName; |
|
|
|
|
return curr |
|
|
|
|
}, '') |
|
|
|
|
this.form.brandName = _newVal.reduce((curr, item) => { |
|
|
|
|
const _brand = this.form.selectList.find(val => val.id === item); |
|
|
|
|
if (_brand) return (curr += _brand.brandName); |
|
|
|
|
return curr; |
|
|
|
|
}, ''); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
.zhu { |
|
|
|
|
display: flex; |
|
|
|
|
flex-direction: row; |
|
|
|
@ -676,8 +903,6 @@ export default {
|
|
|
|
|
.demo-form-inline .el-input { |
|
|
|
|
--el-input-width: 220px; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
.el-row:first-of-type { |
|
|
|
|
/* 样式规则 */ |
|
|
|
|
.el-form { |
|
|
|
|