盘点入库优化
This commit is contained in:
parent
cf8e5eac70
commit
1fd8e4d0a4
|
|
@ -241,6 +241,7 @@
|
|||
v-model="codeForm.codePrefix"
|
||||
placeholder="请输入前缀"
|
||||
clearable
|
||||
maxlength="20"
|
||||
style="width: 220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -257,6 +258,7 @@
|
|||
v-model="codeForm.codeSuffixStart"
|
||||
clearable
|
||||
placeholder="请输入后缀范围起始值"
|
||||
maxlength="10"
|
||||
style="width: 185px"
|
||||
@change="
|
||||
changeSuffixStart(codeForm.codeSuffixStart)
|
||||
|
|
@ -273,6 +275,7 @@
|
|||
v-model="codeForm.codeSuffixEnd"
|
||||
clearable
|
||||
placeholder="请输入后缀范围结束值"
|
||||
maxlength="10"
|
||||
style="width: 185px"
|
||||
@change="changeSuffixEnd"
|
||||
/>
|
||||
|
|
@ -291,6 +294,7 @@
|
|||
placeholder="请输入单价"
|
||||
clearable
|
||||
:min="0"
|
||||
:max="999999999"
|
||||
:controls="false"
|
||||
style="width: 13vw"
|
||||
/>
|
||||
|
|
@ -456,6 +460,7 @@
|
|||
v-model="codeForm.checkMan"
|
||||
placeholder="请输入检验人"
|
||||
clearable
|
||||
maxlength="20"
|
||||
style="width: 220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -553,6 +558,7 @@
|
|||
<el-input
|
||||
v-model="row.maCode"
|
||||
placeholder="请输入设备编码"
|
||||
maxlength="30"
|
||||
@blur="handleMaCodeBlur(row)"
|
||||
></el-input>
|
||||
</template>
|
||||
|
|
@ -567,6 +573,7 @@
|
|||
<el-input
|
||||
v-model="row.outFacCode"
|
||||
placeholder="请输入出厂编码"
|
||||
maxlength="30"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -646,6 +653,7 @@
|
|||
:precision="2"
|
||||
placeholder="请输入单价"
|
||||
:min="0"
|
||||
:max="999999999"
|
||||
:controls="false"
|
||||
clearable
|
||||
style="width: 160px"
|
||||
|
|
@ -730,6 +738,7 @@
|
|||
clearable
|
||||
:controls="false"
|
||||
:min="1"
|
||||
:max="99"
|
||||
style="width: 10vw"
|
||||
/>
|
||||
</template>
|
||||
|
|
@ -754,6 +763,7 @@
|
|||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
clearable
|
||||
maxlength="100"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -983,7 +993,7 @@ export default {
|
|||
created() {
|
||||
this.getList()
|
||||
this.getTypeList()
|
||||
this.GetDeviceTypeTree()
|
||||
// this.GetDeviceTypeTree()
|
||||
this.supplierInfoList()
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -1137,16 +1147,17 @@ export default {
|
|||
this.codeForm.codeSuffixStart =
|
||||
this.codeForm.codeSuffixStart.replace(/[^\d]/g, '')
|
||||
}
|
||||
if (!this.codeForm.codeSuffixStart) {
|
||||
this.codeForm.codeSuffixEnd = ''
|
||||
if (isNaN(this.codeForm.codeSuffixStart) || this.codeForm.codeSuffixStart.includes('.')) {
|
||||
this.$message.error('后缀范围请输入整数类型')
|
||||
this.codeForm.codeSuffixStart = ''
|
||||
}
|
||||
},
|
||||
changeSuffixEnd() {
|
||||
if (!this.codeForm.codeSuffixStart) {
|
||||
this.$message.error('请输入后缀范围起始值')
|
||||
this.codeForm.codeSuffixEnd = ''
|
||||
} else if (isNaN(this.codeForm.codeSuffixEnd)) {
|
||||
this.$message.error('后缀范围请输入数字类型')
|
||||
} else if (isNaN(this.codeForm.codeSuffixEnd) || this.codeForm.codeSuffixEnd.includes('.')) {
|
||||
this.$message.error('后缀范围请输入整数类型')
|
||||
this.codeForm.codeSuffixEnd =
|
||||
this.codeForm.codeSuffixStart.replace(/[^\d]/g, '')
|
||||
} else {
|
||||
|
|
@ -1185,7 +1196,7 @@ export default {
|
|||
this.title = '数量盘点入库'
|
||||
this.resetCodeForm()
|
||||
this.getUnitData()
|
||||
this.GetDeviceTypeTree()
|
||||
this.GetDeviceTypeTree(this.isNumCheck)
|
||||
this.$nextTick(() => {
|
||||
this.$refs['codeForm'].clearValidate()
|
||||
})
|
||||
|
|
@ -1199,7 +1210,7 @@ export default {
|
|||
this.title = '编码盘点入库'
|
||||
this.resetCodeForm()
|
||||
this.getUnitData()
|
||||
this.GetDeviceTypeTree()
|
||||
this.GetDeviceTypeTree(this.isNumCheck)
|
||||
this.$nextTick(() => {
|
||||
this.$refs['codeForm'].clearValidate()
|
||||
})
|
||||
|
|
@ -1252,9 +1263,18 @@ export default {
|
|||
this.getList()
|
||||
})
|
||||
} else {
|
||||
// this.codeTableList 中只要有一个maCode为空, 则不允许提交
|
||||
this.requiredMaCode = this.codeTableList.some(
|
||||
(item) => !item.maCode,
|
||||
)
|
||||
// 过滤this.codeTableList中 如果有maCode是重复数据, 则不允许提交
|
||||
const maCodeList = this.codeTableList.map(
|
||||
(item) => item.maCode,
|
||||
)
|
||||
if (new Set(maCodeList).size !== maCodeList.length) {
|
||||
this.$message.error('设备编码不能重复')
|
||||
return
|
||||
}
|
||||
if (this.requiredMaCode) {
|
||||
this.$message.error('设备编码不能为空')
|
||||
return
|
||||
|
|
@ -1389,14 +1409,31 @@ export default {
|
|||
})
|
||||
},
|
||||
// 获取 设备树结构数据
|
||||
async GetDeviceTypeTree() {
|
||||
async GetDeviceTypeTree(type) {
|
||||
const params = {
|
||||
level: 4,
|
||||
}
|
||||
const res = await getDeviceTypeTree(params)
|
||||
console.log(res)
|
||||
if (type) {
|
||||
this.disableNodes(res.data, '1');
|
||||
} else {
|
||||
this.disableNodes(res.data, '0');
|
||||
}
|
||||
this.deviceTypeTree = res.data
|
||||
},
|
||||
// 递归禁用节点
|
||||
disableNodes(nodes, manageType, level = 1) {
|
||||
nodes.forEach(node => {
|
||||
node.level = level
|
||||
if (node.children) {
|
||||
this.disableNodes(node.children, manageType, level + 1);
|
||||
} else if (!node.children && node.level < 4) {
|
||||
node.disabled = true
|
||||
} else if(node.manageType && node.level == 4 && node.manageType != manageType) {
|
||||
node.disabled = true
|
||||
}
|
||||
});
|
||||
},
|
||||
/////// 设备类型树 切换
|
||||
deviceTypeChange(val) {
|
||||
console.log('🚀 ~ deviceTypeChange ~ val:', val)
|
||||
|
|
@ -1518,7 +1555,7 @@ export default {
|
|||
* -----------------------------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
/* 查看详情 */
|
||||
async queryDetails(row) {
|
||||
queryDetails(row) {
|
||||
this.sendParams.kindName = row.kindName
|
||||
this.dialogConfig.outerVisible = true
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue