Commit 52df6313 authored by dcy's avatar dcy

特需申请

parent d8e067ca
......@@ -6,8 +6,8 @@
<h1>{{orderNo}} 特需</h1>
<el-form label-width="180px" label-position="left">
<el-form-item label="特殊要求">
<el-checkbox-group v-model="advanceType">
<el-checkbox v-for="(item) in getDictDatas(DICT_TYPE.ORDER_SPECIAL_NEEDS)" :label="item.value" >{{item.label}}</el-checkbox>
<el-checkbox-group v-model="advanceType" >
<el-checkbox @click="change(item)" v-for="(item) in getDictDatas(DICT_TYPE.ORDER_SPECIAL_NEEDS)" :label="item.value" >{{item.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="特殊要求备注"><el-input type="textarea" style="width: 300px;" v-model="todoDetail"></el-input></el-form-item>
......@@ -55,6 +55,7 @@ export default {
advanceType:[],
specialNeedsList:[],
todoDetail:'',
echoList:[],
}
},
methods:{
......@@ -63,7 +64,25 @@ export default {
i.todoDetail = this.todoDetail
})
let p = this.specialNeedsList.filter(i => this.advanceType.indexOf(i.advanceType) > -1)
specialNeedCreate(p).then(r=>{
console.log(p,'p')
let p1 = []
//获取新增的和修改的
p.forEach(item => {
if(this.echoList.find( i => item.id === i.id)){
p1.push(item)
}else {
item.oper = 'add'
p1.push(item)
}
})
//获取删除的
this.echoList.forEach(item => {
if(!(p.find(i => i.id === item.id))){
item.oper = 'del'
p1.push(item)
}
})
specialNeedCreate(p1).then(r=>{
if(r.code === 0){
this.$emit('update:show',false)
this.$emit('determine')
......@@ -86,6 +105,7 @@ export default {
})
//特需回显
getSpecialListByOrderId(this.orderId).then(r => {
this.echoList = r.data;
r.data.forEach(i => {
this.advanceType.push(i.advanceType)
let index = this.specialNeedsList.findIndex(item => i.advanceType == item.advanceType)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment