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