| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { addMaterial, updateMaterial } from "@/api/ProductiveTask/inventory"; |
| | | import { getCodeStandardList } from "@/api/basic/standard"; |
| | | |
| | | import { getCodeStandardList } from "@/api/basic/standard"; |
| | | import { |
| | | NetworkCard, |
| | | getMiniDictList, |
| | | addMiniDict, |
| | | deleteMiniDict, |
| | | updateMiniDict, |
| | | sendProcessParams |
| | | } from "@/api/home/index"; |
| | | export default { |
| | | name: "", |
| | | props: { |
| | |
| | | watch: { |
| | | editDialogVisible(newVal){ |
| | | if(newVal){ |
| | | this.BomTableData=this.workList; |
| | | this.BomTableData= JSON.parse( |
| | | JSON.stringify(this.workList)) |
| | | } |
| | | }, |
| | | workList(newVal){ |
| | | this.BomTableData=this.workList; |
| | | this.BomTableData=JSON.parse( |
| | | JSON.stringify(this.workList)) |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | this.BomTableData.push({name:'',isDefault:false}); |
| | | }, |
| | | handleDelete(id) { |
| | | |
| | | this.BomTableData=this.BomTableData.filter(i=>{ |
| | | return i.id!=id |
| | | }) |
| | |
| | | this.$emit('handleConfirmSave',this.BomTableData) |
| | | } |
| | | }, |
| | | async validate() { |
| | | try { |
| | | if (this.flag == "add") |
| | | this.form.id = this.codenumberList.replace(/,/g, ""); |
| | | this.form.explain = this.explain; |
| | | let fn = this.flag == "set" ? updateMaterial : addMaterial; |
| | | const res = await fn(this.form); |
| | | this.shutdown(); |
| | | this.$sucessSet('sucessSet') |
| | | if(res.code==200){ |
| | | this.$message({ |
| | | message: this.flag == "set"?'修改成功!':'添加成功!', |
| | | type: "success", |
| | | }); |
| | | } |
| | | |
| | | } catch (err) { |
| | | console.log(err); |
| | | this.$message({ |
| | | message: err.message.data.data, |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | shutdown() { |
| | | this.editDialogVisible = false; |
| | | |