|
@@ -20,18 +20,18 @@
|
|
|
</slot>
|
|
|
</Toptitle>
|
|
|
<div class="content_topform">
|
|
|
- <Form :label-width="90"
|
|
|
+ <Form :label-width="120"
|
|
|
:model="searchData">
|
|
|
- <FormItem label="订单号:">
|
|
|
+ <FormItem label="订单号:" :label-width='80'>
|
|
|
<Input type="text"
|
|
|
size="small"
|
|
|
v-show="!isCheck"
|
|
|
disabled
|
|
|
- v-model="searchData.residential_name"
|
|
|
+ v-model="searchData.order_no"
|
|
|
style="width: 200px;margin-top:6px"
|
|
|
placeholder="自动生成订单号">
|
|
|
</Input>
|
|
|
- <span v-show="isCheck">{{searchData.residential_name}}</span>
|
|
|
+ <span v-show="isCheck">{{searchData.order_no}}</span>
|
|
|
</FormItem>
|
|
|
<!-- <FormItem label="项目名称:">
|
|
|
<Input type="text"
|
|
@@ -51,7 +51,7 @@
|
|
|
size="small"
|
|
|
v-show="!isCheck"
|
|
|
v-model="searchData.supply_title"
|
|
|
- style="width: 200px;margin-top:6px"
|
|
|
+ style="width: 300px;margin-top:6px"
|
|
|
placeholder="供应商名称">
|
|
|
<span slot="append"
|
|
|
style="cursor:pointer;"
|
|
@@ -59,8 +59,8 @@
|
|
|
</Input>
|
|
|
<span v-show="isCheck">{{searchData.supply_title}}</span>
|
|
|
</FormItem>
|
|
|
- <FormItem label="采购订单类型:">
|
|
|
- <Select v-model="searchData.type_id"
|
|
|
+ <FormItem label="采购订单类型:" style="margin-left:100px">
|
|
|
+ <Select v-model="searchData.basics_purchase_id"
|
|
|
size="small"
|
|
|
v-show="!isCheck"
|
|
|
clearable
|
|
@@ -73,7 +73,7 @@
|
|
|
:value="sitem.id">
|
|
|
</Option>
|
|
|
</Select>
|
|
|
- <span v-show="isCheck">{{searchData.type_title}}</span>
|
|
|
+ <span v-show="isCheck">{{searchData.basics_purchase_title}}</span>
|
|
|
</FormItem>
|
|
|
<!-- <FormItem label="单据号:">
|
|
|
<Input type="text"
|
|
@@ -102,25 +102,25 @@
|
|
|
</Select> -->
|
|
|
<!-- <span>{{searchData.nickname}}</span>
|
|
|
</FormItem> -->
|
|
|
- <!-- <FormItem label="制单日期:">
|
|
|
+ <FormItem label="单据日期:">
|
|
|
<DatePicker type="date"
|
|
|
v-show="!isCheck"
|
|
|
size="small"
|
|
|
style="width: 200px"
|
|
|
placeholder="年/月/日"
|
|
|
- v-model="searchData.crt_time"></DatePicker>
|
|
|
- <span v-show="isCheck">{{func.replaceDate(searchData.crt_time)}}</span>
|
|
|
- </FormItem> -->
|
|
|
- <FormItem label="预计到货日期:">
|
|
|
+ v-model="searchData.order_time"></DatePicker>
|
|
|
+ <span v-show="isCheck">{{searchData.order_time?func.replaceDate(searchData.order_time).split(' ')[0]:''}}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="预计到货日期:" style="margin-left:30px">
|
|
|
<DatePicker type="date"
|
|
|
v-show="!isCheck"
|
|
|
size="small"
|
|
|
style="width: 200px"
|
|
|
placeholder="年/月/日"
|
|
|
v-model="searchData.arrive_time"></DatePicker>
|
|
|
- <span v-show="isCheck">{{func.replaceDate(searchData.arrive_time)}}</span>
|
|
|
+ <span v-show="isCheck">{{searchData.arrive_time?func.replaceDate(searchData.arrive_time).split(' ')[0]:''}}</span>
|
|
|
</FormItem>
|
|
|
- <FormItem label="备注:">
|
|
|
+ <FormItem label="备注:" :label-width='80'>
|
|
|
<Input type="textarea"
|
|
|
v-show="!isCheck"
|
|
|
size="small"
|
|
@@ -133,15 +133,15 @@
|
|
|
</div>
|
|
|
<div class="content_table">
|
|
|
<div class="content_table_btn">
|
|
|
- <div>
|
|
|
- <span>采购清单</span>
|
|
|
+ <div style="display:flex;">
|
|
|
+ <span style="width:200px">采购清单</span>
|
|
|
<!-- <Button @click="showModal=true"
|
|
|
v-show="!isCheck"
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
style="margin-left:10px;"
|
|
|
:disabled="$route.query.is_refer == 0?true:btn_disable">选择物料</Button> -->
|
|
|
- <div><span>参照计划单号:</span><span></span></div>
|
|
|
+ <div ><span>参照计划单号:</span><span v-for="(item,index) in plan_no" :key="index" style="margin-right:10px">{{item}}{{index+1==plan_no.length?'':','}}</span></div>
|
|
|
</div>
|
|
|
<div class="content_table_btn_right"
|
|
|
v-show="!isCheck">
|
|
@@ -207,7 +207,7 @@
|
|
|
>
|
|
|
</Option>
|
|
|
</Select>
|
|
|
- <span v-show="isCheck||row.project_number == '查看'" @click="check(row)" style="color: rgb(45, 140, 240);cursor: pointer;">{{row.project_code}}</span>
|
|
|
+ <span v-show="isCheck||row.project_number == '查看'" @click="check(row)" style="color: rgb(45, 140, 240);cursor: pointer;">{{row.project_number=='查看'?'查看':row.project_code}}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template slot="project_title" slot-scope="{ row,index }">
|
|
@@ -231,7 +231,7 @@
|
|
|
>
|
|
|
</Option>
|
|
|
</Select>
|
|
|
- <span v-show="isCheck||row.project_number == '查看'" @click="check(row)" style="color: rgb(45, 140, 240);cursor: pointer;">{{row.project_title}}</span>
|
|
|
+ <span v-show="isCheck||row.project_number == '查看'" @click="check(row)" style="color: rgb(45, 140, 240);cursor: pointer;">{{row.project_number=='查看'?'查看':row.project_title}}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template slot="numberSet" slot-scope="{row , index }">
|
|
@@ -249,13 +249,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<Input
|
|
|
- type="text"
|
|
|
+
|
|
|
v-show="!isCheck"
|
|
|
size="small"
|
|
|
v-model="tableData[index].num"
|
|
|
placeholder="数量"
|
|
|
- on-change="changenum"
|
|
|
+ @on-change="changenum($event,row,index)"
|
|
|
+ :disabled="row.project_number == '查看'"
|
|
|
>
|
|
|
+
|
|
|
</Input>
|
|
|
<span v-show="isCheck">{{ tableData[index].num }}</span>
|
|
|
</Tooltip>
|
|
@@ -495,6 +497,7 @@ export default {
|
|
|
data () {
|
|
|
// 这里存放数据
|
|
|
return {
|
|
|
+ delData:[],
|
|
|
material_name:'',
|
|
|
checkData:[],
|
|
|
CheckTableColumns:[
|
|
@@ -626,6 +629,9 @@ export default {
|
|
|
currentRow.price = (1 * currentRow.no_tax_price * (1 + 1 * currentRow.fax / 100)).toFixed(2)
|
|
|
currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
|
|
|
currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
+ if(!currentRow.copy&&!currentRow.edit){
|
|
|
+ currentRow.change = true;
|
|
|
+ }
|
|
|
// currentRow.total_price = (1 * currentRow.no_tax_amount + 1 * currentRow.tax_amount).toFixed(2)
|
|
|
this.tableData.splice(index, 1, currentRow);
|
|
|
}
|
|
@@ -654,6 +660,9 @@ export default {
|
|
|
currentRow.price = (1 * currentRow.no_tax_price * (1 + 1 * currentRow.fax / 100)).toFixed(2)
|
|
|
currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
|
|
|
currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
+ if(!currentRow.copy&&!currentRow.edit){
|
|
|
+ currentRow.change = true;
|
|
|
+ }
|
|
|
this.tableData.splice(index, 1, currentRow);
|
|
|
}
|
|
|
}
|
|
@@ -681,7 +690,10 @@ export default {
|
|
|
currentRow.no_tax_price = (1 * currentRow.price / (1 + 1 * currentRow.fax / 100)).toFixed(2)
|
|
|
currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
|
|
|
currentRow.no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
|
|
|
- currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_price).toFixed(2)
|
|
|
+ currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
+ if(!currentRow.copy&&!currentRow.edit){
|
|
|
+ currentRow.change = true;
|
|
|
+ }
|
|
|
this.tableData.splice(index, 1, currentRow);
|
|
|
}
|
|
|
}
|
|
@@ -705,10 +717,13 @@ export default {
|
|
|
on: {
|
|
|
'on-change': (e) => {
|
|
|
currentRow.no_tax_amount = e.target.value
|
|
|
- currentRow.no_tax_price = (1 * currentRow.no_tax_amount / currentRow.num).toFixed(2)
|
|
|
+ currentRow.no_tax_price = (1 * currentRow.no_tax_amount / 1*currentRow.num).toFixed(2)
|
|
|
currentRow.price = (1 * currentRow.no_tax_price * (1 + 1 * currentRow.fax / 100)).toFixed(2)
|
|
|
currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
|
|
|
currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
+ if(!currentRow.copy&&!currentRow.edit){
|
|
|
+ currentRow.change = true;
|
|
|
+ }
|
|
|
this.tableData.splice(index, 1, currentRow);
|
|
|
}
|
|
|
}
|
|
@@ -735,6 +750,9 @@ export default {
|
|
|
// currentRow.fax = (1 * currentRow.tax_amount / currentRow.no_tax_price).toFixed(2)
|
|
|
currentRow.no_tax_amount = (1*(currentRow.total_price-currentRow.tax_amount)).toFixed(2)
|
|
|
currentRow.no_tax_price = (1*(currentRow.no_tax_amount/currentRow.num)).toFixed(2)
|
|
|
+ if(!currentRow.copy&&!currentRow.edit){
|
|
|
+ currentRow.change = true;
|
|
|
+ }
|
|
|
this.tableData.splice(index, 1, currentRow);
|
|
|
}
|
|
|
}
|
|
@@ -762,6 +780,9 @@ export default {
|
|
|
currentRow.no_tax_price = (1 * currentRow.price / (1 + 1 * currentRow.fax / 100)).toFixed(2)
|
|
|
currentRow.no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
|
|
|
currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
+ if(!currentRow.copy&&!currentRow.edit){
|
|
|
+ currentRow.change = true;
|
|
|
+ }
|
|
|
this.tableData.splice(index, 1, currentRow);
|
|
|
}
|
|
|
}
|
|
@@ -913,6 +934,7 @@ export default {
|
|
|
warningList: [],
|
|
|
purchase_data:[],
|
|
|
purchase_tableData:[],
|
|
|
+ plan_no:[],
|
|
|
}
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -921,7 +943,7 @@ export default {
|
|
|
// 获取操作员
|
|
|
this.axios('/api/user').then(res => this.usersList = res.data.data)
|
|
|
// 获取采购类型
|
|
|
- this.axios({ method: 'get', url: '/api/basic_purchase_list', }).then((res) => { this.purchaseTypeList = res.data.data }).catch((err) => { });
|
|
|
+ this.axios({ method: 'get', url: '/api/basic_purchase_list',params:{type_id:2} }).then((res) => { this.purchaseTypeList = res.data.data }).catch((err) => { });
|
|
|
// 获取基础物料类型
|
|
|
this.axios({ method: 'get', url: '/api/basics_material_index_level', }).then((res) => { this.modalData.treeData[0].list = res.data }).catch((err) => { });
|
|
|
// 获取供应商列表
|
|
@@ -947,11 +969,17 @@ export default {
|
|
|
},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted () {
|
|
|
- if (this.$route.query.purchase_order_no != '') {
|
|
|
- this.initData(this.$route.query.purchase_order_no)
|
|
|
+ if (this.$route.query.order_no != '') {
|
|
|
+ this.initData(this.$route.query.order_no)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ selectChange(row,index){
|
|
|
+ if(!row.copy&&!row.edit){
|
|
|
+ this.tableData[index].change = true;
|
|
|
+ console.log(this.tableData)
|
|
|
+ }
|
|
|
+ },
|
|
|
check(row){
|
|
|
console.log(row);
|
|
|
if(row.project_number!=='查看'){
|
|
@@ -987,17 +1015,19 @@ export default {
|
|
|
switch(this.total_type){
|
|
|
case 1:
|
|
|
this.tableData.map((v)=>{
|
|
|
-
|
|
|
+ if(v.project_number == '查看'){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
this.selectChoose.map(m=>{
|
|
|
if(m.index == v.index ){
|
|
|
- v.project_code =this.total_project_info.code;
|
|
|
- v.project_title = this.total_project_info.name;
|
|
|
+ v.project_code =this.total_project_info.code?this.total_project_info.code:v.project_code;
|
|
|
+ v.project_title = this.total_project_info.name?this.total_project_info.name:v.project_title;
|
|
|
v._checked = true;
|
|
|
v.ad = true
|
|
|
}
|
|
|
|
|
|
})
|
|
|
-
|
|
|
+ }
|
|
|
})
|
|
|
break;
|
|
|
case 2:
|
|
@@ -1074,12 +1104,18 @@ if(this.selectChoose.length == 0){
|
|
|
this.showTotal = true;
|
|
|
this.total_type = val;
|
|
|
},
|
|
|
- changenum(e){
|
|
|
+ changenum(e,currentRow,index){
|
|
|
+ console.log(currentRow)
|
|
|
currentRow.num = e.target.value
|
|
|
currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
|
|
|
+ this.tableData[index].total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
|
|
|
currentRow.no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
|
|
|
+ this.tableData[index].no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
|
|
|
currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
- this.tableData.splice(index, 1, currentRow);
|
|
|
+ this.tableData[index].tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
+ if(!this.tableData[index].copy&&!this.tableData[index].edit){
|
|
|
+ this.tableData[index].change = true;
|
|
|
+ }
|
|
|
},
|
|
|
handleToolShow(index, row) {
|
|
|
if (this.warehouse) {
|
|
@@ -1099,31 +1135,48 @@ if(this.selectChoose.length == 0){
|
|
|
// this.warehouse.num = this.warehouseTotal[index].num;
|
|
|
// this.warehouse.warehouseName = this.warehouseTotal[index].warehouseName
|
|
|
},
|
|
|
- initData (purchase_order_no) {
|
|
|
+ initData (order_no) {
|
|
|
this.axios({
|
|
|
method: 'get',
|
|
|
url: '/api/purchase_detail',
|
|
|
- params: { purchase_order_no }
|
|
|
+ params: { order_no }
|
|
|
}).then((res) => {
|
|
|
- this.tableData = res.data.list
|
|
|
+ if(this.$route.query.type==2){
|
|
|
+ this.tableData = []
|
|
|
+ }
|
|
|
+
|
|
|
+ this.tableData=res.data.list;
|
|
|
const data = JSON.parse(JSON.stringify(res.data))
|
|
|
delete data.list
|
|
|
this.searchData = data
|
|
|
this.searchData.crt_time = this.func.replaceDate(this.searchData.crt_time)
|
|
|
this.searchData.arrive_time = this.func.replaceDate(this.searchData.arrive_time)
|
|
|
- this.searchData.supply_title = this.tableData[0].supply_title || null
|
|
|
+ this.searchData.order_time = this.func.replaceDate(this.searchData.order_time)
|
|
|
this.searchData.supply_id = this.tableData[0].supply_id || null
|
|
|
this.tableData.forEach(element => {
|
|
|
- element.no_tax_price = (1 * element.price / (1 + 1 * element.fax / 100)).toFixed(2)
|
|
|
+ if(element.state==1){
|
|
|
+ element.project_number = '查看'
|
|
|
+ }
|
|
|
+ element.material_type = element.type_title;
|
|
|
+ element.material_title = element.title;
|
|
|
+ element.fax = 1*element.tax_rate*100;
|
|
|
+ element.no_tax_price = (1 * element.price / (1 + 1*element.tax_rate)).toFixed(2)
|
|
|
element.no_tax_amount = (1 * element.no_tax_price * element.num).toFixed(2)
|
|
|
element.total_price = (1 * element.price * element.num).toFixed(2)
|
|
|
element.tax_amount = (1 * element.total_price - 1 * element.no_tax_amount).toFixed(2)
|
|
|
});
|
|
|
+ if(this.$route.query.type!==2){
|
|
|
+ this.tableData.push({material_title:'选择物料',_disabled:true})
|
|
|
+ }
|
|
|
+ console.log(this.tableData)
|
|
|
}).catch((err) => { });
|
|
|
},
|
|
|
postData () {
|
|
|
+ if(!this.searchData.order_time){
|
|
|
+ return this.$Message.warning('请选择单据日期')
|
|
|
+ };
|
|
|
let obj = JSON.parse(JSON.stringify(this.searchData))
|
|
|
- obj.crt_time = parseInt(new Date(obj.crt_time).getTime() / 1000) || ''
|
|
|
+ obj.order_time = parseInt(new Date(obj.order_time).getTime() / 1000) || ''
|
|
|
obj.arrive_time = parseInt(new Date(obj.arrive_time).getTime() / 1000) || ''
|
|
|
// if(this.tableData == null){
|
|
|
// this.confirmDelete({
|
|
@@ -1137,15 +1190,39 @@ if(this.selectChoose.length == 0){
|
|
|
// cancel: () => { }
|
|
|
// })
|
|
|
// }
|
|
|
- if (this.$route.query.purchase_order_no == '') {
|
|
|
+ if (this.$route.query.type == 1||this.$route.query.type == 6) {
|
|
|
// 新增
|
|
|
+ let children=[];
|
|
|
+
|
|
|
+ this.tableData.forEach(v=>{
|
|
|
+ let obj={};
|
|
|
+ obj.material_id=v.material_id;
|
|
|
+ obj.material_detail_id = v.material_detail_id ;
|
|
|
+ obj.project_code = v.project_code;
|
|
|
+ obj.project_title = v.project_title ;
|
|
|
+ obj.num = v.num;
|
|
|
+ obj.price = v.price;
|
|
|
+ obj.tax_rate = (1*v.fax)/100;
|
|
|
+ if(v.project_number == '查看'){
|
|
|
+ obj.state = 1
|
|
|
+ }else{
|
|
|
+ obj.state =0
|
|
|
+ };
|
|
|
+ this.purchase_data.forEach(m=>{
|
|
|
+ if(v.material_detail_id = m[0].material_detail_id){
|
|
|
+ obj.children=[...m]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ children.push(obj)
|
|
|
+ })
|
|
|
+
|
|
|
+ children.pop();
|
|
|
this.axios({
|
|
|
method: 'post',
|
|
|
url: '/api/purchase_add',
|
|
|
data: {
|
|
|
...obj,
|
|
|
- list: this.tableData,
|
|
|
- is_refer:this.table_state,
|
|
|
+ children
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
@@ -1154,15 +1231,33 @@ if(this.selectChoose.length == 0){
|
|
|
}
|
|
|
}).catch((err) => { });
|
|
|
} else {
|
|
|
+ let objData = [];
|
|
|
+ objData =JSON.parse(JSON.stringify(this.tableData));
|
|
|
+ objData.pop();
|
|
|
+ let upd_list = [];
|
|
|
+ let add_list = [];
|
|
|
+ let del_list = this.delData;
|
|
|
+ objData.forEach(v=>{
|
|
|
+ if(v.edit||v.copy){
|
|
|
+ add_list.push(v)
|
|
|
+ }
|
|
|
+ if(v.change||v.ad){
|
|
|
+ if(!v.edit||!v.copy){
|
|
|
+ upd_list.push(v)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
// 编辑
|
|
|
this.axios({
|
|
|
method: 'post',
|
|
|
url: '/api/purchase_edit',
|
|
|
data: {
|
|
|
- purchase_order_no: this.$route.query.purchase_order_no,
|
|
|
+ order_no: this.$route.query.order_no,
|
|
|
...obj,
|
|
|
- list: this.tableData,
|
|
|
- is_refer:this.table_state
|
|
|
+ upd_list,
|
|
|
+ add_list,
|
|
|
+ del_list
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
@@ -1275,6 +1370,14 @@ if(this.selectChoose.length == 0){
|
|
|
this.purchase_tableData.push(data)
|
|
|
})
|
|
|
console.log(this.purchase_tableData);
|
|
|
+ this.plan_no = [];
|
|
|
+ this.purchase_data.forEach(v=>{
|
|
|
+ v.forEach(m=>{
|
|
|
+ if(this.plan_no.indexOf(m.plan_no)<0){
|
|
|
+ this.plan_no.push(m.plan_no)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
this.tableData = [{material_title:'选择物料',_disabled:true}];
|
|
|
this.tableData.unshift(...this.purchase_tableData,...this.modalData.selectedData)
|
|
|
// this.searchData.residential_name = result[0].residential_name
|
|
@@ -1292,22 +1395,40 @@ if(this.selectChoose.length == 0){
|
|
|
if(row.project_number == '查看'){
|
|
|
let obj = JSON.parse(JSON.stringify(row));
|
|
|
obj.project_number = '';
|
|
|
+ obj.id=obj.id+''+'a';
|
|
|
+ // console.log(row);
|
|
|
+ // console.log(obj)
|
|
|
this.tableData.splice(index+1,0,obj)
|
|
|
+ this.modalData.selectedData.push(obj)
|
|
|
+ row.copy=true;
|
|
|
+ // console.log(this.tableData)
|
|
|
}else{
|
|
|
- this.tableData.splice(index+1,0,row);}
|
|
|
+ this.tableData.splice(index+1,0,row);
|
|
|
+ this.modalData.selectedData.push(row)
|
|
|
+ row.copy=true;
|
|
|
+ }
|
|
|
}else if(type == 4){
|
|
|
+ if(!row.copy&&!row.edit){
|
|
|
+ this.delData.push(row.id)
|
|
|
+ }
|
|
|
this.tableData.splice(index, 1);
|
|
|
this.purchase_data.forEach((v,idx)=>{
|
|
|
if(row.material_detail_id == v[0].material_detail_id){
|
|
|
this.purchase_data.splice(idx,1)
|
|
|
}
|
|
|
})
|
|
|
+ this.modalData.selectedData.forEach((m,idx)=>{
|
|
|
+ if(row.id === m.id){
|
|
|
+ this.modalData.selectedData.splice(idx,1)
|
|
|
+ }
|
|
|
+ })
|
|
|
}else{
|
|
|
return
|
|
|
}
|
|
|
},
|
|
|
handleSelect () {
|
|
|
this.modalData.selectedData.forEach(element => {
|
|
|
+ element.edit = true;
|
|
|
element.material_title = element.title
|
|
|
element.num = 0
|
|
|
element.no_tax_price = 0
|