From b800e7fef919980f7e39c31d42a74e80008cd25b Mon Sep 17 00:00:00 2001 From: 懒羊羊 <15939171744@163.com> Date: 星期四, 14 十二月 2023 13:02:38 +0800 Subject: [PATCH] 工单 --- jcdm-ui/src/views/main/om/productionOrde/index.vue | 339 +++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 239 insertions(+), 100 deletions(-) diff --git a/jcdm-ui/src/views/main/om/productionOrde/index.vue b/jcdm-ui/src/views/main/om/productionOrde/index.vue index 454d82c..2b6a6a0 100644 --- a/jcdm-ui/src/views/main/om/productionOrde/index.vue +++ b/jcdm-ui/src/views/main/om/productionOrde/index.vue @@ -142,13 +142,71 @@ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> - <el-table border v-loading="loading" :data="productionOrdeList" @selection-change="handleSelectionChange"> + <el-table border @row-click="handleRowClick" v-loading="loading" :data="productionOrdeList" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column width="500" label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <el-table-column label="鐢熶骇宸ュ崟鍙�" width="160" align="center"> + <template slot-scope="scope"> + <router-link :to="{path: '/main/workReport-data/index/', query: {workOrderNo: scope.row.workOrderNo} }" class="link-type"> + <span>{{ scope.row.workOrderNo }}</span> + </router-link> + </template> + </el-table-column> + <el-table-column label="璁㈠崟缂栧彿" width="140" align="center" prop="salesOrderCode"> + </el-table-column> + <el-table-column label="浜у搧缂栧彿" width="140" align="center" prop="productCode"> + </el-table-column> + <el-table-column label="浜у搧鍚嶇О" width="160" align="center" prop="productName"> + </el-table-column> + <el-table-column label="宸ュ崟鐘舵��" align="center" prop="orderStatus"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.order_state" :value="scope.row.orderStatus"/> + </template> + </el-table-column> + <el-table-column label="杞﹂棿缂栧彿" align="center" prop="workshopCode"> + </el-table-column> + <el-table-column label="浜х嚎缂栧彿" align="center" prop="lineCode"> + </el-table-column> + <el-table-column label="宸ヨ壓娴佺▼" width="140" align="center" prop="routeCode"> + </el-table-column> + <el-table-column label="浜у搧BOM" width="140" align="center" prop="bomCode"> + </el-table-column> + <el-table-column label="宸ヨ壓閰嶆柟" width="140" align="center" prop="recipeCode"> + </el-table-column> + <el-table-column label="璁″垝鏁伴噺" align="center" prop="planQty"> + </el-table-column> + <el-table-column label="瀹為檯鏁伴噺" align="center" prop="actualQty"> + </el-table-column> + <el-table-column label="瀹為檯涓婄嚎鏁伴噺" width="100" align="center" prop="actualOnlineQty"> + </el-table-column> + <el-table-column label="闇�姹傛棩鏈�" align="center" prop="demandDate" width="180"> + </el-table-column> + <el-table-column label="璁″垝寮�濮嬫椂闂�" width="160" align="center" prop="planStartTime"> + </el-table-column> + <el-table-column label="璁″垝缁撴潫鏃堕棿" width="160" align="center" prop="planEndTime"> + </el-table-column> + <el-table-column label="瀹為檯寮�濮嬫椂闂�" width="160" align="center" prop="actualStartTime"> + </el-table-column> + <el-table-column label="瀹為檯缁撴潫鏃堕棿" width="160" align="center" prop="actualEndTime"> + </el-table-column> + <el-table-column width="160" label="鍒涘缓鏃堕棿" align="center" prop="createTime"> + </el-table-column> + <el-table-column width="160" label="鏇存柊鏃堕棿" align="center" prop="updateTime"> + </el-table-column> + <el-table-column label="鍒涘缓浜�" width="80" align="center" prop="createUser"> + </el-table-column> + <el-table-column label="淇敼浜�" width="80" align="center" prop="updateUser"> + </el-table-column> + <el-table-column label="澶囨敞" width="100" align="center" prop="remarks"> + </el-table-column> + <el-table-column label="娴佹按鍙�" align="center" prop="streamNumber"> + </el-table-column> + <el-table-column label="瀹㈡埛" width="80" align="center" prop="custom"> + </el-table-column> + <el-table-column fixed="right" width="500" label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <!-- 宸ュ崟鐘舵�侊紙1鍒涘缓銆�2宸插彂甯冦��3鐢熶骇涓��4宸插喕缁撱��5宸插畬宸ャ��6宸插叧闂級 --> - <el-button type="success" style="width: 72px" plain @click="handleCommand('3',scope.row.id)" v-if="scope.row.orderStatus === '1'" size="mini">寮�濮�</el-button> - <el-button style="width: 72px" plain @click="handleCommand('4',scope.row.id)" v-if="scope.row.orderStatus === '2'|| scope.row.orderStatus === '3'" type="warning" size="mini">鍐荤粨</el-button> + <el-button type="success" style="width: 72px" plain @click="handleCommand('3',scope.row.id)" v-if="scope.row.orderStatus === '1'" size="mini">寮�濮�</el-button> + <el-button style="width: 72px" plain @click="handleCommand('4',scope.row.id)" v-if="scope.row.orderStatus === '2'|| scope.row.orderStatus === '3'" type="warning" size="mini">鍐荤粨</el-button> <el-button style="width: 72px" plain @click="handleCommand('3',scope.row.id)" v-if="scope.row.orderStatus === '4'" type="warning" size="mini">瑙e喕</el-button> <el-button style="width: 72px" plain @click="handleCommand('6',scope.row.id)" v-if="scope.row.orderStatus === '1'" type="danger" size="mini">鍏抽棴</el-button> <el-button style="width: 72px" plain @click="handleCommand('1',scope.row.id)" v-if="scope.row.orderStatus === '6' " type="success" size="mini">鍚敤</el-button> @@ -173,74 +231,35 @@ @click="handleDelete(scope.row)" v-hasPermi="['om:productionOrde:remove']" >鍒犻櫎</el-button> + <!-- 宸ュ崟鐘舵�侊紙1鍒涘缓銆�2宸插彂甯冦��3鐢熶骇涓��4宸插喕缁撱��5宸插畬宸ャ��6宸插叧闂級 --> +<!-- <el-button type="success" :disabled="isDisabled1" style="width: 72px" plain @click="handleCommandStart('3',scope.row.id)" size="mini">寮�濮�</el-button>--> +<!-- <el-button style="width: 72px" :disabled="isDisabled2" plain @click="handleCommandDonejie('4',scope.row.id)" v-if="scope.row.orderStatus === '1'|| scope.row.orderStatus === '3'|| scope.row.orderStatus === '5'" type="warning" size="mini">鍐荤粨</el-button>--> +<!-- <el-button style="width: 72px" :disabled="isDisabled3" plain @click="handleCommandJieDong('3',scope.row.id)" v-if="scope.row.orderStatus === '4'" type="warning" size="mini">瑙e喕</el-button>--> +<!-- <el-button style="width: 72px" :disabled="isDisabled4" plain @click="handleCommand('6',scope.row.id)" v-if="scope.row.orderStatus === '3' || scope.row.orderStatus === '1'|| scope.row.orderStatus === '4'|| scope.row.orderStatus === '5'" type="danger" size="mini">鍏抽棴</el-button>--> +<!-- <el-button style="width: 72px" :disabled="isDisabled5" plain @click="handleCommand('1',scope.row.id)" v-if="scope.row.orderStatus === '6' " type="success" size="mini">鍚敤</el-button>--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="success"--> +<!-- :disabled="isDisabled8"--> +<!-- style="width: 72px"--> +<!-- v-if="scope.row.orderStatus === '3' || scope.row.orderStatus === '1'|| scope.row.orderStatus === '4'|| scope.row.orderStatus === '5'"--> +<!-- icon="el-icon-edit"--> +<!-- @click="handleUpdate(scope.row)"--> +<!-- v-hasPermi="['om:productionOrde:edit']"--> +<!-- >淇敼</el-button>--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="warning"--> +<!-- :disabled="isDisabled9"--> +<!-- style="width: 72px"--> +<!-- v-if="scope.row.orderStatus === '3'|| scope.row.orderStatus === '1'|| scope.row.orderStatus === '4'|| scope.row.orderStatus === '5'"--> +<!-- icon="el-icon-delete"--> +<!-- @click="handleDelete(scope.row)"--> +<!-- v-hasPermi="['om:productionOrde:remove']"--> +<!-- >鍒犻櫎</el-button>--> +<!-- <el-button style="width: 72px" :disabled="isDisabled6" v-if="scope.row.orderStatus === '1'|| scope.row.orderStatus === '3'|| scope.row.orderStatus === '4'" @click="handleCommandFinish('5',scope.row.id)" type="success" size="mini">瀹屾垚</el-button>--> +<!-- <el-button style="width: 72px" :disabled="isDisabled7" v-if="scope.row.orderStatus === '5'" type="success" size="mini">宸插畬宸�</el-button>--> </template> - </el-table-column> - <el-table-column label="宸ュ崟鐘舵��" align="center" prop="orderStatus"> - <!-- <template slot-scope="scope">--> - <!-- <dict-tag :options="dict.type.order_state" :value="scope.row.orderStatus"/>--> - <!-- </template>--> - <template slot-scope="scope"> - <dict-tag :options="dict.type.order_state" :value="scope.row.orderStatus"/> - </template> - </el-table-column> - <el-table-column label="鐢熶骇宸ュ崟鍙�" width="130" align="center"> - <template slot-scope="scope"> - <router-link :to="{path: '/main/workReport-data/index/', query: {workOrderNo: scope.row.workOrderNo} }" class="link-type"> - <span>{{ scope.row.workOrderNo }}</span> - </router-link> - </template> - </el-table-column> - <el-table-column label="璁㈠崟缂栧彿" align="center" prop="salesOrderCode"> - </el-table-column> - <el-table-column label="浜у搧缂栧彿" align="center" prop="productCode"> - </el-table-column> - <el-table-column label="浜у搧鍚嶇О" align="center" prop="productName"> - </el-table-column> - <el-table-column label="杞﹂棿缂栧彿" align="center" prop="workshopCode"> - </el-table-column> - <el-table-column label="浜х嚎缂栧彿" align="center" prop="lineCode"> - </el-table-column> - <el-table-column label="宸ヨ壓娴佺▼" align="center" prop="routeCode"> - </el-table-column> - <el-table-column label="浜у搧BOM" align="center" prop="bomCode"> - </el-table-column> - <el-table-column label="宸ヨ壓閰嶆柟" align="center" prop="recipeCode"> - </el-table-column> - <el-table-column label="璁″垝鏁伴噺" align="center" prop="planQty"> - </el-table-column> - <el-table-column label="瀹為檯鏁伴噺" align="center" prop="actualQty"> - </el-table-column> -<!-- <el-table-column label="涓嶈壇鏁伴噺" align="center" prop="badQty">--> -<!-- </el-table-column>--> -<!-- <el-table-column label="鎶ュ簾鏁伴噺" align="center" prop="scrapQty">--> -<!-- </el-table-column>--> -<!-- <el-table-column label="杩斾慨鏁伴噺" align="center" prop="repairQty">--> -<!-- </el-table-column>--> - <el-table-column label="瀹為檯涓婄嚎鏁伴噺" align="center" prop="actualOnlineQty"> - </el-table-column> - <el-table-column label="闇�姹傛棩鏈�" align="center" prop="demandDate" width="180"> - </el-table-column> - <el-table-column label="璁″垝寮�濮嬫椂闂�" align="center" prop="planStartTime"> - </el-table-column> - <el-table-column label="璁″垝缁撴潫鏃堕棿" align="center" prop="planEndTime"> - </el-table-column> - <el-table-column label="瀹為檯寮�濮嬫椂闂�" align="center" prop="actualStartTime"> - </el-table-column> - <el-table-column label="瀹為檯缁撴潫鏃堕棿" align="center" prop="actualEndTime"> - </el-table-column> - <el-table-column :show-overflow-tooltip='true' label="鍒涘缓鏃堕棿" align="center" prop="createTime"> - </el-table-column> - <el-table-column :show-overflow-tooltip='true' label="鏇存柊鏃堕棿" align="center" prop="updateTime"> - </el-table-column> - <el-table-column label="鍒涘缓浜�" align="center" prop="createUser"> - </el-table-column> - <el-table-column label="淇敼浜�" align="center" prop="updateUser"> - </el-table-column> - <el-table-column label="澶囨敞" align="center" prop="remarks"> - </el-table-column> - <el-table-column label="娴佹按鍙�" align="center" prop="streamNumber"> - </el-table-column> - <el-table-column label="瀹㈡埛" align="center" prop="custom"> </el-table-column> </el-table> </el-card> @@ -256,6 +275,10 @@ <!-- 娣诲姞鎴栦慨鏀圭敓浜у伐鍗曞璇濇 --> <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> + <span slot="title"> + <i class="el-icon-s-order"></i> + {{titleName}} + </span> <el-form ref="form" inline :model="form" :rules="rules" label-width="80px"> <el-form-item label="宸ュ崟鍙�" prop="workOrderNo"> <el-input v-model="form.workOrderNo" placeholder="璇疯緭鍏ョ敓浜у伐鍗曞彿" /> @@ -263,9 +286,6 @@ <el-form-item label="璁㈠崟缂栧彿" prop="salesOrderCode"> <el-input v-model="form.salesOrderCode" placeholder="璇疯緭鍏ヨ鍗曠紪鍙�" /> </el-form-item> -<!-- <el-form-item label="浜у搧缂栧彿" prop="productCode">--> -<!-- <el-input v-model="form.productCode" placeholder="璇疯緭鍏ヤ骇鍝佺紪鍙�" />--> -<!-- </el-form-item>--> <el-form-item label="浜у搧缂栧彿" prop="productCode"> <el-input v-model="form.productCode" placeholder="璇烽�夋嫨浜у搧" > <el-button slot="append" @click="handleSelectProduct" icon="el-icon-search"></el-button> @@ -276,16 +296,30 @@ <el-input v-model="form.productName" disabled placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" /> </el-form-item> <el-form-item label="杞﹂棿缂栧彿" prop="workshopCode"> - <el-input v-model="form.workshopCode" placeholder="璇疯緭鍏ヨ溅闂寸紪鍙�" /> + <el-select style="width: 93%" @change="handleSelectChange(form.processesCode)" v-model="form.processesCode" placeholder="璇烽�夋嫨杞﹂棿缂栧彿"> + <el-option + v-for="item in options" + :key="item.workshopCode" + :label="item.workshopName" + :value="item.workshopCode"> + </el-option> + </el-select> </el-form-item> - <el-form-item label="浜х嚎缂栧彿" prop="lineCode"> - <el-input v-model="form.lineCode" placeholder="璇疯緭鍏ヤ骇绾跨紪鍙�" /> + <el-form-item style="margin-left: -15px" label="浜х嚎缂栧彿" prop="lineCode"> + <el-select style="width: 93%" v-model="form.lineCode" placeholder="璇烽�夋嫨浜х嚎缂栧彿"> + <el-option + v-for="item in lineOptions" + :key="item.lineCode" + :label="item.lineName" + :value="item.lineCode"> + </el-option> + </el-select> </el-form-item> - <el-form-item label="宸ヨ壓娴佺▼" disabled prop="routeCode"> - <el-input v-model="form.routeCode" placeholder="璇疯緭鍏ュ伐鑹烘祦绋�" /> + <el-form-item label="宸ヨ壓娴佺▼" prop="routeCode"> + <el-input v-model="form.routeCode" disabled placeholder="璇疯緭鍏ュ伐鑹烘祦绋�" /> </el-form-item> - <el-form-item label="浜у搧BOM" disabled prop="bomCode"> - <el-input v-model="form.bomCode" placeholder="璇疯緭鍏ヤ骇鍝丅OM" /> + <el-form-item label="浜у搧BOM" prop="bomCode"> + <el-input v-model="form.bomCode" disabled placeholder="璇疯緭鍏ヤ骇鍝丅OM" /> </el-form-item> <el-form-item label="宸ヨ壓閰嶆柟" prop="recipeCode"> <el-input v-model="form.recipeCode" placeholder="璇疯緭鍏ュ伐鑹洪厤鏂�" /> @@ -293,29 +327,50 @@ <el-form-item label="璁″垝鏁伴噺" prop="planQty"> <el-input v-model="form.planQty" placeholder="璇疯緭鍏ヨ鍒掓暟閲�" /> </el-form-item> - <el-form-item label="瀹為檯鏁伴噺" prop="actualQty"> - <el-input v-model="form.actualQty" placeholder="璇疯緭鍏ュ疄闄呮暟閲�" /> - </el-form-item> +<!-- <el-form-item label="瀹為檯鏁伴噺" prop="actualQty">--> +<!-- <el-input v-model="form.actualQty" placeholder="璇疯緭鍏ュ疄闄呮暟閲�" />--> +<!-- </el-form-item>--> <el-form-item label="闇�姹傛棩鏈�" prop="demandDate"> - <el-date-picker clearable + <el-date-picker style="width: 88%" clearable v-model="form.demandDate" type="date" value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨闇�姹傛棩鏈�"> </el-date-picker> </el-form-item> - <el-form-item label="椤哄簭鍙�" prop="serialNumber"> - <el-input v-model="form.serialNumber" placeholder="璇疯緭鍏ラ『搴忓彿" /> - </el-form-item> - <el-form-item label="澶囨敞" prop="remarks"> +<!-- <el-form-item style="margin-left: -30px" label="娴佹按鍙�" prop="streamNumber">--> +<!-- <el-input v-model="form.streamNumber" placeholder="璇疯緭鍏ユ祦姘村彿" />--> +<!-- </el-form-item>--> + <el-form-item style="margin-left: -30px" label="澶囨敞" prop="remarks"> <el-input v-model="form.remarks" placeholder="璇疯緭鍏ュ娉�" /> </el-form-item> - <el-form-item label="娴佹按鍙�" prop="streamNumber"> - <el-input v-model="form.streamNumber" placeholder="璇疯緭鍏ユ祦姘村彿" /> - </el-form-item> - <el-form-item label="瀹㈡埛" prop="custom"> - <el-input v-model="form.custom" placeholder="璇疯緭鍏ュ鎴�" /> - </el-form-item> + +<!-- <el-form-item label="瀹㈡埛" prop="custom">--> +<!-- <el-input v-model="form.custom" placeholder="璇疯緭鍏ュ鎴�" />--> +<!-- </el-form-item>--> + <el-row> + <el-col :span="12"> + <el-form-item style="margin-left: 10px" label-width="120" label="璁″垝寮�濮嬫椂闂�" prop="planStartTime"> + <el-date-picker clearable + v-model="form.planStartTime" + type="date" + value-format="yyyy-MM-dd" + placeholder="璇烽�夋嫨璁″垝寮�濮嬫椂闂�"> + </el-date-picker> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item style="margin-left: 76px" label-width="120" label="璁″垝缁撴潫鏃堕棿" prop="planEndTime"> + <el-date-picker clearable + v-model="form.planEndTime" + type="date" + value-format="yyyy-MM-dd" + placeholder="璇烽�夋嫨璁″垝缁撴潫鏃堕棿"> + </el-date-picker> + </el-form-item> + </el-col> + + </el-row> </el-form> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> @@ -327,6 +382,8 @@ </template> <script> +import { listLineInfo } from "@/api/main/bs/lineInfo/lineInfo"; +import { listWorkshop } from "@/api/main/bs/workshop/workshop"; import { listProductBom } from "@/api/main/bs/ProductBom/ProductBom"; import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute"; import ItemSelect from "@/components/itemSelect/single.vue"; @@ -340,6 +397,20 @@ }, data() { return { + titleName: '', + + isDisabled1: false, + isDisabled2: false, + isDisabled3: false, + isDisabled4: false, + isDisabled5: false, + isDisabled6: false, + isDisabled7: false, + isDisabled8: false, + isDisabled9: false, + + options: [], + lineOptions: [], showFlag:false, advancedShowSearch: false, workOrder: { @@ -398,8 +469,62 @@ }, created() { this.getList(); + this.initWorkshop(); }, methods: { + //瀹屾垚 + handleCommandFinish(status,id){ + this.updateOrderState(status,id) + this.isDisabled1 = true; + this.isDisabled4 = true; + this.isDisabled8 = true; + this.isDisabled9 = true; + this.isDisabled6 = true; + this.isDisabled7 = true; + this.isDisabled2 = true; + }, + //瑙e喕 + handleCommandJieDong(status,id){ + this.updateOrderState(status,id) + this.isDisabled1 = true; + this.isDisabled4 = true; + this.isDisabled8 = true; + this.isDisabled9 = true; + this.isDisabled6 = false; + this.isDisabled2 = false; + }, + //鍐荤粨 + handleCommandDonejie(status,id){ + this.updateOrderState(status,id) + this.isDisabled1 = true; + this.isDisabled4 = true; + this.isDisabled8 = true; + this.isDisabled9 = true; + this.isDisabled6 = true; + this.isDisabled2 = true; + + }, + //寮�濮� + handleCommandStart(status,id){ + this.updateOrderState(status,id) + this.isDisabled1 = true; + this.isDisabled4 = true; + this.isDisabled8 = true; + this.isDisabled9 = true; + this.isDisabled2 = false; + }, + initWorkshop(){ + listWorkshop(this.queryParams).then(response => { + this.options = response.rows; + }); + }, + // 鍦ㄨ繖閲岀紪鍐欏鐞嗛�変腑浜嬩欢鐨勯�昏緫 + handleSelectChange(selectedOption) { + this.queryParams.workshopCode = selectedOption; + listLineInfo(this.queryParams).then(response => { + this.lineOptions = response.rows; + }); + }, //鐗╂枡閫夋嫨寮瑰嚭妗� onItemSelected(obj){ if(obj !== undefined && obj !== null){ @@ -408,12 +533,11 @@ this.form.productName = obj.materialName; this.queryParams.productCode = productCode listTechnologyRoute(this.queryParams).then(response => { - console.log(response.data) + this.form.routeCode = response.rows[0].routeCode; }); listProductBom(this.queryParams).then(response => { - console.log(response.row) + this.form.bomCode = response.rows[0].bomCode; }); - } }, handleSelectProduct(){ @@ -423,6 +547,15 @@ this.advancedShowSearch = (this.advancedShowSearch) ? this.advancedShowSearch = false : this.advancedShowSearch = true; }, handleCommand(status,id) { + this.updateStatusParameter.id = id; + this.updateStatusParameter.orderStatus = status; + updateProductionOrde(this.updateStatusParameter).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + }, + updateOrderState(status,id){ this.updateStatusParameter.id = id; this.updateStatusParameter.orderStatus = status; updateProductionOrde(this.updateStatusParameter).then(response => { @@ -509,7 +642,7 @@ handleAdd() { this.reset(); this.open = true; - this.title = "娣诲姞鐢熶骇宸ュ崟"; + this.titleName = "娣诲姞鐢熶骇宸ュ崟"; }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { @@ -518,7 +651,7 @@ getProductionOrde(id).then(response => { this.form = response.data; this.open = true; - this.title = "淇敼鐢熶骇宸ュ崟"; + this.titleName = "淇敼鐢熶骇宸ュ崟"; }); }, /** 鎻愪氦鎸夐挳 */ @@ -560,3 +693,9 @@ } }; </script> +<style> +.el-dialog__header{ + /*background-color: #f8f8f8;*/ + background-color: #f8f8f9; +} +</style> -- Gitblit v1.9.3