{
+ selectList.push(
+ this.getParentsById(this.equipmentTypeList, e.typeId),
+ )
+ })
+ this.deviceType = selectList
})
},
+
//添加机具类型
select(row) {
console.log(row)
@@ -519,10 +560,28 @@ export default {
this.maForm.remark = response.data.remark
this.maForm.purchaseNumber = response.data.purchaseNumber
this.equipmentList = response.data.checkDetailsList
+
// this.loading = false;
})
},
+ getParentsById(list, id) {
+ for (let i in list) {
+ if (list[i].typeId == id) {
+ //查询到就返回该数组对象的value
+ return [list[i].typeId]
+ }
+ if (list[i].children) {
+ let node = this.getParentsById(list[i].children, id)
+ if (node !== undefined) {
+ //查询到把父节把父节点加到数组前面
+ node.unshift(list[i].typeId)
+ return node
+ }
+ }
+ }
+ },
+
/** 查询右侧列表 */
getList() {
// this.loading = true;
@@ -676,10 +735,16 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
- console.log(row.id)
+ // console.log(row.id)
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(() => {
+ this.deviceType.forEach((e, index) => {
+ if (e[3] === row.typeId) {
+ this.deviceType.splice(index, 1)
+ this.propsKey++
+ }
+ })
this.equipmentList.forEach((item, index) => {
if (item.id == row.id) {
this.equipmentList.splice(index, 1)
@@ -702,20 +767,73 @@ export default {
// ...this.queryParams
// }, `role_${new Date().getTime()}.xlsx`)
},
+ deviceTypeChange(val) {
+ const deviceTypeList =
+ this.$refs.deviceTypeCascader.getCheckedNodes()
+ let tempList = []
+ if (val.length > 0) {
+ const items = val.map((e) => {
+ return e[3]
+ })
+ for (let i in items) {
+ for (let z in deviceTypeList) {
+ if (deviceTypeList[z].data.typeId === items[i]) {
+ this.$set(deviceTypeList[z].data, 'supplierId', '')
+ this.$set(
+ deviceTypeList[z].data,
+ 'createTime',
+ null,
+ )
+ this.$set(
+ deviceTypeList[z].data,
+ 'productionTime',
+ '',
+ )
+ this.$set(
+ deviceTypeList[z].data,
+ 'purchasePrice',
+ 0,
+ )
+ this.$set(deviceTypeList[z].data, 'purchaseNum', 1)
+
+ tempList.push(deviceTypeList[z].data)
+
+ break
+ }
+ }
+ }
+ }
+
+ this.equipmentList = [...new Set(tempList)]
+ },
},
}
+//
+
+
diff --git a/src/views/warehouseManage/newPurchase/toolsAcceptance/component/home.vue b/src/views/warehouseManage/newPurchase/toolsAcceptance/component/home.vue
index 75dd862..2624366 100644
--- a/src/views/warehouseManage/newPurchase/toolsAcceptance/component/home.vue
+++ b/src/views/warehouseManage/newPurchase/toolsAcceptance/component/home.vue
@@ -223,7 +223,7 @@
size="mini"
type="text"
icon="el-icon-delete"
- v-if="scope.row.purchasingId == 25"
+ v-if="scope.row.purchasingId === 24"
@click="handleDelete(scope.row)"
v-hasPermi="['newPurchase:tools:del']"
>删除
请上传png、jpg、jpeg类型文件,文件个数不能超过
- {{ limit }} 个,且单个文件不能超过5M
请上传png、jpg、jpeg类型图片,图片总数不能超过
+ {{ limit }} 个,且单张图片不能超过5M
@@ -55,7 +55,7 @@ export default {
this.$emit('success', response, file)
},
handleExceed() {
- this.$message.error(`最多只能上传${this.limit}个文件!`)
+ this.$message.error(`最多只能上传${this.limit}个图片!`)
},
beforeUpload(file) {
const isJPGorPNG =
@@ -64,10 +64,10 @@ export default {
file.type == 'image/jpeg'
const isLt5M = file.size / 1024 / 1024 < 5 // 小于 5MB
if (!isJPGorPNG) {
- this.$message.error('只能上传 jpg、jpeg、png 、 格式的文件!')
+ this.$message.error('只能上传 jpg、jpeg、png 、 格式的图片!')
}
if (!isLt5M) {
- this.$message.error('上传图片大小不能超过 5MB')
+ this.$message.error('上传的图片大小不能超过 5MB')
}
return isJPGorPNG && isLt5M
},
diff --git a/src/views/warehouseManage/warehousing/newTools/index.vue b/src/views/warehouseManage/warehousing/newTools/index.vue
index d3bca95..3816c05 100644
--- a/src/views/warehouseManage/warehousing/newTools/index.vue
+++ b/src/views/warehouseManage/warehousing/newTools/index.vue
@@ -113,10 +113,10 @@
-
+ /> -->
数量管理