| | |
| | | style="margin-left: 16px; color: #fff; background-color: #ee790c" |
| | | >新增</el-button |
| | | > --> |
| | | <el-button @click="shutdown">取消</el-button><el-button type="primary" @click="handleConfirmSave()" |
| | | <el-button @click="shutdown">取消</el-button> |
| | | <el-button type="primary" @click="handleConfirmSave()" |
| | | style="margin-left: 16px; color: #fff; background-color: #2a78fb">确定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | default: () => { |
| | | return { |
| | | editDialogVisible: false, |
| | | BomTableData:[] |
| | | }; |
| | | }, |
| | | }, |
| | |
| | | thatEditRow:this.editRow, |
| | | isTableShow: true, |
| | | form: {}, |
| | | // BomTableData: JSON.parse(this.thatEditRow.BomTableData), |
| | | // BomTableData:[], |
| | | BomTableData: this.editRow.BomTableData, |
| | | // BomTableData: JSON.parse(this.editRow.BomTableData), |
| | | // BomTableData: [{ id: 303, createdAt: "2024-02-05 18:02:47", updatedAt: "2024-02-05 18:02:47",name: "kg", isDefault: false }], |
| | | work: 1, |
| | | flag: "add", |
| | |
| | | }; |
| | | }, |
| | | watch: { |
| | | // editDialogVisible(newVal) { |
| | | // console.log(newVal,"看看val") |
| | | // if (newVal) { |
| | | // this.BomTableData = this.workList; |
| | | // } |
| | | // }, |
| | | // workList(newVal) { |
| | | // console.log(newVal) |
| | | // this.BomTableData = this.workList; |
| | | // }, |
| | | }, |
| | | created() { |
| | | console.log(this.thatEditRow,"thatEditRow") |
| | |
| | | mounted() { }, |
| | | methods: { |
| | | handleAdd() { |
| | | this.BomTableData=this.thatEditRow.BomTableData |
| | | this.BomTableData.push({ name: "", isDefault: false }); |
| | | }, |
| | | handleDelete(id) { |
| | | this.BomTableData = this.BomTableData.filter((i) => { |
| | | if (this.BomTableData.length === 1) { |
| | | this.$message.warning("至少保留一条数据"); |
| | | return; |
| | | } |
| | | this.BomTableData = this.thatEditRow.BomTableData.filter((i) => { |
| | | return i.id != id; |
| | | }); |
| | | this.thatEditRow.BomTableData=this.BomTableData |
| | | }, |
| | | async getCodeStandardList() { |
| | | const res = await getCodeStandardList(this.obj); |
| | |
| | | let fn = this.flag == "set" ? updateMaterial : addMaterial; |
| | | const res = await fn(this.form); |
| | | this.shutdown(); |
| | | this.$sucessSet("sucessSet"); |
| | | // this.$sucessSet("sucessSet"); |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: this.flag == "set" ? "修改成功!" : "添加成功!", |