Merge branch 'projects/mesxc-test' into projects/mesxc-zhp

This commit is contained in:
‘937886381’
2024-02-28 10:55:19 +08:00
18 changed files with 1301 additions and 155 deletions

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-21 09:04:48
* @LastEditTime: 2024-02-27 15:38:04
* @Description:
-->
<template>
@@ -322,14 +322,14 @@ export default {
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
init(row, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.isedit = id ? true : false;
this.dataForm.id = row.id || undefined;
this.isedit = row?.id && row?.externalCode ? true : false;
console.log('你好', this.isedit)
this.visible = true;
if (id) {
if (row) {
this.idAttrShow = true
} else {
this.idAttrShow = false
@@ -340,7 +340,7 @@ export default {
if (this.dataForm.id) {
// 获取产品详情
this.urlOptions.infoURL(id).then(response => {
this.urlOptions.infoURL(this.dataForm.id).then(response => {
this.dataForm = response.data
// this.dataForm.area = response.data.area || 0
// this.dataForm.weight = response.data.weight || 0

View File

@@ -74,9 +74,7 @@ export default {
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getCoreProductAttr({
id: this.dataForm.id
}).then((res) => {
getCoreProductAttr(this.dataForm.id).then((res) => {
const { name, value } = res.data;
this.dataForm.name = name;
this.dataForm.value = value;

View File

@@ -141,6 +141,22 @@ export default {
},
created() {},
methods: {
//tableBtn点击
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
},
// 删除
deleteHandle(id, name, index) {
this.$confirm(`是否确认删除产品名称为"${name}"的数据项`, "提示", {
@@ -168,7 +184,7 @@ export default {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "详情";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
this.$refs.addOrUpdate.init(val.data, true);
});
}
},

View File

@@ -121,7 +121,6 @@
<el-select
v-model="dataForm.roomNameDict"
filterable
:disabled="isdetail || isedit"
style="width: 100%"
placeholder="请选择车间名称">
<el-option
@@ -282,6 +281,7 @@ export default {
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
// this.$confirm('是否添加预使用主原料信息?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',