| | |
| | | v-model="form.market" |
| | | placeholder="请选择" |
| | | class="select-width" |
| | | @change="getGroupNumber" |
| | | > |
| | | <el-option |
| | | v-for="item in marketList" |
| | |
| | | v-model="form.name" |
| | | placeholder="请选择" |
| | | class="select-width" |
| | | @change="getGroupNumber" |
| | | @change="getGroupNumber('name')" |
| | | > |
| | | <el-option |
| | | v-for="item in nameList" |
| | |
| | | placeholder="请先选择车间" |
| | | no-data-text="请先选择车间" |
| | | class="select-width" |
| | | @change="getGroupNumber" |
| | | @change="getGroupNumber()" |
| | | > |
| | | <el-option |
| | | v-for="item in workshopGroupList" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | // getWorkshopManageList, |
| | | // getWorkshopManageList |
| | | import { |
| | | saveRegister, |
| | | getDictList, |
| | | getRegisterDetails, |
| | | getCarNumber |
| | | } from "@/api/productManage/silkRegisterForm.js"; |
| | | import { |
| | | getCheckDetails, |
| | |
| | | this.getDetailsData(); |
| | | }, |
| | | methods: { |
| | | getDetailsData(id) { |
| | | async getDetailsData(id) { |
| | | if (this.activeName == "first") { |
| | | this.form = { |
| | | number: "", |
| | |
| | | position: "", |
| | | }; |
| | | if (this.registerId) { |
| | | getRegisterDetails({ id: id ? id : this.registerId }).then( |
| | | await getRegisterDetails({ id: id ? id : this.registerId }).then( |
| | | (response) => { |
| | | if (response.code === 200) { |
| | | let config = JSON.parse( |
| | |
| | | item.productId=index+1 |
| | | }) |
| | | } |
| | | console.log(finenessList,'===finenessList') |
| | | this.tableList.tableData = finenessList |
| | | this.tableData = this.tableList.tableData; |
| | | } |
| | |
| | | } |
| | | }); |
| | | }, |
| | | getGroupNumber() { |
| | | async getGroupNumber(val) { |
| | | if (this.form.name) { |
| | | //组别 |
| | | let number = ""; |
| | |
| | | break; |
| | | } |
| | | } |
| | | getWorkshopManageGroup({ number: number }).then((res) => { |
| | | await getWorkshopManageGroup({ number: number }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.workshopGroupList = []; |
| | | let workshopGroupList = res.data || {}; |
| | | this.workshopGroupList=[] |
| | | if(val=='name'){ |
| | | this.form.workshopGroup='' |
| | | } |
| | | if (Object.keys(workshopGroupList).length > 0) { |
| | | for (let i in workshopGroupList) { |
| | | this.workshopGroupList.push(workshopGroupList[i]); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }) |
| | | if(this.form.workshopGroup&&this.form.market){ |
| | | getCarNumber({ |
| | | workshopName:this.form.name, |
| | | marketName:this.form.market, |
| | | groupNumber:this.form.workshopGroup, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.tableData=[] |
| | | let data = res.data?JSON.parse(JSON.stringify(res.data)) : []; |
| | | if(Object.keys(data).length>0){ |
| | | for(let i in data){ |
| | | this.tableData.push({position:data[i],productId:Number(i)+1}) |
| | | } |
| | | } |
| | | this.tableList.tableData = this.tableData |
| | | }else{ |
| | | this.tableData=[] |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | this.workshopGroupList = []; |
| | | } |
| | |
| | | }, |
| | | // 产品新增 |
| | | addProductClick() { |
| | | debugger |
| | | this.productId++; |
| | | this.tableData.push({ |
| | | productId: this.productId, |
| | |
| | | item[prop] = val; |
| | | } |
| | | }); |
| | | this.tableList.tableData= this.tableData |
| | | }, |
| | | tabsClick() { |
| | | // if (tab.name === "first") { |
| | |
| | | if (valid) { |
| | | let form = JSON.parse(JSON.stringify(this.form)); |
| | | // params.workshopGroup=Number(params.workshopGroup) |
| | | this.isAddloading = true; |
| | | if (this.activeName == "first") { |
| | | delete form.circleTwo; |
| | | let finenessList = JSON.parse( |
| | | JSON.stringify(this.tableList.tableData) |
| | | ); |
| | | let isContinue=false |
| | | for (let i in finenessList) { |
| | | if(!finenessList[i].position||!finenessList[i].fineness||!finenessList[i].quantity||!finenessList[i].sum){ |
| | | isContinue=true |
| | | break; |
| | | } |
| | | } |
| | | if(isContinue){ |
| | | this.$message.error('请填写完整再保存!') |
| | | return true; |
| | | } |
| | | for (let i in finenessList) { |
| | | delete finenessList[i].productId; |
| | | } |
| | | this.isAddloading = true; |
| | | let params = { |
| | | finenessList: finenessList, |
| | | ...form, |
| | |
| | | if (this.inspectID) { |
| | | params.ID = this.form.ID ? this.form.ID : Number(this.inspectID); |
| | | } |
| | | |
| | | saveRegister(params) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | ? this.form.ID |
| | | : Number(this.registerId); |
| | | } |
| | | this.isAddloading = true; |
| | | saveCheck(paramsTwo) |
| | | .then((res) => { |
| | | if (res.code == 200) { |