| | |
| | | label-width="80px" |
| | | > |
| | | <el-form-item label="编号" prop="number" class="form-item"> |
| | | <el-input v-model="form.number" placeholder="请输入"> </el-input> |
| | | <el-input v-model="form.number" :disabled="title=='修改'?true:false" placeholder="请输入"> </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="落丝时间" prop="finishDate" class="form-item"> |
| | | <el-date-picker |
| | | v-model="form.finishDate" |
| | | value-format="yyyy-MM-dd" |
| | | :picker-options="pickerOptions" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | class="select-width" |
| | |
| | | v-model="form.market" |
| | | placeholder="请选择" |
| | | class="select-width" |
| | | @change="getGroupNumber" |
| | | > |
| | | <el-option |
| | | v-for="item in marketList" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="车间" prop="name" class="form-item"> |
| | | <el-form-item label="车间" prop="workshopObj" class="form-item"> |
| | | <el-select |
| | | v-model="form.name" |
| | | v-model="form.workshopObj" |
| | | placeholder="请选择" |
| | | class="select-width" |
| | | @change="getGroupNumber" |
| | | @change="getGroupNumber('workshopObj')" |
| | | > |
| | | <el-option |
| | | v-for="item in nameList" |
| | | :key="item.ID" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | :value="{ value: item.number, label: item.name }" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | placeholder="请先选择车间" |
| | | no-data-text="请先选择车间" |
| | | class="select-width" |
| | | @change="getGroupNumber()" |
| | | > |
| | | <el-option |
| | | v-for="item in workshopGroupList" |
| | |
| | | :detail-enter="isView ? true : false" |
| | | :selectBox="false" |
| | | :detailEnter="true" |
| | | :isBorder="true" |
| | | :show-summary="showSummary" |
| | | :product-table-list="tableList" |
| | | @inputContent="inputContent" |
| | |
| | | :model="form" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="60px" |
| | | label-width="70px" |
| | | > |
| | | <div class="form-box-t"> |
| | | <el-form-item label="编号" prop="number" class="form-item"> |
| | | <el-form-item label="编号:" prop="number" class="form-item"> |
| | | {{ form.number }} |
| | | </el-form-item> |
| | | <el-form-item label="车间" prop="name" class="form-item"> |
| | | {{ form.name }} |
| | | <el-form-item label="车间:" prop="workshopName" class="form-item"> |
| | | {{ form.workshopName }} |
| | | </el-form-item> |
| | | <el-form-item label="组别" prop="workshopGroup" class="form-item"> |
| | | <el-form-item label="组别:" prop="workshopGroup" class="form-item"> |
| | | {{ form.workshopGroup }} |
| | | </el-form-item> |
| | | <el-form-item label="回数" prop="circle" class="form-item"> |
| | | <el-form-item label="回数:" prop="circle" class="form-item"> |
| | | {{ form.circle }} |
| | | </el-form-item> |
| | | <el-form-item label="规格" prop="spec" class="form-item"> |
| | | <el-form-item label="规格:" prop="spec" class="form-item"> |
| | | {{ form.spec }} |
| | | </el-form-item> |
| | | <el-form-item label="日期" prop="finishDate" class="form-item"> |
| | | <el-form-item label="日期:" prop="finishDate" class="form-item"> |
| | | {{ form.finishDate }} |
| | | </el-form-item> |
| | | </div> |
| | |
| | | tooltip-effect="dark" |
| | | style="width: 100%" |
| | | :height="'calc(100% - 0px)'" |
| | | :header-cell-style="{ background: '#f1f3f8',color: '#000009', 'font-size': '12px', 'font-family': 'PingFangSC' }" |
| | | border |
| | | > |
| | | <el-table-column label="车号" prop="ID" width="100"> |
| | | </el-table-column> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | // getWorkshopManageList, |
| | | // getWorkshopManageList |
| | | import { |
| | | saveRegister, |
| | | getDictList, |
| | | getRegisterDetails, |
| | | getCarNumber |
| | | } from "@/api/productManage/silkRegisterForm.js"; |
| | | import { |
| | | getCheckDetails, |
| | |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | title:'', |
| | | loading: false, |
| | | activeName: "first", |
| | | searchOptions: [], |
| | |
| | | finishDate: [ |
| | | { required: true, message: "请选择", trigger: ["change", "blur"] }, |
| | | ], |
| | | // 庄口 |
| | | market: [ |
| | | { required: true, message: "请选择", trigger: ["change", "blur"] }, |
| | | ], |
| | | // 车间 应该true |
| | | name: [ |
| | | workshopObj: [ |
| | | { required: true, message: "请选择", trigger: ["change", "blur"] }, |
| | | ], |
| | | spec: [ |
| | |
| | | position: [ |
| | | { required: true, message: "请填写", trigger: ["change", "blur"] }, |
| | | ], |
| | | }, |
| | | pickerOptions: { |
| | | disabledDate(time) { |
| | | return time.getTime() < new Date().getTime() - 86400000; |
| | | }, |
| | | }, |
| | | tableTwoList: { |
| | | tableInfomation: [], |
| | |
| | | { |
| | | label: "纤度合计", |
| | | prop: "sum", |
| | | inputNumber: true, |
| | | isRequird: true, |
| | | }, // 下次回访日期 |
| | | ], |
| | | }, |
| | |
| | | this.activeName = query.activeName ? query.activeName : "first"; |
| | | this.registerId = query.id ? query.id : ""; |
| | | this.inspectID = query.inspectID ? query.inspectID : ""; |
| | | this.title= query.title ? query.title : ""; |
| | | } |
| | | this.getSelectDataList(); |
| | | this.keyword = ""; |
| | | this.getDetailsData(); |
| | | }, |
| | | methods: { |
| | | getDetailsData(id) { |
| | | async getDetailsData(id) { |
| | | if (this.activeName == "first") { |
| | | this.form = { |
| | | number: "", |
| | | finishDate: "", |
| | | market: "", |
| | | name: "", |
| | | workshopObj: "", |
| | | spec: "", |
| | | workshopGroup: "", |
| | | circleTwo: "", |
| | |
| | | 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( |
| | | JSON.stringify(response.data ? response.data : {}) |
| | | ); |
| | | this.form = config; |
| | | this.getGroupNumber() |
| | | this.form.workshopObj={ |
| | | value:config.workshopNumber, |
| | | label:config.workshopName, |
| | | } |
| | | this.getGroupNumber('','edit') |
| | | let finenessList=config.finenessList |
| | | ? config.finenessList |
| | | : []; |
| | |
| | | item.productId=index+1 |
| | | }) |
| | | } |
| | | console.log(finenessList,'===finenessList') |
| | | this.tableList.tableData = finenessList |
| | | this.tableData = this.tableList.tableData; |
| | | } |
| | |
| | | } else { |
| | | this.form = { |
| | | number: "", |
| | | name: "", |
| | | workshopObj: "", |
| | | workshopGroup: "", |
| | | circle: "", |
| | | spec: "", |
| | |
| | | ); |
| | | this.form = config; |
| | | this.form.number = config.finenessRegister.number; |
| | | this.form.name = config.finenessRegister.name; |
| | | this.form.workshopName = config.finenessRegister.workshopName; |
| | | this.form.workshopGroup = config.finenessRegister.workshopGroup; |
| | | this.form.spec = config.finenessRegister.spec; |
| | | this.form.finishDate = config.finenessRegister.finishDate; |
| | |
| | | } |
| | | }); |
| | | }, |
| | | getGroupNumber() { |
| | | if (this.form.name) { |
| | | //组别 |
| | | let number = ""; |
| | | for (let i in this.nameList) { |
| | | if (this.nameList[i].name == this.form.name) { |
| | | number = this.nameList[i].number; |
| | | break; |
| | | } |
| | | } |
| | | getWorkshopManageGroup({ number: number }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.workshopGroupList = []; |
| | | let workshopGroupList = res.data || {}; |
| | | if (Object.keys(workshopGroupList).length > 0) { |
| | | for (let i in workshopGroupList) { |
| | | this.workshopGroupList.push(workshopGroupList[i]); |
| | | async getGroupNumber(val,type) { |
| | | if (Object.keys(this.form.workshopObj).length>0) { |
| | | if(this.form.workshopObj.value){ |
| | | await getWorkshopManageGroup({ number: this.form.workshopObj.value }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.workshopGroupList = []; |
| | | let workshopGroupList = res.data || {}; |
| | | this.workshopGroupList=[] |
| | | if(val=='workshopObj'){ |
| | | 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&&type!='edit'){ |
| | | await getCarNumber({ |
| | | workshopName:this.form.workshopObj.label, |
| | | 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)*2+1}) |
| | | this.tableData.push({position:data[i],productId:Number(i)*2+2}) |
| | | } |
| | | } |
| | | this.tableList.tableData = this.tableData |
| | | }else{ |
| | | this.tableData=[] |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | this.workshopGroupList = []; |
| | | } |
| | |
| | | }, |
| | | // 产品新增 |
| | | addProductClick() { |
| | | debugger |
| | | this.productId++; |
| | | this.tableData.push({ |
| | | productId: this.productId, |
| | |
| | | if (item.productId === row.productId) { |
| | | item[prop] = val; |
| | | } |
| | | if(item.fineness&&item.quantity){ |
| | | item.sum=Number(item.fineness)*Number(item.quantity).toFixed(2) |
| | | } |
| | | }); |
| | | this.tableList.tableData= this.tableData |
| | | }, |
| | | tabsClick() { |
| | | // if (tab.name === "first") { |
| | |
| | | number: "", |
| | | finishDate: "", |
| | | market: "", |
| | | name: "", |
| | | workshopObj: "", |
| | | spec: "", |
| | | workshopGroup: "", |
| | | circleTwo: "", |
| | |
| | | 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); |
| | | } |
| | | params.workshopName=this.form.workshopObj.label; |
| | | params.workshopNumber=this.form.workshopObj.value; |
| | | saveRegister(params) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | }); |
| | | } else { |
| | | let paramsTwo = { |
| | | ...form, |
| | | // ...form, |
| | | info:form, |
| | | items:this.tableTwoList.tableInfomation, |
| | | }; |
| | | // 编辑 |
| | | if (this.registerId) { |
| | |
| | | ? this.form.ID |
| | | : Number(this.registerId); |
| | | } |
| | | this.isAddloading = true; |
| | | saveCheck(paramsTwo) |
| | | .then((res) => { |
| | | if (res.code == 200) { |