2024-05-15 基础信息-产品-修改产品附属属性

master
A0010407 4 months ago
parent c030d1d1f3
commit a9820f6ed2

@ -55,3 +55,12 @@ export function delProduct(productId) {
method: 'delete'
});
}
// 修改物料信息
export function updateProductAttached(data) {
return request({
url: '/wms/attached',
method: 'put',
data: data
});
}

@ -62,6 +62,18 @@
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdateAttached"
v-hasPermi="['wms:attached:edit']"
>修改附属属性</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
@ -420,10 +432,37 @@
</div>
</el-dialog>
<!-- 查看物料附属信息 -->
<!-- 更新附属属性 -->
<el-dialog
:title="title"
:visible.sync="openAttached"
width="500px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="标准效率" prop="iei">
<el-input-number
v-model="form.iei"
style="width: 320px"
/>
</el-form-item>
<el-form-item label="标准用人" prop="manStandar">
<el-input-number
v-model="form.manStandar"
style="width: 320px"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitAttachedForm"> </el-button>
<el-button @click="cancelOpenAttached"> </el-button>
</div>
</el-dialog>
<!-- 查看物料附属信息 -->
<el-dialog
:title="title"
:visible.sync="openAttachedView"
width="1000px"
append-to-body
>
@ -506,7 +545,7 @@
</el-descriptions>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelAttached"> </el-button>
<el-button @click="cancelAttachedView"> </el-button>
</div>
</el-dialog>
</div>
@ -519,6 +558,7 @@ import {
delProduct,
addProduct,
updateProduct,
updateProductAttached,
} from "@/api/wms/product";
import { syncProductSAP } from "@/api/technology/proroute";
@ -552,6 +592,7 @@ export default {
title: "",
//
open: false,
openAttachedView: false,
openAttached: false,
//
queryParams: {
@ -637,14 +678,22 @@ export default {
this.open = false;
this.reset();
},
//
cancelAttached() {
//
cancelAttachedView() {
this.openAttachedView = false;
this.reset();
},
//
cancelOpenAttached() {
this.openAttached = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
iei: null,
manStandar: null,
productId: null,
productCode: null,
productDescZh: null,
@ -704,7 +753,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.productId);
this.productCodes = selection.map(item => item.productCode)
this.productCodes = selection.map((item) => item.productCode);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
@ -724,16 +773,18 @@ export default {
this.title = "修改产品信息";
});
},
//
handleView(row) {
this.reset();
const productId = row.productId || this.ids;
getProduct(productId).then((response) => {
this.form = response.data;
this.openAttached = true;
this.openAttachedView = true;
this.title = "查看产品信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
@ -754,6 +805,37 @@ export default {
}
});
},
/** 修改按钮操作 */
handleUpdateAttached(row) {
this.reset();
const productId = row.productId || this.ids;
getProduct(productId).then((response) => {
this.form.id = response.data.id;
this.form.iei = response.data.iei;
this.form.manStandar = response.data.manStandar;
this.openAttached = true;
this.title = "查看产品信息";
});
},
/** 提交按钮 */
submitAttachedForm() {
this.$refs["form"].validate((valid) => {
console.log(this.form);
if (valid) {
if (this.form.id != null) {
console.log(this.form);
updateProductAttached(this.form).then((response) => {
this.$modal.msgSuccess("修改产品附属信息成功");
this.openAttached = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const productIds = row.productId || this.ids;
@ -784,7 +866,7 @@ export default {
handleSyncProductSAP() {
const productCodes = this.productCodes;
return syncProductSAP(productCodes);
}
},
},
};
</script>

Loading…
Cancel
Save