|
@@ -82,8 +82,8 @@
|
|
|
@pagination="getDataList"
|
|
|
/>
|
|
|
<div>
|
|
|
- <el-button type="primary" size="mini" :disabled="viewTag" @click="addOrUpdateHandle(true)">明细新增</el-button>
|
|
|
- <el-button type="primary" size="mini" :disabled="viewTag" @click="addOrUpdateHandle(false)">明细编辑</el-button>
|
|
|
+ <el-button type="primary" size="mini" :disabled="viewTag" @click="addHandle()">明细新增</el-button>
|
|
|
+ <el-button type="primary" size="mini" :disabled="viewTag" @click="updateHandle()">明细编辑</el-button>
|
|
|
<el-button type="primary" size="mini" :disabled="viewTag" @click="deleteHandle()">明细删除</el-button>
|
|
|
</div>
|
|
|
<!-- 弹窗, 新增 / 修改 -->
|
|
@@ -136,25 +136,29 @@
|
|
|
},
|
|
|
// 多选
|
|
|
selectionChangeHandle (val) {
|
|
|
- if(val) {
|
|
|
- this.dataListSelections.push(val)
|
|
|
- }
|
|
|
+ this.dataListSelections = val
|
|
|
},
|
|
|
// 新增 / 修改
|
|
|
- addOrUpdateHandle (isAdd) {
|
|
|
+ addHandle () {
|
|
|
//控制只能单选
|
|
|
this.addOrUpdateVisible = true
|
|
|
this.$nextTick(() => {
|
|
|
- if(isAdd){
|
|
|
- this.$refs.addOrUpdate.init(this.queryParams.asnNo,'')
|
|
|
- } else {
|
|
|
- if (this.dataListSelections.length > 1) {
|
|
|
- this.$modal.msgWarning("编辑操作只能选择一条数据");
|
|
|
- return
|
|
|
- }
|
|
|
- let sel = this.dataListSelections[0][0]
|
|
|
- this.$refs.addOrUpdate.init(sel.asnNo,sel.asnLineNo)
|
|
|
+ this.$refs.addOrUpdate.init(this.queryParams.asnNo,'')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ updateHandle () {
|
|
|
+ this.addOrUpdateVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.dataListSelections.length > 1) {
|
|
|
+ this.$modal.msgError("编辑操作只能选择一条数据");
|
|
|
+ return
|
|
|
}
|
|
|
+ let sel = this.dataListSelections[0]
|
|
|
+ if(sel.lineStatus != "00") {
|
|
|
+ this.$modal.msgError("只能编辑订单创建状态的单据");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$refs.addOrUpdate.init(sel.asnNo,sel.asnLineNo)
|
|
|
})
|
|
|
},
|
|
|
initLotatt() {
|
|
@@ -170,40 +174,22 @@
|
|
|
})
|
|
|
},
|
|
|
deleteHandle() {
|
|
|
- /*if(this.dataListSelections && this.dataListSelections.length>0) {
|
|
|
- this.$modal.confirm('是否确认删除入库明细的数据项?').then(function() {
|
|
|
- console.log("--------------------------")
|
|
|
- console.log(this.dataListSelections.length)
|
|
|
- console.log(this.dataListSelections)
|
|
|
- for(let i= 0;i<this.dataListSelections.length;i++) {
|
|
|
- let obj = this.dataListSelections[i]
|
|
|
- return delDocAsnDetails(obj.asnNo,obj.asnLineNo).then(response => {
|
|
|
- if(response.code == 200) {
|
|
|
- this.$modal.msgSuccess(response.msg);
|
|
|
- } else {
|
|
|
- this.$modal.msgError(response.msg);
|
|
|
- }
|
|
|
- this.getDataList(obj.asnNo)
|
|
|
- });
|
|
|
- }
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
- }*/
|
|
|
if(this.dataListSelections && this.dataListSelections.length>0) {
|
|
|
- let asnNo = this.dataListSelections[0][0].asnNo
|
|
|
- let asnLineNo = this.dataListSelections[0][0].asnLineNo
|
|
|
+ let dataListSelections = this.dataListSelections
|
|
|
this.$modal.confirm('是否确认删除入库明细的数据项?').then(function() {
|
|
|
- return delDocAsnDetails(asnNo,asnLineNo);
|
|
|
+ let arr = []
|
|
|
+ for(let i= 0;i<dataListSelections.length;i++) {
|
|
|
+ let obj = dataListSelections[i]
|
|
|
+ arr.push({"asnNo":obj.asnNo,"asnLineNo":obj.asnLineNo});
|
|
|
+ }
|
|
|
+ return delDocAsnDetails(arr);
|
|
|
}).then(response => {
|
|
|
if(response.code == 200) {
|
|
|
this.$modal.msgSuccess(response.msg);
|
|
|
} else {
|
|
|
this.$modal.msgError(response.msg);
|
|
|
}
|
|
|
- this.getDataList(asnNo)
|
|
|
- this.dataListSelections.length = 0
|
|
|
+ this.getDataList(this.queryParams.asnNo)
|
|
|
}).catch(() => {});
|
|
|
}
|
|
|
}
|