|
@@ -15,14 +15,14 @@
|
|
|
></uploadAllData>
|
|
|
<addProduct v-if="tool.checkAuth($route.name,'productDetailManage') && data.status === '新建' && isLeader"
|
|
|
class="inline-16" :params="paramsAdd" :tablecolsAdd="tablecolsAdd" title="添加"
|
|
|
- @addSuccess="addProducts" @addProduct="addProduct" @uploadData="uploadData" @closeDrawer="listData"
|
|
|
+ @addSuccess="addProducts" @addProduct="addProduct" @uploadData="uploadData"
|
|
|
ref="addProduct"
|
|
|
></addProduct>
|
|
|
<el-button size="small" v-if="tool.checkAuth($route.name,'productDetailManage') && data.status === '新建' && isLeader" :type="delProductData.length === 0?'':'primary'" @click="onDelProduct" :disabled="delProductData.length === 0">删 除</el-button>
|
|
|
</div>
|
|
|
<div class="produtMag-panel">
|
|
|
</div>
|
|
|
- <tableLayout checkbox="true" :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true" fixedName="operation amount" @selectionChange="selectionChange">
|
|
|
+ <tableLayout v-tableLoad="tableLoad" checkbox="true" :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true" fixedName="operation amount" @selectionChange="selectionChange">
|
|
|
<template v-slot:customcol="scope">
|
|
|
<div v-if="scope.column.columnname == 'qty'">
|
|
|
<!-- <el-input-number size="mini" v-if="editIndex == scope.column.data.sa_contract_itemsid" v-model="scope.column.data.qty" @change="qtyChange" :min="1" label="描述文字"></el-input-number>-->
|
|
@@ -46,11 +46,21 @@
|
|
|
</div>
|
|
|
<div v-else-if="scope.column.columnname == 'discountrate'">
|
|
|
<!-- <el-input size="mini" v-if="editIndex == scope.column.data.sa_contract_itemsid" v-model="form.discountrate" @input="discountrateChange($event,scope.column.data)"></el-input>-->
|
|
|
- <el-input size="mini" :disabled="scope.column.data.type === '指定单价' || !tool.checkAuth($route.name,'productDetailManage') || data.status !== '新建' || !isLeader " v-model="scope.column.data.discountrate" @change="discountrateChange(scope.column.data.discountrate,scope.$index,scope.column.data)"></el-input>
|
|
|
+ <el-input
|
|
|
+ size="mini"
|
|
|
+ :disabled="scope.column.data.type === '指定单价' || !tool.checkAuth($route.name,'productDetailManage') || data.status !== '新建' || !isLeader "
|
|
|
+ v-model="scope.column.data.discountrate"
|
|
|
+ @change="discountrateChange(scope.column.data.discountrate,scope.$index,scope.column.data)"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
<div v-else-if="scope.column.columnname == 'price'">
|
|
|
<!-- <el-input size="mini" v-if="editIndex == scope.column.data.sa_contract_itemsid" v-model="form.price" @input="priceChange($event,scope.column.data)"></el-input>-->
|
|
|
- <el-input size="mini" :disabled="scope.column.data.type === '折扣系数' || !tool.checkAuth($route.name,'productDetailManage') || data.status !== '新建' || !isLeader" v-model="scope.column.data.price" @change="priceChange(scope.column.data.price,scope.$index,scope.column.data)"></el-input>
|
|
|
+ <el-input
|
|
|
+ size="mini"
|
|
|
+ :disabled="scope.column.data.type === '折扣系数' || !tool.checkAuth($route.name,'productDetailManage') || data.status !== '新建' || !isLeader"
|
|
|
+ v-model="scope.column.data.price"
|
|
|
+ @change="priceChange(scope.column.data.price,scope.$index,scope.column.data)"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
<div v-else-if="scope.column.columnname == 'countPrice'">
|
|
|
<p>{{tool.formatAmount(scope.column.data.price * scope.column.data.qty,2)}}</p>
|
|
@@ -161,6 +171,9 @@ export default {
|
|
|
this.list = res.data
|
|
|
this.total = res.total
|
|
|
this.$emit('priceChange')
|
|
|
+ },
|
|
|
+ tableLoad () {
|
|
|
+
|
|
|
},
|
|
|
qtyChange (num,index,data) {
|
|
|
data.qty = num
|
|
@@ -222,7 +235,7 @@ export default {
|
|
|
})
|
|
|
this.tool.showMessage(res,() => {
|
|
|
this.editIndex = ''
|
|
|
- this.listData()
|
|
|
+ // this.listData()
|
|
|
this.$emit('editSuccess',res.data.signamount)
|
|
|
})
|
|
|
},
|
|
@@ -255,7 +268,8 @@ export default {
|
|
|
},
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
- this.listData()
|
|
|
+ this.list.unshift(...res.data)
|
|
|
+ // this.listData()
|
|
|
this.$refs.addProduct.listData()
|
|
|
})
|
|
|
},
|
|
@@ -277,7 +291,9 @@ export default {
|
|
|
},
|
|
|
})
|
|
|
this.tool.showMessage(res,() => {
|
|
|
- this.listData()
|
|
|
+ this.list.unshift(res.data[0])
|
|
|
+ console.log(this.list[0],res.data);
|
|
|
+ // this.listData()
|
|
|
this.$refs.addProduct.listData()
|
|
|
})
|
|
|
},
|
|
@@ -347,7 +363,14 @@ export default {
|
|
|
},
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
- this.listData()
|
|
|
+ // this.listData()
|
|
|
+ this.list.forEach(item => {
|
|
|
+ this.delProductData.forEach(item2 => {
|
|
|
+ if (item.sa_contract_itemsid == item2) {
|
|
|
+ this.list.splice(this.list.indexOf(item),1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
this.$emit("delSuccess")
|
|
|
})
|
|
|
},
|