From 211fd8e6bf7cd459c757b58a5d7398d1b4b1ae2b Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期一, 13 五月 2024 10:35:37 +0800 Subject: [PATCH] 修改 --- src/views/technology/operation/operation-form.vue | 186 +++++++++++++-------------------------------- 1 files changed, 55 insertions(+), 131 deletions(-) diff --git a/src/views/technology/operation/operation-form.vue b/src/views/technology/operation/operation-form.vue index 7c8b026..455f8cb 100644 --- a/src/views/technology/operation/operation-form.vue +++ b/src/views/technology/operation/operation-form.vue @@ -6,7 +6,7 @@ <h2>缂栬緫-宸ュ簭</h2> </div> <div class="btn-group header-right"> - <el-button :disabled="isSubmit" v-thinclick="`dataFormSubmit`" + <el-button type="primary" :disabled="isSubmit" v-thinclick="`dataFormSubmit`" >淇濆瓨</el-button > </div> @@ -14,50 +14,39 @@ <div class="page-main"> <div class="operation-basic"> <el-form - :inline="true" + style="width:100%" :model="dataForm" :rules="dataRule" ref="dataForm" label-width="100px" - class="l-mes form-content" - > + class="l-mes"> <el-row class="first-row"> - <el-col :span="24"> + <el-col :span="6"> <el-form-item label="宸ュ簭鍚嶇О" prop="name"> <el-input + style="width:100%" v-model="dataForm.name" placeholder="宸ュ簭鍚嶇О" ></el-input> </el-form-item> + </el-col> + <el-col :span="6"> <el-form-item label="宸ュ簭缂栧彿" prop="operationNo"> <el-input + style="width:100%" v-model="dataForm.operationNo" placeholder="宸ュ簭缂栧彿" + :disabled="isUpdate" ></el-input> </el-form-item> - <el-form-item label="闆朵欢鏃�" prop="partFamilyId"> - <el-select - v-model="dataForm.partFamilyId" - filterable - placeholder="璇烽�夋嫨" - style="width: 100%;" - > - <el-option - v-for="(item, index) in this.partFamilyOptions" - :key="index" - :label="item.partFamilyName" - :value="item.id" - > - </el-option> - </el-select> - </el-form-item> + </el-col> + <el-col :span="6"> <el-form-item label="宸ヤ綔涓績" prop="workCenter"> <el-select v-model="dataForm.workCenter" placeholder="宸ヤ綔涓績" style="width: 100%" - filterable - > + filterable > <el-option v-for="item in workCenterOptions" :key="item.id" @@ -66,18 +55,8 @@ /> </el-select> </el-form-item> - <el-form-item label="鏈哄櫒杩愯浆鍥犵礌" prop="machRunFactor"> - <el-input - v-model="dataForm.machRunFactor" - placeholder="鏈哄櫒杩愯浆鍥犵礌" - ></el-input> - </el-form-item> - <el-form-item label="鏈哄櫒璁剧疆鏃堕棿" prop="machSetupTime"> - <el-input - v-model="dataForm.machSetupTime" - placeholder="鏈哄櫒璁剧疆鏃堕棿" - ></el-input> - </el-form-item> + </el-col> + <el-col :span="6"> <el-form-item label="浜哄伐绫诲埆" prop="laborClassNo"> <el-select v-model="dataForm.laborClassNo" @@ -94,93 +73,28 @@ </el-option> </el-select> </el-form-item> - <el-form-item label="鍔冲姏杩愯浆鍥犵礌" prop="laborRunFactor"> - <el-input - v-model="dataForm.laborRunFactor" - placeholder="鍔冲姏杩愯浆鍥犵礌" - ></el-input> - </el-form-item> - <el-form-item label="鍔冲姏璁剧疆鏃堕棿" prop="laborSetupTime"> - <el-input - v-model="dataForm.laborSetupTime" - placeholder="鍔冲姏璁剧疆鏃堕棿" - ></el-input> - </el-form-item> - <el-form-item label="鍥犵礌鍗曚綅" prop="runTimeCodeDb"> - <el-select - v-model="dataForm.runTimeCodeDb" - placeholder="鍥犵礌鍗曚綅" - style="width: 100%" - > - <el-option - v-for="item in runTimeCodeDbOptions" - :key="item.id" - :label="item.label" - :value="item.value" - /> - </el-select> - </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="6"> <el-form-item label="鐝粍浜哄憳" prop="crewSize"> <el-input + style="width:100%" v-model="dataForm.crewSize" placeholder="鐝粍浜哄憳" ></el-input> </el-form-item> - <el-form-item label="澶栭儴宸ュ簭椤圭洰" prop="outsideOpItem"> - <el-select - v-model="dataForm.outsideOpItem" - placeholder="澶栭儴宸ュ簭椤圭洰" - style="width: 170px" - clearable - > - <el-option - v-for="item in outsideOpItemOptions" - :key="item.id" - :label='item.value + "-" + item.label ' - :value="item.value" - /> - </el-select> - </el-form-item> + </el-col> + <el-col :span="12"> <el-form-item label="澶囨敞" prop="remark"> <el-input v-model="dataForm.remark" placeholder="澶囨敞" - style="width: 280px" + style="width: 100%" ></el-input> </el-form-item> </el-col> - </el-row> - <el-row style="padding-top: 10px"> - <el-col :span="24"> - <el-form-item label="閰嶇疆椤�"> - <el-checkbox-group - v-model="checkboxGroup" - @change="checkboxGroupChange()" - > - <el-checkbox-button - label="productionCounting" - key="productionCounting" - >鎶ュ伐</el-checkbox-button - > - <el-checkbox-button label="daq" key="daq" - >閲囬泦</el-checkbox-button - > - <el-checkbox-button label="inspection" key="inspection" - >妫�楠�</el-checkbox-button - > - <el-checkbox-button - label="autoInspection" - key="autoInspection" - >鑷姩鎶ユ</el-checkbox-button - > - <el-checkbox-button label="semiFinished" key="semiFinished" - >鍗婃垚鍝�</el-checkbox-button - > - <el-checkbox-button label="materialCost" key="materialCost" - >鎶曟枡</el-checkbox-button - > - </el-checkbox-group> - </el-form-item> + <el-col :span="6"> </el-col> </el-row> </el-form> @@ -188,7 +102,7 @@ <div class="operation-detail"> <el-tabs type="card" style="width: 100%;height: 100%"> - <el-tab-pane label="鍩虹" style="height: 100%"> + <!-- <el-tab-pane label="鍩虹" style="height: 100%"> <el-card class="operation-capacity" header="宸ュ簭鑳藉姏"> <el-transfer filterable @@ -226,7 +140,7 @@ </div> </el-upload> </el-card> - </el-tab-pane> + </el-tab-pane> --> <el-tab-pane label="鍙傛暟" style="height: 100%"> <el-card class="operation-capacity" header="宸ュ簭鍙傛暟闆嗘ā鏉�"> <div slot="header"> @@ -307,7 +221,7 @@ </el-table> </el-card> </el-tab-pane> - <el-tab-pane + <!-- <el-tab-pane v-if="isShowStepBusiness" label="宸ユ" style="height: 100%" @@ -363,11 +277,12 @@ </el-table-column> </el-table> </el-card> - </el-tab-pane> + </el-tab-pane> --> </el-tabs> <ParamTemplateDialog :currshowlist.sync="showOperationTemplate" @handleSelectionParamTemplateChange="selectOperationTemplate" + :paramTemplateObj="templateDefaultObj" /> <StepDialog :currshowlist.sync="showStep" @@ -416,6 +331,7 @@ typeOptions: [], ids: [], showOperationTemplate: false, + templateDefaultObj: { dataType: '鐢熶骇璁板綍' }, showStep: false, isInsertStep: false, stepIndex: null, @@ -448,7 +364,7 @@ laborRunFactor: 0, laborSetupTime: 0, runTimeCodeDb: '2', - crewSize: 1, + crewSize: null, outsideOpItem:null }, operationTemplateList: [], @@ -466,6 +382,9 @@ ], name: [ { required: true, message: '宸ュ簭鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' } + ], + workCenter: [ + { required: true, message: '宸ヤ綔涓績涓嶈兘涓虹┖', trigger: 'blur' } ], productionCounting: [ { required: true, message: '鏄惁鎶ュ伐涓嶈兘涓虹┖', trigger: 'blur' } @@ -485,7 +404,8 @@ workCenterOptions: [], runTimeCodeDbOptions: [], laborClassNoOptions: [], - outsideOpItemOptions: [] + outsideOpItemOptions: [], + isUpdate:false } }, computed: { @@ -592,8 +512,9 @@ // } }, init() { - this.operationId = this.dataForm.id - this.fetchCapabilityForOperation() + // this.operationId = this.dataForm.id + // this.fetchCapabilityForOperation() + if (this.dataForm.id) { getObj(this.dataForm.id).then((response) => { this.dataForm = response.data.data @@ -724,7 +645,7 @@ this.dataForm.laborRunFactor = 0 this.dataForm.laborSetupTime = 0 this.dataForm.runTimeCodeDb = '2' - this.dataForm.crewSize = 1 + this.dataForm.crewSize = null this.fileList = [] this.operationTemplateList = [] this.stepList = [] @@ -751,17 +672,17 @@ this.$refs.dataForm.validate((valid) => { if (valid) { // 鏍¢獙銆愭満鍣ㄨ繍杞洜绱犮�戙�併�愭満鍣ㄨ缃椂闂淬�戙�併�愬姵鍔涜繍杞洜绱犮�戙�併�愬姵鍔涜缃椂闂淬�戜腑鑷冲皯鏈変竴涓瓧娈电殑鍊奸』澶т簬0 - if ( - this.dataForm.machRunFactor == 0 && - this.dataForm.machSetupTime == 0 && - this.dataForm.laborRunFactor == 0 && - this.dataForm.laborSetupTime == 0 - ) { - this.$message.error( - '銆愭満鍣ㄨ繍杞洜绱犮�戙�併�愭満鍣ㄨ缃椂闂淬�戙�併�愬姵鍔涜繍杞洜绱犮�戙�併�愬姵鍔涜缃椂闂淬�戜腑鑷冲皯鏈変竴涓瓧娈电殑鍊奸』澶т簬0' - ) - this.isSubmit = false - } else { + // if ( + // this.dataForm.machRunFactor == 0 && + // this.dataForm.machSetupTime == 0 && + // this.dataForm.laborRunFactor == 0 && + // this.dataForm.laborSetupTime == 0 + // ) { + // this.$message.error( + // '銆愭満鍣ㄨ繍杞洜绱犮�戙�併�愭満鍣ㄨ缃椂闂淬�戙�併�愬姵鍔涜繍杞洜绱犮�戙�併�愬姵鍔涜缃椂闂淬�戜腑鑷冲皯鏈変竴涓瓧娈电殑鍊奸』澶т簬0' + // ) + // this.isSubmit = false + // } else { // 銆愪汉宸ョ被鍒�戜负绌烘椂銆愮彮缁勪汉鍛樸�戝繀椤讳负绌猴紝鍚﹀垯蹇呴』澶т簬0 let remindInfo = '' let remindFlag = false @@ -828,7 +749,7 @@ }) } } - } + // } } else { this.isSubmit = false } @@ -1149,6 +1070,9 @@ created() { this.dataForm.id = this.$route.params.id + if(this.dataForm.id){ + this.isUpdate=true + } this.init() this.initPartFamilySelect() this.getParamType() @@ -1163,7 +1087,7 @@ <style> .operation-basic { background-color: #fff; - height: 200px; + height: 130px; display: flex; padding: 20px 30px; border: 1px solid #ddd; -- Gitblit v1.9.3