Merge remote-tracking branch 'origin/dev-nx' into dev-nx
This commit is contained in:
commit
247c419442
|
|
@ -195,7 +195,6 @@
|
|||
<el-select
|
||||
v-model="form.fixCode"
|
||||
placeholder="是否为固定资产"
|
||||
@change="fillingCodeList"
|
||||
clearable
|
||||
allow-create
|
||||
style="width: 100px"
|
||||
|
|
@ -253,6 +252,7 @@
|
|||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
:ref="`inputRef-${scope.row.id}`"
|
||||
v-if="!isDetail"
|
||||
v-model="scope.row.maCode"
|
||||
:disabled="scope.row.statusFlag == 0"
|
||||
|
|
@ -595,10 +595,6 @@ export default {
|
|||
let suffixOneCode = parseInt(this.form.suffixOneCode)
|
||||
let suffixTwoCode = parseInt(this.form.suffixTwoCode)
|
||||
let sumNum = suffixTwoCode - suffixOneCode + 1
|
||||
// // 剩余待绑定数量
|
||||
// let surplusNoBindNum =
|
||||
// parseInt(this.form.checkNum) -
|
||||
// parseInt(this.form.bindNum)
|
||||
|
||||
if (sumNum > this.surplusNoBindNum) {
|
||||
this.$modal.msgError(
|
||||
|
|
@ -624,6 +620,8 @@ export default {
|
|||
}
|
||||
this.codeList.push(obj)
|
||||
}
|
||||
|
||||
this.surplusNoBindNum -= this.codeList.length
|
||||
} else {
|
||||
for (let i = 0; i < sumNum; i++) {
|
||||
let obj = {
|
||||
|
|
@ -644,11 +642,10 @@ export default {
|
|||
)
|
||||
if (isRepeat) {
|
||||
this.codeList.push(obj)
|
||||
this.surplusNoBindNum -= 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.surplusNoBindNum -= this.codeList.length
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -686,12 +683,23 @@ export default {
|
|||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
// console.log(this.codeList)
|
||||
if (this.form.fixCode == 0) {
|
||||
if (this.hasDuplicateField(this.codeList, 'assetsCode')) {
|
||||
this.$modal.msgError('固定资产编码不能为空')
|
||||
return false
|
||||
}
|
||||
// if (this.form.fixCode == 0) {
|
||||
// if (this.hasDuplicateField(this.codeList, 'assetsCode')) {
|
||||
// this.$modal.msgError('固定资产编码不能为空')
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
|
||||
let noCode = this.codeList.filter((e) => e.maCode === '')
|
||||
if (noCode.length > 0) {
|
||||
this.$modal.msgError('编码不可为空')
|
||||
noCode.map((e, index) => {
|
||||
if (index === 0) {
|
||||
this.$refs[`inputRef-${e.id}`].focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (this.codeList.length == 0) {
|
||||
this.$modal.msgError('无新增编码绑定')
|
||||
} else {
|
||||
|
|
@ -701,13 +709,13 @@ export default {
|
|||
for (const item of this.codeList) {
|
||||
const maCode = item.maCode
|
||||
|
||||
console.log(maCodeSet.has(maCode), '是否有编码')
|
||||
if (maCodeSet.has(maCode)) {
|
||||
hasDuplicates = true
|
||||
break
|
||||
}
|
||||
maCodeSet.add(maCode)
|
||||
}
|
||||
console.log('codeList:', this.codeList)
|
||||
if (hasDuplicates) {
|
||||
this.$modal.msgError(
|
||||
'编码绑定失败,存在重复编码,请重新输入',
|
||||
|
|
@ -715,7 +723,6 @@ export default {
|
|||
return // 停止提交流程
|
||||
}
|
||||
editPurchaseMacode(this.codeList).then((response) => {
|
||||
console.log(this.codeList)
|
||||
if (response.data && response.data.length > 0) {
|
||||
this.codeList = response.data
|
||||
this.$modal.msgError(
|
||||
|
|
@ -787,6 +794,19 @@ export default {
|
|||
this.codeList = res.data
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
open: {
|
||||
handler(newValue) {
|
||||
if (!newValue) {
|
||||
this.form.suffixOneCode = ''
|
||||
this.form.suffixTwoCode = ''
|
||||
this.form.fixCode = '1'
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -540,6 +540,7 @@ export default {
|
|||
name: undefined,
|
||||
typeId: '',
|
||||
keyWord: '',
|
||||
taskState: '',
|
||||
},
|
||||
openPrint: false,
|
||||
printData: {},
|
||||
|
|
|
|||
Loading…
Reference in New Issue