Compare commits
	
		
			42 Commits
		
	
	
		
			319e0ac90d
			...
			projects/m
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ceeb853783 | |||
| 6ed21030f5 | |||
| 73feff0d8b | |||
| d49a698136 | |||
| 6e774dfc5d | |||
| 3eeded056f | |||
| 881eace12f | |||
| dad3b2da95 | |||
| f5cfc5d2bb | |||
| 235b0a6512 | |||
| 13bf1e0fd0 | |||
|  | 97acb4faac | ||
|  | 04a5359eda | ||
| 7ae7dfad95 | |||
| e202ac542e | |||
| eb8736178a | |||
| 580a66549c | |||
| 30c45e6f74 | |||
| e9c2917c77 | |||
| 0a9bd0c6de | |||
| 84dbd8d5b2 | |||
|  | 00f54f3de6 | ||
|  | f26d7abc64 | ||
| 028c14a174 | |||
| b14abd39b6 | |||
| dfc8110410 | |||
| baede9ef34 | |||
| 2c44906bd6 | |||
| 466c822b0f | |||
| 031e3098b7 | |||
| d14dae86fc | |||
| 492b591fa9 | |||
| fc20e275f7 | |||
| 10fd959c9d | |||
| 342e83ab41 | |||
| df530abb90 | |||
| 8f1e5212e3 | |||
|  | 5dd299e549 | ||
|  | 511a00d0a3 | ||
| d5b71c4d7d | |||
|  | 43d0a2668d | ||
| a492fe4c87 | 
							
								
								
									
										2
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								.env.dev
									
									
									
									
									
								
							| @@ -18,7 +18,7 @@ VUE_APP_BASE_API = 'http://mes2.kszny.picaiba.com' | ||||
|  | ||||
|  | ||||
| # 积木报表指向地址 | ||||
| VUE_APP_JIMU_API = 'http://192.168.0.33:48082' | ||||
| VUE_APP_JIMU_API = 'http://mes2.kszny.picaiba.com' | ||||
|  | ||||
| # 路由懒加载 | ||||
| VUE_CLI_BABEL_TRANSPILE_MODULES = true | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
|   "license": "MIT", | ||||
|   "scripts": { | ||||
|     "local": "vue-cli-service serve --mode local", | ||||
|     "dev": "vue-cli-service serve --mode dev", | ||||
|     "dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev", | ||||
|     "front": "vue-cli-service serve --mode front", | ||||
|     "build:prod": "vue-cli-service build --mode prod", | ||||
|     "build:stage": "vue-cli-service build --mode stage", | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
|  * @Date: 2023-10-21 11:50:46 | ||||
|  * @LastEditTime: 2023-10-30 14:37:28 | ||||
|  * @LastEditors: DY | ||||
|  * @Description:  | ||||
|  * @Description: | ||||
|  */ | ||||
| import request from '@/utils/request' | ||||
|  | ||||
| @@ -65,4 +65,11 @@ export function getCoreDepartmentList(query) { | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }) | ||||
| } | ||||
| } | ||||
| export function getDepartmentList(query) { | ||||
|   return request({ | ||||
|     url: '/system/dept/list', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }) | ||||
| } | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* | ||||
|  * @Author: Do not edit | ||||
|  * @Date: 2023-10-21 11:50:46 | ||||
|  * @LastEditTime: 2023-11-15 17:19:19 | ||||
|  * @LastEditors: DY | ||||
|  * @LastEditTime: 2024-12-27 15:20:14 | ||||
|  * @LastEditors: zwq | ||||
|  * @Description: | ||||
|  */ | ||||
| import request from '@/utils/request' | ||||
| @@ -161,3 +161,20 @@ export function createConCoreWOr(data) { | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 更新分配产量 | ||||
| export function updateBatch(data) { | ||||
|   return request({ | ||||
|     url: '/base/core-order-con-work-order/updateBatch', | ||||
|     method: 'put', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
| // 更新订单表与工单关联表 多对多 | ||||
| export function updateConCoreWOr(data) { | ||||
|   return request({ | ||||
|     url: '/base/core-order-con-work-order/update', | ||||
|     method: 'put', | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|   | ||||
| @@ -8,7 +8,13 @@ export function createGroupRule(data) { | ||||
|     data: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 作废排班规则 | ||||
| export function disableGroupRule(id) { | ||||
|   return request({ | ||||
|     url: '/base/group-scheduling-rule/disable?id=' + id, | ||||
|     method: 'post', | ||||
|   }) | ||||
| } | ||||
| // 更新排班规则基础信息 | ||||
| export function updateGroupRule(data) { | ||||
|   return request({ | ||||
|   | ||||
| @@ -1,8 +1,16 @@ | ||||
| import request from '@/utils/request' | ||||
| // 获得产品列表 | ||||
| // 获得物料列表(包括产品) | ||||
| export function getProductAll() { | ||||
|   return request({ | ||||
|     url: '/base/core-product-material/listAll', | ||||
|     method: 'get' | ||||
|   }) | ||||
| } | ||||
| // 获得产品列表 | ||||
| export function getProductList() { | ||||
|   return request({ | ||||
|     url: '/base/core-product-material/listAllProduct', | ||||
|     method: 'get' | ||||
|   }) | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -5,13 +5,6 @@ | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
|  */ | ||||
| /* | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-07-12 15:31:41 | ||||
|  * @LastEditTime: 2024-07-22 09:33:20 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
|  */ | ||||
| import request from '@/utils/request' | ||||
|  | ||||
|  | ||||
| @@ -26,7 +19,7 @@ export function getItemPageData(data) { | ||||
|   return request({ | ||||
|     url: '/base/equipment-check-program/page', | ||||
|     method: 'get', | ||||
|     data | ||||
|     params: data | ||||
|   }) | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -23,6 +23,13 @@ export function getItemPageData(data) { | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function getByEquId(id) { | ||||
|   return request({ | ||||
|     url: '/base/equipment-maintain-program/getByEquId?id=' + id, | ||||
|     method: 'get', | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function getItemData(id) { | ||||
|   return request({ | ||||
|     url: 'base/equipment-maintain-program/get?id=' + id, | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
|  * @Date: 2023-11-08 15:56:52 | ||||
|  * @LastEditTime: 2024-02-26 17:02:53 | ||||
|  * @LastEditors: DY | ||||
|  * @Description:  | ||||
|  * @Description: | ||||
|  */ | ||||
| import request from '@/utils/request' | ||||
|  | ||||
| @@ -78,3 +78,11 @@ export function deleteLogDet(id) { | ||||
|     method: 'delete' | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function getEqMaintainPlanPageData(query) { | ||||
|   return request({ | ||||
|     url: '/base/equipment-maintain-plan-det/page', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }) | ||||
| } | ||||
|   | ||||
| @@ -27,7 +27,7 @@ export function getWorkOrderList(query) { | ||||
|  | ||||
| export function getCoreProduct(id) { | ||||
|   return request({ | ||||
|     url: '/base/core-product/get?id=' + id, | ||||
|     url: '/base/core-product-material/get?id=' + id, | ||||
|     method: 'get' | ||||
|   }) | ||||
| } | ||||
|   | ||||
| @@ -44,11 +44,7 @@ export function updateRole(data) { | ||||
| } | ||||
|  | ||||
| // 角色状态修改 | ||||
| export function changeRoleStatus(id, status) { | ||||
|   const data = { | ||||
|     id, | ||||
|     status | ||||
|   } | ||||
| export function changeRoleStatus(data) { | ||||
|   return request({ | ||||
|     url: '/system/role/update-status', | ||||
|     method: 'put', | ||||
|   | ||||
| @@ -1,10 +1,3 @@ | ||||
| <!-- | ||||
|     filename: index.vue | ||||
|     author: liubin | ||||
|     date: 2024-04-02 09:49:36 | ||||
|     description: | ||||
| --> | ||||
|  | ||||
| <template> | ||||
|   <!-- 按钮切换 --> | ||||
|   <div v-if="buttonMode" class="button-nav"> | ||||
| @@ -12,9 +5,8 @@ | ||||
|       v-for="m in menus" | ||||
|       :key="m" | ||||
|       @click="currentMenu = m" | ||||
|       :data-text="m" | ||||
|       :class="[m === currentMenu ? 'active' : '']" | ||||
|     ></button> | ||||
|     >{{m}}</button> | ||||
|   </div> | ||||
|   <!-- 标签切换 --> | ||||
|   <div v-else class="custom-tabs" style="height: 100%; width: 100%"> | ||||
| @@ -75,33 +67,24 @@ export default { | ||||
|   } | ||||
|  | ||||
|   button { | ||||
|     height: 48px; | ||||
|     line-height: 48px; | ||||
|     cursor: pointer; | ||||
|     appearance: none; | ||||
|     outline: none; | ||||
|     border: none; | ||||
|     background: #fff; | ||||
|     border-radius: 8px; | ||||
|     padding: 15px; | ||||
|     color: #888; | ||||
|     font-size: 16px; | ||||
|     font-weight: 500; | ||||
|     color: rgba(22, 22, 22, 0.65); | ||||
|     letter-spacing: 2px; | ||||
|     flex: 1; | ||||
|     box-sizing: padding-box; | ||||
|     position: relative; | ||||
|  | ||||
|     &::after { | ||||
|       content: attr(data-text); | ||||
|       position: absolute; | ||||
|       top: 5px; | ||||
|       left: 50%; | ||||
|       font-size: 16px; | ||||
|       font-weight: 500; | ||||
|       transform: translate(-50%); | ||||
|     } | ||||
|  | ||||
|     &.active { | ||||
|       color: #111; | ||||
|       //border-bottom: 2px solid #0b58ff; | ||||
|       box-shadow: 0px 2px 1px 1px #0b58ff; | ||||
|       color: rgba(22, 22, 22, 1); | ||||
|       border-bottom: 4px solid #0b58ff; | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -28,7 +28,7 @@ export default { | ||||
| 			// tableBtn: [], // 占位 | ||||
| 			// searchBarFormConfig: [], // 占位 | ||||
| 			// // 弹窗表单配置 | ||||
| 			// dialogFormConfig: [], //  | ||||
| 			// dialogFormConfig: [], // | ||||
| 			updateUrl: '', | ||||
| 			addUrl: '', | ||||
| 			pageUrl: '', | ||||
| @@ -109,7 +109,9 @@ export default { | ||||
| 			} | ||||
| 		}, | ||||
| 		// 处理搜索栏按钮 | ||||
| 		handleSearchBarBtnClick(btn) { | ||||
|     handleSearchBarBtnClick(btn) { | ||||
|       console.log(btn); | ||||
|  | ||||
| 			// const keys = ['name', 'createTime']; // timeVal // 已被 searchBarKeys 替代 | ||||
| 			switch (btn.btnName) { | ||||
| 				case 'search': | ||||
|   | ||||
| @@ -23,7 +23,7 @@ const permission = { | ||||
|       state.topbarRouters = routes | ||||
|     }, | ||||
|     SET_SIDEBAR_ROUTERS: (state, routes) => { | ||||
|       console.log('==SET_SIDEBAR_ROUTERS==:',routes) | ||||
|       // console.log('==SET_SIDEBAR_ROUTERS==:',routes) | ||||
|       state.sidebarRouters = routes | ||||
|     }, | ||||
|   }, | ||||
|   | ||||
| @@ -89,6 +89,7 @@ export const DICT_TYPE = { | ||||
|  | ||||
|   // ============== ENERGY - 能源模块 ============= | ||||
|   ENERGY_UNIT: 'energy_unit', | ||||
|   ENERGY_TYPE: 'energy_type', | ||||
|   EQU_ALARM_LEVEL: 'equ_alarm_level', | ||||
|   MONITOR_INDEX_TYPE: 'monitor_index_type', | ||||
|   OBJECT_TYPE: 'object_type', | ||||
|   | ||||
| @@ -38,15 +38,8 @@ | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="发货负责人" prop="deliveryPersonId"> | ||||
|           <el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;" filterable> | ||||
|             <el-option | ||||
|               v-for="item in personList" | ||||
|               :key="item.id" | ||||
|               :label="item.name" | ||||
|               :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         <el-form-item label="发货负责人" prop="deliveryPerson"> | ||||
|           <el-input v-model="form.deliveryPerson"></el-input> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
| @@ -75,7 +68,6 @@ | ||||
|   </el-form> | ||||
| </template> | ||||
| <script> | ||||
| import { getWorkerList } from '@/api/base/worker' | ||||
| import { deliveryLogCreate, deliveryLogUpdate, getDeliveryLog, listOrderList } from '@/api/base/delivery' | ||||
| export default { | ||||
|   name: 'AddOrUpdate', | ||||
| @@ -87,7 +79,7 @@ export default { | ||||
|         name: '', | ||||
|         code: '', | ||||
|         deliveryTime: null, | ||||
|         deliveryPersonId: '', | ||||
|         deliveryPerson: '', | ||||
|         principal: '', | ||||
|         principalCall: '', | ||||
|         principalCost: 0.00, | ||||
| @@ -100,7 +92,6 @@ export default { | ||||
|         code: [{ required: true, message: "发货单号不能为空", trigger: "blur" }] | ||||
|       }, | ||||
|       orderList: [], | ||||
|       personList: [] | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
| @@ -118,9 +109,6 @@ export default { | ||||
|       listOrderList().then(res => { | ||||
|         this.orderList = res.data || [] | ||||
|       }) | ||||
|       getWorkerList().then(res => { | ||||
|         this.personList = res.data || [] | ||||
|       }) | ||||
|     }, | ||||
|     submitForm() { | ||||
|       this.$refs['addOrUpdate'].validate((valid) => { | ||||
|   | ||||
| @@ -92,7 +92,8 @@ export default { | ||||
|           type: 'select', | ||||
|           label: '能源类型', | ||||
|           selectOptions: [], | ||||
|           param: 'energyTypeId' | ||||
|           param: 'energyTypeId', | ||||
|           clearable: false | ||||
|         }, | ||||
|         { | ||||
|           type: 'select', | ||||
| @@ -162,7 +163,6 @@ export default { | ||||
|     window.addEventListener('resize', () => { | ||||
|       this.tableH = this.tableHeight(260) | ||||
|     }) | ||||
|     this.getList(); | ||||
|     this.getTypeList() | ||||
|     // 获取对象树形结构 | ||||
|     this.getObjTree() | ||||
| @@ -171,7 +171,10 @@ export default { | ||||
|     getTypeList() { | ||||
|       getEnergyTypeListAll().then((res) => { | ||||
|         this.formConfig[0].selectOptions = res.data || [] | ||||
|         this.formConfig[0].defaultSelect = res.data[0].id | ||||
|         this.queryParams.energyTypeId = res.data[0].id | ||||
|         this.energyTypeList = res.data || [] | ||||
|         this.getList(); | ||||
|       }) | ||||
|     }, | ||||
|     buttonClick(val) { | ||||
|   | ||||
| @@ -82,6 +82,7 @@ export default { | ||||
|     init(param) { | ||||
|       this.form.connectId = param.connectId | ||||
|       getEnergyTypeListAll().then((res) => { | ||||
|         console.log(res) | ||||
|         this.energyListType = res.data || [] | ||||
|       }) | ||||
|       if (param.id) { | ||||
|   | ||||
| @@ -37,7 +37,7 @@ | ||||
|       @cancel="handleCancel" | ||||
|       @confirm="handleConfirm" | ||||
|       :before-close="handleCancel" | ||||
|       width='30%' | ||||
|       width='50%' | ||||
|     > | ||||
|       <energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" /> | ||||
|     </base-dialog> | ||||
| @@ -60,7 +60,8 @@ const tableProps = [ | ||||
|   }, | ||||
|   { | ||||
|     prop: 'objCode', | ||||
|     label: '对象编码' | ||||
|     label: '对象编码', | ||||
|     minWidth: 160, | ||||
|   }, | ||||
|   { | ||||
|     prop: 'plcTableName', | ||||
| @@ -69,7 +70,8 @@ const tableProps = [ | ||||
|   { | ||||
|     prop: 'plcTableCode', | ||||
|     label: '关联表编码', | ||||
|     showOverflowtooltip: true | ||||
|     showOverflowtooltip: true, | ||||
|     minWidth: 160, | ||||
|   }, | ||||
|   { | ||||
|     prop: 'cnName', | ||||
|   | ||||
| @@ -60,7 +60,8 @@ export default { | ||||
|         name: '', | ||||
|         code: '', | ||||
|         type: '', | ||||
|         energyTypeId: '' | ||||
|         energyTypeId: '', | ||||
|         remark: '' | ||||
|       }, | ||||
|       plcList: [], | ||||
|       objList: [], | ||||
|   | ||||
| @@ -16,7 +16,7 @@ | ||||
|       type="text" | ||||
|       class="tableInnerButton" | ||||
|       @click="showInnerTable(injectData)" | ||||
|       >详情</el-button | ||||
|       >价格详情</el-button | ||||
|     > | ||||
|   </el-popover> | ||||
| </template> | ||||
|   | ||||
| @@ -3,7 +3,14 @@ | ||||
|     <el-row> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="能源类型" prop="name"> | ||||
|           <el-input v-model="form.name"></el-input> | ||||
|           <el-select v-model="form.name" placeholder="请选择" style="width: 100%;"> | ||||
|             <el-option | ||||
|               v-for="item in getDictDatas(DICT_TYPE.ENERGY_TYPE)" | ||||
|               :key="item.value" | ||||
|               :label="item.label" | ||||
|               :value="item.label"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span="12"> | ||||
| @@ -213,10 +220,6 @@ export default { | ||||
|     // 增加 | ||||
|     emitButtonClick1() { | ||||
|       let n = this.tableData1.length | ||||
|       if (n >=3) { | ||||
|         this.$modal.msgWarning('最多可添加3档计价') | ||||
|         return false | ||||
|       } | ||||
|       let obj = {} | ||||
|       obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime | ||||
|       obj.endTime = '' | ||||
| @@ -225,10 +228,6 @@ export default { | ||||
|     }, | ||||
|     emitButtonClick2() { | ||||
|       let n = this.tableData2.length | ||||
|       if (n >=3) { | ||||
|         this.$modal.msgWarning('最多可添加3档计价') | ||||
|         return false | ||||
|       } | ||||
|       let obj = {} | ||||
|       obj.startUsed = n === 0 ? 0 : this.tableData2[n-1].endUsed | ||||
|       obj.endUsed = 0 | ||||
|   | ||||
| @@ -80,10 +80,14 @@ export default { | ||||
|     return { | ||||
|       formConfig: [ | ||||
|         { | ||||
|           type: 'input', | ||||
|           type: 'select', | ||||
|           label: '能源类型', | ||||
|           selectOptions: this.getDictDatas(this.DICT_TYPE.ENERGY_TYPE), | ||||
|           placeholder: '能源类型', | ||||
|           param: 'name' | ||||
|           labelField: 'label', | ||||
|           valueField: 'label', | ||||
|           param: 'name', | ||||
|           flilterable: true | ||||
|         }, | ||||
|         { | ||||
|           type: 'button', | ||||
|   | ||||
| @@ -13,60 +13,6 @@ | ||||
| 		v-loading="formLoading"> | ||||
| 		<el-row :gutter="20"> | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="产线" | ||||
| 					prop="productionLineId" | ||||
| 					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> | ||||
| 					<el-select | ||||
| 						v-model="dataForm.productionLineId" | ||||
| 						placeholder="请选择产线" | ||||
| 						filterable | ||||
| 						@change="handleProductlineChange"> | ||||
| 						<el-option | ||||
| 							v-for="opt in productionLineList" | ||||
| 							:key="opt.value" | ||||
| 							:label="opt.label" | ||||
| 							:value="opt.value" /> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="工段" | ||||
| 					prop="sectionId" | ||||
| 					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> | ||||
| 					<el-select | ||||
| 						v-model="dataForm.sectionId" | ||||
| 						placeholder="请选择工段" | ||||
| 						filterable | ||||
| 						@change="$emit('update', dataForm)"> | ||||
| 						<el-option | ||||
| 							v-for="opt in workshopSectionList" | ||||
| 							:key="opt.value" | ||||
| 							:label="opt.label" | ||||
| 							:value="opt.value" /> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="按钮盒识别码" | ||||
| 					prop="buttonId" | ||||
| 					:rules="[ | ||||
| 						{ required: true, message: '不能为空', trigger: 'blur' }, | ||||
| 						{ | ||||
| 							type: 'number', | ||||
| 							message: '请输入整数', | ||||
| 							trigger: 'blur', | ||||
| 							transform: (val) => Number.isInteger(Number(val)) && Number(val), | ||||
| 						}, | ||||
| 					]"> | ||||
| 					<el-input | ||||
| 						v-model="dataForm.buttonId" | ||||
| 						@change="$emit('update', dataForm)" | ||||
| 						placeholder="请输入整数" /> | ||||
| 				</el-form-item> | ||||
| 				<el-form-item | ||||
| 					label="产线" | ||||
| 					prop="productionLineId" | ||||
| @@ -130,13 +76,22 @@ | ||||
| 						placeholder="请输入整数" /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="按钮盒模式" | ||||
| 					prop="model"> | ||||
| 					<el-input | ||||
| 						v-model="dataForm.model" | ||||
| 						@change="$emit('update', dataForm)" | ||||
| 						placeholder="请输入按钮盒模式" /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="按钮值" | ||||
| 					prop="keyValue" | ||||
| 					:rules="[ | ||||
| 						{ required: true, message: '不能为空', trigger: 'blur' }, | ||||
| 						{ required: true, message: '按钮值不能为空', trigger: 'blur' }, | ||||
| 						{ | ||||
| 							type: 'number', | ||||
| 							message: '请输入100以内的整数', | ||||
| @@ -154,17 +109,22 @@ | ||||
| 						min="0" | ||||
| 						max="100" | ||||
| 						@change="$emit('update', dataForm)" | ||||
| 						placeholder="请输入按钮盒模式" /> | ||||
| 						placeholder="请输入按钮值" /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item label="检测内容" prop="inspectionDetId"> | ||||
| 				<el-form-item  | ||||
| 					label="检测内容" | ||||
| 					prop="inspectionDetId" | ||||
| 					:rules="[ | ||||
| 						{ required: true, message: '检测内容不能为空', trigger: 'blur' }, | ||||
| 					]"> | ||||
| 					<el-select | ||||
| 						v-model="dataForm.inspectionDetId" | ||||
| 						placeholder="请选择检测内容" | ||||
| 						filterable | ||||
| 						@change="$emit('update', dataForm)"> | ||||
| 						@change="handleInspectionDetChange"> | ||||
| 						<el-option | ||||
| 							v-for="opt in inspectionDetList" | ||||
| 							:key="opt.value" | ||||
| @@ -203,14 +163,9 @@ export default { | ||||
| 	mounted() { | ||||
| 		this.getProductionLineList(); | ||||
| 		this.getQualityInspectionDetList(); | ||||
| 		// this.getWorksectionList(); | ||||
| 		// this.getCode('/base/equipment-group-alarm/getCode').then((code) => { | ||||
| 		// 	this.formLoading = false; | ||||
| 		// 	this.$emit('update', { | ||||
| 		// 		...this.dataForm, | ||||
| 		// 		code, | ||||
| 		// 	}); | ||||
| 		// }); | ||||
| 		if (this.dataForm.productionLineId) { | ||||
| 			this.getWorksectionList(this.dataForm.productionLineId); | ||||
| 		} | ||||
| 	}, | ||||
| 	watch: { | ||||
| 		'dataForm.productionId': { | ||||
| @@ -279,11 +234,18 @@ export default { | ||||
| 			this.dataForm.sectionId = null; | ||||
| 			this.$emit('update', this.dataForm); | ||||
| 		}, | ||||
|  | ||||
| 		async getCode(url) { | ||||
| 			const response = await this.$axios(url); | ||||
| 			return response.data; | ||||
| 		}, | ||||
| 		handleInspectionDetChange(id) { | ||||
| 			this.inspectionDetList.forEach((item) => { | ||||
| 				if (item.value == id) { | ||||
| 					this.dataForm.inspectionDetContent = item.label; | ||||
| 				} | ||||
| 			}); | ||||
| 			this.$emit('update', this.dataForm); | ||||
| 		} | ||||
| 	}, | ||||
| }; | ||||
| </script> | ||||
|   | ||||
| @@ -40,7 +40,7 @@ | ||||
| 			@close="cancel" | ||||
| 			@cancel="cancel" | ||||
| 			@confirm="submitForm"> | ||||
| 			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> | ||||
| 			<DialogForm v-if="open" ref="form" v-model="form"/> | ||||
| 		</base-dialog> | ||||
| 	</div> | ||||
| </template> | ||||
| @@ -65,78 +65,6 @@ export default { | ||||
| 	components: { DialogForm }, | ||||
| 	data() { | ||||
| 		return { | ||||
| 			rows: [ | ||||
| 				[ | ||||
| 					{ | ||||
| 						select: true, | ||||
| 						label: '产线', | ||||
| 						url: '/base/production-line/listAll', | ||||
| 						prop: 'productionId', | ||||
| 						rules: [ | ||||
| 							{ required: true, message: '产线不能为空', trigger: 'blur' }, | ||||
| 						], | ||||
| 						bind: { | ||||
| 							filterable: true, | ||||
| 						}, | ||||
| 					}, | ||||
| 					{ | ||||
| 						select: true, | ||||
| 						label: '工段', | ||||
| 						url: '/base/workshop-section/listAll', | ||||
| 						prop: 'sectionId', | ||||
| 						rules: [ | ||||
| 							{ required: true, message: '工段不能为空', trigger: 'blur' }, | ||||
| 						], | ||||
| 						bind: { | ||||
| 							filterable: true, | ||||
| 						}, | ||||
| 					}, | ||||
| 				], | ||||
| 				[ | ||||
| 					{ | ||||
| 						input: true, | ||||
| 						label: '按钮盒识别码', | ||||
| 						prop: 'buttonId', | ||||
| 						rules: [ | ||||
| 							{ | ||||
| 								type: 'number', | ||||
| 								message: '请输入整数', | ||||
| 								trigger: 'blur', | ||||
| 								transform: (val) => | ||||
| 									Number.isInteger(Number(val)) && Number(val), | ||||
| 							}, | ||||
| 						], | ||||
| 					}, | ||||
| 					{ input: true, label: '按钮盒模式', prop: 'model' }, | ||||
| 				], | ||||
| 				[ | ||||
| 					{ | ||||
| 						input: true, | ||||
| 						label: '按钮值', | ||||
| 						prop: 'keyValue', | ||||
| 						rules: [ | ||||
| 							{ | ||||
| 								type: 'number', | ||||
| 								message: '请输入100以内的整数', | ||||
| 								trigger: 'blur', | ||||
| 								transform: (val) => | ||||
| 									Number(val) <= 100 && Number.isInteger(+val) && Number(val), | ||||
| 							}, | ||||
| 						], | ||||
| 						bind: { type: 'number', min: 0, max: 100 }, | ||||
| 					}, | ||||
| 					{ | ||||
| 						select: true, | ||||
| 						label: '检测内容', | ||||
| 						url: '/base/quality-inspection-det/listAll', | ||||
| 						prop: 'inspectionDetId', | ||||
| 						rules: [{ required: true, message: '不能为空', trigger: 'blur' }], | ||||
| 						bind: { | ||||
| 							filterable: true, | ||||
| 						}, | ||||
| 					}, | ||||
| 				], | ||||
| 			], | ||||
| 			searchBarFormConfig: [ | ||||
| 				{ | ||||
| 					type: 'input', | ||||
| @@ -230,6 +158,7 @@ export default { | ||||
| 				id: null, | ||||
| 				buttonId: null, | ||||
| 				inspectionDetId: null, | ||||
| 				inspectionDetContent: null, | ||||
| 				productionLineId: null, | ||||
| 				sectionId: null, | ||||
| 				model: null, | ||||
| @@ -256,12 +185,13 @@ export default { | ||||
| 			this.form = { | ||||
| 				id: null, | ||||
| 				buttonId: null, | ||||
| 				inspectionDetId: null, | ||||
| 				inspectionDetContent: null, | ||||
| 				productionId: null, | ||||
| 				productionLineId: null, | ||||
| 				sectionId: null, | ||||
| 				model: null, | ||||
| 				keyValue: null, | ||||
| 			}; | ||||
| 			}, | ||||
| 			this.resetForm('form'); | ||||
| 		}, | ||||
| 		/** 新增按钮操作 */ | ||||
|   | ||||
| @@ -219,6 +219,7 @@ export default { | ||||
|     getTypeList() { | ||||
|       getEnergyTypeListAll().then((res) => { | ||||
|         this.energyTypeList = res.data || [] | ||||
|         this.queryParams.energyTypeId = res.data[0].id | ||||
|       }) | ||||
|     }, | ||||
|     // 范围选择器 | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
| --> | ||||
| <template> | ||||
| 	<div> | ||||
| 		<div style="background: #f2f4f9; height: 40px; width: 100%"> | ||||
| 		<div style="background: #f2f4f9; height: 56px; width: 100%"> | ||||
| 			<ButtonNav | ||||
| 				:menus="['走势分析', '对比分析', '同比分析', '环比分析']" | ||||
| 				@change="currentMenu"> | ||||
|   | ||||
| @@ -205,6 +205,7 @@ export default { | ||||
| 		getTypeList() { | ||||
| 			getEnergyTypeListAll().then((res) => { | ||||
| 				this.energyTypeList = res.data || []; | ||||
| 				this.queryParams.energyTypeId = res.data[0].id | ||||
| 			}); | ||||
| 		}, | ||||
| 		getObjTree() { | ||||
|   | ||||
| @@ -252,7 +252,7 @@ export default { | ||||
| 	computed: {}, | ||||
| 	created() { | ||||
| 		this.fillLineOptions(); | ||||
| 		this.fillProductOptions(); | ||||
| 		// this.fillProductOptions(); | ||||
| 	}, | ||||
| 	mounted() { | ||||
| 		// window.addEventListener('resize', () => { | ||||
| @@ -284,23 +284,23 @@ export default { | ||||
| 			); | ||||
| 		}, | ||||
|  | ||||
| 		async fillProductOptions() { | ||||
| 			const { data } = await this.$axios({ | ||||
| 				url: '/base/core-product/listAll', | ||||
| 				method: 'get', | ||||
| 			}); | ||||
| 			const cfg = this.searchBarFormConfig.find( | ||||
| 				(item) => item.__index == 'product' | ||||
| 			); | ||||
| 			this.$set( | ||||
| 				cfg, | ||||
| 				'selectOptions', | ||||
| 				data.map((item) => ({ | ||||
| 					id: item.id, | ||||
| 					name: item.name, | ||||
| 				})) | ||||
| 			); | ||||
| 		}, | ||||
| 		// async fillProductOptions() { | ||||
| 		// 	const { data } = await this.$axios({ | ||||
| 		// 		url: '/base/core-product/listAll', | ||||
| 		// 		method: 'get', | ||||
| 		// 	}); | ||||
| 		// 	const cfg = this.searchBarFormConfig.find( | ||||
| 		// 		(item) => item.__index == 'product' | ||||
| 		// 	); | ||||
| 		// 	this.$set( | ||||
| 		// 		cfg, | ||||
| 		// 		'selectOptions', | ||||
| 		// 		data.map((item) => ({ | ||||
| 		// 			id: item.id, | ||||
| 		// 			name: item.name, | ||||
| 		// 		})) | ||||
| 		// 	); | ||||
| 		// }, | ||||
|  | ||||
| 		async getList() { | ||||
| 			const { data } = await this.$axios({ | ||||
|   | ||||
| @@ -119,12 +119,12 @@ export default { | ||||
| 		return { | ||||
| 			searchBarKeys: ['groupId', 'equipmentName'], | ||||
| 			tableBtn: [ | ||||
| 				this.$auth.hasPermi('equipment:bind-group:update') | ||||
| 					? { | ||||
| 							type: 'detail', | ||||
| 							btnName: '查看报警', | ||||
| 					  } | ||||
| 					: undefined, | ||||
| 				// this.$auth.hasPermi('equipment:bind-group:update') | ||||
| 				// 	? { | ||||
| 				// 			type: 'detail', | ||||
| 				// 			btnName: '查看报警', | ||||
| 				// 	  } | ||||
| 				// 	: undefined, | ||||
| 				this.$auth.hasPermi('equipment:bind-group:update') | ||||
| 					? { | ||||
| 							type: 'edit', | ||||
| @@ -371,8 +371,8 @@ export default { | ||||
| 		}, | ||||
| 		handleTableBtnClick({ data, type }) { | ||||
| 			switch (type) { | ||||
| 				case 'edit': | ||||
| 					this.handleDetail(data, 'edit'); | ||||
|         case 'edit': | ||||
|           this.handleUpdate(data) | ||||
| 					break; | ||||
| 				case 'delete': | ||||
| 					this.handleDelete(data); | ||||
| @@ -397,7 +397,7 @@ export default { | ||||
| 			this.reset(); | ||||
| 			this.open = true; | ||||
| 			this.title = '添加设备与分组绑定'; | ||||
| 		}, | ||||
|     }, | ||||
| 		/** 修改按钮操作 */ | ||||
| 		handleUpdate(row) { | ||||
| 			this.reset(); | ||||
| @@ -432,19 +432,19 @@ export default { | ||||
| 			}); | ||||
| 		}, | ||||
| 		// 查看报警 | ||||
| 		handleDetail(row, mode = 'detail') { | ||||
| 			const { equipmentId, equipmentName, groupCode, groupId, groupName, id } = | ||||
| 				row; | ||||
| 			// 打开抽屉 | ||||
| 			this.editMode = mode; | ||||
| 			this.alarmForm.id = groupId; | ||||
| 			this.alarmForm.equipmentGroupCode = groupCode; | ||||
| 			this.alarmForm.equipmentGroupName = groupName; | ||||
| 			this.editVisible = true; | ||||
| 			this.$nextTick(() => { | ||||
| 				this.$refs['drawer'].init(); | ||||
| 			}); | ||||
| 		}, | ||||
| 		// handleDetail(row, mode = 'detail') { | ||||
| 		// 	const { equipmentId, equipmentName, groupCode, groupId, groupName, id } = | ||||
| 		// 		row; | ||||
| 		// 	// 打开抽屉 | ||||
| 		// 	this.editMode = mode; | ||||
| 		// 	this.alarmForm.id = groupId; | ||||
| 		// 	this.alarmForm.equipmentGroupCode = groupCode; | ||||
| 		// 	this.alarmForm.equipmentGroupName = groupName; | ||||
| 		// 	this.editVisible = true; | ||||
| 		// 	this.$nextTick(() => { | ||||
| 		// 		this.$refs['drawer'].init(); | ||||
| 		// 	}); | ||||
| 		// }, | ||||
| 		/** 删除按钮操作 */ | ||||
| 		handleDelete(row) { | ||||
| 			const id = row.id; | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| <!--  | ||||
| <!-- | ||||
|     filename: CollectionConfig.vue | ||||
|     author: liubin | ||||
|     date: 2023-10-30 10:09:03 | ||||
|     description:  | ||||
|     description: | ||||
| --> | ||||
|  | ||||
| <template> | ||||
| @@ -198,8 +198,8 @@ export default { | ||||
| 				}, | ||||
| 				{ | ||||
| 					type: 'select', | ||||
| 					label: '关联表编码', | ||||
| 					placeholder: '请选择关联表编码', | ||||
|           label: '标识名称', | ||||
| 					placeholder: '请选择标识名称', | ||||
| 					param: 'plcId', | ||||
| 					selectOptions: [], | ||||
| 					filterable: true, | ||||
|   | ||||
| @@ -1,160 +1,100 @@ | ||||
| <!-- | ||||
|  * @Author: zwq | ||||
|  * @Date: 2021-11-18 14:16:25 | ||||
|  * @LastEditors: zhp | ||||
|  * @LastEditTime: 2024-07-31 09:48:36 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-11-18 09:51:03 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| 	<el-drawer | ||||
| 		:visible.sync="visible" | ||||
| 		:show-close="false" | ||||
| 		:wrapper-closable="true" | ||||
| 		:before-close="beforeClose" | ||||
| 		class="drawer" | ||||
| 		size="60%"> | ||||
| 		<small-title slot="title" :no-padding="true"> | ||||
| 			{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }} | ||||
| 		</small-title> | ||||
| 		<div class="content"> | ||||
| 			<div class="visual-part"> | ||||
| 				<el-form | ||||
| 					:model="dataForm" | ||||
| 					:rules="dataRule" | ||||
| 					ref="dataForm" | ||||
| 					@keyup.enter.native="dataFormSubmit()" | ||||
| 					label-width="100px" | ||||
| 					label-position="top"> | ||||
| 					<el-row :gutter="20"> | ||||
| 						<el-col :span="8"> | ||||
| 							<el-form-item label="巡检单名称" prop="name"> | ||||
| 								<el-input v-model="dataForm.name" :disabled="isdetail" placeholder="请输入巡检单名称" /> | ||||
| 							</el-form-item> | ||||
| 						</el-col> | ||||
| 						<el-col :span="8"> | ||||
| 							<el-form-item label="部门" prop="departmentId"> | ||||
| 								<el-select | ||||
| 									v-model="dataForm.departmentId" | ||||
| 									:disabled="isdetail" | ||||
| 									:placeholder="`请选择部门`" | ||||
| 									style="width: 100%"> | ||||
| 									<el-option | ||||
| 										v-for="opt in departmentOptions" | ||||
| 										:key="opt.id" | ||||
| 										:label="opt.name" | ||||
| 										:value="opt.id" /> | ||||
| 								</el-select> | ||||
| 							</el-form-item> | ||||
| 						</el-col> | ||||
| 						<el-col :span="8"> | ||||
| 							<el-form-item label="班次" prop="groupClass"> | ||||
| 								<el-select | ||||
| 									v-model="dataForm.groupClass" | ||||
| 									filterable | ||||
| 									clearable | ||||
| 									multiple | ||||
| 									:disabled="isdetail" | ||||
| 									style="width: 100%" | ||||
| 									placeholder="请选择班次"> | ||||
| 									<el-option | ||||
| 										v-for="d in groupOptions" | ||||
| 										:key="d.id" | ||||
| 										:label="d.label" | ||||
| 										:value="d.label" /> | ||||
| 								</el-select> | ||||
| 							</el-form-item> | ||||
| 						</el-col> | ||||
| 					</el-row> | ||||
| 					<el-row :gutter="20"> | ||||
| 						<el-col :span="8"> | ||||
| 							<el-form-item label="巡检人" prop="checkPerson"> | ||||
| 								<el-select | ||||
| 									v-model="dataForm.checkPerson" | ||||
| 									:placeholder="`请选择巡检人`" | ||||
| 									multiple | ||||
| 									clearable | ||||
| 									:disabled="isdetail" | ||||
| 									filterable | ||||
| 									style="width: 100%"> | ||||
| 									<el-option | ||||
| 										v-for="opt in inspectorOptions" | ||||
| 										:key="opt.value" | ||||
| 										:label="opt.label" | ||||
| 										:value="opt.label" /> | ||||
| 								</el-select> | ||||
| 							</el-form-item> | ||||
| 						</el-col> | ||||
| 						<el-col :span="8"> | ||||
| 							<el-form-item label="实际巡检时间" prop="actualCheckTime"> | ||||
| 								<el-date-picker | ||||
| 									v-model="dataForm.actualCheckTime" | ||||
| 									type="datetime" | ||||
| 									:disabled="isdetail" | ||||
| 									placeholder="请选择实际巡检时间" | ||||
| 									value-format="timestamp" | ||||
| 									style="width: 100%" /> | ||||
| 							</el-form-item> | ||||
| 						</el-col> | ||||
| 					</el-row> | ||||
| 				</el-form> | ||||
| 			</div> | ||||
|   <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" :before-close="beforeClose" | ||||
|     class="drawer" size="60%"> | ||||
|     <small-title slot="title" :no-padding="true"> | ||||
|       {{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }} | ||||
|     </small-title> | ||||
|     <div class="content"> | ||||
|       <div class="visual-part"> | ||||
|         <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" | ||||
|           label-width="100px" label-position="top"> | ||||
|           <el-row :gutter="20"> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item label="巡检单名称" prop="name"> | ||||
|                 <el-input v-model="dataForm.name" :disabled="isdetail" placeholder="请输入巡检单名称" /> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item label="部门" prop="departmentId"> | ||||
|                 <el-select v-model="dataForm.departmentId" :disabled="isdetail" :placeholder="`请选择部门`" | ||||
|                   style="width: 100%"> | ||||
|                   <el-option v-for="opt in departmentOptions" :key="opt.id" :label="opt.name" :value="opt.id" /> | ||||
|                 </el-select> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item label="班次" prop="groupClass"> | ||||
|                 <el-select v-model="dataForm.groupClass" filterable clearable multiple :disabled="isdetail" | ||||
|                   style="width: 100%" placeholder="请选择班次"> | ||||
|                   <el-option v-for="d in groupOptions" :key="d.id" :label="d.label" :value="d.label" /> | ||||
|                 </el-select> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|           </el-row> | ||||
|           <el-row :gutter="20"> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item label="巡检人" prop="checkPerson"> | ||||
|                 <!-- <el-input v-model="dataForm.checkPerson" :disabled="isdetail" placeholder="请输入巡检人" /> --> | ||||
|  | ||||
| 			<div v-if="idAttrShow"> | ||||
| 				<small-title> | ||||
| 					巡检内容 | ||||
| 				</small-title> | ||||
|                 <el-select v-model="dataForm.checkPerson" :placeholder="`请选择巡检人`" multiple clearable | ||||
|                   :disabled="isdetail" filterable style="width: 100%"> | ||||
|                   <el-option v-for="opt in inspectorOptions" :key="opt.value" :label="opt.label" :value="opt.label" /> | ||||
|                 </el-select> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item label="实际巡检时间" prop="actualCheckTime"> | ||||
|                 <el-date-picker v-model="dataForm.actualCheckTime" type="datetime" :disabled="isdetail" | ||||
|                   placeholder="请选择实际巡检时间" value-format="timestamp" style="width: 100%" /> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|           </el-row> | ||||
|         </el-form> | ||||
|       </div> | ||||
|  | ||||
| 				<div v-if="!isdetail" style="display: flex"> | ||||
| 					<SearchBar | ||||
| 						:formConfigs="searchBarFormConfig" | ||||
| 						ref="attr-search-bar" | ||||
| 						@headBtnClick="handleSearchBarBtnClick" /> | ||||
| 					<!-- <div class="action_btn"> --> | ||||
| 					<el-button type="text" class="action_btn" @click="addNew()"> | ||||
| 						<span style="display: inline-block;"> | ||||
| 							<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" /> | ||||
| 							<span class="add">添加内容</span> | ||||
| 						</span> | ||||
| 					</el-button> | ||||
| 					<!-- </div> --> | ||||
| 				</div> | ||||
| 				<base-table | ||||
| 					:table-props="tableProps" | ||||
| 					:page="listQuery.pageNo" | ||||
| 					:limit="listQuery.pageSize" | ||||
| 					:table-data="detList"> | ||||
| 					<method-btn | ||||
| 						v-if="!isdetail" | ||||
| 						slot="handleBtn" | ||||
| 						:width="120" | ||||
| 						label="操作" | ||||
| 						:method-list="tableBtn" | ||||
| 						@clickBtn="handleClick" /> | ||||
| 				</base-table> | ||||
| 				<pagination | ||||
| 					v-show="listQuery.total > 0" | ||||
| 					:total="listQuery.total" | ||||
| 					:page.sync="listQuery.pageNo" | ||||
| 					:limit.sync="listQuery.pageSize" | ||||
| 					:page-sizes="[5, 10, 15]" | ||||
| 					@pagination="getList" /> | ||||
| 			</div> | ||||
|       <div v-if="idAttrShow"> | ||||
|         <small-title> | ||||
|           巡检内容 | ||||
|         </small-title> | ||||
|  | ||||
| 		</div> | ||||
|         <div v-if="!isdetail" style="display: flex"> | ||||
|           <SearchBar :formConfigs="searchBarFormConfig" ref="attr-search-bar" @headBtnClick="handleSearchBarBtnClick" /> | ||||
|           <!-- <div class="action_btn"> --> | ||||
|           <el-button type="text" class="action_btn" @click="addNew()"> | ||||
|             <span style="display: inline-block;"> | ||||
|               <svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" /> | ||||
|               <span class="add">添加内容</span> | ||||
|             </span> | ||||
|           </el-button> | ||||
|           <!-- </div> --> | ||||
|         </div> | ||||
|         <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" | ||||
|           :table-data="detList"> | ||||
|           <method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" | ||||
|             @clickBtn="handleClick" /> | ||||
|         </base-table> | ||||
|         <pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo" | ||||
|           :limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" /> | ||||
|       </div> | ||||
|  | ||||
| 		<div v-if="!isdetail" class="drawer-body__footer"> | ||||
| 			<el-button @click="goback()">取消</el-button> | ||||
| 			<!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> --> | ||||
| 			<el-button v-if="isshowConfirm" type="primary" @click="confirmIns()">保存</el-button> | ||||
| 			<el-button v-else type="primary" @click="dataFormSubmit()">保存</el-button> | ||||
| 		</div> | ||||
|     </div> | ||||
|  | ||||
| 		<attr-add | ||||
| 			v-if="addOrUpdateVisible" | ||||
| 			ref="addOrUpdate" | ||||
| 			:order-id="dataForm.id" | ||||
| 			@refreshDataList="getList" /> | ||||
| 	</el-drawer> | ||||
|     <div v-if="!isdetail" class="drawer-body__footer"> | ||||
|       <el-button @click="goback()">取消</el-button> | ||||
|       <!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> --> | ||||
|       <el-button v-if="isshowConfirm" type="primary" @click="confirmIns()">保存</el-button> | ||||
|       <el-button v-else type="primary" @click="dataFormSubmit()">保存</el-button> | ||||
|     </div> | ||||
|  | ||||
|     <attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :order-id="dataForm.id" @refreshDataList="getList" /> | ||||
|   </el-drawer> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| @@ -305,15 +245,15 @@ export default { | ||||
| 					})) | ||||
| 				); | ||||
| 			} | ||||
| 			const workerlist = await this.$axios('/base/core-worker/listAll'); | ||||
| 			if (workerlist.code == 0) { | ||||
| 				inspectorList = inspectorList.concat( | ||||
| 					workerlist.data.map((item) => ({ | ||||
| 						label: item.name, | ||||
| 						value: item.id, | ||||
| 					})) | ||||
| 				); | ||||
| 			} | ||||
| 			// const workerlist = await this.$axios('/base/core-worker/listAll'); | ||||
| 			// if (workerlist.code == 0) { | ||||
| 			// 	inspectorList = inspectorList.concat( | ||||
| 			// 		workerlist.data.map((item) => ({ | ||||
| 			// 			label: item.name, | ||||
| 			// 			value: item.id, | ||||
| 			// 		})) | ||||
| 			// 	); | ||||
| 			// } | ||||
| 			this.inspectorOptions = inspectorList; | ||||
| 			// const res1 = await groupClassesListAll(); | ||||
| 			// this.groupOptions = res1.data || []; | ||||
| @@ -453,9 +393,12 @@ export default { | ||||
| 						// } | ||||
| 						this.$axios({ | ||||
| 							url: | ||||
| 								`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`, | ||||
| 								`/base/equipment-check-order/confirm`, | ||||
| 								method: 'put', | ||||
| 								data: [this.dataForm.id], | ||||
| 								data: { | ||||
| 									ids: [this.dataForm.id], | ||||
| 									confirmBy: this.$store.getters.nickname, | ||||
| 								}, | ||||
| 						}).then(res =>{ | ||||
| 							if (res.code == 0) { | ||||
| 								this.visible = false; | ||||
|   | ||||
| @@ -42,9 +42,7 @@ | ||||
| import AddOrUpdate from './add-or-updata'; | ||||
| import moment from 'moment'; | ||||
| import basicPageMixin from '@/mixins/lb/basicPageMixin'; | ||||
| import { | ||||
| 	exportCheckOrderExcel, | ||||
| } from '@/api/equipment/base/maintain/record'; | ||||
| import { exportCheckOrderExcel } from '@/api/equipment/base/maintain/record'; | ||||
| import WaitingListTable from './WaitingListTable.vue'; | ||||
|  | ||||
| // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); | ||||
| @@ -76,16 +74,14 @@ export default { | ||||
| 	name: 'Confirm', | ||||
| 	components: { | ||||
| 		WaitingListTable, | ||||
| 		AddOrUpdate | ||||
| 		AddOrUpdate, | ||||
| 	}, | ||||
| 	mixins: [basicPageMixin], | ||||
| 	data() { | ||||
| 		return { | ||||
| 			addOrUpdateVisible: false, | ||||
| 			recordDetailVisible: false, | ||||
| 			searchBarKeys: [ | ||||
| 				'name' | ||||
| 			], | ||||
| 			searchBarKeys: ['name'], | ||||
| 			tobeConfirmedIdList: [], | ||||
| 			searchBarFormConfig: [ | ||||
| 				{ | ||||
| @@ -100,46 +96,51 @@ export default { | ||||
| 					name: 'search', | ||||
| 					color: 'primary', | ||||
| 				}, | ||||
|         { | ||||
|           type: (this.$auth.hasPermiAnd([ | ||||
|             'equipment:check-record:create', | ||||
|             'base:core-worker:query', | ||||
|             'base:core-production-line:query', | ||||
|             'base:core-department:query' | ||||
|           ]) || this.$auth.hasPermi('equipment:check-record:update') || this.$auth.hasPermi('equipment:check-record:export')) ? 'separate' : '', | ||||
|         }, | ||||
|         { | ||||
|           type: this.$auth.hasPermiAnd([ | ||||
|             'equipment:check-record:create', | ||||
|             'base:core-worker:query', | ||||
|             'base:core-production-line:query', | ||||
|             'base:core-department:query' | ||||
|           ]) | ||||
|             ? 'button' | ||||
|             : '', | ||||
|           btnName: '新增', | ||||
|           name: 'add', | ||||
|           plain: true, | ||||
|           color: 'success', | ||||
|         }, | ||||
| 				{ | ||||
|           type: this.$auth.hasPermi('equipment:check-record:update') | ||||
| 					type: | ||||
| 						this.$auth.hasPermiAnd([ | ||||
| 							'equipment:check-record:create', | ||||
| 							'base:core-worker:query', | ||||
| 							'base:core-production-line:query', | ||||
| 							'base:core-department:query', | ||||
| 						]) || | ||||
| 						this.$auth.hasPermi('equipment:check-record:update') || | ||||
| 						this.$auth.hasPermi('equipment:check-record:export') | ||||
| 							? 'separate' | ||||
| 							: '', | ||||
| 				}, | ||||
| 				{ | ||||
| 					type: this.$auth.hasPermiAnd([ | ||||
| 						'equipment:check-record:create', | ||||
| 						'base:core-worker:query', | ||||
| 						'base:core-production-line:query', | ||||
| 						'base:core-department:query', | ||||
| 					]) | ||||
| 						? 'button' | ||||
| 						: '', | ||||
| 					btnName: '新增', | ||||
| 					name: 'add', | ||||
| 					plain: true, | ||||
| 					color: 'success', | ||||
| 				}, | ||||
| 				{ | ||||
| 					type: this.$auth.hasPermi('equipment:check-record:update') | ||||
| 						? 'button' | ||||
| 						: '', | ||||
| 					btnName: '巡检人批量确认', | ||||
| 					name: 'batchConfirm', | ||||
| 					color: 'primary', | ||||
| 					plain: true, | ||||
|         }, | ||||
|         { | ||||
|           type: this.$auth.hasPermi('equipment:check-record:update') | ||||
|             ? 'button' | ||||
|             : '', | ||||
|           btnName: '确认人批量确认', | ||||
|           name: 'batchConfirm2', | ||||
|           color: 'primary', | ||||
|           plain: true, | ||||
|         }, | ||||
| 				}, | ||||
| 				{ | ||||
| 					type: this.$auth.hasPermi('equipment:check-record:update') | ||||
| 						? 'button' | ||||
| 						: '', | ||||
| 					btnName: '确认人批量确认', | ||||
| 					name: 'batchConfirm2', | ||||
| 					color: 'primary', | ||||
| 					plain: true, | ||||
| 				}, | ||||
| 				// { | ||||
| 				// 	type: this.$auth.hasPermi('equipment:check-record:export') | ||||
| 				// 		? 'button' | ||||
| @@ -194,7 +195,9 @@ export default { | ||||
| 	}, | ||||
| 	methods: { | ||||
| 		/** 批量确认 */ | ||||
| 		async searchBarClicked(btn) { | ||||
|     async handleSearchBarBtnClick(btn) { | ||||
|       console.log(11111); | ||||
|  | ||||
| 			switch (btn.btnName) { | ||||
| 				case 'batchConfirm': | ||||
| 					if (this.$refs['waiting-list-table'].selectedPlan.length == 0) { | ||||
| @@ -211,11 +214,45 @@ export default { | ||||
| 							// } | ||||
| 							return this.$axios({ | ||||
| 								// url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam, | ||||
| 								url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`, | ||||
| 								url: `/base/equipment-check-order/confirm`, | ||||
| 								method: 'put', | ||||
| 								data: this.$refs['waiting-list-table'].selectedPlan.map( | ||||
| 									(item) => item.id | ||||
| 								), | ||||
| 								data: { | ||||
| 									ids: this.$refs['waiting-list-table'].selectedPlan.map( | ||||
| 										(item) => item.id | ||||
| 									), | ||||
| 									confirmBy: this.$store.getters.nickname, | ||||
| 								}, | ||||
| 							}); | ||||
| 						}) | ||||
| 						.then((res) => { | ||||
| 							this.getList(); | ||||
| 							res.code == 0 && this.$modal.msgSuccess('确认成功'); | ||||
| 							res.code != 0 && this.$modal.msgError('确认失败'); | ||||
| 						}) | ||||
| 						.catch(() => {}); | ||||
| 				case 'batchConfirm2': | ||||
| 					if (this.$refs['waiting-list-table'].selectedPlan.length == 0) { | ||||
| 						this.$message.warning('请选择待确认的设备巡检单'); | ||||
| 						return; | ||||
| 					} | ||||
| 					this.$modal | ||||
| 						.confirm('是否确认所有选中巡检单"?') | ||||
| 						.then(() => { | ||||
| 							// let checkPersonParam = ''; | ||||
| 							// if (!row.checkPerson || row.checkPerson.trim() == '') { | ||||
| 							// 	/** 如有必要,更新巡检人 */ | ||||
| 							// 	checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`; | ||||
| 							// } | ||||
| 							return this.$axios({ | ||||
| 								// url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam, | ||||
| 								url: `/base/equipment-check-order/confirm2`, | ||||
| 								method: 'put', | ||||
| 								data: { | ||||
| 									ids: this.$refs['waiting-list-table'].selectedPlan.map( | ||||
| 										(item) => item.id | ||||
| 									), | ||||
| 									confirmBy: this.$store.getters.nickname, | ||||
| 								}, | ||||
| 							}); | ||||
| 						}) | ||||
| 						.then((res) => { | ||||
| @@ -224,34 +261,15 @@ export default { | ||||
| 							res.code != 0 && this.$modal.msgError('确认失败'); | ||||
| 						}) | ||||
|             .catch(() => { }); | ||||
|         case 'batchConfirm2': | ||||
|           if (this.$refs['waiting-list-table'].selectedPlan.length == 0) { | ||||
|             this.$message.warning('请选择待确认的设备巡检单'); | ||||
|             return; | ||||
|           } | ||||
|           this.$modal | ||||
|             .confirm('是否确认所有选中巡检单"?') | ||||
|             .then(() => { | ||||
|               // let checkPersonParam = ''; | ||||
|               // if (!row.checkPerson || row.checkPerson.trim() == '') { | ||||
|               // 	/** 如有必要,更新巡检人 */ | ||||
|               // 	checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`; | ||||
|               // } | ||||
|               return this.$axios({ | ||||
|                 // url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam, | ||||
|                 url: `/base/equipment-check-order/confirm2?confirmPerson=${this.$store.getters.nickname}`, | ||||
|                 method: 'put', | ||||
|                 data: this.$refs['waiting-list-table'].selectedPlan.map( | ||||
|                   (item) => item.id | ||||
|                 ), | ||||
|               }); | ||||
|             }) | ||||
|             .then((res) => { | ||||
|               this.getList(); | ||||
|               res.code == 0 && this.$modal.msgSuccess('确认成功'); | ||||
|               res.code != 0 && this.$modal.msgError('确认失败'); | ||||
|             }) | ||||
|             .catch(() => { }); | ||||
|           break; | ||||
|         case 'search': | ||||
|           this.getList() | ||||
|           break; | ||||
|         case 'add': | ||||
|           this.addOrUpdateVisible = true; | ||||
|           this.$nextTick(() => { | ||||
|             this.$refs.addOrUpdate.init(); | ||||
|           }); | ||||
| 					break; | ||||
| 			} | ||||
| 		}, | ||||
| @@ -311,7 +329,7 @@ export default { | ||||
| 		}, | ||||
|  | ||||
| 		handleSearchBarChange({ param, value }) { | ||||
| 			console.log('122', param) | ||||
| 			console.log('122', param); | ||||
| 			// if ('specialType' === param) { | ||||
| 			// 	if (!value) { | ||||
| 			// 		this.setSearchBarEquipmentList(this.allSpecialEquipments); | ||||
| @@ -327,7 +345,7 @@ export default { | ||||
| 			this.loading = true; | ||||
| 			// 执行查询 | ||||
| 			this.recv({ | ||||
| 				...this.queryParams | ||||
| 				...this.queryParams, | ||||
| 			}).then((response) => { | ||||
| 				this.list = response.data.list; | ||||
| 				this.total = response.data.total; | ||||
| @@ -376,18 +394,18 @@ export default { | ||||
| 			// this.title = '添加待确认保养记录'; | ||||
| 			// this.addOrEditTitle = '新增'; | ||||
| 			this.addOrUpdateVisible = true; | ||||
|       this.$nextTick(() => { | ||||
|         this.$refs.addOrUpdate.init(); | ||||
|       }); | ||||
| 			this.$nextTick(() => { | ||||
| 				this.$refs.addOrUpdate.init(); | ||||
| 			}); | ||||
| 		}, | ||||
|  | ||||
| 		// 新增 / 修改 | ||||
|     // addOrUpdateHandle(id) { | ||||
|     //   this.addOrUpdateVisible = true; | ||||
|     //   this.$nextTick(() => { | ||||
|     //     this.$refs.addOrUpdate.init(id); | ||||
|     //   }); | ||||
|     // }, | ||||
| 		// addOrUpdateHandle(id) { | ||||
| 		//   this.addOrUpdateVisible = true; | ||||
| 		//   this.$nextTick(() => { | ||||
| 		//     this.$refs.addOrUpdate.init(id); | ||||
| 		//   }); | ||||
| 		// }, | ||||
|  | ||||
| 		getConfirmed() { | ||||
| 			return this.$confirm('是否直接确认巡检记录', '提示', { | ||||
| @@ -462,10 +480,12 @@ export default { | ||||
| 					// 	checkPersonParam = `&checkPerson=${row.checkPerson}` | ||||
| 					// } | ||||
| 					return this.$axios({ | ||||
| 						url: | ||||
| 							`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`, | ||||
| 						url: `/base/equipment-check-order/confirm`, | ||||
| 						method: 'put', | ||||
| 						data: [row.id], | ||||
| 						data: { | ||||
| 									ids: [row.id], | ||||
| 									confirmBy: this.$store.getters.nickname, | ||||
| 								}, | ||||
| 					}); | ||||
| 				}) | ||||
| 				.then((res) => { | ||||
| @@ -478,9 +498,9 @@ export default { | ||||
| 		/** 编辑 */ | ||||
| 		async handleEdit(row) { | ||||
| 			this.addOrUpdateVisible = true; | ||||
|       this.$nextTick(() => { | ||||
|         this.$refs.addOrUpdate.init(row.id); | ||||
|       }); | ||||
| 			this.$nextTick(() => { | ||||
| 				this.$refs.addOrUpdate.init(row.id); | ||||
| 			}); | ||||
| 			// this.reset(); | ||||
| 			// if (row.relatePlan == 1) { | ||||
| 			// 	// 计划型 | ||||
| @@ -501,9 +521,7 @@ export default { | ||||
| 		/** 删除按钮操作 */ | ||||
| 		handleDelete(row) { | ||||
| 			this.$modal | ||||
| 				.confirm( | ||||
| 					'是否确认删除巡检单名称为"' + row.name + '"的数据项?' | ||||
| 				) | ||||
| 				.confirm('是否确认删除巡检单名称为"' + row.name + '"的数据项?') | ||||
| 				.then(() => { | ||||
| 					return this.$axios({ | ||||
| 						url: '/base/equipment-check-order/delete?id=' + row.id, | ||||
| @@ -518,9 +536,9 @@ export default { | ||||
| 		}, | ||||
| 		handleDetail(row) { | ||||
| 			this.addOrUpdateVisible = true; | ||||
|       this.$nextTick(() => { | ||||
|         this.$refs.addOrUpdate.init(row.id, true); | ||||
|       }); | ||||
| 			this.$nextTick(() => { | ||||
| 				this.$refs.addOrUpdate.init(row.id, true); | ||||
| 			}); | ||||
| 			// this.recordDetailVisible = true; | ||||
| 			// this.$nextTick(() => { | ||||
| 			// 	this.$refs.recordDetailDrawer.show({ | ||||
|   | ||||
| @@ -6,84 +6,60 @@ | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| 	<el-drawer | ||||
| 		:visible.sync="visible" | ||||
| 		:show-close="false" | ||||
| 		:wrapper-closable="true" | ||||
| 		class="drawer" | ||||
| 		size="50%"> | ||||
| 		<small-title slot="title" :no-padding="true"> | ||||
| 			<!-- {{ isdetail ? '详情' : '添加巡检' }} --> | ||||
| 			{{ '添加内容' }} | ||||
| 		</small-title> | ||||
| 		<div class="content"> | ||||
| 			<div class="visual-part"> | ||||
|   <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" class="drawer" size="50%"> | ||||
|     <small-title slot="title" :no-padding="true"> | ||||
|       <!-- {{ isdetail ? '详情' : '添加巡检' }} --> | ||||
|       {{ '添加内容' }} | ||||
|     </small-title> | ||||
|     <div class="content"> | ||||
|       <div class="visual-part"> | ||||
|         <el-row :gutter="20"> | ||||
|           <el-col :span="8"> | ||||
|             <div class="blodTip">巡检单名称</div> | ||||
|             <div class="lightTip">{{ dataForm.name }}</div> | ||||
|           </el-col> | ||||
| 					<el-col :span="8"> | ||||
|           <el-col :span="8"> | ||||
|             <div class="blodTip">部门</div> | ||||
|             <div class="lightTip">{{ dataForm.department }}</div> | ||||
|           </el-col> | ||||
| 					<el-col :span="8"> | ||||
|             <div class="blodTip">巡检时间</div> | ||||
|           <el-col :span="8"> | ||||
|             <div class="blodTip">计划巡检时间</div> | ||||
|             <div class="lightTip">{{ parseTime(dataForm.planCheckTime) }}</div> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
| 			</div> | ||||
|       </div> | ||||
|  | ||||
| 			<el-divider /> | ||||
|       <el-divider /> | ||||
|  | ||||
| 			<div class="attr-list"> | ||||
| 				<small-title | ||||
| 					style="margin: 16px 0; padding-left: 8px" | ||||
| 					:no-padding="true"> | ||||
| 					巡检内容 | ||||
| 				</small-title> | ||||
|       <div class="attr-list"> | ||||
|         <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true"> | ||||
|           巡检内容 | ||||
|         </small-title> | ||||
|  | ||||
| 				<div v-if="!isdetail" class="action_btn"> | ||||
| 					<template> | ||||
|         <div v-if="!isdetail" class="action_btn"> | ||||
|           <template> | ||||
|             <span style="display: inline-block;"> | ||||
|               <el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button> | ||||
|             </span> | ||||
|           </template> | ||||
| 				</div> | ||||
| 				<base-table | ||||
| 					:table-props="tableProps" | ||||
| 					:page="listQuery.pageNo" | ||||
| 					:limit="listQuery.pageSize" | ||||
| 					:table-data="checkDetList"> | ||||
| 					<method-btn | ||||
| 						v-if="!isdetail" | ||||
| 						slot="handleBtn" | ||||
| 						:width="120" | ||||
| 						label="操作" | ||||
| 						:method-list="tableBtn" | ||||
| 						@clickBtn="handleClick" /> | ||||
| 				</base-table> | ||||
| 				<pagination | ||||
| 					v-show="listQuery.total > 0" | ||||
| 					:total="listQuery.total" | ||||
| 					:page.sync="listQuery.pageNo" | ||||
| 					:limit.sync="listQuery.pageSize" | ||||
| 					:page-sizes="[5, 10, 15]" | ||||
| 					@pagination="getList" /> | ||||
|         </div> | ||||
|         <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" | ||||
|           :table-data="checkDetList"> | ||||
|           <method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" | ||||
|             @clickBtn="handleClick" /> | ||||
|         </base-table> | ||||
|         <pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo" | ||||
|           :limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" /> | ||||
|  | ||||
| 				<!-- <div class="drawer-body__footer"> | ||||
|         <!-- <div class="drawer-body__footer"> | ||||
| 					<el-button type="primary" @click="goback()">关闭</el-button> | ||||
| 				</div> --> | ||||
| 			</div> | ||||
|       </div> | ||||
|  | ||||
| 		</div> | ||||
|     </div> | ||||
|  | ||||
| 		<attr-add | ||||
| 			v-if="addOrUpdateVisible" | ||||
| 			ref="addOrUpdate" | ||||
| 			:order-id="dataForm.id" | ||||
| 			@refreshDataList="getList" /> | ||||
| 	</el-drawer> | ||||
|     <attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :order-id="dataForm.id" @refreshDataList="getList" /> | ||||
|   </el-drawer> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| @@ -111,8 +87,13 @@ const tableProps = [ | ||||
| 	}, | ||||
| 	{ | ||||
| 		prop: 'program', | ||||
| 		label: '检查项目', | ||||
| 	} | ||||
|     label: '巡检项目', | ||||
|   }, | ||||
|   { | ||||
|     prop: 'checkResult', | ||||
|     label: '巡检结果', | ||||
|   }, | ||||
|  | ||||
| ]; | ||||
|  | ||||
| export default { | ||||
|   | ||||
| @@ -201,7 +201,7 @@ export default { | ||||
| 			this.groupOptions = | ||||
| 				res1.data.map((item) => { | ||||
| 					item.label = | ||||
| 						item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict); | ||||
|             item.name + (getDictDataLabel('workshop', item.roomNameDict) ? ' - ' + getDictDataLabel('workshop', item.roomNameDict) : '') | ||||
| 					return item; | ||||
| 				}) || []; | ||||
| 			// const res = await getEquipmentAll() | ||||
|   | ||||
| @@ -17,7 +17,7 @@ | ||||
|     <el-row :gutter="24"> | ||||
|       <el-col :span="24"> | ||||
|         <el-form-item label="默认巡检结果" prop="resultType"> | ||||
|           <el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果"> | ||||
|           <el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果" @change="handleClear"> | ||||
|             <el-option v-for="dict in resultList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
| @@ -38,13 +38,16 @@ | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row v-else-if="dataForm.resultType === 2" :gutter="24"> | ||||
|       <el-col :span="12"> | ||||
|       <el-col :span="11"> | ||||
|         <el-form-item prop="minValue"> | ||||
|           <el-input oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.minValue" placeholder="请输入最小值" /> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item prop="maxValue"> | ||||
|       <el-col :span="4"> | ||||
|         ————— | ||||
|       </el-col> | ||||
|       <el-col :span="9"> | ||||
|         <el-form-item prop="maxValue" label-width="20"> | ||||
|           <el-input @change="handleChange" oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.maxValue" | ||||
|             placeholder="请输入最大值" /> | ||||
|         </el-form-item> | ||||
| @@ -113,7 +116,12 @@ export default { | ||||
| 		this.getDict() | ||||
| 		console.log('我看看', this.dataForm) | ||||
| 	}, | ||||
| 	methods: { | ||||
|   methods: { | ||||
|     handleClear() { | ||||
|       this.dataForm.minValue = undefined | ||||
|       this.dataForm.maxValue = undefined | ||||
|       this.dataForm.maintainResult = undefined | ||||
|     }, | ||||
| 		async getDict() { | ||||
| 			// 物料列表 | ||||
|       const res = await getList(); | ||||
|   | ||||
| @@ -29,9 +29,9 @@ export default { | ||||
|   }, | ||||
|   created() { | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.getDataList() | ||||
|   }, | ||||
|   // mounted() { | ||||
|   //   this.getDataList() | ||||
|   // }, | ||||
|   methods: { | ||||
|     // 获取数据列表 | ||||
|     getDataList() { | ||||
|   | ||||
| @@ -28,7 +28,6 @@ import moment from 'moment'; | ||||
| import basicPageMixin from '@/mixins/lb/basicPageMixin'; | ||||
| import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items' | ||||
| import showDetail  from './showDetail.vue' | ||||
| import { publicFormatter } from '@/utils/dict'; | ||||
|  | ||||
| export default { | ||||
|   name: 'PlanConfig', | ||||
| @@ -40,7 +39,7 @@ export default { | ||||
| 		const t = new Date(); | ||||
| 		const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()]; | ||||
| 		return { | ||||
|       searchBarKeys: ['equipmentName', 'createTime'], | ||||
|       searchBarKeys: ['equipmentTypeId'], | ||||
|       equipmentTypeList:[], | ||||
| 			tableBtn: [ | ||||
| 				{ | ||||
| @@ -125,7 +124,7 @@ export default { | ||||
|   created() { | ||||
|     this.initSearchBar() | ||||
| 		this.getList(); | ||||
| 	}, | ||||
|   }, | ||||
| 	methods: { | ||||
| 		/** 查询列表 */ | ||||
| 		getList() { | ||||
| @@ -231,13 +230,14 @@ export default { | ||||
| 					return; | ||||
| 				} | ||||
|         // 添加的提交 | ||||
| 				this.post(this.form).then((response) => { | ||||
|         this.post(this.form).then((res) => { | ||||
|           console.log('res', res) | ||||
| 					this.$modal.msgSuccess('新增成功'); | ||||
| 					this.open = false; | ||||
|           this.getList() | ||||
|           this.showDetailVisible = true | ||||
|           this.$nextTick(() => { | ||||
|             this.$refs.showDetail.init(this.form.equipmentTypeId) | ||||
|             this.$refs.showDetail.init(res.data) | ||||
|           }) | ||||
| 				}); | ||||
| 			}); | ||||
|   | ||||
| @@ -36,7 +36,7 @@ const tableProps = [ | ||||
|     align:'center', | ||||
|   }, | ||||
|   { | ||||
|     prop: 'maintainResult', | ||||
|     prop: 'checkResult', | ||||
|     label: '默认巡检结果', | ||||
|     align: 'center', | ||||
|   }, | ||||
| @@ -100,9 +100,11 @@ export default { | ||||
|       // console.log(this.tableData) | ||||
|     }, | ||||
|     getDataList(id) { | ||||
|       console.log(id) | ||||
|       this.dataListLoading = true; | ||||
|       this.queryParams.equipmentTypeId = id | ||||
|       this.urlOptions.getDataListURL(this.listQuery).then(response => { | ||||
|       console.log(this.queryParams.equipmentTypeId) | ||||
|       this.urlOptions.getDataListURL(this.queryParams).then(response => { | ||||
|         this.tableData = response.data.list; | ||||
|         this.listQuery.total = response.data.total; | ||||
|         this.dataListLoading = false | ||||
|   | ||||
| @@ -6,55 +6,32 @@ | ||||
| --> | ||||
|  | ||||
| <template> | ||||
| 	<el-form | ||||
| 		ref="form" | ||||
| 		:model="form" | ||||
| 		:size="size" | ||||
| 		:label-position="labelPosition" | ||||
| 		v-loading="formLoading"> | ||||
| 		<el-row :gutter="20"> | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="设备保养单号" | ||||
| 					prop="maintainOrderNumber" | ||||
| 					:rules="[ | ||||
|   <el-form ref="form" :model="form" :size="size" :label-position="labelPosition" v-loading="formLoading"> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="设备保养单号" prop="maintainOrderNumber" :rules="[ | ||||
| 						{ required: true, message: '请输入设备保养单号', trigger: 'blur' }, | ||||
| 					]"> | ||||
| 					<el-input | ||||
| 						v-model="form.maintainOrderNumber" | ||||
| 						@change="$emit('update', form)" | ||||
| 						:placeholder="`请输入保养计划单号`" | ||||
| 						:disabled="disabled" /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|           <el-input v-model="form.maintainOrderNumber" @change="$emit('update', form)" :placeholder="`请输入保养计划单号`" | ||||
|             :disabled="disabled" /> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item label="保养计划名称" prop="name"> | ||||
| 					<el-input value="---" disabled /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="保养计划名称" prop="name"> | ||||
|           <el-input value="---" disabled /> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="部门" | ||||
| 					prop="departmentId" | ||||
| 					:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]"> | ||||
| 					<el-select | ||||
| 						v-model="form.departmentId" | ||||
| 						:placeholder="`请选择部门`" | ||||
| 						:disabled="disabled" | ||||
| 						clearable | ||||
| 						filterable | ||||
| 						@change="$emit('update', form)"> | ||||
| 						<el-option | ||||
| 							v-for="opt in departmentOptions" | ||||
| 							:key="opt.value" | ||||
| 							:label="opt.label" | ||||
| 							:value="opt.value" /> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="部门" prop="departmentId" :rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]"> | ||||
|           <el-select v-model="form.departmentId" :placeholder="`请选择部门`" :disabled="disabled" clearable filterable | ||||
|             @change="$emit('update', form)"> | ||||
|             <el-option v-for="opt in departmentOptions" :key="opt.value" :label="opt.label" :value="opt.value" /> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|  | ||||
| 				<!-- <el-form-item | ||||
|         <!-- <el-form-item | ||||
| 					label="设备大类" | ||||
| 					prop="equipmentCategory" | ||||
| 					:rules="[ | ||||
| @@ -72,89 +49,59 @@ | ||||
| 							:value="opt.value" /> | ||||
| 					</el-select> | ||||
| 				</el-form-item> --> | ||||
| 			</el-col> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="产线" | ||||
| 					prop="lineId" | ||||
| 					:rules="[{ required: true, message: '请选择产线', trigger: 'blur' }]"> | ||||
| 					<el-select | ||||
| 						v-model="form.lineId" | ||||
| 						:placeholder="`请选择产线`" | ||||
| 						:disabled="disabled" | ||||
| 						clearable | ||||
| 						filterable | ||||
| 						@change="$emit('update', form)"> | ||||
| 						<el-option | ||||
| 							v-for="opt in lineOptions" | ||||
| 							:key="opt.value" | ||||
| 							:label="opt.label" | ||||
| 							:value="opt.value" /> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="产线" prop="lineId" :rules="[{ required: true, message: '请选择产线', trigger: 'blur' }]"> | ||||
|           <el-select v-model="form.lineId" :placeholder="`请选择产线`" :disabled="disabled" clearable filterable | ||||
|             @change="$emit('update', form)"> | ||||
|             <el-option v-for="opt in lineOptions" :key="opt.value" :label="opt.label" :value="opt.value" /> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item label="计划保养人员" prop="maintainer"> | ||||
| 					<el-input value="---" disabled /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="计划保养人员" prop="maintainer"> | ||||
|           <el-input value="---" disabled /> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item label="计划开始时间" prop="planStartTime"> | ||||
| 					<el-input value="---" disabled /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="计划开始时间" prop="planStartTime"> | ||||
|           <el-input value="---" disabled /> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item label="计划结束时间" prop="planEndTime"> | ||||
| 					<el-input value="---" disabled /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="计划结束时间" prop="planEndTime"> | ||||
|           <el-input value="---" disabled /> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="实际开始时间" | ||||
| 					prop="startTime" | ||||
| 					:rules="[ | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="实际开始时间" prop="startTime" :rules="[ | ||||
| 						{ required: true, message: '请选择实际开始时间', trigger: 'blur' }, | ||||
| 					]"> | ||||
| 					<el-date-picker | ||||
| 						v-model="form.startTime" | ||||
| 						type="datetime" | ||||
| 						:disabled="edit" | ||||
| 						placeholder="请选择实际开始时间" | ||||
| 						@change="$emit('update', form)" | ||||
| 						value-format="timestamp"></el-date-picker> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|           <el-date-picker v-model="form.startTime" type="datetime" :disabled="edit" placeholder="请选择实际开始时间" | ||||
|             @change="$emit('update', form)" value-format="timestamp"></el-date-picker> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="实际结束时间" | ||||
| 					prop="endTime" | ||||
| 					:rules="[ | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="实际结束时间" prop="endTime" :rules="[ | ||||
| 						{ required: true, message: '请选择实际结束时间', trigger: 'blur' }, | ||||
| 					]"> | ||||
| 					<el-date-picker | ||||
| 						v-model="form.endTime" | ||||
| 						type="datetime" | ||||
| 						:disabled="edit" | ||||
| 						placeholder="请选择实际结束时间" | ||||
| 						@change="$emit('update', form)" | ||||
| 						value-format="timestamp"></el-date-picker> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
|           <el-date-picker v-model="form.endTime" type="datetime" :disabled="edit" placeholder="请选择实际结束时间" | ||||
|             @change="$emit('update', form)" value-format="timestamp"></el-date-picker> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="12"> | ||||
| 				<el-form-item | ||||
| 					label="实际保养人员" | ||||
| 					prop="maintainWorker" | ||||
| 					:rules="[ | ||||
| 						{ required: false, message: '请选择实际保养人员', trigger: 'blur' }, | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item label="实际保养人员" prop="maintainWorker" :rules="[ | ||||
|           { required: false, message: '请输入实际保养人员', trigger: 'blur' }, | ||||
| 					]"> | ||||
| 					<el-select | ||||
|           <el-input v-model="form.maintainWorker" @change="$emit('update', form)" :placeholder="`请输入实际保养人员`" :disabled="disabled" /> | ||||
|           <!-- <el-select | ||||
| 						v-model="form.maintainWorker" | ||||
| 						:placeholder="`请选择实际保养人员`" | ||||
| 						:disabled="disabled" | ||||
| @@ -167,21 +114,17 @@ | ||||
| 							:key="opt.value" | ||||
| 							:label="opt.label" | ||||
| 							:value="opt.value" /> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 					</el-select> --> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|  | ||||
| 			<el-col :span="24"> | ||||
| 				<el-form-item label="备注" prop="remark"> | ||||
| 					<el-input | ||||
| 						v-model="form.remark" | ||||
| 						@change="$emit('update', form)" | ||||
| 						:placeholder="`请输入备注`" | ||||
| 						:disabled="disabled" /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 		</el-row> | ||||
| 	</el-form> | ||||
|       <el-col :span="24"> | ||||
|         <el-form-item label="备注" prop="remark"> | ||||
|           <el-input v-model="form.remark" @change="$emit('update', form)" :placeholder="`请输入备注`" :disabled="disabled" /> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|   </el-form> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| @@ -321,7 +264,6 @@ export default { | ||||
| 			const urls = [ | ||||
| 				'/base/core-production-line/listAll', | ||||
| 				'/system/dept/list-all-simple', | ||||
| 				'/base/core-worker/listAll', | ||||
| 			]; | ||||
| 			let res; | ||||
| 			switch (source) { | ||||
| @@ -329,10 +271,6 @@ export default { | ||||
| 					res = await this.$axios(urls[1]); | ||||
| 					this.departmentList = res.data || []; | ||||
| 					break; | ||||
| 				case 'maintainer': | ||||
| 					res = await this.$axios(urls[2]); | ||||
| 					this.maintainerList = res.data || []; | ||||
| 					break; | ||||
| 				case 'line': | ||||
| 					res = await this.$axios(urls[0]); | ||||
| 					this.lineList = res.data || []; | ||||
|   | ||||
| @@ -6,177 +6,116 @@ | ||||
| --> | ||||
|  | ||||
| <template> | ||||
| 	<el-drawer | ||||
| 		:visible.sync="visible" | ||||
| 		:show-close="false" | ||||
| 		:wrapper-closable="true" | ||||
| 		class="drawer" | ||||
| 		custom-class="mes-drawer" | ||||
| 		size="60%" | ||||
| 		:before-close="beforeClose" | ||||
| 		@closed="$emit('destroy')"> | ||||
| 		<SmallTitle slot="title">编辑</SmallTitle> | ||||
|   <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" class="drawer" | ||||
|     custom-class="mes-drawer" size="60%" :before-close="beforeClose" @closed="$emit('destroy')"> | ||||
|     <SmallTitle slot="title">编辑</SmallTitle> | ||||
|  | ||||
| 		<div class="drawer-body flex"> | ||||
| 			<div class="drawer-body__content"> | ||||
| 				<div class="form-part" style="margin-bottom: 32px"> | ||||
| 					<!-- <el-skeleton v-if="!showForm" animated /> --> | ||||
| 					<el-form | ||||
| 						class="equipment-info-form" | ||||
| 						ref="form" | ||||
| 						:model="form" | ||||
| 						label-width="200px" | ||||
| 						label-position="top" | ||||
| 						v-loading="formLoading"> | ||||
| 						<el-row :gutter="20"> | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item label="保养计划单号" prop="maintainOrderNumber"> | ||||
| 									<!-- :rules="[ | ||||
|     <div class="drawer-body flex"> | ||||
|       <div class="drawer-body__content"> | ||||
|         <div class="form-part" style="margin-bottom: 32px"> | ||||
|           <!-- <el-skeleton v-if="!showForm" animated /> --> | ||||
|           <el-form class="equipment-info-form" ref="form" :model="form" label-width="200px" label-position="top" | ||||
|             v-loading="formLoading"> | ||||
|             <el-row :gutter="20"> | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="保养计划单号" prop="maintainOrderNumber"> | ||||
|                   <!-- :rules="[ | ||||
| 										{ | ||||
| 											required: true, | ||||
| 											message: '请输入保养计划单号', | ||||
| 											trigger: 'blur', | ||||
| 										}, | ||||
| 									]" --> | ||||
| 									<el-input | ||||
| 										v-model="form.maintainOrderNumber" | ||||
| 										disabled | ||||
| 										:placeholder="`请输入保养计划单号`" /> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
|                   <el-input v-model="form.maintainOrderNumber" disabled :placeholder="`请输入保养计划单号`" /> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item label="保养计划名称" prop="planName"> | ||||
| 									<el-input | ||||
| 										v-model="form.planName" | ||||
| 										placeholder="请输入保养计划名称" | ||||
| 										disabled /> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="保养计划名称" prop="planName"> | ||||
|                   <el-input v-model="form.planName" placeholder="请输入保养计划名称" disabled /> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item label="部门" prop="departmentId"> | ||||
| 									<!-- :rules="[ | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="部门" prop="departmentId"> | ||||
|                   <!-- :rules="[ | ||||
| 										{ required: true, message: '请选择部门', trigger: 'blur' }, | ||||
| 									]" --> | ||||
| 									<el-select | ||||
| 										v-model="form.departmentId" | ||||
| 										:placeholder="`请选择部门`" | ||||
| 										clearable | ||||
| 										disabled | ||||
| 										filterable> | ||||
| 										<el-option | ||||
| 											v-for="opt in departmentOptions" | ||||
| 											:key="opt.value" | ||||
| 											:label="opt.label" | ||||
| 											:value="opt.value" /> | ||||
| 									</el-select> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
|                   <el-select v-model="form.departmentId" :placeholder="`请选择部门`" clearable disabled filterable> | ||||
|                     <el-option v-for="opt in departmentOptions" :key="opt.value" :label="opt.label" | ||||
|                       :value="opt.value" /> | ||||
|                   </el-select> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item label="产线" prop="lineId"> | ||||
| 									<!-- :rules="[ | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="产线" prop="lineId"> | ||||
|                   <!-- :rules="[ | ||||
| 										{ required: true, message: '请选择产线', trigger: 'blur' }, | ||||
| 									]" --> | ||||
| 									<el-select | ||||
| 										v-model="form.lineId" | ||||
| 										:placeholder="`请选择产线`" | ||||
| 										disabled | ||||
| 										clearable | ||||
| 										filterable> | ||||
| 										<el-option | ||||
| 											v-for="opt in lineOptions" | ||||
| 											:key="opt.value" | ||||
| 											:label="opt.label" | ||||
| 											:value="opt.value" /> | ||||
| 									</el-select> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
|                   <el-select v-model="form.lineId" :placeholder="`请选择产线`" disabled clearable filterable> | ||||
|                     <el-option v-for="opt in lineOptions" :key="opt.value" :label="opt.label" :value="opt.value" /> | ||||
|                   </el-select> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item label="计划保养人员" prop="maintainer"> | ||||
| 									<el-select | ||||
| 										v-model="form.planMaintainWorker" | ||||
| 										placeholder="请选择计划保养人员" | ||||
| 										disabled | ||||
| 										clearable | ||||
| 										filterable /> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="计划保养人员" prop="maintainer"> | ||||
|                   <el-select v-model="form.planMaintainWorker" placeholder="请选择计划保养人员" disabled clearable filterable /> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item label="计划开始时间" prop="planStartTime"> | ||||
| 									<el-date-picker | ||||
| 										v-model="form.planStartTime" | ||||
| 										type="datetime" | ||||
| 										disabled | ||||
| 										placeholder="请选择计划开始时间" | ||||
| 										value-format="timestamp"></el-date-picker> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="计划开始时间" prop="planStartTime"> | ||||
|                   <el-date-picker v-model="form.planStartTime" type="datetime" disabled placeholder="请选择计划开始时间" | ||||
|                     value-format="timestamp"></el-date-picker> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item label="计划结束时间" prop="planEndTime"> | ||||
| 									<el-date-picker | ||||
| 										v-model="form.planEndTime" | ||||
| 										type="datetime" | ||||
| 										disabled | ||||
| 										placeholder="请选择计划结束时间" | ||||
| 										value-format="timestamp"></el-date-picker> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="计划结束时间" prop="planEndTime"> | ||||
|                   <el-date-picker v-model="form.planEndTime" type="datetime" disabled placeholder="请选择计划结束时间" | ||||
|                     value-format="timestamp"></el-date-picker> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item | ||||
| 									label="实际开始时间" | ||||
| 									prop="startTime" | ||||
| 									:rules="[ | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="实际开始时间" prop="startTime" :rules="[ | ||||
| 										{ | ||||
| 											required: true, | ||||
| 											message: '请选择实际开始时间', | ||||
| 											trigger: 'blur', | ||||
| 										}, | ||||
| 									]"> | ||||
| 									<el-date-picker | ||||
| 										v-model="form.startTime" | ||||
| 										type="datetime" | ||||
| 										placeholder="请选择实际开始时间" | ||||
| 										value-format="timestamp"></el-date-picker> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
|                   <el-date-picker v-model="form.startTime" type="datetime" placeholder="请选择实际开始时间" | ||||
|                     value-format="timestamp"></el-date-picker> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item | ||||
| 									label="实际结束时间" | ||||
| 									prop="endTime" | ||||
| 									:rules="[ | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="实际结束时间" prop="endTime" :rules="[ | ||||
| 										{ | ||||
| 											required: true, | ||||
| 											message: '请选择实际结束时间', | ||||
| 											trigger: 'blur', | ||||
| 										}, | ||||
| 									]"> | ||||
| 									<el-date-picker | ||||
| 										v-model="form.endTime" | ||||
| 										type="datetime" | ||||
| 										placeholder="请选择实际结束时间" | ||||
| 										value-format="timestamp"></el-date-picker> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
|                   <el-date-picker v-model="form.endTime" type="datetime" placeholder="请选择实际结束时间" | ||||
|                     value-format="timestamp"></el-date-picker> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="8"> | ||||
| 								<el-form-item | ||||
| 									label="实际保养人员" | ||||
| 									prop="maintainWorker" | ||||
| 									:rules="[ | ||||
|               <el-col :span="8"> | ||||
|                 <el-form-item label="实际保养人员" prop="maintainWorker" :rules="[ | ||||
| 										{ | ||||
| 											required: false, | ||||
| 											message: '请选择实际保养人员', | ||||
|                       message: '请输入实际保养人员', | ||||
| 											trigger: 'blur', | ||||
| 										}, | ||||
| 									]"> | ||||
| 									<el-select | ||||
|                   <el-input v-model="form.maintainWorker" :placeholder="`请输入实际保养人员`" /> | ||||
|  | ||||
|                   <!-- <el-select | ||||
| 										v-model="form.maintainWorker" | ||||
| 										:placeholder="`请选择实际保养人员`" | ||||
| 										multiple | ||||
| @@ -187,89 +126,62 @@ | ||||
| 											:key="opt.value" | ||||
| 											:label="opt.label" | ||||
| 											:value="opt.value" /> | ||||
| 									</el-select> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
| 									</el-select> --> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|  | ||||
| 							<el-col :span="24"> | ||||
| 								<el-form-item label="备注" prop="remark"> | ||||
| 									<el-input v-model="form.remark" :placeholder="`请输入备注`" /> | ||||
| 								</el-form-item> | ||||
| 							</el-col> | ||||
| 						</el-row> | ||||
| 					</el-form> | ||||
| 				</div> | ||||
|               <el-col :span="24"> | ||||
|                 <el-form-item label="备注" prop="remark"> | ||||
|                   <el-input v-model="form.remark" :placeholder="`请输入备注`" /> | ||||
|                 </el-form-item> | ||||
|               </el-col> | ||||
|             </el-row> | ||||
|           </el-form> | ||||
|         </div> | ||||
|  | ||||
| 				<SmallTitle>保养内容</SmallTitle> | ||||
|         <SmallTitle>保养内容</SmallTitle> | ||||
|  | ||||
| 				<div style="margin-top: 12px; position: relative"> | ||||
| 					<SearchBar | ||||
| 						:formConfigs="searchBarFormConfig" | ||||
| 						ref="attr-search-bar" | ||||
| 						@headBtnClick="handleSearchBarBtnClick" /> | ||||
| 				</div> | ||||
|         <div style="margin-top: 12px; position: relative"> | ||||
|           <SearchBar :formConfigs="searchBarFormConfig" ref="attr-search-bar" @headBtnClick="handleSearchBarBtnClick" /> | ||||
|         </div> | ||||
|  | ||||
| 				<div style="margin-top: 12px; position: relative"> | ||||
| 					<div style="position: absolute; top: -40px; right: 0"> | ||||
| 						<el-button @click="handleAddAttr" type="text"> | ||||
| 							<i class="el-icon-plus"></i> | ||||
| 							添加属性 | ||||
| 						</el-button> | ||||
| 					</div> | ||||
| 					<base-table | ||||
| 						v-loading="attrListLoading" | ||||
| 						:table-props="attrTableProps" | ||||
| 						:page="attrQuery?.params.pageNo || 1" | ||||
| 						:limit="attrQuery?.params.pageSize || 10" | ||||
| 						:table-data="attrList" | ||||
| 						@emitFun="handleEmitFun"> | ||||
| 						<method-btn | ||||
| 							slot="handleBtn" | ||||
| 							label="操作" | ||||
| 							:method-list="tableBtn" | ||||
| 							@clickBtn="handleTableBtnClick" /> | ||||
| 					</base-table> | ||||
|         <div style="margin-top: 12px; position: relative"> | ||||
|           <div style="position: absolute; top: -40px; right: 0"> | ||||
|             <el-button @click="handleAddAttr" type="text"> | ||||
|               <i class="el-icon-plus"></i> | ||||
|               添加属性 | ||||
|             </el-button> | ||||
|           </div> | ||||
|           <base-table v-loading="attrListLoading" :table-props="attrTableProps" :page="attrQuery?.params.pageNo || 1" | ||||
|             :limit="attrQuery?.params.pageSize || 10" :table-data="attrList" @emitFun="handleEmitFun"> | ||||
|             <method-btn slot="handleBtn" label="操作" :method-list="tableBtn" @clickBtn="handleTableBtnClick" /> | ||||
|           </base-table> | ||||
|  | ||||
| 					<!-- 分页组件 --> | ||||
| 					<pagination | ||||
| 						v-show="attrTotal > 0" | ||||
| 						:total="attrTotal" | ||||
| 						:page.sync="attrQuery.params.pageNo" | ||||
| 						:limit.sync="attrQuery.params.pageSize" | ||||
| 						@pagination="getAttrList" /> | ||||
| 				</div> | ||||
| 			</div> | ||||
|           <!-- 分页组件 --> | ||||
|           <pagination v-show="attrTotal > 0" :total="attrTotal" :page.sync="attrQuery.params.pageNo" | ||||
|             :limit.sync="attrQuery.params.pageSize" @pagination="getAttrList" /> | ||||
|         </div> | ||||
|       </div> | ||||
|  | ||||
| 			<div class="drawer-body__footer"> | ||||
| 				<el-button style="" @click="handleCancel">取消</el-button> | ||||
| 				<el-button type="primary" @click="handleConfirm">保存</el-button> | ||||
| 				<!-- sections的第二项必须是 属性列表  --> | ||||
| 				<!-- <el-button | ||||
|       <div class="drawer-body__footer"> | ||||
|         <el-button style="" @click="handleCancel">取消</el-button> | ||||
|         <el-button type="primary" @click="handleConfirm">保存</el-button> | ||||
|         <!-- sections的第二项必须是 属性列表  --> | ||||
|         <!-- <el-button | ||||
| 						v-if="sections[1].allowAdd" | ||||
| 						type="primary" | ||||
| 						@click="handleAddAttr"> | ||||
| 						添加属性 | ||||
| 					</el-button> --> | ||||
| 			</div> | ||||
| 		</div> | ||||
|       </div> | ||||
|     </div> | ||||
|  | ||||
| 		<!-- 属性对话框 --> | ||||
| 		<base-dialog | ||||
| 			:dialogTitle="attrTitle" | ||||
| 			:dialogVisible="attrFormVisible" | ||||
| 			width="35%" | ||||
| 			:append-to-body="true" | ||||
| 			custom-class="baseDialog" | ||||
| 			@close="closeAttrForm" | ||||
| 			@cancel="closeAttrForm" | ||||
| 			@confirm="submitAttrForm"> | ||||
| 			<DialogForm | ||||
| 				v-if="attrFormVisible" | ||||
| 				ref="attrForm" | ||||
| 				v-model="attrForm" | ||||
| 				:rows="attrRows" /> | ||||
| 		</base-dialog> | ||||
| 	</el-drawer> | ||||
|     <!-- 属性对话框 --> | ||||
|     <base-dialog :dialogTitle="attrTitle" :dialogVisible="attrFormVisible" width="35%" :append-to-body="true" | ||||
|       custom-class="baseDialog" @close="closeAttrForm" @cancel="closeAttrForm" @confirm="submitAttrForm"> | ||||
|       <DialogForm v-if="attrFormVisible" ref="attrForm" v-model="attrForm" :rows="attrRows" /> | ||||
|     </base-dialog> | ||||
|   </el-drawer> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| @@ -541,7 +453,7 @@ export default { | ||||
| 			const urls = [ | ||||
| 				'/base/core-production-line/listAll', | ||||
| 				'system/dept/list-all-simple', | ||||
| 				'/base/core-worker/listAll', | ||||
| 				// '/base/core-worker/listAll', | ||||
| 			]; | ||||
| 			let res; | ||||
| 			switch (source) { | ||||
| @@ -549,10 +461,10 @@ export default { | ||||
| 					res = await this.$axios(urls[1]); | ||||
| 					this.departmentList = res.data || []; | ||||
| 					break; | ||||
| 				case 'maintainer': | ||||
| 					res = await this.$axios(urls[2]); | ||||
| 					this.maintainerList = res.data || []; | ||||
| 					break; | ||||
| 				// case 'maintainer': | ||||
| 				// 	res = await this.$axios(urls[2]); | ||||
| 				// 	this.maintainerList = res.data || []; | ||||
| 				// 	break; | ||||
| 				case 'line': | ||||
| 					res = await this.$axios(urls[0]); | ||||
| 					this.lineList = res.data || []; | ||||
|   | ||||
| @@ -105,14 +105,16 @@ | ||||
|                   <el-form-item label="实际保养人员" prop="maintainWorker" :rules="[ | ||||
|                   	{ | ||||
|                   		required: false, | ||||
|                   		message: '请选择实际保养人员', | ||||
|                       message: '请输入实际保养人员', | ||||
|                   		trigger: 'blur', | ||||
|                   	}, | ||||
|                   ]"> | ||||
|                     <el-select v-model="form.maintainWorker" :placeholder="`请选择实际保养人员`" multiple clearable filterable> | ||||
|                     <el-input v-model="form.maintainWorker" :placeholder="`请输入实际保养人员`" /> | ||||
|  | ||||
|                     <!-- <el-select v-model="form.maintainWorker" :placeholder="`请选择实际保养人员`" multiple clearable filterable> | ||||
|                       <el-option v-for="opt in maintainerOptions" :key="opt.value" :label="opt.label" | ||||
|                         :value="opt.value" /> | ||||
|                     </el-select> | ||||
|                     </el-select> --> | ||||
|                   </el-form-item> | ||||
|                 </el-col> | ||||
|  | ||||
| @@ -390,10 +392,12 @@ export default { | ||||
| 						console.log('111', confirm) | ||||
| 						this.$axios({ | ||||
| 							url: | ||||
| 								'/base/equipment-maintain-log/confirm?confirmPerson=' + | ||||
| 								this.$store.getters.userId, | ||||
| 								'/base/equipment-maintain-log/confirm', | ||||
| 								method: 'put', | ||||
| 								data: [this.form.id], | ||||
| 								data: { | ||||
| 									ids: [this.form.id], | ||||
| 									confirmBy: this.$store.getters.nickname, | ||||
| 								}, | ||||
| 						}).then(res =>{ | ||||
| 							if (res.code == 0) { | ||||
| 								this.visible = false; | ||||
| @@ -445,7 +449,7 @@ export default { | ||||
| 						method: 'put', | ||||
| 						data: { | ||||
| 							...this.form, | ||||
| 							maintainWorker: this.form.maintainWorker.join(','), | ||||
|               maintainWorker: this.form.maintainWorker ? this.form.maintainWorker.join(',') :null, | ||||
| 							special: false, | ||||
| 							relatePlan: 2 | ||||
| 						} | ||||
| @@ -463,8 +467,8 @@ export default { | ||||
| 					url: '/base/equipment-maintain-log/create', | ||||
| 					method: 'post', | ||||
| 					data: { | ||||
| 						...this.form, | ||||
| 						maintainWorker: this.form.maintainWorker.join(','), | ||||
|             ...this.form, | ||||
|             maintainWorker: this.form.maintainWorker ? this.form.maintainWorker.join(',') : null, | ||||
| 						special: false, | ||||
| 						relatePlan: 2, | ||||
| 						confirmed: false, | ||||
| @@ -536,7 +540,7 @@ export default { | ||||
| 			const urls = [ | ||||
| 				'/base/core-production-line/listAll', | ||||
| 				'/system/dept/list-all-simple', | ||||
| 				'/base/core-worker/listAll', | ||||
| 				// '/base/core-worker/listAll', | ||||
| 			]; | ||||
| 			let res; | ||||
| 			switch (source) { | ||||
| @@ -544,10 +548,10 @@ export default { | ||||
| 					res = await this.$axios(urls[1]); | ||||
| 					this.departmentList = res.data || []; | ||||
| 					break; | ||||
| 				case 'maintainer': | ||||
| 					res = await this.$axios(urls[2]); | ||||
| 					this.maintainerList = res.data || []; | ||||
| 					break; | ||||
| 				// case 'maintainer': | ||||
| 				// 	res = await this.$axios(urls[2]); | ||||
| 				// 	this.maintainerList = res.data || []; | ||||
| 				// 	break; | ||||
| 				case 'line': | ||||
| 					res = await this.$axios(urls[0]); | ||||
| 					this.lineList = res.data || []; | ||||
|   | ||||
| @@ -287,9 +287,12 @@ export default { | ||||
| 							return this.$axios({ | ||||
| 								url: '/base/equipment-maintain-log/confirm', | ||||
| 								method: 'put', | ||||
| 								data: this.$refs['waiting-list-table'].selectedPlan.map( | ||||
| 									(item) => item.id | ||||
| 								), | ||||
| 								data:{ | ||||
| 									ids: this.$refs['waiting-list-table'].selectedPlan.map( | ||||
| 										(item) => item.id | ||||
| 									), | ||||
| 									confirmBy: this.$store.getters.nickname, | ||||
| 								}, | ||||
| 							}); | ||||
| 					// if (res.code == 0) { | ||||
| 					// 	this.$message.success('确认成功'); | ||||
| @@ -313,9 +316,12 @@ export default { | ||||
|               return this.$axios({ | ||||
|                 url: '/base/equipment-maintain-log/confirm2', | ||||
|                 method: 'put', | ||||
|                 data: this.$refs['waiting-list-table'].selectedPlan.map( | ||||
|                   (item) => item.id | ||||
|                 ), | ||||
|                 data: { | ||||
| 									ids: this.$refs['waiting-list-table'].selectedPlan.map( | ||||
| 										(item) => item.id | ||||
| 									), | ||||
| 									confirmBy: this.$store.getters.nickname, | ||||
| 								}, | ||||
|               }); | ||||
|               // if (res.code == 0) { | ||||
|               // 	this.$message.success('确认成功'); | ||||
| @@ -547,7 +553,10 @@ export default { | ||||
| 					return this.$axios({ | ||||
| 						url: '/base/equipment-maintain-log/confirm', | ||||
| 						method: 'put', | ||||
| 						data: [row.id], | ||||
| 						data: { | ||||
| 									ids: [row.id], | ||||
| 									confirmBy: this.$store.getters.nickname, | ||||
| 								}, | ||||
| 					}); | ||||
| 			// if (res.code == 0) { | ||||
| 			// 	this.$message.success('确认成功'); | ||||
|   | ||||
| @@ -37,8 +37,8 @@ | ||||
|         </el-form> | ||||
|         <div class="blue-title">保养内容</div> | ||||
|         <base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData"> | ||||
|           <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn" | ||||
|             @clickBtn="handleClick" /> | ||||
|           <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn" | ||||
|             @clickBtn="handleClick" /> --> | ||||
|         </base-table> | ||||
|       </div> | ||||
|     </el-drawer> | ||||
|   | ||||
| @@ -135,7 +135,7 @@ export default { | ||||
| 				maintainDuration: undefined, | ||||
|         remark: undefined, | ||||
| 				firstMaintenanceTime: undefined, | ||||
| 				maintainer: undefined | ||||
| 				maintainer: null | ||||
| 			}, | ||||
| 			menuOptions: [], | ||||
| 			proLineList: [], | ||||
| @@ -175,8 +175,8 @@ export default { | ||||
| 			const resline = await getCorePLList(); | ||||
| 			this.proLineList = resline.data; | ||||
| 			// 保养人员 | ||||
| 			const personres = await getWorkerList() | ||||
|       this.personList = personres.data || [] | ||||
| 			// const personres = await getWorkerList() | ||||
|       // this.personList = personres.data || [] | ||||
| 		}, | ||||
| 		getList() { | ||||
| 			// 获取产品属性列表 | ||||
| @@ -259,7 +259,8 @@ export default { | ||||
|         if (this.dataForm.id) { | ||||
|           this.urlOptions.updateURL({ | ||||
| 						...this.dataForm, | ||||
| 						maintainer: this.dataForm.maintainer.join(',') | ||||
|             maintainer: this.dataForm.maintainer ? this.dataForm.maintainer.join(',') : null, | ||||
|  | ||||
| 					}).then(response => { | ||||
|             this.$modal.msgSuccess("修改成功"); | ||||
|             this.visible = false; | ||||
| @@ -270,7 +271,7 @@ export default { | ||||
|         // 添加的提交 | ||||
|         this.urlOptions.createURL({ | ||||
| 					...this.dataForm, | ||||
| 					maintainer: this.dataForm.maintainer.join(',') | ||||
|           maintainer: this.dataForm.maintainer ? this.dataForm.maintainer.join(',') : null, | ||||
| 				}).then(response => { | ||||
|           this.$modal.msgSuccess("新增成功"); | ||||
| 					// this.idAttrShow = true | ||||
|   | ||||
| @@ -37,7 +37,7 @@ | ||||
| <script> | ||||
| import { createPlanDet, updatePlanDet, getPlanDet } from '@/api/equipment/base/maintain/planconfig'; | ||||
| import { getEquipmentPage } from '@/api/base/equipment' | ||||
| import { getItemPageData } from '@/api/equipment/base/maintain/items'; | ||||
| import { getByEquId } from '@/api/equipment/base/maintain/items'; | ||||
|  | ||||
| export default { | ||||
| 	props: { | ||||
| @@ -94,20 +94,14 @@ export default { | ||||
| 			}); | ||||
|     }, | ||||
|     async handleChange(val) { | ||||
|       console.log(val); | ||||
|       let equipmentTypeId = undefined | ||||
|       this.eqList.forEach((ele) => { | ||||
|         if (ele.id == val) { | ||||
|           equipmentTypeId = ele.equipmentTypeId | ||||
|         } | ||||
|       }) | ||||
|       const { code, data } = await getItemPageData({ | ||||
|         pageNo: 1, | ||||
|         pageSize: 99, | ||||
|         equipmentTypeId: equipmentTypeId, | ||||
|       }) | ||||
|       this.programList = data.list | ||||
|       console.log(data); | ||||
|       // let equipmentTypeId = undefined | ||||
|       // this.eqList.forEach((ele) => { | ||||
|       //   if (ele.id == val) { | ||||
|       //     equipmentTypeId = ele.equipmentTypeId | ||||
|       //   } | ||||
|       // }) | ||||
|       const { code, data } = await getByEquId(val) | ||||
|       this.programList = data | ||||
|     }, | ||||
|     handleDecChange(val) { | ||||
|       let maintenanceDes = undefined | ||||
|   | ||||
| @@ -17,7 +17,7 @@ | ||||
|     <el-row :gutter="24"> | ||||
|       <el-col :span="24"> | ||||
|         <el-form-item label="默认保养结果" prop="resultType"> | ||||
|           <el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果"> | ||||
|           <el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果" @change="handleClear"> | ||||
|             <el-option v-for="dict in resultList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
| @@ -39,13 +39,16 @@ | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row v-else-if="dataForm.resultType === 2" :gutter="24"> | ||||
|       <el-col :span="12"> | ||||
|       <el-col :span="11"> | ||||
|         <el-form-item prop="minValue"> | ||||
|           <el-input oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.minValue" placeholder="请输入最小值" /> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span="12"> | ||||
|         <el-form-item prop="maxValue"> | ||||
|       <el-col :span="4"> | ||||
|        ————— | ||||
|       </el-col> | ||||
|       <el-col :span="9"> | ||||
|         <el-form-item prop="maxValue" label-width="20"> | ||||
|           <el-input @change="handleChange" oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.maxValue" | ||||
|             placeholder="请输入最大值" /> | ||||
|         </el-form-item> | ||||
| @@ -67,6 +70,12 @@ import { getList,} from "@/api/base/qualityScrapType"; | ||||
|  | ||||
| export default { | ||||
| 	mixins: [basicAdd], | ||||
|  | ||||
|   props: { | ||||
|     mainId: { | ||||
|       type: String, | ||||
|     }, | ||||
|   }, | ||||
| 	data() { | ||||
| 		return { | ||||
| 			urlOptions: { | ||||
| @@ -93,7 +102,7 @@ export default { | ||||
|         id: undefined, | ||||
|         program: undefined, | ||||
|         resultType: undefined, | ||||
|         equipmentTypeId: undefined, | ||||
|         mainId:this.mainId, | ||||
|         minValue: undefined, | ||||
|         maxValue: undefined, | ||||
|         maintainResult:undefined, | ||||
| @@ -102,7 +111,9 @@ export default { | ||||
| 			dataRule: { | ||||
| 				// materialId: [{ required: true, message: "", trigger: "blur" }], | ||||
|         program: [{ required: true, message: "保养项目不能为空", trigger: "blur" }], | ||||
|         maintainResult: [{ required: true, message: "默认保养结果不能为空", trigger: "blur" }], | ||||
|         maintainResult: [{ required: true, message: "文本或数值不能为空不能为空", trigger: "blur" }], | ||||
|         resultType: [{ required: true, message: "默认保养结果不能为空", trigger: "blur" }], | ||||
|  | ||||
|         minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }], | ||||
|         maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }], | ||||
|  | ||||
| @@ -112,9 +123,13 @@ export default { | ||||
| 	}, | ||||
| 	mounted() { | ||||
| 		this.getDict() | ||||
| 		console.log('我看看', this.dataForm) | ||||
| 	}, | ||||
| 	methods: { | ||||
|   methods: { | ||||
|     handleClear() { | ||||
|       this.dataForm.minValue = undefined | ||||
|       this.dataForm.maxValue = undefined | ||||
|       this.dataForm.maintainResult = undefined | ||||
|     }, | ||||
| 		async getDict() { | ||||
| 			// 物料列表 | ||||
|       const res = await getList(); | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* | ||||
|  * @Author: zwq | ||||
|  * @Date: 2022-08-24 11:19:43 | ||||
|  * @LastEditors: zhp | ||||
|  * @LastEditTime: 2024-07-19 14:47:02 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-12-13 15:50:49 | ||||
|  * @Description: | ||||
|  */ | ||||
| export default { | ||||
| @@ -28,10 +28,8 @@ export default { | ||||
|   activated() { | ||||
|   }, | ||||
|   methods: { | ||||
|     init(obj) { | ||||
|       console.log(obj); | ||||
|       this.dataForm.id = obj.id || ""; | ||||
|       this.dataForm.equipmentTypeId = obj.equipmentTypeId || ""; | ||||
|     init(id) { | ||||
|       this.dataForm.id = id || ""; | ||||
|       this.visible = true; | ||||
|       if (this.urlOptions.getOption) { | ||||
|         this.getArr() | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-07-19 09:49:22 | ||||
|  * @LastEditTime: 2024-07-22 09:17:31 | ||||
|  * @LastEditors: zhp | ||||
|  * @LastEditTime: 2024-12-13 15:52:24 | ||||
|  * @LastEditors: zwq | ||||
|  * @Description: | ||||
|  */ | ||||
| export default { | ||||
| @@ -88,12 +88,8 @@ export default { | ||||
|       if (val.type === "edit") { | ||||
|         this.addOrUpdateVisible = true; | ||||
|         this.addOrEditTitle = "编辑" | ||||
|         let obj = { | ||||
|           id: val.data.id, | ||||
|           equipmentTypeId:val.data.equipmentTypeId | ||||
|         } | ||||
|         this.$nextTick(() => { | ||||
|           this.$refs.addOrUpdate.init(obj); | ||||
|           this.$refs.addOrUpdate.init(val.data.id); | ||||
|         }); | ||||
|       } else if (val.type === "delete") { | ||||
|         this.deleteHandle(val.data.id, val.data.program, val.data._pageIndex) | ||||
|   | ||||
| @@ -186,7 +186,7 @@ export default { | ||||
|     handleDetail(row) { | ||||
|       this.showDetailVisible = true | ||||
|       this.$nextTick(() => { | ||||
|         this.$refs.showDetail.init(row.equipmentTypeId) | ||||
|         this.$refs.showDetail.init(row.id) | ||||
|       }) | ||||
| 				// alert('跳转到 保养记录') | ||||
| 				// console.log(row) | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-07-12 13:28:21 | ||||
|  * @LastEditTime: 2024-07-23 14:00:38 | ||||
|  * @LastEditors: zhp | ||||
|  * @LastEditTime: 2024-12-13 16:03:29 | ||||
|  * @LastEditors: zwq | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| @@ -22,7 +22,7 @@ | ||||
|     </el-drawer> | ||||
|     <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel" | ||||
|       @confirm="handleConfirm" :before-close="handleCancel" width="30%"> | ||||
|       <add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update> | ||||
|       <add-or-update ref="addOrUpdate" @refreshDataList="successSubmit" :main-id="queryParams.mainId"></add-or-update> | ||||
|     </base-dialog> | ||||
|   </div> | ||||
|  | ||||
| @@ -74,7 +74,7 @@ export default { | ||||
|         queryParams: { | ||||
|           pageNo:1, | ||||
|           pageSize:10, | ||||
|           equipmentTypeId:null, | ||||
|           mainId:null, | ||||
|         }, | ||||
|         tableProps, | ||||
|         basePath: 'base/equipment-maintain-program', | ||||
| @@ -105,21 +105,18 @@ export default { | ||||
|     }, | ||||
|     getDataList(id) { | ||||
|       this.dataListLoading = true; | ||||
|       this.queryParams.equipmentTypeId = id | ||||
|       this.urlOptions.getDataListURL(this.listQuery).then(response => { | ||||
|       this.queryParams.mainId = id | ||||
|       this.urlOptions.getDataListURL(this.queryParams).then(response => { | ||||
|         this.tableData = response.data.list; | ||||
|         this.listQuery.total = response.data.total; | ||||
|         this.queryParams.total = response.data.total; | ||||
|         this.dataListLoading = false | ||||
|       }); | ||||
|     }, | ||||
|     handleAdd() { | ||||
|       this.addOrUpdateVisible = true | ||||
|       this.addOrEditTitle = '新增' | ||||
|       let obj = { | ||||
|         equipmentTypeId: this.queryParams.equipmentTypeId | ||||
|       } | ||||
|       this.$nextTick(() => { | ||||
|         this.$refs.addOrUpdate.init(obj) | ||||
|         this.$refs.addOrUpdate.init() | ||||
|       }); | ||||
|     }, | ||||
|     init(id) { | ||||
|   | ||||
| @@ -223,15 +223,13 @@ export default { | ||||
| 	}, | ||||
| 	methods: { | ||||
| 		initSearchBar() { | ||||
| 			this.http('/base/core-equipment/page', 'get', { | ||||
| 				special: false, | ||||
| 				pageNo: 1, | ||||
| 				pageSize: 999, | ||||
| 			}).then(({ data }) => { | ||||
|       this.http('/base/core-equipment/listAll', 'get').then(({ data }) => { | ||||
|         console.log('data', data); | ||||
|  | ||||
| 				this.$set( | ||||
| 					this.searchBarFormConfig[0], | ||||
| 					'selectOptions', | ||||
| 					(data?.list || []).map((item) => ({ | ||||
| 					(data || []).map((item) => ({ | ||||
| 						name: item.name, | ||||
| 						id: item.id, | ||||
| 					})) | ||||
|   | ||||
| @@ -184,16 +184,17 @@ export default { | ||||
| 				], | ||||
| 				[ | ||||
| 					{ | ||||
| 						select: true, // TODO: or INPUT instead of SELECT | ||||
|             input: true, // TODO: or INPUT instead of SELECT | ||||
| 						label: '负责人', | ||||
| 						prop: 'responsible', | ||||
| 						url: '/base/core-worker/listAll', // TODO: 班组 | ||||
| 						valueKey: 'name', | ||||
| 						bind: { | ||||
| 							filterable: true, | ||||
| 							clearable: true, | ||||
| 							multiple: true | ||||
| 						}, | ||||
|             // url: 'system/user/page', // TODO: 班组 | ||||
|             // valueKey: 'id', | ||||
|             // labelKey:'username', | ||||
| 						// bind: { | ||||
| 						// 	filterable: true, | ||||
| 						// 	clearable: true, | ||||
| 						// 	multiple: true | ||||
| 						// }, | ||||
| 					}, | ||||
| 				], | ||||
| 				[ | ||||
| @@ -288,7 +289,7 @@ export default { | ||||
| 			const id = row.id; | ||||
| 			this.info({ id }).then((response) => { | ||||
| 				this.form = response.data; | ||||
| 				this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined | ||||
| 				// this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined | ||||
| 				this.open = true; | ||||
| 				this.title = '修改备品备件配置'; | ||||
| 			}); | ||||
| @@ -299,7 +300,7 @@ export default { | ||||
| 				if (!valid) { | ||||
| 					return; | ||||
| 				} | ||||
| 				this.form.responsible = this.form.responsible.join(',') | ||||
| 				// this.form.responsible = this.form.responsible.join(',')/ | ||||
| 				// 修改的提交 | ||||
| 				if (this.form.id != null) { | ||||
| 					this.put(this.form).then((response) => { | ||||
|   | ||||
| @@ -135,7 +135,8 @@ export default { | ||||
| 					{ | ||||
| 						select: true, | ||||
| 						label: '备件名称', | ||||
| 						prop: 'productMaterialId', | ||||
|             prop: 'productMaterialId', | ||||
|             // url: '/base/core-product-material/listAll', // TODO: 供应商 | ||||
| 						options: [], | ||||
| 						bind: { | ||||
| 							filterable: true, | ||||
| @@ -403,19 +404,19 @@ export default { | ||||
| 				.catch(() => {}); | ||||
| 		}, | ||||
| 		async getDict() { | ||||
| 			const materRes = await getMaterialTree(); // | ||||
| 			let typeId = materRes.data.find((item) => item.product === 2).id; | ||||
| 			const listQuery = { | ||||
| 				typeId: typeId, | ||||
| 			}; | ||||
| 			const materData = await getMaterialList(listQuery); | ||||
| 			this.rows[0][0].options = (materData.data || []).map((item) => ({ | ||||
| 				label: item.name, | ||||
| 				value: item.id, | ||||
|         ...item | ||||
| 			})); | ||||
| 			// const materRes = await getMaterialTree(); | ||||
| 			// let typeId = materRes.data.find((item) => item.product === 2); | ||||
| 			// const listQuery = { | ||||
| 			// 	typeId: typeId, | ||||
| 			// }; | ||||
| 			const materData = await getMaterialList(); | ||||
|       this.rows[0][0].options = (materData.data || []).filter(item => item.typeId === 3) | ||||
|         .map(item => ({ label: item.name, value: item.id,...item })) | ||||
|       console.log(this.rows[0][0].options); | ||||
|  | ||||
| 		}, | ||||
| 		updateDialogFormZ(val) { | ||||
|     updateDialogFormZ(val) { | ||||
|       // console.log(this.rows[0][0].options) | ||||
| 			const selectData = this.rows[0][0].options.find( | ||||
| 				(item) => item.id === val.productMaterialId | ||||
| 			); | ||||
|   | ||||
| @@ -61,9 +61,9 @@ function getTodayStart(today) { | ||||
|  | ||||
| /** 颜色配置 */ | ||||
| const types = [ | ||||
|     { name: '运行', color: '#288AFF' }, | ||||
|     { name: '故障', color: '#FC9C91' }, | ||||
|      { name: '运行', color: '#288AFF' }, | ||||
|     { name: '计划停机', color: '#FFDC94' }, | ||||
|     { name: '故障', color: '#FC9C91' }, | ||||
|     { name: '空白', color: '#F2F4F9' }, | ||||
| ]; | ||||
|  | ||||
| @@ -86,7 +86,7 @@ export default class GanttGraph { | ||||
|                         <span class="eq-name" style="margin-left: 4px;">${params.seriesName}</span> | ||||
|                     </div> | ||||
|                     <span class="run-status" style="margin-left: 8px; opacity: 0.6">${params.name}</span> | ||||
|             </div>             | ||||
|             </div> | ||||
|             ` | ||||
|         } | ||||
|     } | ||||
| @@ -251,7 +251,7 @@ export default class GanttGraph { | ||||
|                     y: 0, | ||||
|                 }, | ||||
|                 data: arr.map(item => ({ | ||||
|                     name: ['运行', '故障', '计划停机'][item.status], | ||||
|                     name: ['运行', '计划停机', '故障'][item.status], | ||||
|                     value: [0, item.startTime, item.startTime + item.duration * 60 * 1000, 0], | ||||
|                     itemStyle: { | ||||
|                         color: types[item.status].color, | ||||
| @@ -325,4 +325,4 @@ export default class GanttGraph { | ||||
|         console.log(JSON.stringify(this.option, null, 2)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -6,29 +6,19 @@ | ||||
| --> | ||||
|  | ||||
| <template> | ||||
| 	<div | ||||
| 		class="status-timegraph-container" | ||||
| 		style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column"> | ||||
| 		<el-row | ||||
| 			class="" | ||||
| 			style=" | ||||
|   <div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column"> | ||||
|     <el-row class="" style=" | ||||
| 				margin-bottom: 12px; | ||||
| 				background: #fff; | ||||
| 				padding: 16px 16px 0; | ||||
| 				border-radius: 8px; | ||||
| 			"> | ||||
| 			<div class="blue-title">生产节拍时序图</div> | ||||
| 			<SearchBar | ||||
| 				:formConfigs="searchBarFormConfig" | ||||
| 				ref="search-bar" | ||||
| 				:remove-blue="true" | ||||
| 				@select-changed="handleSearchBarSelectChange" | ||||
| 				@headBtnClick="handleSearchBarBtnClick" /> | ||||
| 		</el-row> | ||||
|       <div class="blue-title">生产节拍时序图</div> | ||||
|       <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" :remove-blue="true" | ||||
|         @select-changed="handleSearchBarSelectChange" @headBtnClick="handleSearchBarBtnClick" /> | ||||
|     </el-row> | ||||
|  | ||||
| 		<el-row | ||||
| 			class="" | ||||
| 			style=" | ||||
|     <el-row class="" style=" | ||||
| 				height: 1px; | ||||
| 				flex: 1; | ||||
| 				margin-bottom: 12px; | ||||
| @@ -38,60 +28,40 @@ | ||||
| 				display: flex; | ||||
| 				flex-direction: column; | ||||
| 			"> | ||||
| 			<el-row :gutter="20"> | ||||
| 				<el-col :span="6"> | ||||
| 					<div class="blue-title">设备状态时序图</div> | ||||
| 				</el-col> | ||||
| 				<el-col :span="18" class="legend-row"> | ||||
| 					<div class="legend"> | ||||
| 						<div class="icon running"></div> | ||||
| 						<div>运行中</div> | ||||
| 					</div> | ||||
| 					<div class="legend"> | ||||
| 						<div class="icon fault"></div> | ||||
| 						<div>故障</div> | ||||
| 					</div> | ||||
| 					<div class="legend"> | ||||
| 						<div class="icon stop"></div> | ||||
| 						<div>计划停机</div> | ||||
| 					</div> | ||||
| 				</el-col> | ||||
| 			</el-row> | ||||
| 			<div | ||||
| 				class="main-area" | ||||
| 				style="flex: 1; display: flex; flex-direction: column"> | ||||
| 				<div | ||||
| 					class="graphs" | ||||
| 					v-show="graphList.length" | ||||
| 					id="status-chart" | ||||
| 					style="height: 1px; flex: 1"></div> | ||||
| 				<h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2> | ||||
| 			</div> | ||||
| 		</el-row> | ||||
|       <el-row :gutter="20"> | ||||
|         <el-col :span="6"> | ||||
|           <div class="blue-title">设备状态时序图</div> | ||||
|         </el-col> | ||||
|         <el-col :span="18" class="legend-row"> | ||||
|           <div class="legend"> | ||||
|             <div class="icon running"></div> | ||||
|             <div>运行中</div> | ||||
|           </div> | ||||
|           <div class="legend"> | ||||
|             <div class="icon stop"></div> | ||||
|             <div>计划停机</div> | ||||
|           </div> | ||||
|           <div class="legend"> | ||||
|             <div class="icon fault"></div> | ||||
|             <div>故障</div> | ||||
|           </div> | ||||
|         </el-col> | ||||
|       </el-row> | ||||
|       <div class="main-area" style="flex: 1; display: flex; flex-direction: column"> | ||||
|         <div class="graphs" v-show="graphList.length" id="status-chart" style="height: 1px; flex: 1"></div> | ||||
|         <h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2> | ||||
|       </div> | ||||
|     </el-row> | ||||
|  | ||||
| 		<!-- 对话框(添加 / 修改) --> | ||||
| 		<base-dialog | ||||
| 			dialogTitle="添加设备" | ||||
| 			:dialogVisible="open" | ||||
| 			width="500px" | ||||
| 			@close="open = false" | ||||
| 			@cancel="open = false" | ||||
| 			@confirm="submitForm"> | ||||
| 			<el-select | ||||
| 				v-if="open" | ||||
| 				style="width: 100%" | ||||
| 				filterable | ||||
| 				clearable | ||||
| 				v-model="queryParams.equipmentId" | ||||
| 				placeholder="请选择一个设备"> | ||||
| 				<el-option | ||||
| 					v-for="eq in eqList" | ||||
| 					:key="eq.id" | ||||
| 					:value="eq.id" | ||||
| 					:label="eq.name"></el-option> | ||||
| 			</el-select> | ||||
| 		</base-dialog> | ||||
| 	</div> | ||||
|     <!-- 对话框(添加 / 修改) --> | ||||
|     <base-dialog dialogTitle="添加设备" :dialogVisible="open" width="500px" @close="open = false" @cancel="open = false" | ||||
|       @confirm="submitForm"> | ||||
|       <el-select v-if="open" style="width: 100%" filterable clearable v-model="queryParams.equipmentId" | ||||
|         placeholder="请选择一个设备"> | ||||
|         <el-option v-for="eq in eqList" :key="eq.id" :value="eq.id" :label="eq.name"></el-option> | ||||
|       </el-select> | ||||
|     </base-dialog> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| @@ -103,12 +73,6 @@ export default { | ||||
| 	components: {}, | ||||
| 	props: {}, | ||||
| 	data() { | ||||
| 		const today = new Date(); | ||||
| 		const todayStart = new Date( | ||||
| 			today.getFullYear(), | ||||
| 			today.getMonth(), | ||||
| 			today.getDate() | ||||
| 		); | ||||
| 		return { | ||||
| 			chart: null, | ||||
| 			searchBarFormConfig: [ | ||||
| @@ -138,7 +102,7 @@ export default { | ||||
| 					placeholder: '选择日期', | ||||
| 					param: 'recordTime', | ||||
| 					required: true, | ||||
| 					defaultSelect: moment(todayStart).format('YYYY-MM-DD HH:mm:ss'), | ||||
| 					defaultSelect:null, | ||||
| 				}, | ||||
| 				{ | ||||
| 					type: 'button', | ||||
| @@ -191,14 +155,24 @@ export default { | ||||
| 			// ], | ||||
| 		}; | ||||
| 	}, | ||||
| 	computed: {}, | ||||
| 	created() { | ||||
| 		this.initProductline(); | ||||
| 		this.initWorksection(); | ||||
| 		this.initEquipment(); | ||||
|   computed: {}, | ||||
|   created () { | ||||
|     this.initProductline(); | ||||
|     this.initWorksection(); | ||||
|     this.initEquipment(); | ||||
|   }, | ||||
|   mounted() { | ||||
|     const today = new Date(); | ||||
|     const todayStart = new Date( | ||||
|       today.getFullYear(), | ||||
|       today.getMonth(), | ||||
|       today.getDate() | ||||
|     ); | ||||
|     this.searchBarFormConfig[2].defaultSelect = moment(todayStart).format('YYYY-MM-DD HH:mm:ss') | ||||
|     console.log('111111', this.searchBarFormConfig[2].defaultSelect) | ||||
| 		// this.getList(); | ||||
| 	}, | ||||
| 	mounted() {}, | ||||
| 	// mounted() {}, | ||||
| 	watch: { | ||||
| 		graphList: { | ||||
| 			handler(val) { | ||||
| @@ -246,7 +220,7 @@ export default { | ||||
| 			}); | ||||
| 		}, | ||||
|  | ||||
| 		async getList() { | ||||
|     async getList() { | ||||
| 			const { code, data } = await this.$axios({ | ||||
| 				url: '/monitoring/equipment-monitor/status-series', | ||||
| 				method: 'get', | ||||
| @@ -312,7 +286,7 @@ export default { | ||||
| 			if (!value) { | ||||
| 				this.searchBarFormConfig[1].selectOptions = []; | ||||
| 				return; | ||||
| 			} | ||||
|       } | ||||
| 			switch (param) { | ||||
| 				case 'lineId': | ||||
| 					this.$axios({ | ||||
| @@ -322,7 +296,8 @@ export default { | ||||
| 							id: value, | ||||
| 						}, | ||||
| 					}).then(({ code, data }) => { | ||||
| 						if (code == 0) { | ||||
|             if (code == 0) { | ||||
|               this.searchBarFormConfig[2].defaultSelect = null | ||||
| 							this.searchBarFormConfig[1].selectOptions = data.map((item) => { | ||||
| 								return { | ||||
| 									name: item.name, | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| <!--  | ||||
| <!-- | ||||
|     filename: index.vue | ||||
|     author: liubin | ||||
|     date: 2023-10-19 10:03:42 | ||||
|     description:  | ||||
|     description: | ||||
| --> | ||||
|  | ||||
| <template> | ||||
| @@ -189,7 +189,7 @@ export default { | ||||
| 						input: true, | ||||
| 						label: '工艺编码', | ||||
| 						prop: 'code', | ||||
| 						// url: '/base/core-equipment/getCode', | ||||
| 						url: '/extend/process-flow/getCode', | ||||
| 					}, | ||||
| 				], | ||||
| 				[ | ||||
|   | ||||
| @@ -76,10 +76,10 @@ const tableProps = [ | ||||
| 		label: '班次状态', | ||||
| 		subcomponent: StatusBtn, | ||||
| 	}, | ||||
| 	{ | ||||
| 		prop: 'remark', | ||||
| 		label: '备注', | ||||
| 	}, | ||||
| 	// { | ||||
| 	// 	prop: 'remark', | ||||
| 	// 	label: '备注', | ||||
| 	// }, | ||||
| ]; | ||||
| export default { | ||||
| 	name: 'GroupClass', | ||||
|   | ||||
| @@ -82,7 +82,7 @@ | ||||
| 						</div> | ||||
| 						<!-- 班次班组 --> | ||||
| 						<!-- class有两个样式,一个是类似class1,还有个是选中红框显示 --> | ||||
| 						<el-row | ||||
| 						<!-- <el-row | ||||
| 							:gutter="2" | ||||
| 							:class=" | ||||
| 								'class' + | ||||
| @@ -92,6 +92,14 @@ | ||||
| 									: '') | ||||
| 							" | ||||
| 							v-for="(item, index) in list[Number(data.day.split('-')[2])]" | ||||
| 							:key="index"> --> | ||||
| 						<el-row | ||||
| 							:gutter="2" | ||||
| 							:class=" | ||||
| 								'class' + | ||||
| 								(index + 1) | ||||
| 							" | ||||
| 							v-for="(item, index) in list[Number(data.day.split('-')[2])]" | ||||
| 							:key="index"> | ||||
| 							<el-col :span="12"> | ||||
| 								<div class="selectDiv"> | ||||
| @@ -141,6 +149,9 @@ | ||||
| 							</el-col> | ||||
| 						</el-row> | ||||
| 					</div> | ||||
| 					<div v-else style='font-size: 20px;font-weight: 500;text-align: right;'> | ||||
| 						{{ Number(data.day.split('-')[2]) }} | ||||
| 					</div> | ||||
| 				</template> | ||||
| 			</el-calendar> | ||||
| 		</div> | ||||
| @@ -277,7 +288,7 @@ export default { | ||||
| 			if ( | ||||
| 				moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM') | ||||
| 			) { | ||||
| 				num = Number(moment().format('DD')); | ||||
| 				num = Number(moment().format('DD'))-1; | ||||
| 			} else { | ||||
| 				num = 0; | ||||
| 			} | ||||
|   | ||||
| @@ -211,6 +211,9 @@ export default { | ||||
| 										this.$modal.msgSuccess('操作成功'); | ||||
| 										this.$emit('successSubmit'); | ||||
| 									}); | ||||
| 								}else{ | ||||
| 									this.$modal.msgSuccess('操作成功'); | ||||
| 									this.$emit('successSubmit'); | ||||
| 								} | ||||
| 							} | ||||
| 						}); | ||||
| @@ -226,6 +229,9 @@ export default { | ||||
| 										this.$modal.msgSuccess('操作成功'); | ||||
| 										this.$emit('successSubmit'); | ||||
| 									}); | ||||
| 								}else{ | ||||
| 									this.$modal.msgSuccess('操作成功'); | ||||
| 									this.$emit('successSubmit'); | ||||
| 								} | ||||
| 							} | ||||
| 						}); | ||||
|   | ||||
| @@ -176,8 +176,10 @@ export default { | ||||
| 				if (res.code === 0 && res.data.list && res.data.list.length > 0) { | ||||
|           res.data.list.forEach(item => { | ||||
|             if(item.isProduction){ | ||||
|               item.str = item.strList?item.strList.join(','):'-' | ||||
|             } | ||||
|               item.str = item.strList?item.strList.join(','):'-' | ||||
|             }else{ | ||||
| 							item.str = '-' | ||||
| 						} | ||||
|           }); | ||||
| 					this.list = res.data.list; | ||||
| 					this.total = res.data.total; | ||||
|   | ||||
| @@ -125,13 +125,15 @@ export default { | ||||
| 			addButtonShow: '', | ||||
| 			planArr: [], //排班计划数组 | ||||
| 			rules: { | ||||
| 				name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }], | ||||
| 				startDay: [ | ||||
| 					{ required: true, message: '请选择排班开始时间', trigger: 'change' }, | ||||
| 				], | ||||
| 				endDay: [ | ||||
| 					{ required: true, message: '请选择排班结束时间', trigger: 'change' }, | ||||
| 				], | ||||
| 				planId:[ | ||||
| 					{ required: true, message: '请选择排班计划', trigger: 'change' }, | ||||
| 				] | ||||
| 			}, | ||||
| 		}; | ||||
| 	}, | ||||
| @@ -231,6 +233,10 @@ export default { | ||||
| 							}; | ||||
| 							list.push(obj); | ||||
| 						}); | ||||
| 						if (list.length === 0) { | ||||
| 							this.$modal.msgError('班组上班顺序不能为空'); | ||||
| 							return false; | ||||
| 						} | ||||
| 						this.form.list = list; | ||||
| 						updateGroupRule({ ...this.form }).then((res) => { | ||||
| 							this.$modal.msgSuccess('操作成功'); | ||||
| @@ -246,6 +252,10 @@ export default { | ||||
| 							}; | ||||
| 							list.push(obj); | ||||
| 						}); | ||||
| 						if (list.length === 0) { | ||||
| 							this.$modal.msgError('班组上班顺序不能为空'); | ||||
| 							return false; | ||||
| 						} | ||||
| 						this.form.list = list; | ||||
| 						createGroupRule({ ...this.form }).then((res) => { | ||||
| 							this.$modal.msgSuccess('操作成功'); | ||||
| @@ -268,13 +278,8 @@ export default { | ||||
| 	margin-bottom: 5px; | ||||
| } | ||||
| .min-title::before { | ||||
| 	content: ''; | ||||
| 	display: inline-block; | ||||
| 	vertical-align: middle; | ||||
| 	width: 6px; | ||||
| 	height: 6px; | ||||
| 	border-radius: 50%; | ||||
| 	margin: auto 5px; | ||||
| 	background-color: #0b58ff; | ||||
| 	content: "*"; | ||||
| 	color: #ff5454; | ||||
| 	margin-right: 4px; | ||||
| } | ||||
| </style> | ||||
|   | ||||
| @@ -44,7 +44,9 @@ import { | ||||
| 	deleteGroupRule, | ||||
| 	updateGroupRule, | ||||
| 	getGroupRule, | ||||
| 	disableGroupRule | ||||
| } from '@/api/base/groupSchedulingRule'; | ||||
| import { groupClassesListAll } from '@/api/monitoring/teamProduction'; | ||||
| import schedulingRuleConfigAdd from './components/schedulingRuleConfigAdd.vue'; | ||||
| import { formatDate } from '@/utils'; | ||||
| import tableHeightMixin from '@/mixins/tableHeightMixin'; | ||||
| @@ -76,11 +78,13 @@ export default { | ||||
| 	data() { | ||||
| 		return { | ||||
| 			formConfig: [ | ||||
| 				{ | ||||
| 					type: 'input', | ||||
| 			{ | ||||
| 					type: 'select', | ||||
| 					label: '班次', | ||||
| 					placeholder: '班次', | ||||
| 					param: 'name', | ||||
| 					selectOptions: [], | ||||
| 					param: 'id', | ||||
| 					defaultSelect: '', | ||||
| 					filterable: true, | ||||
| 				}, | ||||
| 				{ | ||||
| 					type: 'button', | ||||
| @@ -154,19 +158,35 @@ export default { | ||||
| 			queryParams: { | ||||
| 				pageNo: 1, | ||||
| 				pageSize: 20, | ||||
| 				name: null, | ||||
| 				id: null, | ||||
| 			}, | ||||
| 			classNameList:[] | ||||
| 		}; | ||||
| 	}, | ||||
| 	created() { | ||||
| 		this.getClassNameList(); | ||||
| 		this.getList(); | ||||
| 	}, | ||||
| 	methods: { | ||||
| 		getClassNameList() { | ||||
| 		  groupClassesListAll().then((res) => { | ||||
| 				this.formConfig[0].selectOptions = res.data; | ||||
| 				this.classNameList = res.data; | ||||
| 		  }) | ||||
| 		}, | ||||
| 		buttonClick(val) { | ||||
| 			switch (val.btnName) { | ||||
| 				case 'search': | ||||
| 					this.queryParams.pageNo = 1; | ||||
| 					this.queryParams.classesName = val.name || undefined; | ||||
| 					if (val.id) { | ||||
| 						this.classNameList.map((item) => { | ||||
| 							if (val.id === item.id) { | ||||
| 								this.queryParams.classesName = item.name | ||||
| 							} | ||||
| 						}) | ||||
| 					}else{ | ||||
| 						this.queryParams.classesName = '' | ||||
| 					} | ||||
| 					this.getList(); | ||||
| 					break; | ||||
| 				default: | ||||
| @@ -186,7 +206,7 @@ export default { | ||||
| 							formatDate(item.startDay) + | ||||
| 							'至' + | ||||
| 							(item.endDay ? formatDate(item.endDay) : '永久'); | ||||
| 						item.str = item.strList.join(','); | ||||
| 						item.str = item.strList.join(','); | ||||
| 					}); | ||||
| 					this.list = res.data.list; | ||||
| 					this.total = res.data.total; | ||||
| @@ -231,14 +251,9 @@ export default { | ||||
| 						'是否确认作废序号为"' + row.planName + '"的数据项?' | ||||
| 					,'提示') | ||||
| 				.then(() => { | ||||
| 					getGroupRule(row.id).then((response) => { | ||||
| 						let datas = response.data; | ||||
| 						datas.list = datas.sequenceList; | ||||
| 						datas.enabled = 0; | ||||
| 						updateGroupRule(datas).then(() => { | ||||
| 					disableGroupRule(row.id).then((response) => { | ||||
| 							_this.getList(); | ||||
| 							_this.$modal.msgSuccess('操作成功'); | ||||
| 						}); | ||||
| 					}); | ||||
| 				}) | ||||
| 				.catch(() => {}); | ||||
|   | ||||
| @@ -13,6 +13,8 @@ | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <base-table | ||||
|           :page="1" | ||||
|           :limit="5000" | ||||
|           :table-props="tableProps" | ||||
|           :table-data="tableData" | ||||
|           :max-height="tableH" | ||||
| @@ -43,7 +45,7 @@ const tableProps = [ | ||||
|   }, | ||||
|   { | ||||
|     prop: 'workTime', | ||||
|     label: '工作时长' | ||||
|     label: '工作时长(h)' | ||||
|   } | ||||
| ] | ||||
| export default { | ||||
|   | ||||
| @@ -62,7 +62,8 @@ export default { | ||||
|           selectOptions: [], | ||||
|           param: 'workOrderId', | ||||
|           clearable: false, | ||||
|           filterable: true | ||||
|           filterable: true, | ||||
|           required: true | ||||
|         }, | ||||
|         { | ||||
|           type: 'button', | ||||
|   | ||||
| @@ -18,7 +18,7 @@ | ||||
|         v-if="tableBtn.length" | ||||
|         slot="handleBtn" | ||||
|         :width="80" | ||||
|         label="操作" | ||||
|         label="生产情况" | ||||
|         :method-list="tableBtn" | ||||
|         @clickBtn="handleClick" | ||||
|       /> | ||||
| @@ -38,6 +38,7 @@ import { groupTeamSchedulingPage, groupClassesListAll } from '@/api/monitoring/t | ||||
| import { parseTime } from '@/utils/ruoyi' | ||||
| import TeamProductionDetail from './components/teamProductionDetail' | ||||
| import tableHeightMixin from '@/mixins/tableHeightMixin'; | ||||
| import moment from 'moment' | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: 'createTime', | ||||
| @@ -53,14 +54,12 @@ const tableProps = [ | ||||
|   { | ||||
|     prop: 'startTime', | ||||
|     label: '上班时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|     filter: (val) => moment(val).format('HH:mm') | ||||
|   }, | ||||
|   { | ||||
|     prop: 'endTime', | ||||
|     label: '下班时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|     filter: (val) => moment(val).format('HH:mm') | ||||
|   }, | ||||
|   { | ||||
|     prop: 'classesName', | ||||
| @@ -70,7 +69,8 @@ const tableProps = [ | ||||
|   { | ||||
|     prop: 'teamName', | ||||
|     label: '班组名称', | ||||
|     showOverflowtooltip: true | ||||
|     showOverflowtooltip: true, | ||||
|     minWidth: 100 | ||||
|   } | ||||
| ] | ||||
| export default { | ||||
| @@ -122,8 +122,8 @@ export default { | ||||
|       tableBtn: [ | ||||
|       this.$auth.hasPermi('base:team-production:detail') | ||||
|           ? { | ||||
|               type: 'detail', | ||||
|               btnName: '详情' | ||||
|               type: 'prodDetail', | ||||
|               btnName: '查看' | ||||
|             } | ||||
|           : undefined | ||||
|       ].filter((v) => v), | ||||
|   | ||||
| @@ -176,7 +176,6 @@ import { | ||||
| } from "@/utils/constants"; | ||||
| import { getSpuSimpleList } from "@/api/mall/product/spu"; | ||||
| import { parseTime } from "@/utils/ruoyi"; | ||||
| import {changeRoleStatus} from "@/api/system/role"; | ||||
|  | ||||
| export default { | ||||
|   name: "PromotionCouponTemplate", | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: zwq | ||||
|  * @Date: 2021-11-18 14:16:25 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-08-14 15:24:11 | ||||
|  * @LastEditTime: 2024-12-12 09:54:25 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| @@ -83,7 +83,7 @@ | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="8" v-if="showTime"> | ||||
| 				<el-form-item label="生产单位用时" prop="processTime"> | ||||
| 				<el-form-item label="生产单位用时(s)" prop="processTime"> | ||||
| 					<el-input | ||||
| 						v-model.number="dataForm.processTime" | ||||
| 						type="number" | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: zwq | ||||
|  * @Date: 2024-07-01 14:54:06 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-08-21 11:19:51 | ||||
|  * @LastEditTime: 2024-12-16 10:03:30 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| @@ -346,6 +346,7 @@ export default { | ||||
| 			this.listQuery.typeId = data.id || undefined; | ||||
| 			this.listQuery.product = data.product; | ||||
| 			this.$refs.searchBarForm.formInline.type = data.name || undefined; | ||||
|       this.getDataList() | ||||
| 		}, | ||||
| 		// 新增节点 | ||||
| 		append(data) { | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: zwq | ||||
|  * @Date: 2021-11-18 14:16:25 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-10-14 09:26:53 | ||||
|  * @LastEditTime: 2024-12-12 16:13:11 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| @@ -41,18 +41,19 @@ | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="8"> | ||||
| 				<el-form-item label="物料批次" prop="materialDateId"> | ||||
| 				<el-form-item label="物料批次" prop="materialDate"> | ||||
| 					<el-select | ||||
| 						v-model="dataForm.materialDateId" | ||||
| 						v-model="dataForm.materialDate" | ||||
| 						clearable | ||||
| 						filterable | ||||
| 						allow-create | ||||
| 						placeholder="请选择物料批次" | ||||
| 						style="width: 100%"> | ||||
| 						<el-option | ||||
| 							v-for="dict in materialDateList" | ||||
| 							:key="dict.id" | ||||
| 							:label="dict.code" | ||||
| 							:value="dict.id" /> | ||||
| 							:value="dict.code" /> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| @@ -147,7 +148,7 @@ import { | ||||
| 	getMaterialLog, | ||||
| 	getEqListAll, | ||||
| } from '@/api/base/materialUseLog'; | ||||
| import { getMaterialTree,getMaterialList } from '@/api/base/material'; | ||||
| import { getMaterialTree, getMaterialList } from '@/api/base/material'; | ||||
| import { getMaterDateList } from '@/api/base/materialDate'; | ||||
| import { listSimpleUsers } from '@/api/system/user'; | ||||
|  | ||||
| @@ -164,7 +165,7 @@ export default { | ||||
| 				id: undefined, | ||||
| 				materialId: undefined, | ||||
| 				materialCode: undefined, | ||||
| 				materialDateId: undefined, | ||||
| 				materialDate: undefined, | ||||
| 				equipmentId: undefined, | ||||
| 				userName: undefined, | ||||
| 				userNames: [], | ||||
| @@ -208,15 +209,17 @@ export default { | ||||
| 	methods: { | ||||
| 		async getDictData() { | ||||
| 			const materRes = await getMaterialTree(); // | ||||
|       let typeId = materRes.data.find(item=>item.product === 0).id | ||||
|       const listQuery= { | ||||
|         typeId:typeId | ||||
|       } | ||||
| 			let typeId = materRes.data.find((item) => item.product === 0).id; | ||||
| 			const listQuery = { | ||||
| 				typeId: typeId, | ||||
| 			}; | ||||
| 			const materData = await getMaterialList(listQuery); | ||||
| 			this.materialList = []; | ||||
| 			this.materialList = materData.data; | ||||
| 			const dateRes = await getMaterDateList(); | ||||
| 			this.materialDateList = dateRes.data; | ||||
| 			if (!this.dataForm.id) { | ||||
| 				const dateRes = await getMaterDateList(); | ||||
| 				this.materialDateList = dateRes.data; | ||||
| 			} | ||||
| 			const eqRes = await getEqListAll(); | ||||
| 			this.eqList = eqRes.data; | ||||
| 			const workerRes = await listSimpleUsers(); | ||||
| @@ -257,7 +260,7 @@ export default { | ||||
| 						this.dataForm.id = response.data.id; | ||||
| 						this.dataForm.materialCode = response.data.materialCode; | ||||
| 						this.dataForm.materialId = response.data.materialId; | ||||
| 						this.dataForm.materialDateId = response.data.materialDateId; | ||||
| 						this.dataForm.materialDate = response.data.materialDateName; | ||||
| 						this.dataForm.equipmentId = response.data.equipmentId; | ||||
| 						this.dataForm.useTime = response.data.useTime; | ||||
| 						// this.dataForm.userName = response.data.userName | ||||
| @@ -265,6 +268,11 @@ export default { | ||||
| 						this.dataForm.source = response.data.source; | ||||
| 						this.dataForm.remark = response.data.remark; | ||||
| 						this.dataForm.userNames = response.data.userName.split(','); | ||||
| 						getMaterDateList({ materialId: this.dataForm.materialId }).then( | ||||
| 							(res) => { | ||||
| 								this.materialDateList = res.data; | ||||
| 							} | ||||
| 						); | ||||
| 					}); | ||||
| 				} else { | ||||
| 				} | ||||
|   | ||||
| @@ -91,7 +91,13 @@ export default { | ||||
| 					btnName: '查询', | ||||
| 					name: 'search', | ||||
| 					color: 'primary', | ||||
| 				}, | ||||
|         }, | ||||
|         { | ||||
|           type: 'button', | ||||
|           btnName: '返回', | ||||
|           name: 'return', | ||||
|           color: 'primary', | ||||
|         }, | ||||
| 			], | ||||
| 			queryParams: { | ||||
| 				equipmentId: null, | ||||
| @@ -278,19 +284,24 @@ export default { | ||||
| 			); | ||||
| 		}, | ||||
|  | ||||
| 		async handleSearchBarBtnClick({ btnName, timeVal }) { | ||||
| 			if (timeVal && timeVal.length > 0) { | ||||
| 				console.log('nihc ', timeVal) | ||||
| 				if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 30 * 60 * 1000) { | ||||
| 					this.queryParams.recordTime = timeVal; | ||||
| 					await this.handleQuery(); | ||||
| 				} else { | ||||
| 					this.$message.warning('时间范围最大30分钟限制!') | ||||
| 				} | ||||
| 			} else { | ||||
| 				this.queryParams.recordTime = []; | ||||
| 				this.$message.warning('时间段必选!') | ||||
| 			} | ||||
|     async handleSearchBarBtnClick({ btnName, timeVal }) { | ||||
|       console.log(btnName); | ||||
|       if (btnName === 'search') { | ||||
|         if (timeVal && timeVal.length > 0) { | ||||
|           console.log('nihc ', timeVal) | ||||
|           if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 30 * 60 * 1000) { | ||||
|             this.queryParams.recordTime = timeVal; | ||||
|             await this.handleQuery(); | ||||
|           } else { | ||||
|             this.$message.warning('时间范围最大30分钟限制!') | ||||
|           } | ||||
|         } else { | ||||
|           this.queryParams.recordTime = []; | ||||
|           this.$message.warning('时间段必选!') | ||||
|         } | ||||
|       } else { | ||||
|         this.$router.go(-1) | ||||
|       } | ||||
|  | ||||
| 		}, | ||||
|  | ||||
|   | ||||
| @@ -1,304 +0,0 @@ | ||||
| <template> | ||||
|   <el-form ref="addWorkOrder" :rules="rules" label-width="130px" :model="form" label-position='top'> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="工单名称" prop="name" v-if='!isBind'> | ||||
|           <el-input v-model="form.name"></el-input> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="工单名称" prop="workOrderId"  v-if='isBind'> | ||||
|           <el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable @change="getWorkOrderMsg"> | ||||
|             <el-option | ||||
|               v-for="item in workOrderList" | ||||
|               :key="item.id" | ||||
|               :label="item.name" | ||||
|               :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="工单编码" prop="code"> | ||||
|           <el-input v-model="form.code" disabled></el-input> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="产品名称" prop="planProductId"> | ||||
|           <el-select v-model="form.planProductId" placeholder="请选择" disabled  style="width: 100%;"> | ||||
|             <el-option | ||||
|               v-for="item in productList" | ||||
|               :key="item.id" | ||||
|               :label="item.name+' | '+item.specifications" | ||||
|               :value="item.id"> | ||||
|               <span style="float: left">{{ item.name }}</span> | ||||
|               <span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="计划开始时间"> | ||||
|           <el-date-picker | ||||
|             v-model="planStartTime" | ||||
|             type="datetime" | ||||
|             value-format="yyyy-MM-dd HH:mm:ss" | ||||
|             style="width: 100%;" | ||||
|             placeholder="选择日期" | ||||
|             :disabled="isBind"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="计划完成时间"> | ||||
|           <el-date-picker | ||||
|             v-model="planFinishTime" | ||||
|             type="datetime" | ||||
|             value-format="yyyy-MM-dd HH:mm:ss" | ||||
|             style="width: 100%;" | ||||
|             placeholder="选择日期" | ||||
|             :disabled="isBind"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="计划投入数量" prop="planAssignQuantity"> | ||||
|           <el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="计划生产数量" prop="planQuantity"> | ||||
|           <el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="关联工艺" prop="processFlowId"> | ||||
|           <el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;"> | ||||
|             <el-option | ||||
|               v-for="item in processFlowList" | ||||
|               :key="item.id" | ||||
|               :label="item.name" | ||||
|               :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="物料计算方式" prop="materialMethod"> | ||||
|           <el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" disabled> | ||||
|             <el-option label="产品基础BOM" :value="1"></el-option> | ||||
|             <el-option label="工艺扩展BOM" :value="2"></el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="优先级" prop="priority"> | ||||
|           <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind"> | ||||
|             <el-option | ||||
|               v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" | ||||
|               :key="item.value" | ||||
|               :label="item.label" | ||||
|               :value="item.value"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="工单类型" prop="type"> | ||||
|           <el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind"> | ||||
|             <el-option | ||||
|               v-for="item in workOrderTypeList" | ||||
|               :key="item.id" | ||||
|               :label="item.name" | ||||
|               :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="关联产线" prop="productLineId"> | ||||
|           <el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind"> | ||||
|             <el-option | ||||
|               v-for="item in productLineList" | ||||
|               :key="item.id" | ||||
|               :label="item.name" | ||||
|               :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="负责人" prop="workers"> | ||||
|           <el-input v-model="form.workers" :disabled="isBind"></el-input> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="计划分配订单量" prop="planAssignmentQuantity"> | ||||
|           <el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|   </el-form> | ||||
| </template> | ||||
| <script> | ||||
| import { getProductAll } from '@/api/base/product' | ||||
| import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage' | ||||
| import { getLineAll } from '@/api/base/productionLine' | ||||
| import moment from 'moment' | ||||
| export default { | ||||
|   name: 'AddWorkOrder', | ||||
|   data() { | ||||
|     return { | ||||
|       form: { | ||||
|         workOrderId: '', | ||||
|         orderId: '', | ||||
|         name: '', | ||||
|         code: '', | ||||
|         planProductId: '', | ||||
|         planStartTime: '', | ||||
|         planFinishTime: '', | ||||
|         planAssignQuantity: 0, | ||||
|         planQuantity: 0, | ||||
|         processFlowId: '', | ||||
|         materialMethod: 1, | ||||
|         priority: '', | ||||
|         productLineId: [], | ||||
|         type: '', | ||||
|         workers: '', | ||||
|         planAssignmentQuantity: '' | ||||
|       }, | ||||
|       rules: { | ||||
|         name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }], | ||||
|         planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }], | ||||
|         planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }], | ||||
|         planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }], | ||||
|         productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }], | ||||
|         planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }] | ||||
|       }, | ||||
|       productList: [], | ||||
|       processFlowList: [], | ||||
|       productLineList: [], | ||||
|       workOrderTypeList: [ | ||||
|         {id: 1,name:'标准工单'}, | ||||
|         {id: 2, name:'特殊工单'} | ||||
|       ], | ||||
|       planStartTime: '', | ||||
|       planFinishTime: '', | ||||
|       isBind: false, | ||||
|       workOrderList: [] | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     init(data, param) { | ||||
|       this.form.orderId = data.id | ||||
|       this.getList() | ||||
|       if (param === 'add') { | ||||
|         this.isBind = false | ||||
|         getWorkOrderCode().then(res => { | ||||
|           this.form.code = res.data || '' | ||||
|         }) | ||||
|         this.form.planProductId = data.planProductId | ||||
|         this.form.processFlowId = data.processFlowId | ||||
|         this.form.materialMethod = data.materialMethod | ||||
|       }else{//绑定 | ||||
|         this.isBind = true | ||||
|       } | ||||
|     }, | ||||
|     getList() { | ||||
|       // 产品 | ||||
|       getProductAll().then(res => { | ||||
|         this.productList = res.data || [] | ||||
|       }) | ||||
|       // 产线 | ||||
|       getLineAll().then(res => { | ||||
|         this.productLineList = res.data || [] | ||||
|       }) | ||||
|       // 工艺 | ||||
|       getProcessFlowList().then(res => { | ||||
|         this.processFlowList = res.data || [] | ||||
|       }) | ||||
|       // 工单list | ||||
|       workOrderList({ | ||||
|         status: 1 | ||||
|       }).then(res => { | ||||
|         this.workOrderList = res.data || [] | ||||
|       }) | ||||
|     }, | ||||
|     addWorkOrderSubmit() { | ||||
|       this.$refs['addWorkOrder'].validate((valid) => { | ||||
|         if (valid) { | ||||
|           if (this.isBind) { | ||||
|             //绑定工单 | ||||
|             orderIssue({ | ||||
|               workOrderId: this.form.workOrderId, | ||||
|               orderId: this.form.orderId, | ||||
|               planAssignmentQuantity: this.form.planAssignmentQuantity | ||||
|              }).then((res) => { | ||||
|               if (res.code === 0) { | ||||
|                 this.$modal.msgSuccess("操作成功") | ||||
|                 this.$emit('addWorkOrderSubmit') | ||||
|               } | ||||
|             }) | ||||
|           } else { | ||||
|             // 新增工单 | ||||
|             let _this = this | ||||
|             _this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : '' | ||||
|             _this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : '' | ||||
|             orderIssue({ ..._this.form }).then(res => { | ||||
|               if (res.code === 0) { | ||||
|                 _this.$modal.msgSuccess("操作成功") | ||||
|                 let name = this.form.name | ||||
|                 _this.$emit('addWorkOrderSubmit') | ||||
|                 // 询问是否添加预使用主原料 | ||||
|                 _this.$modal.confirm('是否添加预使用主原料信息?').then(function() { | ||||
|                     _this.$router.push({ | ||||
|                       path: '/core/core-work-order?workOrderName='+encodeURI(name) | ||||
|                     }) | ||||
|                   }) | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         } else { | ||||
|           return false | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     formClear() { | ||||
|       this.$refs.addWorkOrder.resetFields() | ||||
|       this.form.materialMethod = 1 | ||||
|       this.form.planAssignQuantity = 0 | ||||
|       this.form.planQuantity = 0 | ||||
|       this.planFinishTime = '' | ||||
|       this.planStartTime = '' | ||||
|       this.form.planFinishTime = '' | ||||
|       this.form.planStartTime = '' | ||||
|       this.isBind = false | ||||
|     }, | ||||
|     // 绑定工单,选择工单时获取工单信息 | ||||
|     getWorkOrderMsg() { | ||||
|       if (this.form.workOrderId) { | ||||
|         getWorkOrderById({id:this.form.workOrderId}).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.form.code = res.data.code | ||||
|             this.form.planProductId = res.data.planProductId | ||||
|             this.planStartTime = res.data.planStartTime ? moment.unix(res.data.planStartTime).format('YYYY-MM-DD HH:mm:ss') : null | ||||
|             this.planFinishTime = res.data.planFinishTime ? moment.unix(res.data.planFinishTime).format('YYYY-MM-DD HH:mm:ss') : null | ||||
|             this.form.planAssignQuantity = res.data.planAssignQuantity | ||||
|             this.form.planQuantity = res.data.planQuantity | ||||
|             this.form.processFlowId = res.data.processFlowId | ||||
|             this.form.materialMethod = res.data.materialMethod | ||||
|             this.form.priority = res.data.priority ? res.data.priority + '' : '' | ||||
|             this.form.productLineId = res.data.productLineIds | ||||
|             this.form.type = res.data.type | ||||
|             this.form.workers = res.data.workers | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| @@ -1,293 +0,0 @@ | ||||
| <template> | ||||
|   <el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form" label-position='top'> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="订单名称" prop="name"> | ||||
|           <el-input v-model="form.name"></el-input> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="订单号" prop="code"> | ||||
|           <el-input v-model="form.code"></el-input> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="计划加工数量" prop="planQuantity"> | ||||
|           <el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="产品名称" prop="planProductId"> | ||||
|           <el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable> | ||||
|             <el-option | ||||
|               v-for="item in productList" | ||||
|               :key="item.id" | ||||
|               :label="item.name+' | '+(item.specifications || '')" | ||||
|               :value="item.id"> | ||||
|               <span style="float: left">{{ item.name }}</span> | ||||
|               <span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="单价" prop="price"> | ||||
|           <el-input-number v-model="form.price" :min="0" :max="9999999999999" :precision='2' style="width: 100%;"></el-input-number> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="客户" prop="customerId"> | ||||
|           <el-select v-model="form.customerId" placeholder="请选择" style="width: 100%;" clearable filterable> | ||||
|             <el-option | ||||
|               v-for="item in customerList" | ||||
|               :key="item.id" | ||||
|               :label="item.name" | ||||
|               :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="优先级" prop="priority"> | ||||
|           <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" clearable> | ||||
|             <el-option | ||||
|               v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" | ||||
|               :key="item.value" | ||||
|               :label="item.label" | ||||
|               :value="item.value"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="包装规格" prop="packSpec"> | ||||
|           <el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable> | ||||
|             <el-option | ||||
|               v-for="item in getDictDatas(DICT_TYPE.PACK_SPEC)" | ||||
|               :key="item.value" | ||||
|               :label="item.label" | ||||
|               :value="item.value"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="负责人" prop="workers"> | ||||
|           <el-input v-model="form.workers"></el-input> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="关联工艺" prop="processFlowId"> | ||||
|           <el-select v-model="form.processFlowId" placeholder="请选择" style="width: 100%;" clearable filterable @change="processFlowIdChange"> | ||||
|             <el-option | ||||
|               v-for="item in processFlowList" | ||||
|               :key="item.id" | ||||
|               :label="item.name" | ||||
|               :value="item.id"> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="物料计算方式" prop="materialMethod"> | ||||
|           <el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" @change='materialMethodChange'> | ||||
|             <el-option label="产品基础BOM" :value="1"></el-option> | ||||
|             <el-option label="工艺扩展BOM" :value="2"></el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="订单计划开始时间" prop="planStartTime"> | ||||
|           <el-date-picker | ||||
|             v-model="form.planStartTime" | ||||
|             type="datetime" | ||||
|             style="width: 100%;" | ||||
|             value-format="timestamp" | ||||
|             @change="timeChange" | ||||
|             placeholder="选择日期"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="订单计划完成时间" prop="planFinishTime"> | ||||
|           <el-date-picker | ||||
|             v-model="form.planFinishTime" | ||||
|             type="datetime" | ||||
|             style="width: 100%;" | ||||
|             value-format="timestamp" | ||||
|             @change="timeChange" | ||||
|             placeholder="选择日期"> | ||||
|           </el-date-picker> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='12'> | ||||
|         <el-form-item label="备注" prop="remark"> | ||||
|           <el-input v-model="form.remark"></el-input> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <!-- <el-row> | ||||
|       <el-col :span='24'> | ||||
|         <el-form-item label="描述信息" prop="description"> | ||||
|           <el-input v-model="form.description"></el-input> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> --> | ||||
|   </el-form> | ||||
| </template> | ||||
| <script> | ||||
| import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate } from '@/api/base/orderManage' | ||||
| import { getProductAll } from '@/api/base/product' | ||||
| import { getCustomerList } from '@/api/base/customer' | ||||
| export default { | ||||
|   name: 'OrderAdd', | ||||
|   data() { | ||||
|     return { | ||||
|       form: { | ||||
|         id: '', | ||||
|         name: '', | ||||
|         code: '', | ||||
|         planQuantity: '', | ||||
|         planProductId: '', | ||||
|         price: '', | ||||
|         customerId: '', | ||||
|         priority: '', | ||||
|         packSpec: '', | ||||
|         workers: '', | ||||
|         processFlowId: '', | ||||
|         materialMethod: 1, | ||||
|         remark: '', | ||||
|         // description: '', | ||||
|         planStartTime: '', | ||||
|         planFinishTime: '' | ||||
|       }, | ||||
|       rules: { | ||||
|         name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }], | ||||
|         code: [{ required: true, message: "订单号不能为空", trigger: "blur" }], | ||||
|         planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }], | ||||
|         planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }] | ||||
|       }, | ||||
|       productList: [], | ||||
|       customerList: [], | ||||
|       processFlowList: [], | ||||
|       isEdit: false //是否是编辑 | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     init(id) { | ||||
|       this.getList() | ||||
|       if (id) { | ||||
|         this.isEdit = true | ||||
|         this.form.id = id | ||||
|         getOrderById({id: this.form.id}).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.form.name = res.data.name | ||||
|             this.form.code = res.data.code | ||||
|             this.form.planQuantity = res.data.planQuantity | ||||
|             this.form.planProductId = res.data.planProductId | ||||
|             this.form.price = res.data.price | ||||
|             this.form.customerId = res.data.customerId | ||||
|             this.form.priority = res.data.priority ? res.data.priority + '' : '' | ||||
|             this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null | ||||
|             this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : '' | ||||
|             this.form.workers = res.data.workers | ||||
|             this.form.processFlowId = res.data.processFlowId | ||||
|             this.form.materialMethod = res.data.materialMethod | ||||
|             this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null | ||||
|             this.form.remark = res.data.remark | ||||
|             // this.form.description = res.data.description | ||||
|           } | ||||
|         }) | ||||
|       } else { | ||||
|         this.isEdit = false | ||||
|         this.form.id = '' | ||||
|         // 订单号 | ||||
|         getOrderCode().then(res => { | ||||
|           this.form.code = res.data || '' | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     getList() { | ||||
|       // 产品 | ||||
|       getProductAll().then(res => { | ||||
|         this.productList = res.data || [] | ||||
|       }) | ||||
|       // 客户 | ||||
|       getCustomerList().then(res => { | ||||
|         this.customerList = res.data || [] | ||||
|       }) | ||||
|       // 工艺 | ||||
|       getProcessFlowList().then(res => { | ||||
|         this.processFlowList = res.data || [] | ||||
|       }) | ||||
|     }, | ||||
|     timeChange() { | ||||
|       if (this.form.planStartTime && this.form.planFinishTime) { | ||||
|         if (this.form.planStartTime > this.form.planFinishTime) { | ||||
|           this.$modal.msgError('计划开始时间不能大于结束时间') | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     // 工艺变更 | ||||
|     materialMethodChange(val) { | ||||
|       if (val === 2 && !this.form.processFlowId) { | ||||
|         this.form.materialMethod = 1 | ||||
|         this.$modal.msgError("请先选择关联工艺"); | ||||
|       } | ||||
|     }, | ||||
|     // 工艺变更 | ||||
|     processFlowIdChange(val) { | ||||
|       console.log(val) | ||||
|       if (!val) { | ||||
|         this.form.materialMethod = 1 | ||||
|       } | ||||
|     }, | ||||
|     submitForm() { | ||||
|       this.$refs['orderAddForm'].validate((valid) => { | ||||
|         if (valid) { | ||||
|           if (this.form.planStartTime && this.form.planFinishTime) { | ||||
|             if (this.form.planStartTime > this.form.planFinishTime) { | ||||
|               this.$modal.msgError('计划开始时间不能大于结束时间') | ||||
|               return false | ||||
|             } | ||||
|           } | ||||
|           // console.log(this.form) | ||||
|           if (this.isEdit) { | ||||
|             //编辑 | ||||
|             orderUpdate({ ...this.form }).then((res) => { | ||||
|               if (res.code === 0) { | ||||
|                 this.$modal.msgSuccess("操作成功"); | ||||
|                 this.$emit('successSubmit') | ||||
|               } | ||||
|             }) | ||||
|           } else { | ||||
|             this.form.status = 1 | ||||
|             this.form.triggerOrigin = 1 | ||||
|             orderCreate({ ...this.form }).then((res) => { | ||||
|               if (res.code === 0) { | ||||
|                 this.$modal.msgSuccess("操作成功"); | ||||
|                 this.$emit('successSubmit') | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         } else { | ||||
|           return false | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     formClear() { | ||||
|       this.$refs.orderAddForm.resetFields() | ||||
|       this.form.materialMethod = 1 | ||||
|       this.form.price = 0.00 | ||||
|       this.form.planQuantity = 0 | ||||
|       this.isEdit = false | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| @@ -1,470 +0,0 @@ | ||||
| <template> | ||||
|   <div class="app-container"> | ||||
|     <!-- 搜索工作栏 --> | ||||
|     <search-bar | ||||
|       :formConfigs="formConfig" | ||||
|       ref="searchBarForm" | ||||
|       @headBtnClick="buttonClick" | ||||
|     /> | ||||
|     <!-- 列表 --> | ||||
|     <base-table | ||||
|       :page="queryParams.pageNo" | ||||
|       :limit="queryParams.pageSize" | ||||
|       :table-props="tableProps" | ||||
|       :table-data="list" | ||||
|       :max-height="tableH" | ||||
|     > | ||||
|       <method-btn | ||||
|         v-if="tableBtn.length" | ||||
|         slot="handleBtn" | ||||
|         :width="240" | ||||
|         label="操作" | ||||
|         :method-list="tableBtn" | ||||
|         @clickBtn="handleClick" | ||||
|       /> | ||||
|     </base-table> | ||||
|     <pagination | ||||
|       :page.sync="queryParams.pageNo" | ||||
|       :limit.sync="queryParams.pageSize" | ||||
|       :total="total" | ||||
|       @pagination="getList" | ||||
|     /> | ||||
|     <!-- 新增&编辑 --> | ||||
|     <base-dialog | ||||
|       :dialogTitle="addOrEditTitle" | ||||
|       :dialogVisible="centervisible" | ||||
|       @cancel="handleCancel" | ||||
|       @confirm="handleConfirm" | ||||
|       :before-close="handleCancel" | ||||
|       width='60%' | ||||
|     > | ||||
|       <order-add ref="orderAdd" @successSubmit="successSubmit" /> | ||||
|     </base-dialog> | ||||
|     <!-- 查看详情 --> | ||||
|     <!-- 新增工单 --> | ||||
|     <base-dialog | ||||
|       :dialogTitle="workIssueTitle" | ||||
|       :dialogVisible="addWorkOrdervisible" | ||||
|       @cancel="addWorkOrderCancel" | ||||
|       @confirm="addWorkOrderConfirm" | ||||
|       :before-close="addWorkOrderCancel" | ||||
|       width='70%' | ||||
|     > | ||||
|       <add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" /> | ||||
|     </base-dialog> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import { parseTime } from '@/utils/ruoyi' | ||||
| import { getOrderPage, orderDelete, customerList, orderFinish } from '@/api/base/orderManage' | ||||
| import OrderAdd from './components/orderAdd' | ||||
| import AddWorkOrder from './components/addWorkOrder' | ||||
| import { publicFormatter } from '@/utils/dict' | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: 'createTime', | ||||
|     label: '添加时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'name', | ||||
|     label: '订单名称', | ||||
|     minWidth: 120, | ||||
|     showOverflowtooltip: true | ||||
|   }, | ||||
|   { | ||||
|     prop: 'code', | ||||
|     label: '订单编码', | ||||
|     minWidth: 180 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'customerId', | ||||
|     label: '客户', | ||||
|     showOverflowtooltip: true | ||||
|   }, | ||||
|   { | ||||
|     prop: 'triggerOrigin', | ||||
|     label: '来源', | ||||
|     filter: publicFormatter('order_Origin') | ||||
|   }, | ||||
|   { | ||||
|     prop: 'priority', | ||||
|     label: '优先级', | ||||
|     filter: publicFormatter('order_priority') | ||||
|   }, | ||||
|   { | ||||
|     prop: 'status', | ||||
|     label: '订单状态', | ||||
|     filter: publicFormatter('order_status') | ||||
|   }, | ||||
|   { | ||||
|     prop: 'planQuantity', | ||||
|     label: '计划加工量', | ||||
|     width: 100 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'actualQuantity', | ||||
|     label: '实际加工量', | ||||
|     width: 100 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'productName', | ||||
|     label: '产品', | ||||
|     showOverflowtooltip: true | ||||
|   }, | ||||
|   { | ||||
|     prop: 'unit', | ||||
|     label: '单位', | ||||
|     filter: publicFormatter('unit_dict') | ||||
|   }, | ||||
|   { | ||||
|     prop: 'price', | ||||
|     label: '单价(元)', | ||||
|     align: 'right' | ||||
|   }, | ||||
|   { | ||||
|     prop: 'workOrderNum', | ||||
|     label: '工单数量' | ||||
|   } | ||||
| ] | ||||
| export default { | ||||
|   name: 'OrderManage', | ||||
|   data() { | ||||
|     return { | ||||
|       formConfig: [ | ||||
|         { | ||||
|           type: 'input', | ||||
|           label: '订单名称', | ||||
|           placeholder: '订单名称', | ||||
|           param: 'name' | ||||
|         }, | ||||
|         { | ||||
|           type: 'select', | ||||
|           label: '状态', | ||||
|           selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS), | ||||
|           labelField: 'label', | ||||
|           valueField: 'value', | ||||
|           param: 'status' | ||||
|         }, | ||||
|         { | ||||
|           type: 'datePicker', | ||||
|           label: '时间段', | ||||
|           dateType: 'daterange', | ||||
|           format: 'yyyy-MM-dd', | ||||
|           valueFormat: "yyyy-MM-dd", | ||||
|           rangeSeparator: '-', | ||||
|           startPlaceholder: '开始时间', | ||||
|           endPlaceholder: '结束时间', | ||||
|           param: 'timeVal', | ||||
|           defaultSelect: [], | ||||
|           width: 250 | ||||
|         }, | ||||
|         { | ||||
|           type: 'button', | ||||
|           btnName: '查询', | ||||
|           name: 'search', | ||||
|           color: 'primary' | ||||
|         }, | ||||
|         { | ||||
|           type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '', | ||||
|         }, | ||||
|         { | ||||
|           type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '', | ||||
|           btnName: '新增', | ||||
|           name: 'add', | ||||
|           color: 'success', | ||||
|           plain: true | ||||
|         } | ||||
|       ], | ||||
|       // 查询参数 | ||||
|       queryParams: { | ||||
|         pageNo: 1, | ||||
|         pageSize: 20, | ||||
|         name: null, | ||||
|         status: null, | ||||
|         lastIssuedTime: [] | ||||
|       }, | ||||
|       total: 0, | ||||
|       tableProps, | ||||
|       list: [], | ||||
|       tableH: this.tableHeight(260), | ||||
|       tableBtn: [ | ||||
|       this.$auth.hasPermi('base:order-manage:addWorkOrder') | ||||
|           ? { | ||||
|               type: 'add', | ||||
|               btnName: '新增', | ||||
|               showTip: '新增工单', | ||||
|               showParam: { | ||||
|                 type: '|', | ||||
|                 data: [ | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 1 | ||||
|                   }, | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 2 | ||||
|                   }, | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 3 | ||||
|                   } | ||||
|                 ] | ||||
|               } | ||||
|             } | ||||
|           : undefined, | ||||
|       this.$auth.hasPermi('base:order-manage:bindWorkOrder') | ||||
|           ? { | ||||
|               type: 'bind', | ||||
|               btnName: '绑定', | ||||
|               showTip: '绑定工单', | ||||
|               showParam: { | ||||
|                 type: '|', | ||||
|                 data: [ | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 1 | ||||
|                   }, | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 2 | ||||
|                   }, | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 3 | ||||
|                   } | ||||
|                 ] | ||||
|               } | ||||
|             } | ||||
|           : undefined, | ||||
|       this.$auth.hasPermi('base:order-manage:bindWorkOrder') | ||||
|           ? { | ||||
|               type: 'complete', | ||||
|               btnName: '完成', | ||||
|               showTip: '完成订单', | ||||
|               showParam: { | ||||
|                 type: '|', | ||||
|                 data: [ | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 2 | ||||
|                   }, | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 3 | ||||
|                   } | ||||
|                 ] | ||||
|               } | ||||
|             } | ||||
|           : undefined, | ||||
|       this.$auth.hasPermi('base:order-manage:detail') | ||||
|           ? { | ||||
|               type: 'detail', | ||||
|               btnName: '详情' | ||||
|             } | ||||
|           : undefined, | ||||
|         this.$auth.hasPermi('base:order-manage:edit') | ||||
|           ? { | ||||
|               type: 'edit', | ||||
|               btnName: '编辑', | ||||
|               showParam: { | ||||
|                 type: '&', | ||||
|                 data: [ | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'triggerOrigin', | ||||
|                     value: 1 | ||||
|                   }, | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 1 | ||||
|                   } | ||||
|                 ] | ||||
|               } | ||||
|             } | ||||
|           : undefined, | ||||
|         this.$auth.hasPermi('base:order-manage:delete') | ||||
|           ? { | ||||
|               type: 'delete', | ||||
|               btnName: '删除', | ||||
|               showParam: { | ||||
|                 type: '&', | ||||
|                 data: [ | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'triggerOrigin', | ||||
|                     value: 1 | ||||
|                   }, | ||||
|                   { | ||||
|                     type: 'equal', | ||||
|                     name: 'status', | ||||
|                     value: 1 | ||||
|                   } | ||||
|                 ] | ||||
|               } | ||||
|             } | ||||
|           : undefined | ||||
|       ].filter((v) => v), | ||||
|       addOrEditTitle: '', | ||||
|       centervisible: false, | ||||
|       priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY), | ||||
|       workIssueTitle: '', | ||||
|       addWorkOrdervisible: false, | ||||
|       orderDetailVisible: false | ||||
|     } | ||||
|   }, | ||||
|   components: { OrderAdd, AddWorkOrder }, | ||||
|   created() { | ||||
|     window.addEventListener('resize', () => { | ||||
|       this.tableH = this.tableHeight(260) | ||||
|     }) | ||||
|     this.getList() | ||||
|   }, | ||||
|   methods: { | ||||
|     getList() { | ||||
|       getOrderPage({...this.queryParams}).then(res => { | ||||
|         let arr = res.data.records || [] | ||||
|         this.total = res.data.total || 0 | ||||
|         if (arr.length > 0) { | ||||
|           customerList().then(result => { | ||||
|             let tempData = result.data || [] | ||||
|             if (tempData.length > 0) { | ||||
|               arr.map(item => { | ||||
|                 for (let i of tempData) { | ||||
|                   if (item.customerId === i.id) { | ||||
|                     item.customerId = i.name | ||||
|                   } | ||||
|                 } | ||||
|                 item.price = item.price.toFixed(2) | ||||
|               }) | ||||
|               this.list = arr | ||||
|             } | ||||
|           }) | ||||
|         }else { | ||||
|           this.list = arr | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     buttonClick(val) { | ||||
|       console.log(val) | ||||
|       if (val.btnName === 'search') { | ||||
|         this.queryParams.name = val.name | ||||
|         this.queryParams.status = val.status | ||||
|         if (val.timeVal && val.timeVal.length > 0) { | ||||
|           this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00' | ||||
|           this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59' | ||||
|         } else { | ||||
|           this.queryParams.lastIssuedTime = [] | ||||
|         } | ||||
|         this.getList() | ||||
|       } else { | ||||
|         this.addOrEditTitle = '新增' | ||||
|         this.centervisible = true | ||||
|         this.$nextTick(() => { | ||||
|           this.$refs.orderAdd.init() | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     handleClick(val) { | ||||
|       console.log(val) | ||||
|       switch (val.type) { | ||||
|         case 'edit': | ||||
|           this.addOrEditTitle = '编辑' | ||||
|           this.centervisible = true | ||||
|           this.$nextTick(() => { | ||||
|             this.$refs.orderAdd.init(val.data.id) | ||||
|           }) | ||||
|           break | ||||
|         case 'delete': | ||||
|           this.handleDelete(val.data) | ||||
|           break | ||||
|         case 'detail': | ||||
|           this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id}) | ||||
|           break | ||||
|         case 'add': | ||||
|           this.workIssueTitle = '新增工单' | ||||
|           this.addWorkOrdervisible = true | ||||
|           this.$nextTick(() => { | ||||
|             this.$refs.addWorkOrder.init(val.data, 'add') | ||||
|           }) | ||||
|           break | ||||
|         case 'bind': | ||||
|           this.workIssueTitle = '绑定工单' | ||||
|           this.addWorkOrdervisible = true | ||||
|           this.$nextTick(() => { | ||||
|             this.$refs.addWorkOrder.init(val.data, 'bind') | ||||
|           }) | ||||
|           break | ||||
|         case 'complete': | ||||
|           this.handleComplete(val.data) | ||||
|           break | ||||
|         default: | ||||
|       } | ||||
|     }, | ||||
|     // 删除 | ||||
|     handleDelete(val) { | ||||
|       this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() { | ||||
|           return orderDelete({ id: val.id }) | ||||
|         }).then(() => { | ||||
|           this.getList(); | ||||
|           this.$modal.msgSuccess("操作成功"); | ||||
|         }).catch(() => {}); | ||||
|     }, | ||||
|     // 完成 | ||||
|     handleComplete(val) { | ||||
|       this.$modal.confirm('是否确认完成订单"' + val.name + '"?').then(function() { | ||||
|           return orderFinish({ id: val.id }) | ||||
|         }).then(() => { | ||||
|           this.getList(); | ||||
|           this.$modal.msgSuccess("操作成功"); | ||||
|         }).catch(() => {}); | ||||
|     }, | ||||
|     // 新增 | ||||
|     handleCancel() { | ||||
|       this.$refs.orderAdd.formClear() | ||||
|       this.centervisible = false | ||||
|       this.addOrEditTitle = '' | ||||
|     }, | ||||
|     handleConfirm() { | ||||
|       this.$refs.orderAdd.submitForm() | ||||
|     }, | ||||
|     successSubmit() { | ||||
|       this.handleCancel() | ||||
|       this.getList() | ||||
|     }, | ||||
|     // 下发新增 | ||||
|     addWorkOrderCancel() { | ||||
|       this.$refs.addWorkOrder.formClear() | ||||
|       this.addWorkOrdervisible = false | ||||
|     }, | ||||
|     addWorkOrderConfirm() { | ||||
|       this.$refs.addWorkOrder.addWorkOrderSubmit() | ||||
|     }, | ||||
|     addWorkOrderSubmit() { | ||||
|       this.addWorkOrderCancel() | ||||
|       this.getList() | ||||
|     } | ||||
|     // bindWorkOrderCancel() { | ||||
|     //   this.$refs.bindWorkOrder.formClear() | ||||
|     //   this.bindWorkOrdervisible = false | ||||
|     // }, | ||||
|     // bindWorkOrderConfirm() { | ||||
|     //   this.$refs.bindWorkOrder.bindWorkOrderSubmit() | ||||
|     // }, | ||||
|     // bindWorkOrderSubmit() { | ||||
|     //   this.bindWorkOrderCancel() | ||||
|     //   this.getList() | ||||
|     // } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| @@ -1,343 +0,0 @@ | ||||
| <template> | ||||
|   <div class="orderDetailData"> | ||||
|     <div class="box1"> | ||||
|       <div class="boxTitle"> | ||||
|         <span class="blueTitle"></span> | ||||
|         <span>订单编码: {{orderMsg.code}}</span> | ||||
|       </div> | ||||
|       <el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button> | ||||
|       <div style="padding-left: 14px;"> | ||||
|         <el-row> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">订单名</div> | ||||
|             <div class="lightTip">{{orderMsg.name}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">产品信息</div> | ||||
|             <div class="lightTip">{{orderMsg.productName}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">产品规格</div> | ||||
|             <div class="lightTip">{{orderMsg.specifications}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">客户</div> | ||||
|             <div class="lightTip">{{orderMsg.customerName}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">包装规格</div> | ||||
|             <div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">物料计算方式</div> | ||||
|             <div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">创建时间</div> | ||||
|             <div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">计划开始时间</div> | ||||
|             <div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <el-row> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">计划完成时间</div> | ||||
|             <div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">计划加工数量</div> | ||||
|             <div class="lightTip">{{orderMsg.planQuantity}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">加工平方数(平方米)</div> | ||||
|             <div class="lightTip">{{orderMsg.planArea}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">预计用时(时)</div> | ||||
|             <div class="lightTip">{{ orderMsg.expectTime }}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">状态</div> | ||||
|             <div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">实际开始时间</div> | ||||
|             <div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">实际完成时间</div> | ||||
|             <div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">实际生产数量</div> | ||||
|             <div class="lightTip">{{orderMsg.actualQuantity	}}</div> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <el-row> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">完成比%</div> | ||||
|             <div class="lightTip">{{orderMsg.completeProp}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">废片数量</div> | ||||
|             <div class="lightTip">{{orderMsg.nokQuantity}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">负责人</div> | ||||
|             <div class="lightTip">{{orderMsg.workers}}</div> | ||||
|           </el-col> | ||||
|           <el-col :span='3'> | ||||
|             <div class="blodTip">关联工艺</div> | ||||
|             <div class="lightTip">{{processFlowName}}</div> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div class="box2"> | ||||
|       <div class="boxTitle"> | ||||
|         <span class="blueTitle"></span> | ||||
|         <span>工单信息</span> | ||||
|       </div> | ||||
|       <!-- 列表 --> | ||||
|       <base-table | ||||
|         :page="queryParams.pageNo" | ||||
|         :limit="queryParams.pageSize" | ||||
|         :table-props="tableProps1" | ||||
|         :table-data="list1" | ||||
|         :max-height="tableH" | ||||
|       /> | ||||
|     </div> | ||||
|     <div class="box3"> | ||||
|       <div class="boxTitle"> | ||||
|         <span class="blueTitle"></span> | ||||
|         <span>预计用料信息</span> | ||||
|       </div> | ||||
|       <!-- 列表 --> | ||||
|       <base-table | ||||
|         :page="queryParams.pageNo" | ||||
|         :limit="queryParams.pageSize" | ||||
|         :table-props="tableProps2" | ||||
|         :table-data="list2" | ||||
|         :max-height="tableH" | ||||
|       /> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import { parseTime } from '@/utils/ruoyi' | ||||
| import { publicFormatter } from '@/utils/dict' | ||||
| import { getProcessFlowList } from '@/api/base/orderManage' | ||||
| const tableProps1 = [ | ||||
|   { | ||||
|     prop: 'issueTime', | ||||
|     label: '下发时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'name', | ||||
|     label: '工单名', | ||||
|     minWidth: 100, | ||||
|     showOverflowtooltip: true | ||||
|   }, | ||||
|   { | ||||
|     prop: 'code', | ||||
|     label: '工单编码', | ||||
|     minWidth: 150 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'planAssignmentQuantity', | ||||
|     label: '计划加工量', | ||||
|     width: 100 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'actualQuantity', | ||||
|     label: '实际加工量', | ||||
|     width: 100 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'actualArea', | ||||
|     label: '加工平方数', | ||||
|     width: 100 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'status', | ||||
|     label: '状态', | ||||
|     filter: publicFormatter('order_status') | ||||
|   }, | ||||
|   { | ||||
|     prop: 'startProduceTime', | ||||
|     label: '开始时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'finishProduceTime', | ||||
|     label: '结束时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'productLineNames', | ||||
|     label: '关联产线', | ||||
|     filter: (val) => val ? val.join(',') : '', | ||||
|     showOverflowtooltip: true | ||||
|   }, | ||||
|   { | ||||
|     prop: 'workers', | ||||
|     label: '负责人' | ||||
|   }, | ||||
|   { | ||||
|     prop: 'remark', | ||||
|     label: '备注' | ||||
|   } | ||||
| ] | ||||
| const tableProps2 = [ | ||||
|   { | ||||
|     prop: 'materialName', | ||||
|     label: '物料名称' | ||||
|   }, | ||||
|   { | ||||
|     prop: 'unit', | ||||
|     label: '单位', | ||||
|     filter: publicFormatter('unit_dict') | ||||
|   }, | ||||
|   { | ||||
|     prop: 'num', | ||||
|     label: '剩余生产预计消耗' | ||||
|   } | ||||
| ] | ||||
| import { orderDetail, bomUseNum } from '@/api/base/orderManage' | ||||
| export default { | ||||
|   name: 'OrderDetailData', | ||||
|   data() { | ||||
|     return { | ||||
|       orderId: '', | ||||
|       tableProps1, | ||||
|       tableProps2, | ||||
|       list1: [], | ||||
|       list2: [], | ||||
|       tableH: this.tableHeight(510) / 2, | ||||
|       // 查询参数 | ||||
|       queryParams: { | ||||
|         pageNo: 1, | ||||
|         pageSize: 500 | ||||
|       }, | ||||
|       orderMsg: {}, | ||||
|       processFlowName: '' | ||||
|     } | ||||
|   }, | ||||
|   mounted() { | ||||
|     window.addEventListener('resize', () => { | ||||
|       this.tableH = this.tableHeight(510) / 2 | ||||
|     }) | ||||
|     this.orderId = location.href.split('?')[1].split('=')[1] | ||||
|     this.getMsg() | ||||
|   }, | ||||
|   watch: { | ||||
|     $route: 'initData' | ||||
|   }, | ||||
|   methods: { | ||||
|     initData(to) { | ||||
|       if (to.name === 'OrderDetailData') { | ||||
|         this.orderId = location.href.split('?')[1].split('=')[1] | ||||
|         this.getMsg() | ||||
|       } | ||||
|     }, | ||||
|     getMsg() { | ||||
|       orderDetail({ | ||||
|         id: this.orderId | ||||
|       }).then(res => { | ||||
|         this.orderMsg = res.data | ||||
|         this.list1 = res.data.coreWorkOrderRespVOS | ||||
|         bomUseNum({ | ||||
|           productId: this.orderMsg.planProductId | ||||
|         }).then(res2 => { | ||||
|           if (res2.data && res2.data.length > 0) { | ||||
|             let arr = res2.data | ||||
|             arr.map(item => { | ||||
|               if (item) { | ||||
|                 let a = item.num * this.orderMsg.remainingQuantity | ||||
|                 item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : '' | ||||
|               } | ||||
|             }) | ||||
|             this.list2 = arr | ||||
|           }else { | ||||
|             this.list2 = [] | ||||
|           } | ||||
|         }) | ||||
|         // 工艺 | ||||
|         getProcessFlowList().then(res => { | ||||
|           let arr = res.data || [] | ||||
|           if (arr.length > 0) { | ||||
|             arr.map(item => { | ||||
|               if (item.id === this.orderMsg.processFlowId) { | ||||
|                 this.processFlowName = item.name | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         }) | ||||
|       }) | ||||
|     }, | ||||
|     // 返回 | ||||
|     returnOrderManage() { | ||||
| 			this.$router.go(-1); | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| <style lang='scss' scoped> | ||||
| .orderDetailData { | ||||
|   background-color: rgb(242, 244, 249); | ||||
|   .box1, .box2, .box3 { | ||||
|     background-color: #fff; | ||||
|     border-radius: 9px; | ||||
|   } | ||||
|   .box2 { | ||||
|     height: calc((100vh - 360px) / 2); | ||||
|     padding: 12px 16px 0; | ||||
|     margin: 8px 0; | ||||
|   } | ||||
|   .box1 { | ||||
|     height: 215px; | ||||
|     padding: 16px 16px 0 16px; | ||||
|     .blodTip { | ||||
|       height: 16px; | ||||
|       font-size: 14px; | ||||
|       font-weight: 600; | ||||
|       color: rgba(0,0,0,0.85); | ||||
|       margin-bottom: 8px; | ||||
|     } | ||||
|     .lightTip { | ||||
|       height: 16px; | ||||
|       font-size: 14px; | ||||
|       font-weight: 400; | ||||
|       color: rgba(102,102,102,0.75); | ||||
|       margin-bottom: 12px; | ||||
|     } | ||||
|   } | ||||
|   .box3 { | ||||
|     padding: 16px; | ||||
|     height: calc((100vh - 360px) / 2); | ||||
|     } | ||||
|   .boxTitle { | ||||
|     display: inline-block; | ||||
|     font-size: 16px; | ||||
|     font-weight: 400; | ||||
|     color: #000000; | ||||
|     margin:0 10px 20px 0; | ||||
|   } | ||||
|   .blueTitle { | ||||
|     content: ''; | ||||
|     display: inline-block; | ||||
|     width: 4px; | ||||
|     height: 18px; | ||||
|     background-color: #0B58FF; | ||||
|     border-radius: 1px; | ||||
|     margin-right: 8px; | ||||
|     vertical-align: bottom; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
| @@ -1,168 +0,0 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <div class="boxTitle"> | ||||
|       <span class="blueTitle"></span> | ||||
|       <span>各订单环形图</span> | ||||
|     </div> | ||||
|     <div class="chartBox" id='orderChartBox' v-show='chartList.length'> | ||||
|       <div class="chartItem" v-for="(item, index) in chartList" :key='index' :style="{width: 388*beilv+'px',height: 286*beilv+'px',padding:14*beilv+'px',marginRight:9*beilv+'px',marginBottom:9*beilv+'px'}"> | ||||
|         <div class="topTitle" :style="{fontSize: 14 * beilv + 'px'}"> | ||||
|           <svg-icon icon-class="order-monitoring" :style="{fontSize: 16*beilv+'px'}"/> | ||||
|           <span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderName}}</span> | ||||
|           <span>订单计划数量{{item.num}}</span> | ||||
|         </div> | ||||
|         <div | ||||
|           :id="item.id" | ||||
|           :style="{width: 166*beilv+'px',height: 166*beilv+'px',margin: 'auto'}" | ||||
|         ></div> | ||||
|         <div class="legend" :style="{height: 54 * beilv + 'px', marginTop: 10*beilv+'px'}"> | ||||
|           <div class="legendItem" v-for="(subItem, i) in item.workOrder" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}"> | ||||
|             <span class="itemNum" :style="{fontSize: 18 * beilv + 'px'}">{{subItem.value}}</span> | ||||
|             <div> | ||||
|               <span class="itemName" :style="{fontSize: 14 * beilv + 'px'}"> | ||||
|                 <span class="smallBlock" :style="{backgroundColor:subItem.color,width:8*beilv+'px',height:8*beilv+'px'}"></span> | ||||
|                 {{subItem.name}} | ||||
|               </span> | ||||
|             </div> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|     <!-- 空图 --> | ||||
|     <div class="no-data-bg" v-show='!chartList.length'></div> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import * as echarts from 'echarts' | ||||
| import { debounce } from '@/utils/debounce' | ||||
| export default { | ||||
|   name: 'MonitoringRingCharts', | ||||
|   props: { | ||||
|     chartList: { | ||||
|       type: Array, | ||||
|       default: () => { | ||||
|         return [] | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       myChart: [], | ||||
|       beilv: 1, | ||||
|       canvasReset: '' | ||||
|     } | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610 | ||||
|     this.canvasReset = debounce(() => { | ||||
|       this.initChart() | ||||
|     }, 500) | ||||
|     window.addEventListener('resize', () => { | ||||
|       this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610 | ||||
|       this.canvasReset() | ||||
|     }) | ||||
|   }, | ||||
|   methods: { | ||||
|     // 饼图 | ||||
|     initChart() { | ||||
|       if (this.chartList.length <= 0) { | ||||
|         return false | ||||
|       } | ||||
|       // 销毁实例 | ||||
|       for (let j = 0;j < this.chartList.length; j++) { | ||||
|         if (this.myChart[j]) { | ||||
|           this.myChart[j].dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例 | ||||
|         } | ||||
|       } | ||||
|       for (let i = 0; i < this.chartList.length; i++) { | ||||
|         var chartDom = document.getElementById(this.chartList[i].id); | ||||
|         this.myChart[i] = echarts.init(chartDom); | ||||
|         let colorList = [] | ||||
|         this.chartList[i].workOrder.map(item => { | ||||
|           colorList.push(item.color) | ||||
|         }) | ||||
|         let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(0) | ||||
|         var option = { | ||||
|           color: colorList, | ||||
|           series: [ | ||||
|             { | ||||
|               name: 'Access From', | ||||
|               type: 'pie', | ||||
|               radius: ['75%', '95%'], | ||||
|               avoidLabelOverlap: false, | ||||
|               itemStyle: { | ||||
|                 borderRadius: 5, | ||||
|                 borderColor: '#fff', | ||||
|                 borderWidth: 2 | ||||
|               }, | ||||
|               label: { | ||||
|                 show: true, | ||||
|                 position: 'center', | ||||
|                 color: '#000', | ||||
|                 formatter: [ | ||||
|                     '{a|'+percentage+'%}', | ||||
|                     '{b|生产'+this.chartList[i].sunNum+'}' | ||||
|                 ].join('\n\n'), | ||||
|                 rich: { | ||||
|                   a: { | ||||
|                       fontSize: this.beilv*24 +'px' | ||||
|                   }, | ||||
|                   b: { | ||||
|                       fontSize: this.beilv*12 +'px' | ||||
|                   } | ||||
|                 } | ||||
|               }, | ||||
|               emphasis: { | ||||
|                 disabled: true | ||||
|               }, | ||||
|               labelLine: { | ||||
|                 show: false | ||||
|               }, | ||||
|               data: this.chartList[i].workOrder | ||||
|             } | ||||
|           ] | ||||
|         }; | ||||
|         option && this.myChart[i].setOption(option) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| <style lang='scss' scoped> | ||||
| .chartBox { | ||||
|   width: 100%; | ||||
|   padding-right: 6px; | ||||
|   height: calc(100vh - 310px); | ||||
|   display: flex; | ||||
|   flex-flow: row wrap; | ||||
|   overflow: auto; | ||||
|   align-content: flex-start; | ||||
|   .chartItem { | ||||
|     border-radius: 8px; | ||||
|     border: 1px solid #CACACA; | ||||
|     .topTitle { | ||||
|       margin-bottom: 10px; | ||||
|       .orderName { | ||||
|         border-right: 1px solid #CACACA; | ||||
|       } | ||||
|     } | ||||
|     .legend { | ||||
|       text-align: center; | ||||
|       white-space: nowrap; | ||||
|       overflow: auto; | ||||
|       .legendItem { | ||||
|         display: inline-block; | ||||
|         border-right: 1px solid #E8E8E8; | ||||
|         .itemName { | ||||
|           .smallBlock { | ||||
|             display: inline-block; | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|       .legendItem:last-child { | ||||
|         border: none; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
| @@ -1,371 +0,0 @@ | ||||
| <template> | ||||
|   <div class="app-container orderMonitoring"> | ||||
|     <!-- 搜索工作栏 --> | ||||
|     <search-bar | ||||
|       :formConfigs="formConfig" | ||||
|       ref="searchBarForm" | ||||
|       @headBtnClick="buttonClick" | ||||
|     /> | ||||
|     <el-tabs v-model="activeName" @tab-click="toggleTab"> | ||||
|       <el-tab-pane label="数据列表" name="dataList"></el-tab-pane> | ||||
|       <el-tab-pane label="环形图" name="barChart"></el-tab-pane> | ||||
|     </el-tabs> | ||||
|     <!-- 表 --> | ||||
|     <div v-if="activeName === 'dataList'"> | ||||
|       <base-table | ||||
|         :page="queryParams.pageNo" | ||||
|         :limit="queryParams.pageSize" | ||||
|         :table-props="tableProps" | ||||
|         :table-data="list" | ||||
|         :max-height="tableH" | ||||
|       > | ||||
|         <method-btn | ||||
|           v-if="tableBtn.length" | ||||
|           slot="handleBtn" | ||||
|           :width="140" | ||||
|           label="操作" | ||||
|           :method-list="tableBtn" | ||||
|           @clickBtn="handleClick" | ||||
|         /> | ||||
|       </base-table> | ||||
|       <pagination | ||||
|         :page.sync="queryParams.pageNo" | ||||
|         :limit.sync="queryParams.pageSize" | ||||
|         :total="total" | ||||
|         @pagination="getPage" | ||||
|       /> | ||||
|     </div> | ||||
|     <!-- 图 --> | ||||
|     <monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList'/> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import { parseTime } from '@/utils/ruoyi' | ||||
| import { publicFormatter } from '@/utils/dict' | ||||
| import { orderMonitor, orderAssignmentList } from '@/api/base/orderManage' | ||||
| import MonitoringRingCharts from './../components/monitoringRingCharts' | ||||
| import moment from "moment" | ||||
| const tableProps = [ | ||||
|   { | ||||
|     prop: 'name', | ||||
|     label: '订单名称' | ||||
|   }, | ||||
|   { | ||||
|     prop: 'customerName', | ||||
|     label: '客户' | ||||
|   }, | ||||
|   { | ||||
|     prop: 'productname', | ||||
|     label: '产品' | ||||
|   }, | ||||
|   { | ||||
|     prop: 'planStartTime', | ||||
|     label: '计划开始时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'planFinishTime', | ||||
|     label: '计划完成时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'status', | ||||
|     label: '订单状态', | ||||
|     filter: publicFormatter('order_status') | ||||
|   }, | ||||
|   { | ||||
|     prop: 'startProduceTime', | ||||
|     label: '实际开始时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'finishProduceTime', | ||||
|     label: '实际完成时间', | ||||
|     filter: parseTime, | ||||
|     minWidth: 160 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'lineNames', | ||||
|     label: '加工线', | ||||
|     filter: (val) => val ? val.join(',') : '', | ||||
|     minWidth: 180 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'planQuantity', | ||||
|     label: '计划生产量', | ||||
|     width: 100 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'actualquantity', | ||||
|     label: '实际产出量', | ||||
|     width: 100 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'completeRate', | ||||
|     label: '订单完成率', | ||||
|     width: 100 | ||||
|   }, | ||||
|   { | ||||
|     prop: 'workOrderNum', | ||||
|     label: '关联工单数量', | ||||
|     width: 110 | ||||
|   } | ||||
| ] | ||||
| export default { | ||||
|   name: 'OrderCompletionMonitoring', | ||||
|   data() { | ||||
|     return { | ||||
|       formConfig: [ | ||||
|         { | ||||
|           type: 'input', | ||||
|           label: '订单名称', | ||||
|           param: 'name' | ||||
|         }, | ||||
|         { | ||||
|           type: 'datePicker', | ||||
|           label: '时间段', | ||||
|           dateType: 'daterange', | ||||
|           format: 'yyyy-MM-dd', | ||||
|           valueFormat: "yyyy-MM-dd", | ||||
|           rangeSeparator: '-', | ||||
|           startPlaceholder: '开始时间', | ||||
|           endPlaceholder: '结束时间', | ||||
|           param: 'timeVal', | ||||
|           defaultSelect: [], | ||||
|           width: 250 | ||||
|         }, | ||||
|         { | ||||
|           type: 'button', | ||||
|           btnName: '查询', | ||||
|           name: 'search', | ||||
|           color: 'primary' | ||||
|         } | ||||
|       ], | ||||
|       activeName: 'dataList', | ||||
|       // 查询参数 | ||||
|       queryParams: { | ||||
|         pageNo: 1, | ||||
|         pageSize: 20, | ||||
|         name: null, | ||||
|         startProduceTime: [] | ||||
|       }, | ||||
|       tableProps, | ||||
|       list: [], | ||||
|       tableH: this.tableHeight(305), | ||||
|       total: 0, | ||||
|       tableBtn: [ | ||||
|       this.$auth.hasPermi('base:order-completion-monitoring:orderDet') | ||||
|           ? { | ||||
|               type: 'orderDetail', | ||||
|               btnName: '工单', | ||||
|               showTip: '工单详情', | ||||
|               showParam: { | ||||
|                 type: '&', | ||||
|                 data: [ | ||||
|                   { | ||||
|                     type: 'more', | ||||
|                     name: 'workOrderNum', | ||||
|                     value: 1 | ||||
|                   } | ||||
|                 ] | ||||
|               } | ||||
|             } | ||||
|           : undefined, | ||||
|       this.$auth.hasPermi('base:order-completion-monitoring:qualityDet') | ||||
|           ? { | ||||
|               type: 'qualityDetail', | ||||
|               btnName: '质量', | ||||
|               showTip: '质量详情', | ||||
|               showParam: { | ||||
|                 type: '&', | ||||
|                 data: [ | ||||
|                   { | ||||
|                     type: 'more', | ||||
|                     name: 'workOrderNum', | ||||
|                     value: 1 | ||||
|                   } | ||||
|                 ] | ||||
|               } | ||||
|             } | ||||
|           : undefined, | ||||
|       this.$auth.hasPermi('base:order-completion-monitoring:sendOut') | ||||
|           ? { | ||||
|               type: 'sendOutDetail', | ||||
|               btnName: '发货', | ||||
|               showTip: '发货详情', | ||||
|               showParam: { | ||||
|                 type: '&', | ||||
|                 data: [ | ||||
|                   { | ||||
|                     type: 'more', | ||||
|                     name: 'workOrderNum', | ||||
|                     value: 1 | ||||
|                   } | ||||
|                 ] | ||||
|               } | ||||
|             } | ||||
|           : undefined | ||||
|       ].filter((v) => v), | ||||
|       chartList: [] | ||||
|     } | ||||
|   }, | ||||
|   components: { MonitoringRingCharts }, | ||||
|   mounted() { | ||||
|     window.addEventListener('resize', () => { | ||||
|       this.tableH = this.tableHeight(305) | ||||
|     }) | ||||
|     let start = moment().subtract(30, 'days').format('yyyy-MM-DD') | ||||
|     let end = moment().format('yyyy-MM-DD') | ||||
|     this.formConfig[1].defaultSelect = [start, end] | ||||
|     this.queryParams.startProduceTime[0] = start + ' 00:00:00' | ||||
|     this.queryParams.startProduceTime[1] = end + ' 23:59:59' | ||||
|     this.getPage() | ||||
|   }, | ||||
|   methods: { | ||||
|     getPage() { | ||||
|       // 表数据 | ||||
|       orderMonitor({...this.queryParams}).then(res => { | ||||
|         this.list = res.data.records || [] | ||||
|         this.total = res.data.total || 0 | ||||
|         if (this.list.length > 0) { | ||||
|           let orderIdList = [] | ||||
|           this.list.map(item => { | ||||
|             orderIdList.push(item.orderid) | ||||
|           }) | ||||
|           // 图的数据 | ||||
|           orderAssignmentList({orderIdList:orderIdList}).then(res => { | ||||
|             let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A'] | ||||
|             let tempArr = res.data || {} | ||||
|             let tempArr2 = [] | ||||
|             for (let key in tempArr) { | ||||
|               let tempArr3 = [] | ||||
|               let obj = {} | ||||
|               obj.orderName = tempArr[key][0].orderName | ||||
|               obj.id = key | ||||
|               obj.num = tempArr[key][0].planQuantity | ||||
|               let sunNum = 0 | ||||
|               for (let i = 0; i < tempArr[key].length; i++) { | ||||
|                 let subObj = {} | ||||
|                 subObj.value = tempArr[key][i].actualAssignmentQuantity | ||||
|                 subObj.name = tempArr[key][i].woName | ||||
|                 if (i < 5) { | ||||
|                   subObj.color = color[i] | ||||
|                 } else { | ||||
|                   subObj.color = color[i%5] | ||||
|                 } | ||||
|                 sunNum+=tempArr[key][i].actualAssignmentQuantity | ||||
|                 tempArr3.push(subObj) | ||||
|               } | ||||
|               tempArr3.push({ | ||||
|                 value: tempArr[key][0].planQuantity - sunNum > 0 ? tempArr[key][0].planQuantity - sunNum : 0, | ||||
|                 name: '未下发', | ||||
|                 color: '#F5F5F5' | ||||
|               }) | ||||
|               obj.sunNum = sunNum | ||||
|               obj.workOrder = tempArr3 | ||||
|               tempArr2.push(obj) | ||||
|             } | ||||
|             this.chartList = tempArr2 | ||||
|             if (this.activeName === 'barChart' && this.chartList.length > 0) { | ||||
|               this.$nextTick(() => { | ||||
|                 this.$refs.monitoringRingCharts.initChart() | ||||
|               }) | ||||
|             } | ||||
|           }) | ||||
|         }else{ | ||||
|           // 显示无数据的图片 | ||||
|           this.chartList = [] | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     // 查询 | ||||
|     buttonClick(val) { | ||||
|       this.queryParams.name = val.name | ||||
|       if (val.timeVal && val.timeVal.length > 0) { | ||||
|         this.queryParams.startProduceTime[0] = val.timeVal[0] + ' 00:00:00' | ||||
|         this.queryParams.startProduceTime[1] = val.timeVal[1] + ' 23:59:59' | ||||
|       } else { | ||||
|         this.queryParams.startProduceTime = [] | ||||
|       } | ||||
|       this.getPage() | ||||
|     }, | ||||
|     handleClick(val) { | ||||
|       console.log(val) | ||||
|       switch (val.type) { | ||||
|         case 'orderDetail': | ||||
|           this.$router.push({ | ||||
|             path: '/core/core-work-order-detail?woIdString='+val.data.woIdString | ||||
|           }) | ||||
|           break | ||||
|         case 'qualityDetail': | ||||
|           this.$router.push({ | ||||
|             path: '/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString='+val.data.woIdString | ||||
|           }) | ||||
|           break | ||||
|         default: | ||||
|           this.$router.push({ | ||||
|             path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name) | ||||
|           }) | ||||
|         } | ||||
|     }, | ||||
|     toggleTab() { | ||||
|       if (this.activeName === 'barChart' && this.chartList.length > 0) { | ||||
|         this.$nextTick(() => { | ||||
|           this.$refs.monitoringRingCharts.initChart() | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
| } | ||||
| } | ||||
| </script> | ||||
| <style lang='scss'> | ||||
| .orderMonitoring { | ||||
|   .el-tabs__nav::after { | ||||
|     content: ""; | ||||
|     position: absolute; | ||||
|     left: 0; | ||||
|     bottom: 0; | ||||
|     width: 100%; | ||||
|     height: 2px; | ||||
|     background-color: #e4e7ed; | ||||
|   } | ||||
|   .el-tabs__nav-wrap::after { | ||||
|     width: 0; | ||||
|   } | ||||
|   .el-tabs__item { | ||||
|     padding: 0 10px; | ||||
|   } | ||||
|   .el-tabs__item:hover { | ||||
|     color: rgba(0, 0, 0, 0.85); | ||||
|   } | ||||
|   .el-tabs__item.is-active { | ||||
|     color: rgba(0, 0, 0, 0.85); | ||||
|   } | ||||
|   .el-tabs__item { | ||||
|     color: rgba(0, 0, 0, 0.45); | ||||
|   } | ||||
|   .searchBarBox { | ||||
|     margin-bottom: 0; | ||||
|   } | ||||
|   .boxTitle { | ||||
|     display: inline-block; | ||||
|     font-size: 16px; | ||||
|     font-weight: 400; | ||||
|     color: #000000; | ||||
|     margin:0 10px 16px 0; | ||||
|   } | ||||
|   .blueTitle { | ||||
|     content: ''; | ||||
|     display: inline-block; | ||||
|     width: 4px; | ||||
|     height: 18px; | ||||
|     background-color: #0B58FF; | ||||
|     border-radius: 1px; | ||||
|     margin-right: 8px; | ||||
|     vertical-align: bottom; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
| @@ -8,7 +8,7 @@ | ||||
| 		<el-row :gutter="20"> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="工单模式"> | ||||
| 					<el-radio-group v-model="isBind"> | ||||
| 					<el-radio-group v-model="isBind" @input='toggleWay'> | ||||
| 						<el-radio :label="true">绑定工单</el-radio> | ||||
| 						<el-radio :label="false">新增工单</el-radio> | ||||
| 					</el-radio-group> | ||||
| @@ -48,16 +48,19 @@ | ||||
| 						<el-option | ||||
| 							v-for="item in productList" | ||||
| 							:key="item.id" | ||||
| 							:label="item.name + ' | ' + item.specifications" | ||||
| 							:value="item.id"> | ||||
| 							<span style="float: left">{{ item.name }}</span> | ||||
| 							<span style="float: right; color: #8492a6; font-size: 13px"> | ||||
| 								{{ item.specifications }} | ||||
| 							</span> | ||||
| 						</el-option> | ||||
| 							:label="item.name" | ||||
| 							:value="item.id"/> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="产品规格" prop="specifications"> | ||||
| 					<el-input | ||||
| 						v-model="form.specifications" | ||||
| 						placeholder="请输入产品规格" | ||||
| 						disabled /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="计划开始时间"> | ||||
| 					<el-date-picker | ||||
| @@ -100,48 +103,6 @@ | ||||
| 						style="width: 100%"></el-input-number> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="关联工艺" prop="processFlowId"> | ||||
| 					<el-select | ||||
| 						v-model="form.processFlowId" | ||||
| 						placeholder="请选择" | ||||
| 						disabled | ||||
| 						style="width: 100%"> | ||||
| 						<el-option | ||||
| 							v-for="item in processFlowList" | ||||
| 							:key="item.id" | ||||
| 							:label="item.name" | ||||
| 							:value="item.id"></el-option> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="物料计算方式" prop="materialMethod"> | ||||
| 					<el-select | ||||
| 						v-model="form.materialMethod" | ||||
| 						placeholder="请选择" | ||||
| 						style="width: 100%" | ||||
| 						disabled> | ||||
| 						<el-option label="产品基础BOM" :value="1"></el-option> | ||||
| 						<el-option label="工艺扩展BOM" :value="2"></el-option> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="优先级" prop="priority"> | ||||
| 					<el-select | ||||
| 						v-model="form.priority" | ||||
| 						placeholder="请选择" | ||||
| 						style="width: 100%" | ||||
| 						:disabled="isBind"> | ||||
| 						<el-option | ||||
| 							v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" | ||||
| 							:key="item.value" | ||||
| 							:label="item.label" | ||||
| 							:value="item.value"></el-option> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="工单类型" prop="type"> | ||||
| 					<el-select | ||||
| @@ -157,33 +118,13 @@ | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="关联产线" prop="productLineId"> | ||||
| 					<el-select | ||||
| 						v-model="form.productLineId" | ||||
| 						placeholder="请选择" | ||||
| 						multiple | ||||
| 						style="width: 100%" | ||||
| 						:disabled="isBind"> | ||||
| 						<el-option | ||||
| 							v-for="item in productLineList" | ||||
| 							:key="item.id" | ||||
| 							:label="item.name" | ||||
| 							:value="item.id"></el-option> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="负责人" prop="workers"> | ||||
| 					<el-input v-model="form.workers" :disabled="isBind"></el-input> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="负责部门" prop="deptId"> | ||||
| 					<el-select | ||||
| 						v-model="form.deptId" | ||||
| 						placeholder="请选择关联产线" | ||||
| 						style="width: 100%"> | ||||
| 						style="width: 100%" | ||||
| 						:disabled="isBind"> | ||||
| 						<el-option | ||||
| 							v-for="item in deptList" | ||||
| 							:key="item.id" | ||||
| @@ -192,23 +133,123 @@ | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="6"> | ||||
| 				<el-form-item label="计划分配订单量" prop="planAssignmentQuantity"> | ||||
| 					<el-input-number | ||||
| 						v-model="form.planAssignmentQuantity" | ||||
| 						:min="0" | ||||
| 						:max="9999999999999" | ||||
| 						style="width: 100%"></el-input-number> | ||||
| 				</el-form-item> | ||||
| 		</el-row> | ||||
| 		<el-row :gutter="20"> | ||||
| 			<el-col :span="24"> | ||||
| 				<span class="add-type">物料计算方式</span> | ||||
| 				<el-radio-group | ||||
| 					v-model="form.materialMethod" | ||||
| 					:disabled="isBind" | ||||
| 					@change="materialMethodChange"> | ||||
| 					<el-radio :label="1">产品基础BOM</el-radio> | ||||
| 					<el-radio :label="2">工艺扩展BOM</el-radio> | ||||
| 				</el-radio-group> | ||||
| 			</el-col> | ||||
| 		</el-row> | ||||
| 		<div v-if="form.materialMethod === 1"> | ||||
| 			<el-row :gutter="20"> | ||||
| 				<el-col :span="24"> | ||||
| 					<span style="margin: 8px 0;" class="add-type">关联产线</span> | ||||
| 					<el-button style="margin-left: 20px" type="text" @click="addBind" :disabled="isBind"> | ||||
| 						新增 | ||||
| 					</el-button> | ||||
| 				</el-col> | ||||
| 			</el-row> | ||||
| 			<el-row | ||||
| 				:gutter="20" | ||||
| 				v-for="(item, index) in form.productLineIds" | ||||
| 				:key="index + 'line'" | ||||
| 				style="margin-bottom: 8px"> | ||||
| 				<el-col :span="8"> | ||||
| 					<el-select | ||||
| 						v-model="item.lineId" | ||||
| 						placeholder="请选择产线" | ||||
| 						:disabled="isBind" | ||||
| 						style="width: 100%"> | ||||
| 						<el-option | ||||
| 							v-for="item in productLineList" | ||||
| 							:key="item.id" | ||||
| 							:label="item.name" | ||||
| 							:value="item.id"></el-option> | ||||
| 					</el-select> | ||||
| 				</el-col> | ||||
| 				<el-col :span="8"> | ||||
|           <el-tooltip effect="dark" content="该产线分配生产数量" placement="top-end"> | ||||
| 					<el-input-number | ||||
| 						style="width: 100%" | ||||
| 						v-model="item.num" | ||||
| 						placeholder="请输入数量" | ||||
| 						:step="1" | ||||
| 						:min="0" | ||||
| 						:disabled="isBind" | ||||
| 						step-strictly /> | ||||
|             </el-tooltip> | ||||
| 				</el-col> | ||||
| 			</el-row> | ||||
| 		</div> | ||||
| 		<div v-else> | ||||
| 			<el-row :gutter="20"> | ||||
| 				<el-col :span="24"> | ||||
| 					<span style="margin: 8px 0; display: inline-block"> | ||||
| 						关联产线及工艺 | ||||
| 					</span> | ||||
| 					<el-button style="margin-left: 20px" type="text" @click="addBind" :disabled="isBind"> | ||||
| 						新增 | ||||
| 					</el-button> | ||||
| 				</el-col> | ||||
| 			</el-row> | ||||
| 			<el-row | ||||
| 				:gutter="20" | ||||
| 				v-for="(item, index) in form.productLineIds" | ||||
| 				:key="index + 'process'" | ||||
| 				style="margin-bottom: 8px"> | ||||
| 				<el-col :span="8"> | ||||
| 					<el-select | ||||
| 						v-model="item.lineId" | ||||
| 						placeholder="请选择产线" | ||||
| 						style="width: 100%" | ||||
| 						:disabled="isBind" | ||||
| 						@change="processLineIdChange"> | ||||
| 						<el-option | ||||
| 							v-for="item in productLineList" | ||||
| 							:key="item.id" | ||||
| 							:label="item.name" | ||||
| 							:value="item.id"></el-option> | ||||
| 					</el-select> | ||||
| 				</el-col> | ||||
| 				<el-col :span="8"> | ||||
| 					<el-select | ||||
| 						v-model="item.processId" | ||||
| 						placeholder="请选择工艺" | ||||
| 						filterable | ||||
| 						:disabled="isBind" | ||||
| 						style="width: 100%"> | ||||
| 						<el-option | ||||
| 							v-for="item in processFlowList" | ||||
| 							:key="item.id" | ||||
| 							:label="item.name" | ||||
| 							:value="item.id"></el-option> | ||||
| 					</el-select> | ||||
| 				</el-col> | ||||
| 				<el-col :span="8"> | ||||
|           <el-tooltip effect="dark" content="该产线分配生产数量" placement="top-end"> | ||||
| 					<el-input-number | ||||
| 						style="width: 100%" | ||||
| 						v-model="item.num" | ||||
| 						:step="1" | ||||
| 						:min="0" | ||||
| 						:disabled="isBind" | ||||
| 						step-strictly /> | ||||
|           </el-tooltip> | ||||
| 				</el-col> | ||||
| 			</el-row> | ||||
| 		</div> | ||||
| 	</el-form> | ||||
| </template> | ||||
| <script> | ||||
| import { getProductAll } from '@/api/base/product'; | ||||
| import { getProductList } from '@/api/base/product'; | ||||
| import { | ||||
| 	getProcessFlowList, | ||||
| 	getWorkOrderCode, | ||||
| 	getProcessFlowPage, | ||||
| 	orderIssue, | ||||
| 	workOrderList, | ||||
| 	getWorkOrderById, | ||||
| @@ -216,13 +257,13 @@ import { | ||||
| import { getLineAll } from '@/api/base/productionLine'; | ||||
| import { listDept } from '@/api/system/dept'; | ||||
| import moment from 'moment'; | ||||
| import { getCode } from '@/api/base/coreWorkOrder'; | ||||
| export default { | ||||
| 	name: 'AddWorkOrder', | ||||
| 	data() { | ||||
| 		return { | ||||
| 			form: { | ||||
| 				workOrderId: '', | ||||
| 				orderId: '', | ||||
| 				name: '', | ||||
| 				code: '', | ||||
| 				planProductId: '', | ||||
| @@ -231,12 +272,9 @@ export default { | ||||
| 				planAssignQuantity: 0, | ||||
| 				deptId: undefined, | ||||
| 				planQuantity: 0, | ||||
| 				processFlowId: '', | ||||
| 				materialMethod: 1, | ||||
| 				priority: '', | ||||
| 				productLineId: [], | ||||
| 				productLineIds: [{ lineId: null, processId: null, num: null }], | ||||
| 				type: '', | ||||
| 				workers: '', | ||||
| 				planAssignmentQuantity: '', | ||||
| 			}, | ||||
| 			deptList: [], | ||||
| @@ -244,6 +282,9 @@ export default { | ||||
| 				name: [ | ||||
| 					{ required: true, message: '工单名称不能为空', trigger: 'blur' }, | ||||
| 				], | ||||
| 				workOrderId:[ | ||||
| 				{ required: true, message: '工单名称不能为空', trigger: 'change' }, | ||||
| 				], | ||||
| 				planProductId: [ | ||||
| 					{ required: true, message: '产品名称不能为空', trigger: 'change' }, | ||||
| 				], | ||||
| @@ -253,9 +294,6 @@ export default { | ||||
| 				planQuantity: [ | ||||
| 					{ required: true, message: '计划生产数量不能为空', trigger: 'blur' }, | ||||
| 				], | ||||
| 				productLineId: [ | ||||
| 					{ required: true, message: '产线不能为空', trigger: 'change' }, | ||||
| 				], | ||||
| 				planAssignmentQuantity: [ | ||||
| 					{ | ||||
| 						required: true, | ||||
| @@ -263,63 +301,81 @@ export default { | ||||
| 						trigger: 'blur', | ||||
| 					}, | ||||
| 				], | ||||
| 				deptId:[ | ||||
| 					{ required: true, message: '负责部门不能为空', trigger: 'change' }, | ||||
| 				], | ||||
| 			}, | ||||
| 			productList: [], | ||||
| 			processFlowList: [], | ||||
| 			productLineList: [], | ||||
| 			workOrderTypeList: [ | ||||
| 				{ id: 1, name: '标准工单' }, | ||||
| 				{ id: 2, name: '特殊工单' }, | ||||
| 				{ id: 1, name: '普通' }, | ||||
| 				{ id: 2, name: '特殊' }, | ||||
| 			], | ||||
| 			planStartTime: '', | ||||
| 			planFinishTime: '', | ||||
| 			isBind: false, | ||||
| 			isBind: true, | ||||
| 			workOrderList: [], | ||||
| 			orderData: {}, | ||||
| 		}; | ||||
| 	}, | ||||
| 	methods: { | ||||
| 		// 工艺变更 | ||||
| 		materialMethodChange(val) { | ||||
| 			console.log(val); | ||||
| 			this.processFlowList = []; | ||||
| 			this.form.productLineIds = []; | ||||
| 			const obj = { lineId: null, processId: null, num: null }; | ||||
| 			this.form.productLineIds.push(obj); | ||||
| 		}, | ||||
| 		// 产线工艺关联 | ||||
| 		processLineIdChange(val) { | ||||
| 			const params = { | ||||
| 				pageNo: 1, | ||||
| 				pageSize: 100, | ||||
| 				lineId: val, | ||||
| 			}; | ||||
| 			// 工艺 | ||||
| 			getProcessFlowPage(params).then((res) => { | ||||
| 				this.processFlowList = res.data.list || []; | ||||
| 				console.log(this.processFlowList); | ||||
| 			}); | ||||
| 		}, | ||||
| 		init(data, param) { | ||||
| 			this.isBind = true; | ||||
| 			this.orderData = data; | ||||
| 			this.form.orderId = data.id; | ||||
| 			this.getList(); | ||||
| 		}, | ||||
| 		changeAdd() { | ||||
| 			if (this.isBind) { | ||||
| 				this.isBind = false; | ||||
| 				getWorkOrderCode().then((res) => { | ||||
| 					this.form.code = res.data || ''; | ||||
| 				}); | ||||
| 				this.form.orderId = null; | ||||
| 				this.form.planProductId = this.orderData.planProductId; | ||||
| 				this.form.processFlowId = this.orderData.processFlowId; | ||||
| 				this.form.materialMethod = this.orderData.materialMethod; | ||||
| 			} else { | ||||
| 				this.isBind = true; | ||||
| 				this.form.orderId = this.orderData.id; | ||||
| 				this.form.planProductId = null; | ||||
| 				this.form.processFlowId = null; | ||||
| 				this.form.materialMethod = null; | ||||
| 				this.form.code = null; | ||||
| 		toggleWay(val) { | ||||
| 			console.log(val); | ||||
| 			this.formClear() | ||||
| 			if (!val) { | ||||
| 				// 获取工单编码 | ||||
| 				getCode().then((res) => { | ||||
| 				  this.form.code = res.data; | ||||
| 					this.form.planProductId = this.orderData.planProductId; | ||||
| 					this.form.name = ''; | ||||
| 					this.selectProduct(this.form.planProductId) | ||||
| 				}) | ||||
| 			}else{ | ||||
| 				this.form.code = ''; | ||||
| 				this.form.planProductId = ''; | ||||
| 			} | ||||
| 			this.form.materialMethod = 1; | ||||
| 			this.form.productLineIds = []; | ||||
| 		}, | ||||
| 		getList() { | ||||
| 			listDept().then((res) => { | ||||
| 				this.deptList = res.data || []; | ||||
| 			}); | ||||
| 			// 产品 | ||||
| 			getProductAll().then((res) => { | ||||
| 			getProductList().then((res) => { | ||||
| 				this.productList = res.data || []; | ||||
| 			}); | ||||
| 			// 产线 | ||||
| 			getLineAll().then((res) => { | ||||
| 				this.productLineList = res.data || []; | ||||
| 			}); | ||||
| 			// 工艺 | ||||
| 			getProcessFlowList().then((res) => { | ||||
| 				this.processFlowList = res.data || []; | ||||
| 			}); | ||||
| 			// 工单list | ||||
| 			workOrderList({ | ||||
| 				status: 1, | ||||
| @@ -327,6 +383,18 @@ export default { | ||||
| 				this.workOrderList = res.data || []; | ||||
| 			}); | ||||
| 		}, | ||||
| 		// 选产品带出规格 | ||||
| 		selectProduct(val) { | ||||
| 			if (val) { | ||||
| 				this.productList.map((item) => { | ||||
| 					if (val === item.id) { | ||||
| 						this.form.specifications = item.specifications; | ||||
| 					} | ||||
| 				}); | ||||
| 			} else { | ||||
| 				this.form.specifications = ''; | ||||
| 			} | ||||
| 		}, | ||||
| 		addWorkOrderSubmit() { | ||||
| 			this.$refs['addWorkOrder'].validate((valid) => { | ||||
| 				if (valid) { | ||||
| @@ -334,8 +402,7 @@ export default { | ||||
| 						//绑定工单 | ||||
| 						orderIssue({ | ||||
| 							workOrderId: this.form.workOrderId, | ||||
| 							orderId: this.form.orderId, | ||||
| 							planAssignmentQuantity: this.form.planAssignmentQuantity, | ||||
| 							orderId: this.orderData.id, | ||||
| 						}).then((res) => { | ||||
| 							if (res.code === 0) { | ||||
| 								this.$modal.msgSuccess('操作成功'); | ||||
| @@ -344,24 +411,19 @@ export default { | ||||
| 						}); | ||||
| 					} else { | ||||
| 						// 新增工单 | ||||
| 						let _this = this; | ||||
| 						_this.form.planStartTime = _this.planStartTime | ||||
| 							? new Date(_this.planStartTime).valueOf() | ||||
| 						this.form.planStartTime = this.planStartTime | ||||
| 							? new Date(this.planStartTime).valueOf() | ||||
| 							: ''; | ||||
| 						_this.form.planFinishTime = _this.planFinishTime | ||||
| 							? new Date(_this.planFinishTime).valueOf() | ||||
| 						this.form.planFinishTime = this.planFinishTime | ||||
| 							? new Date(this.planFinishTime).valueOf() | ||||
| 							: ''; | ||||
| 						orderIssue({ ..._this.form }).then((res) => { | ||||
| 						orderIssue({ | ||||
| 							...this.form, | ||||
| 							orderId: this.orderData.id, | ||||
| 						}).then((res) => { | ||||
| 							if (res.code === 0) { | ||||
| 								_this.$modal.msgSuccess('操作成功'); | ||||
| 								let name = this.form.name; | ||||
| 								_this.$emit('addWorkOrderSubmit'); | ||||
| 								// 询问是否添加预使用主原料 | ||||
| 								// _this.$modal.confirm('是否添加预使用主原料信息?').then(function() { | ||||
| 								//     _this.$router.push({ | ||||
| 								//       path: '/core/core-work-order?workOrderName='+encodeURI(name) | ||||
| 								//     }) | ||||
| 								//   }) | ||||
| 								this.$modal.msgSuccess('操作成功'); | ||||
| 								this.$emit('addWorkOrderSubmit'); | ||||
| 							} | ||||
| 						}); | ||||
| 					} | ||||
| @@ -379,39 +441,49 @@ export default { | ||||
| 			this.planStartTime = ''; | ||||
| 			this.form.planFinishTime = ''; | ||||
| 			this.form.planStartTime = ''; | ||||
| 			this.isBind = false; | ||||
| 		}, | ||||
| 		// 绑定工单,选择工单时获取工单信息 | ||||
| 		getWorkOrderMsg() { | ||||
| 			if (this.form.workOrderId) { | ||||
| 				getWorkOrderById({ id: this.form.workOrderId }).then((res) => { | ||||
| 					if (res.code === 0) { | ||||
| 						this.form.code = res.data.code; | ||||
| 						this.form.planProductId = res.data.planProductId; | ||||
| 						this.form = res.data; | ||||
| 						this.form.workOrderId = res.data.id; | ||||
| 						this.planStartTime = res.data.planStartTime | ||||
| 							? moment | ||||
| 									.unix(res.data.planStartTime) | ||||
| 							? moment(res.data.planStartTime) | ||||
| 									.format('YYYY-MM-DD HH:mm:ss') | ||||
| 							: null; | ||||
| 						this.planFinishTime = res.data.planFinishTime | ||||
| 							? moment | ||||
| 									.unix(res.data.planFinishTime) | ||||
| 							? moment(res.data.planFinishTime) | ||||
| 									.format('YYYY-MM-DD HH:mm:ss') | ||||
| 							: null; | ||||
| 						this.form.planAssignQuantity = res.data.planAssignQuantity; | ||||
| 						this.form.planQuantity = res.data.planQuantity; | ||||
| 						this.form.processFlowId = res.data.processFlowId; | ||||
| 						this.form.materialMethod = res.data.materialMethod; | ||||
| 						this.form.priority = res.data.priority | ||||
| 							? res.data.priority + '' | ||||
| 							: ''; | ||||
| 						this.form.productLineId = res.data.productLineIds; | ||||
| 						this.form.type = res.data.type; | ||||
| 						this.form.workers = res.data.workers; | ||||
| 						// 根据产线获取工艺 | ||||
| 						if (this.form.materialMethod === 2) { | ||||
| 							this.form.productLineIds.forEach((item) => { | ||||
| 								if (item.lineId) { | ||||
| 									this.processLineIdChange(item.lineId); | ||||
| 								} | ||||
| 							}) | ||||
| 						} | ||||
| 					} | ||||
| 				}); | ||||
| 			} | ||||
| 		}, | ||||
| 		addBind() { | ||||
| 			const obj = { lineId: null, processId: null, num: null }; | ||||
| 			this.form.productLineIds.push(obj); | ||||
| 		}, | ||||
| 	}, | ||||
| }; | ||||
| </script> | ||||
| <style scoped> | ||||
| .add-type { | ||||
| 	margin: 0 20px 15px 0; | ||||
| 	display: inline-block; | ||||
| } | ||||
| .add-type::before { | ||||
| 	content: '*'; | ||||
| 	color: #ff4949; | ||||
| 	margin-right: 4px; | ||||
| } | ||||
| </style> | ||||
|   | ||||
| @@ -19,6 +19,12 @@ | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="产品名称" prop="planProductId"> | ||||
|           <el-select @change="getSpec" v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable> | ||||
|             <el-option v-for="item in productList" :key="item.id" :label="item.name" | ||||
|               :value="item.id"/> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <!-- <el-form-item label="产品名称" prop="planProductId"> | ||||
|           <el-select @change="getSpec" v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable> | ||||
|             <el-option v-for="item in productList" :key="item.id" :label="item.name+' | '+(item.specifications || '')" | ||||
|               :value="item.id"> | ||||
| @@ -26,7 +32,7 @@ | ||||
|               <span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span> | ||||
|             </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         </el-form-item> --> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
| @@ -50,16 +56,6 @@ | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="单价" prop="price"> | ||||
|           <el-input-number v-model="form.price" :min="0" :max="9999999999999" :precision='2' style="width: 100%;"> | ||||
|           </el-input-number> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='6'> | ||||
|         <el-form-item label="包装规格" prop="packSpec"> | ||||
|           <el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable> | ||||
| @@ -69,7 +65,9 @@ | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|       <el-col :span='12'> | ||||
|     </el-row> | ||||
|     <el-row :gutter="20"> | ||||
|       <el-col :span='24'> | ||||
|         <el-form-item label="备注" prop="remark"> | ||||
|           <el-input v-model="form.remark"></el-input> | ||||
|         </el-form-item> | ||||
| @@ -79,7 +77,7 @@ | ||||
| </template> | ||||
| <script> | ||||
| import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate } from '@/api/base/orderManage' | ||||
| import { getProductAll } from '@/api/base/product' | ||||
| import { getProductList } from '@/api/base/product' | ||||
| import { getCustomerList } from '@/api/base/customer' | ||||
| export default { | ||||
|   name: 'OrderAdd', | ||||
| @@ -93,9 +91,7 @@ export default { | ||||
|         planQuantity: '', | ||||
|         planProductId: '', | ||||
|         specifications:undefined, | ||||
|         price: '', | ||||
|         customerId: '', | ||||
|         priority: '', | ||||
|         packSpec: '', | ||||
|         workers: '', | ||||
|         materialMethod: 1, | ||||
| @@ -108,7 +104,8 @@ export default { | ||||
|         name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }], | ||||
|         code: [{ required: true, message: "订单号不能为空", trigger: "blur" }], | ||||
|         planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }], | ||||
|         planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }] | ||||
|         planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }], | ||||
|         deliveTime: [{ required: true, message: "交货日期不能为空", trigger: "change" }] | ||||
|       }, | ||||
|       productList: [], | ||||
|       customerList: [], | ||||
| @@ -136,9 +133,7 @@ export default { | ||||
|             this.form.code = res.data.code | ||||
|             this.form.planQuantity = res.data.planQuantity | ||||
|             this.form.planProductId = res.data.planProductId | ||||
|             this.form.price = res.data.price | ||||
|             this.form.customerId = res.data.customerId | ||||
|             this.form.priority = res.data.priority ? res.data.priority + '' : '' | ||||
|             this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null | ||||
|             this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : '' | ||||
|             this.form.workers = res.data.workers | ||||
| @@ -160,7 +155,7 @@ export default { | ||||
|     }, | ||||
|     getList() { | ||||
|       // 产品 | ||||
|       getProductAll().then(res => { | ||||
|       getProductList().then(res => { | ||||
|         this.productList = res.data || [] | ||||
|       }) | ||||
|       // 客户 | ||||
| @@ -229,7 +224,6 @@ export default { | ||||
|     formClear() { | ||||
|       this.$refs.orderAddForm.resetFields() | ||||
|       this.form.materialMethod = 1 | ||||
|       this.form.price = 0.00 | ||||
|       this.form.planQuantity = 0 | ||||
|       this.isEdit = false | ||||
|     } | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: zwq | ||||
|  * @Date: 2024-09-26 14:08:58 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-11-06 09:52:59 | ||||
|  * @LastEditTime: 2024-11-13 15:23:25 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| @@ -69,15 +69,10 @@ const tableProps = [ | ||||
| 		showOverflowtooltip: true, | ||||
| 	}, | ||||
| 	{ | ||||
| 		prop: 'specifications', | ||||
| 		prop: 'productSpec', | ||||
| 		label: '产品规格', | ||||
| 		showOverflowtooltip: true, | ||||
| 	}, | ||||
| 	// { | ||||
| 	//   prop: 'priority', | ||||
| 	//   label: '优先级', | ||||
| 	//   filter: publicFormatter('order_priority') | ||||
| 	// }, | ||||
| 	{ | ||||
| 		prop: 'planQuantity', | ||||
| 		label: '计划加工量', | ||||
| @@ -92,17 +87,11 @@ const tableProps = [ | ||||
| 		subcomponent: selectTime, | ||||
| 	}, | ||||
| 	{ | ||||
| 		prop: 'customerId', | ||||
| 		prop: 'customerName', | ||||
| 		label: '客户', | ||||
| 		showOverflowtooltip: true, | ||||
| 		// subcomponent: selectMember, | ||||
| 	}, | ||||
| 	{ | ||||
| 		prop: 'price', | ||||
| 		label: '单价', | ||||
| 		width: 100, | ||||
| 		// subcomponent: inputArea, | ||||
| 	}, | ||||
| 	{ | ||||
| 		prop: 'packSpec', | ||||
| 		label: '包装规格', | ||||
| @@ -130,10 +119,8 @@ export default { | ||||
| 				code: '', | ||||
| 				planQuantity: '', | ||||
| 				planProductId: '', | ||||
| 				price: '', | ||||
| 				customerId: '', | ||||
| 				attr3: undefined, | ||||
| 				priority: '', | ||||
| 				packSpec: '', | ||||
| 				workers: '', | ||||
| 				materialMethod: 1, | ||||
| @@ -190,9 +177,7 @@ export default { | ||||
| 			//       this.form.code = res.data.code | ||||
| 			//       this.form.planQuantity = res.data.planQuantity | ||||
| 			//       this.form.planProductId = res.data.planProductId | ||||
| 			//       this.form.price = res.data.price | ||||
| 			//       this.form.customerId = res.data.customerId | ||||
| 			//       this.form.priority = res.data.priority ? res.data.priority + '' : '' | ||||
| 			//       this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null | ||||
| 			//       this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : '' | ||||
| 			//       this.form.workers = res.data.workers | ||||
|   | ||||
| @@ -62,14 +62,14 @@ | ||||
| 				label="产品" | ||||
| 				show-overflow-tooltip | ||||
| 				min-width="120" /> | ||||
| 			<el-table-column prop="deliveTime" label="交货时间" width="160"> | ||||
| 			<el-table-column prop="deliveTime" label="交货日期" width="160"> | ||||
| 				<template v-slot="scope"> | ||||
| 					<span>{{ parseTime(scope.row.deliveTime) }}</span> | ||||
| 				</template> | ||||
| 			</el-table-column> | ||||
| 			<el-table-column prop="workOrderNum" label="工单数量" width="140"> | ||||
| 				<template v-slot="scope"> | ||||
| 					<el-button @click="handleRoute" type="text"> | ||||
| 					<el-button @click="handleRoute(scope.row)" type="text" style='padding: 0px;'> | ||||
| 						{{ scope.row.workOrderNum }} | ||||
| 					</el-button> | ||||
| 				</template> | ||||
| @@ -78,6 +78,7 @@ | ||||
| 				<template v-slot="scope"> | ||||
| 					<el-button | ||||
| 						type="text" | ||||
| 						style='padding: 0px;' | ||||
| 						:disabled="!(scope.row.status != 5 && scope.row.workOrderNum === 0)" | ||||
| 						@click="handleClick({ data: scope.row, type: 'split' })" | ||||
| 						v-hasPermi="['base:order-manage:split']"> | ||||
| @@ -86,6 +87,7 @@ | ||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||
| 					<el-button | ||||
| 						type="text" | ||||
| 						style='padding: 0px;' | ||||
| 						:disabled=" | ||||
| 							!( | ||||
| 								scope.row.status === 1 || | ||||
| @@ -95,12 +97,22 @@ | ||||
| 						" | ||||
| 						@click="handleClick({ data: scope.row, type: 'bind' })" | ||||
| 						v-hasPermi="['base:order-manage:bindWorkOrder']"> | ||||
| 						绑定工单 | ||||
| 						下发工单 | ||||
| 					</el-button> | ||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||
| 					<el-button | ||||
| 						type="text" | ||||
| 						style='padding: 0px;' | ||||
| 						:disabled="!(scope.row.status === 2 || scope.row.status === 3)" | ||||
| 						@click="handleClick({ data: scope.row, type: 'stop' })" | ||||
| 						v-hasPermi="['base:order-manage:stop']"> | ||||
| 						终止 | ||||
| 					</el-button> | ||||
|           <!-- addWorkOrder --> | ||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||
| 					<el-button | ||||
| 						type="text" | ||||
| 						style='padding: 0px;' | ||||
| 						:disabled="!(scope.row.status === 2 || scope.row.status === 3)" | ||||
| 						@click="handleClick({ data: scope.row, type: 'complete' })" | ||||
| 						v-hasPermi="['base:order-manage:bindWorkOrder']"> | ||||
| @@ -109,6 +121,7 @@ | ||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||
| 					<el-button | ||||
| 						type="text" | ||||
| 						style='padding: 0px;' | ||||
| 						@click="handleClick({ data: scope.row, type: 'detail' })" | ||||
| 						v-hasPermi="['base:order-manage:detail']"> | ||||
| 						<span class="iconfont icon-detail primary-color" /> | ||||
| @@ -116,15 +129,16 @@ | ||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||
| 					<el-button | ||||
| 						type="text" | ||||
| 						style='padding: 0px;' | ||||
| 						:disabled=" | ||||
| 							!(scope.row.status === 1 && scope.row.triggerOrigin === 1) | ||||
| 							!(scope.row.status === 1) | ||||
| 						" | ||||
| 						@click="handleClick({ data: scope.row, type: 'edit' })" | ||||
| 						v-hasPermi="['base:order-manage:edit']"> | ||||
| 						<span | ||||
| 							class="iconfont icon-edit" | ||||
| 							:class=" | ||||
| 								!(scope.row.status === 1 && scope.row.triggerOrigin === 1) | ||||
| 								!(scope.row.status === 1) | ||||
| 									? '' | ||||
| 									: 'primary-color' | ||||
| 							" /> | ||||
| @@ -132,18 +146,12 @@ | ||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||
| 					<el-button | ||||
| 						type="text" | ||||
| 						style='padding: 0px;' | ||||
| 						:disabled="scope.row.status != 1" | ||||
| 						@click="handleClick({ data: scope.row, type: 'void' })" | ||||
| 						v-hasPermi="['base:order-manage:delete']"> | ||||
| 						作废 | ||||
| 					</el-button> | ||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||
| 					<el-button | ||||
| 						type="text" | ||||
| 						@click="handleClick({ data: scope.row, type: 'stop' })" | ||||
| 						v-hasPermi="['base:order-manage:stop']"> | ||||
| 						终止 | ||||
| 					</el-button> | ||||
| 				</template> | ||||
| 			</el-table-column> | ||||
| 		</el-table> | ||||
| @@ -193,7 +201,6 @@ | ||||
| import { parseTime } from '@/utils/ruoyi'; | ||||
| import { | ||||
| 	getOrderPage, | ||||
| 	orderDelete, | ||||
| 	orderAssignmentList, | ||||
| 	orderFinish, | ||||
| 	orderVoid, | ||||
| @@ -380,7 +387,6 @@ export default { | ||||
| 			} | ||||
| 		}, | ||||
| 		handleClick(val) { | ||||
| 			console.log(val); | ||||
| 			switch (val.type) { | ||||
| 				case 'edit': | ||||
| 					this.addOrEditTitle = '编辑'; | ||||
| @@ -389,21 +395,11 @@ export default { | ||||
| 						this.$refs.orderAdd.init(val.data.id); | ||||
| 					}); | ||||
| 					break; | ||||
| 				case 'delete': | ||||
| 					this.handleDelete(val.data); | ||||
| 					break; | ||||
| 				case 'detail': | ||||
| 					this.$router.push({ | ||||
| 						path: 'order-detail-data?orderId=' + val.data.id, | ||||
| 					}); | ||||
| 					break; | ||||
| 				case 'add': | ||||
| 					this.workIssueTitle = '新增工单'; | ||||
| 					this.addWorkOrdervisible = true; | ||||
| 					this.$nextTick(() => { | ||||
| 						this.$refs.addWorkOrder.init(val.data, 'add'); | ||||
| 					}); | ||||
| 					break; | ||||
| 				case 'void': | ||||
| 					orderVoid({ id: val.data.id }).then((res) => { | ||||
| 						console.log(res); | ||||
| @@ -437,19 +433,6 @@ export default { | ||||
| 				default: | ||||
| 			} | ||||
| 		}, | ||||
| 		// 删除 | ||||
| 		handleDelete(val) { | ||||
| 			this.$modal | ||||
| 				.confirm('是否确认删除"' + val.name + '"的数据项?') | ||||
| 				.then(function () { | ||||
| 					return orderDelete({ id: val.id }); | ||||
| 				}) | ||||
| 				.then(() => { | ||||
| 					this.getList(); | ||||
| 					this.$modal.msgSuccess('操作成功'); | ||||
| 				}) | ||||
| 				.catch(() => {}); | ||||
| 		}, | ||||
| 		// 完成 | ||||
| 		handleComplete(val) { | ||||
| 			this.$modal | ||||
| @@ -499,13 +482,13 @@ export default { | ||||
| 			this.splitWorkOrderCancel(); | ||||
| 			this.getList(); | ||||
| 		}, | ||||
| 		async handleRoute() { | ||||
| 		async handleRoute(row) { | ||||
| 			const res = await orderAssignmentList({ | ||||
| 				orderIdList: [this.injectData.id], | ||||
| 				orderIdList: [row.id], | ||||
| 			}); | ||||
| 			console.log(res.data); | ||||
| 			let arr = []; | ||||
| 			res.data[this.injectData.id].forEach((ele) => { | ||||
| 			res.data[row.id].forEach((ele) => { | ||||
| 				arr.push(ele.workOrderId); | ||||
| 			}); | ||||
| 			let woIdString = arr.join(','); | ||||
| @@ -571,3 +554,9 @@ export default { | ||||
| 	background-color: unset !important; | ||||
| } | ||||
| </style> | ||||
| <style> | ||||
| .orderTable .el-table__cell { | ||||
| 	padding: 0 !important; | ||||
| 	height: 35px !important; | ||||
| } | ||||
| </style> | ||||
| @@ -9,7 +9,7 @@ | ||||
| 				type="primary" | ||||
| 				plain | ||||
| 				size="small" | ||||
| 				style="float: right; margin-top: -10px" | ||||
| 				style="float: right; margin-top: -25px" | ||||
| 				@click="returnOrderManage"> | ||||
| 				<svg-icon icon-class="return" /> | ||||
| 				返回 | ||||
| @@ -116,10 +116,6 @@ | ||||
| 						<div class="blodTip">备注</div> | ||||
| 						<div class="lightTip">{{ orderMsg.remark }}</div> | ||||
| 					</el-col> | ||||
| 					<!-- <el-col :span="3"> | ||||
| 						<div class="blodTip">负责人</div> | ||||
| 						<div class="lightTip">{{ orderMsg.workers }}</div> | ||||
| 					</el-col> --> | ||||
| 					<!-- <el-col :span='3'> | ||||
|             <div class="blodTip">关联工艺</div> | ||||
|             <div class="lightTip">{{processFlowName}}</div> | ||||
| @@ -249,10 +245,6 @@ const tableProps1 = [ | ||||
| 		filter: (val) => (val ? val.join(',') : ''), | ||||
| 		showOverflowtooltip: true, | ||||
| 	}, | ||||
| 	{ | ||||
| 		prop: 'workers', | ||||
| 		label: '负责人', | ||||
| 	}, | ||||
| 	{ | ||||
| 		prop: 'remark', | ||||
| 		label: '备注', | ||||
| @@ -421,6 +413,19 @@ export default { | ||||
| 	.box1 { | ||||
| 		height: 215px; | ||||
| 		padding: 16px 16px 0 16px; | ||||
| 		.boxTitle { | ||||
| 			font-size: 16px; | ||||
| 			font-weight: 600; | ||||
| 		} | ||||
| 		.blueTitle { | ||||
| 			display: inline-block; | ||||
| 			width: 4px; | ||||
| 			height: 18px; | ||||
| 			background-color: #0b58ff; | ||||
| 			margin-right: 8px; | ||||
| 			position: relative; | ||||
| 			top:4px; | ||||
| 		} | ||||
| 		.blodTip { | ||||
| 			height: 16px; | ||||
| 			font-size: 14px; | ||||
|   | ||||
| @@ -81,7 +81,7 @@ export default { | ||||
|         this.chartList[i].workOrder.map(item => { | ||||
|           colorList.push(item.color) | ||||
|         }) | ||||
|         let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(0) | ||||
|         let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(2) | ||||
|         var option = { | ||||
|           color: colorList, | ||||
|           series: [ | ||||
|   | ||||
| @@ -249,14 +249,14 @@ export default { | ||||
|               let sunNum = 0 | ||||
|               for (let i = 0; i < tempArr[key].length; i++) { | ||||
|                 let subObj = {} | ||||
|                 subObj.value = tempArr[key][i].actualAssignmentQuantity | ||||
|                 subObj.value = tempArr[key][i].actualAssignmentQuantity || 0 | ||||
|                 subObj.name = tempArr[key][i].woName | ||||
|                 if (i < 5) { | ||||
|                   subObj.color = color[i] | ||||
|                 } else { | ||||
|                   subObj.color = color[i%5] | ||||
|                 } | ||||
|                 sunNum+=tempArr[key][i].actualAssignmentQuantity | ||||
|                 sunNum+=(tempArr[key][i].actualAssignmentQuantity || 0) | ||||
|                 tempArr3.push(subObj) | ||||
|               } | ||||
|               tempArr3.push({ | ||||
| @@ -268,6 +268,7 @@ export default { | ||||
|               obj.workOrder = tempArr3 | ||||
|               tempArr2.push(obj) | ||||
|             } | ||||
|             console.log(tempArr2) | ||||
|             this.chartList = tempArr2 | ||||
|             if (this.activeName === 'barChart' && this.chartList.length > 0) { | ||||
|               this.$nextTick(() => { | ||||
|   | ||||
| @@ -40,7 +40,7 @@ $pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px); | ||||
| $mgr: 8px; | ||||
| @each $size, $height in $pxls { | ||||
| 	.#{$size}-title { | ||||
| 		font-size: 18px; | ||||
| 		font-size: $height; | ||||
| 		line-height: $height; | ||||
| 		color: #000; | ||||
| 		font-weight: 500; | ||||
|   | ||||
| @@ -43,7 +43,8 @@ | ||||
| 				<el-form-item label="产品规格" prop="specifications"> | ||||
| 					<el-input | ||||
| 						v-model="dataForm.specifications" | ||||
| 						placeholder="请输入产品规格" /> | ||||
| 						placeholder="请输入产品规格" | ||||
| 						disabled/> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="8"> | ||||
| @@ -132,13 +133,6 @@ | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="8"> | ||||
| 				<el-form-item label="负责人" prop="workers"> | ||||
| 					<el-input | ||||
| 						v-model="dataForm.workers" | ||||
| 						placeholder="请输入负责人"></el-input> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 		</el-row> | ||||
| 		<el-row :gutter="20"> | ||||
| 			<el-col :span="12"> | ||||
| @@ -149,11 +143,6 @@ | ||||
| 					<el-radio :label="1">产品基础BOM</el-radio> | ||||
| 					<el-radio :label="2">工艺扩展BOM</el-radio> | ||||
| 				</el-radio-group> | ||||
| 				<!-- <el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" | ||||
|             @change="materialMethodChange"> | ||||
|             <el-option key="1" label="产品基础BOM" :value="1" /> | ||||
|             <el-option key="2" label="工艺扩展BOM" :value="2" /> | ||||
|           </el-select> --> | ||||
| 			</el-col> | ||||
| 		</el-row> | ||||
| 		<div v-if="dataForm.materialMethod === 1"> | ||||
| @@ -183,6 +172,7 @@ | ||||
| 					</el-select> | ||||
| 				</el-col> | ||||
| 				<el-col :span="8"> | ||||
|           <el-tooltip effect="dark" content="该产线分配生产数量" placement="top-end"> | ||||
| 					<el-input-number | ||||
| 						style="width: 100%" | ||||
| 						v-model="item.num" | ||||
| @@ -190,6 +180,7 @@ | ||||
| 						:step="1" | ||||
| 						:min="0" | ||||
| 						step-strictly /> | ||||
|             </el-tooltip> | ||||
| 				</el-col> | ||||
| 			</el-row> | ||||
| 		</div> | ||||
| @@ -236,26 +227,21 @@ | ||||
| 					</el-select> | ||||
| 				</el-col> | ||||
| 				<el-col :span="8"> | ||||
|           <el-tooltip effect="dark" content="该产线分配生产数量" placement="top-end"> | ||||
| 					<el-input-number | ||||
| 						style="width: 100%" | ||||
| 						v-model="item.num" | ||||
| 						:step="1" | ||||
| 						:min="0" | ||||
| 						step-strictly /> | ||||
|           </el-tooltip> | ||||
| 				</el-col> | ||||
| 			</el-row> | ||||
| 		</div> | ||||
| 		<!-- <el-row> | ||||
|       <el-col :span='12'> | ||||
|         <el-form-item label="计划分配订单量" prop="planAssignmentQuantity"> | ||||
|           <el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number> | ||||
|         </el-form-item> | ||||
|       </el-col> | ||||
|     </el-row> --> | ||||
| 	</el-form> | ||||
| </template> | ||||
| <script> | ||||
| import { getProductAll } from '@/api/base/product'; | ||||
| import { getProductList } from '@/api/base/product'; | ||||
| import { getProcessFlowPage, workOrderList } from '@/api/base/orderManage'; | ||||
| import { | ||||
| 	createCoreWO, | ||||
| @@ -295,7 +281,6 @@ export default { | ||||
| 				priority: '', | ||||
| 				productLineIds: [{ lineId: null, processId: null, num: null }], | ||||
| 				type: '', | ||||
| 				workers: '', | ||||
| 				status: 1, | ||||
| 			}, | ||||
| 			rules: { | ||||
| @@ -323,9 +308,6 @@ export default { | ||||
| 				{ id: 1, name: '普通' }, | ||||
| 				{ id: 2, name: '特殊' }, | ||||
| 			], | ||||
| 			planStartTime: '', | ||||
| 			planFinishTime: '', | ||||
| 			isBind: false, | ||||
| 			workOrderList: [], | ||||
| 		}; | ||||
| 	}, | ||||
| @@ -340,10 +322,6 @@ export default { | ||||
| 			this.dataForm.productLineIds = []; | ||||
| 			const obj = { lineId: null, processId: null, num: null }; | ||||
| 			this.dataForm.productLineIds.push(obj); | ||||
| 			// if (val === 2 && !this.dataForm.processFlowId) { | ||||
| 			// 	this.dataForm.materialMethod = 1; | ||||
| 			// 	this.$modal.msgError('请先选择关联工艺'); | ||||
| 			// } | ||||
| 		}, | ||||
| 		// 产线工艺关联 | ||||
| 		processLineIdChange(val) { | ||||
| @@ -355,6 +333,7 @@ export default { | ||||
| 			// 工艺 | ||||
| 			getProcessFlowPage(params).then((res) => { | ||||
| 				this.processFlowList = res.data.list || []; | ||||
| 				console.log(this.processFlowList); | ||||
| 			}); | ||||
| 		}, | ||||
| 		init(id) { | ||||
| @@ -365,15 +344,26 @@ export default { | ||||
| 			} | ||||
| 			this.$nextTick(() => { | ||||
| 				this.$refs['dataForm'].resetFields(); | ||||
| 				this.planStartTime = ''; | ||||
| 				this.planFinishTime = ''; | ||||
| 				this.dataForm.planStartTime = ''; | ||||
| 				this.dataForm.planFinishTime = ''; | ||||
| 				this.dataForm.productLineIds = [{ lineId: null, processId: null, num: null }]; | ||||
| 				if (this.dataForm.id) { | ||||
| 					getCoreWO(id).then((response) => { | ||||
| 						this.dataForm = response.data; | ||||
| 						this.dataForm.planStartTime = response.data.planStartTime ? response.data.planStartTime : ''; | ||||
| 						this.dataForm.planFinishTime = response.data.planFinishTime ? response.data.planFinishTime : ''; | ||||
| 						if (this.dataForm.priority !== undefined) { | ||||
| 							this.dataForm.priority = String(this.dataForm.priority); | ||||
| 						} | ||||
| 						this.dataForm.priority; | ||||
| 						// 根据产线获取工艺 | ||||
| 						if (this.dataForm.materialMethod === 2) { | ||||
| 							this.dataForm.productLineIds.forEach((item) => { | ||||
| 								if (item.lineId) { | ||||
| 									this.processLineIdChange(item.lineId); | ||||
| 								} | ||||
| 							}) | ||||
| 						} | ||||
| 					}); | ||||
| 				} else { | ||||
| 					if (this.urlOptions.isGetCode) { | ||||
| @@ -418,21 +408,7 @@ export default { | ||||
| 					this.urlOptions.createURL(this.dataForm).then((response) => { | ||||
| 						this.$modal.msgSuccess('新增成功'); | ||||
| 						this.visible = false; | ||||
| 						this.$confirm('是否添加预使用主原料信息?', '提示', { | ||||
| 							confirmButtonText: '确定', | ||||
| 							cancelButtonText: '取消', | ||||
| 							type: 'warning', | ||||
| 						}) | ||||
| 							.then(() => { | ||||
| 								console.log('121', this.dataForm.name); | ||||
| 								this.$emit('refreshDataList', { | ||||
| 									id: response.data, | ||||
| 									name: this.dataForm.name, | ||||
| 								}); | ||||
| 							}) | ||||
| 							.catch(() => { | ||||
| 								this.$emit('refreshDataList'); | ||||
| 							}); | ||||
| 						this.$emit('refreshDataList'); | ||||
| 					}); | ||||
| 				} | ||||
| 			}); | ||||
| @@ -447,7 +423,7 @@ export default { | ||||
| 		}, | ||||
| 		getDict() { | ||||
| 			// 产品 | ||||
| 			getProductAll().then((res) => { | ||||
| 			getProductList().then((res) => { | ||||
| 				this.productList = res.data || []; | ||||
| 			}); | ||||
| 			// 产线 | ||||
|   | ||||
							
								
								
									
										311
									
								
								src/views/produce/workOrder/allocation copy.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										311
									
								
								src/views/produce/workOrder/allocation copy.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,311 @@ | ||||
| <!-- | ||||
|  * @Author: zwq | ||||
|  * @Date: 2021-11-18 14:16:25 | ||||
|  * @LastEditors: DY | ||||
|  * @LastEditTime: 2024-07-19 18:59:13 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| 	<el-drawer | ||||
| 		:visible.sync="visible" | ||||
| 		:show-close="false" | ||||
| 		:wrapper-closable="false" | ||||
| 		class="drawer" | ||||
| 		size="55%"> | ||||
| 		<small-title slot="title" :no-padding="true"> | ||||
| 			{{ '分配产量' }} | ||||
| 		</small-title> | ||||
| 		<div class="content"> | ||||
| 			<div class='formContainer'> | ||||
| 				<el-row :gutter="20"> | ||||
| 					<el-col :span="12"><span class='label'>工单名称:</span><span class='text'>{{ dataForm.name }}</span></el-col> | ||||
| 					<el-col :span="12"><span class='label'>工单编码:</span><span class='text'>{{ dataForm.code }}</span></el-col> | ||||
| 				</el-row> | ||||
| 				<el-row :gutter="20"> | ||||
| 					<el-col :span="12"><span class='label'>产品名称:</span><span class='text'>{{ dataForm.productName }}</span></el-col> | ||||
| 					<el-col :span="12"><span class='label'>产品规格:</span><span class='text'>{{ dataForm.specifications }}</span></el-col> | ||||
| 				</el-row> | ||||
| 				<el-row :gutter="20"> | ||||
| 					<el-col :span="12"><span class='label'>实际生产数量:</span><span class='text'>{{ dataForm.actualQuantity }}</span></el-col> | ||||
| 				</el-row> | ||||
| 			</div> | ||||
|  | ||||
| 			<div class="attr-list"> | ||||
| 				<!-- <el-button v-show="!isdetail" type="success" size="small" style="float: right" @click="addRow()">添加一行</el-button> --> | ||||
| 				<el-table | ||||
| 					border | ||||
| 					:data="tableData" | ||||
| 					:header-cell-style="{ | ||||
| 						background: '#F2F4F9', | ||||
| 						color: '#606266' | ||||
| 					}" | ||||
|       		style="width: 100%"> | ||||
| 					<el-table-column type="index" label="序号" width='50' align="center" /> | ||||
| 					<el-table-column prop="orderName" label="订单名称" /> | ||||
| 					<el-table-column prop="orderCode" label="订单编码" /> | ||||
| 					<el-table-column prop="priority" label="优先级" /> | ||||
| 					<el-table-column prop="planAssignmentQuantity" label="计划分配数量" > | ||||
| 						<template slot-scope="scope"> | ||||
| 							<el-input v-model="scope.row.planAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></el-input> | ||||
| 						</template> | ||||
| 					</el-table-column> | ||||
| 					<el-table-column prop="actualAssignmentQuantity" label="实际分配数量"> | ||||
| 						<template slot-scope="scope"> | ||||
| 							<el-input v-model="scope.row.actualAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></el-input> | ||||
| 						</template> | ||||
| 					</el-table-column> | ||||
| 					<el-table-column label="操作" width='50' align="center" fixed='right'> | ||||
| 						<template slot-scope="scope"> | ||||
| 							<el-button type="text" size="small" @click="saveData(scope.row)">保存</el-button> | ||||
| 							<!-- <el-tooltip v-if="!scope.row.isEdit" placement="top" content="编辑"> | ||||
| 								<el-button | ||||
| 									type="text" | ||||
| 									:style="{color:'#0B58FF'}" | ||||
| 									size="mini" | ||||
| 									@click="edit(scope.row)" | ||||
| 								> | ||||
| 									<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="edit" /> | ||||
| 								</el-button> | ||||
| 							</el-tooltip> --> | ||||
| 							 | ||||
| 							<!-- <el-tooltip placement="top" content="删除"> | ||||
| 								<el-button | ||||
| 									type="text" | ||||
| 									:style="{color:'#FF5454'}" | ||||
| 									size="mini" | ||||
| 									@click="deleteDetail(scope.row)" | ||||
| 								> | ||||
| 									<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="table_delete" /> | ||||
| 								</el-button> | ||||
| 							</el-tooltip> --> | ||||
| 						</template> | ||||
| 					</el-table-column> | ||||
| 				</el-table> | ||||
| 				<pagination | ||||
| 					v-show="listQuery.total > 0" | ||||
| 					:total="listQuery.total" | ||||
| 					:page.sync="listQuery.pageNo" | ||||
| 					:limit.sync="listQuery.pageSize" | ||||
| 					:page-sizes="[5, 10, 15]" | ||||
| 					@pagination="getList" /> | ||||
| 			</div> | ||||
|  | ||||
| 			<div class="drawer-body__footer"> | ||||
| 				<el-button style="" type="primary" @click="goback()">关闭</el-button> | ||||
| 				<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> | ||||
| 					编辑 | ||||
| 				</el-button> | ||||
| 				<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button> --> | ||||
| 			</div> | ||||
| 		</div> | ||||
|  | ||||
| 		<!-- <attr-add | ||||
| 			v-if="addOrUpdateVisible" | ||||
| 			ref="addOrUpdate" | ||||
| 			:material-id="dataForm.id" | ||||
| 			@refreshDataList="getList" /> --> | ||||
| 	</el-drawer> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import basicAdd from '../../core/mixins/basic-add'; | ||||
| import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder'; | ||||
| import SmallTitle from './SmallTitle'; | ||||
| // import { parseTime } from '../../core/mixins/code-filter'; | ||||
| // import attrAdd from './attr-add'; | ||||
|  | ||||
| export default { | ||||
| 	mixins: [basicAdd], | ||||
| 	components: { SmallTitle }, | ||||
| 	data() { | ||||
| 		return { | ||||
| 			addOrUpdateVisible: false, | ||||
| 			urlOptions: { | ||||
| 				infoURL: getCoreWO, | ||||
| 			}, | ||||
| 			listQuery: { | ||||
| 				pageSize: 10, | ||||
| 				pageNo: 1, | ||||
| 				total: 0, | ||||
| 			}, | ||||
| 			dataForm: { | ||||
|         id: undefined, | ||||
|         code: undefined, | ||||
|         productId: '', | ||||
|         remark: undefined, | ||||
| 			}, | ||||
| 			productList: [], | ||||
| 			materialAttrList: [], | ||||
| 			materialList: [], | ||||
| 			tableData: [], | ||||
| 			visible: false, | ||||
| 			isdetail: false, | ||||
| 			idAttrShow: false | ||||
| 		}; | ||||
| 	}, | ||||
| 	mounted() {}, | ||||
| 	methods: { | ||||
| 		initData() { | ||||
| 			// this.materialAttrList.splice(0); | ||||
| 			this.listQuery.total = 0; | ||||
| 		}, | ||||
| 		edit(row) { | ||||
| 			row.isEdit = true | ||||
| 		}, | ||||
| 		saveData(row) { | ||||
| 			if (row.actualAssignmentQuantity) { | ||||
| 				if (row.id) { | ||||
| 					// updateMaterialPBDet({ | ||||
| 					// 	...row | ||||
| 					// }).then((response) => { | ||||
| 					// 	this.$modal.msgSuccess('修改成功'); | ||||
| 					// 	// this.visible = false; | ||||
| 					// 	this.getList(); | ||||
| 					// }); | ||||
| 					// return; | ||||
| 				} | ||||
| 					// 添加的提交 | ||||
| 				createConCoreWOr({ | ||||
| 					...row, | ||||
| 					workOrderId: this.dataForm.id | ||||
| 				}).then((response) => { | ||||
| 					this.$modal.msgSuccess('分配成功'); | ||||
| 					// this.visible = false; | ||||
| 					this.getList(); | ||||
| 				}); | ||||
| 			} else { | ||||
| 				this.$message.warning('请填写实际分配数量'); | ||||
| 			} | ||||
| 		}, | ||||
| 		getList() { | ||||
| 			// 获取产品Bom详细列表 | ||||
| 			getConOrderList({ | ||||
| 				...this.listQuery, | ||||
| 				workOrderId: this.dataForm.id | ||||
| 			}).then((response) => { | ||||
| 				this.tableData = response.data.map(item => { | ||||
| 					item.isEdit = false | ||||
| 					return item | ||||
| 				}); | ||||
| 				this.listQuery.total = response.data.total; | ||||
| 			}); | ||||
| 		}, | ||||
| 		// 构造一行 | ||||
| 		// addRow() { | ||||
| 		// 	const row = { | ||||
| 		// 		bomId: this.dataForm.id, | ||||
| 		// 		materialId: '', | ||||
| 		// 		num: 0, | ||||
| 		// 		materialCode: undefined, | ||||
| 		// 		unit: undefined, | ||||
| 		// 		remark: '', | ||||
| 		// 		isEdit: true | ||||
| 		// 	} | ||||
| 		// 	this.tableData.push(row) | ||||
| 		// }, | ||||
| 		init(id, isdetail) { | ||||
| 			this.initData(); | ||||
| 			this.isdetail = isdetail || false; | ||||
| 			this.dataForm.id = id || undefined; | ||||
| 			this.visible = true; | ||||
| 			// if (id) { | ||||
| 			// 	this.idAttrShow = true | ||||
| 			// } else { | ||||
| 			// 	this.idAttrShow = false | ||||
| 			// } | ||||
|  | ||||
| 			this.$nextTick(() => { | ||||
| 				// this.$refs['dataForm'].resetFields(); | ||||
|  | ||||
| 				if (this.dataForm.id) { | ||||
| 					// 获取工单详情 | ||||
| 					this.urlOptions.infoURL(id).then(response => { | ||||
|             this.dataForm = response.data; | ||||
|           }); | ||||
| 					// 获取工单订单明细 | ||||
| 					this.getList(); | ||||
| 				} else {} | ||||
| 			}); | ||||
| 		}, | ||||
| 		goback() { | ||||
| 			this.$emit('refreshDataList'); | ||||
| 			this.visible = false; | ||||
| 			// this.initData(); | ||||
| 		}, | ||||
| 		goEdit() { | ||||
| 			this.isdetail = false; | ||||
| 		}, | ||||
| 		// 新增 / 修改 | ||||
| 		addNew(id) { | ||||
| 			this.addOrUpdateVisible = true; | ||||
| 			this.$nextTick(() => { | ||||
| 				this.$refs.addOrUpdate.init(id); | ||||
| 			}); | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
| </script> | ||||
| <style scoped> | ||||
| .drawer >>> .el-drawer { | ||||
| 	border-radius: 8px 0 0 8px; | ||||
| 	display: flex; | ||||
| 	flex-direction: column; | ||||
| } | ||||
|  | ||||
| .drawer >>> .el-form-item__label { | ||||
| 	padding: 0; | ||||
| } | ||||
|  | ||||
| .drawer >>> .el-drawer__header { | ||||
| 	margin: 0; | ||||
| 	padding: 32px 32px 24px; | ||||
| 	border-bottom: 1px solid #dcdfe6; | ||||
| } | ||||
| .drawer >>> .el-drawer__body { | ||||
| 	flex: 1; | ||||
| 	height: 1px; | ||||
| 	display: flex; | ||||
| 	flex-direction: column; | ||||
| } | ||||
|  | ||||
| .drawer >>> .content { | ||||
| 	padding: 30px 24px; | ||||
| 	flex: 1; | ||||
| 	display: flex; | ||||
| 	flex-direction: column; | ||||
| 	/* height: 100%; */ | ||||
| } | ||||
|  | ||||
| .drawer >>> .visual-part { | ||||
| 	flex: 1 auto; | ||||
| 	max-height: 30vh; | ||||
| 	overflow: hidden; | ||||
| 	overflow-y: scroll; | ||||
| 	padding-right: 10px; /* 调整滚动条样式 */ | ||||
| } | ||||
|  | ||||
| .drawer >>> .el-form { | ||||
| 	padding: 0 16px; | ||||
| } | ||||
|  | ||||
| .drawer-body__footer { | ||||
| 	display: flex; | ||||
| 	justify-content: flex-end; | ||||
| 	padding: 18px; | ||||
| } | ||||
| .formContainer { | ||||
|   .label { | ||||
| 		display: inline-block; | ||||
| 		padding: 5px 0px; | ||||
| 		font-size: 14px; | ||||
| 		font-weight: 600; | ||||
| 	} | ||||
| 	.text { | ||||
| 		display: inline-block; | ||||
| 		padding: 5px 0px; | ||||
| 		font-size: 14px; | ||||
| 		color:rgba(102, 102, 102, 0.75); | ||||
| 	} | ||||
| 	margin-bottom: 10px; | ||||
| } | ||||
| </style> | ||||
| @@ -16,98 +16,58 @@ | ||||
| 			{{ '分配产量' }} | ||||
| 		</small-title> | ||||
| 		<div class="content"> | ||||
| 			<div class="formContent"> | ||||
| 			<div class='formContainer'> | ||||
| 				<el-row :gutter="20"> | ||||
| 					<el-col :span="12">工单名称:{{ dataForm.name }}</el-col> | ||||
| 					<el-col :span="12">工单编码:{{ dataForm.code }}</el-col> | ||||
| 					<el-col :span="12"><span class='label'>工单名称:</span><span class='text'>{{ dataForm.name }}</span></el-col> | ||||
| 					<el-col :span="12"><span class='label'>工单编码:</span><span class='text'>{{ dataForm.code }}</span></el-col> | ||||
| 				</el-row> | ||||
| 				<el-row :gutter="20"> | ||||
| 					<el-col :span="12">产品名称:{{ dataForm.productName }}</el-col> | ||||
| 					<el-col :span="12">产品规格:{{ dataForm.specifications }}</el-col> | ||||
| 					<el-col :span="12"><span class='label'>产品名称:</span><span class='text'>{{ dataForm.productName }}</span></el-col> | ||||
| 					<el-col :span="12"><span class='label'>产品规格:</span><span class='text'>{{ dataForm.specifications }}</span></el-col> | ||||
| 				</el-row> | ||||
| 				<el-row :gutter="20"> | ||||
| 					<el-col :span="12">实际生产数量:{{ dataForm.expectedTime }}</el-col> | ||||
| 					<el-col :span="12"><span class='label'>实际生产数量:</span><span class='text'>{{ dataForm.actualQuantity }}</span></el-col> | ||||
| 				</el-row> | ||||
| 			</div> | ||||
|  | ||||
| 			<div class="attr-list"> | ||||
| 				<!-- <el-button v-show="!isdetail" type="success" size="small" style="float: right" @click="addRow()">添加一行</el-button> --> | ||||
| 				<el-table | ||||
| 					border | ||||
| 					:data="tableData" | ||||
| 					:header-cell-style="{ | ||||
| 						background: '#F2F4F9', | ||||
| 						color: '#606266' | ||||
| 					}" | ||||
|       		style="width: 100%"> | ||||
| 					<el-table-column type="index" label="序号" /> | ||||
| 					<el-table-column type="index" label="序号" width='50' align="center" /> | ||||
| 					<el-table-column prop="orderName" label="订单名称" /> | ||||
| 					<el-table-column prop="orderCode" label="订单编码" /> | ||||
| 					<el-table-column prop="priority" label="优先级" /> | ||||
| 					<el-table-column prop="planAssignmentQuantity" label="计划分配数量" > | ||||
| 					<el-table-column prop="priority" label="优先级"> | ||||
| 						<template slot-scope="scope"> | ||||
| 							<el-input v-model="scope.row.planAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></el-input> | ||||
| 							{{scope.row.priority == 1 ? '低' : scope.row.priority == 2 ? '正常' : scope.row.priority == 3 ? '高' : ''}} | ||||
| 						</template> | ||||
| 					</el-table-column> | ||||
| 					<el-table-column prop="planAssignmentQuantity" label="计划分配数量" /> | ||||
| 					<el-table-column prop="actualAssignmentQuantity" label="实际分配数量"> | ||||
| 						<template slot-scope="scope"> | ||||
| 							<el-input v-model="scope.row.actualAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></el-input> | ||||
| 						</template> | ||||
| 					</el-table-column> | ||||
| 					<el-table-column label="操作"> | ||||
| 						<template slot-scope="scope"> | ||||
| 							<el-button type="text" size="small" @click="saveData(scope.row)">保存</el-button> | ||||
| 							<!-- <el-tooltip v-if="!scope.row.isEdit" placement="top" content="编辑"> | ||||
| 								<el-button | ||||
| 									type="text" | ||||
| 									:style="{color:'#0B58FF'}" | ||||
| 									size="mini" | ||||
| 									@click="edit(scope.row)" | ||||
| 								> | ||||
| 									<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="edit" /> | ||||
| 								</el-button> | ||||
| 							</el-tooltip> --> | ||||
| 							 | ||||
| 							<!-- <el-tooltip placement="top" content="删除"> | ||||
| 								<el-button | ||||
| 									type="text" | ||||
| 									:style="{color:'#FF5454'}" | ||||
| 									size="mini" | ||||
| 									@click="deleteDetail(scope.row)" | ||||
| 								> | ||||
| 									<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="table_delete" /> | ||||
| 								</el-button> | ||||
| 							</el-tooltip> --> | ||||
| 							<el-input-number :disabled='isSaved' v-model="scope.row.actualAssignmentQuantity" style='width: 100%;' controls-position="right" :min="0" :max="dataForm.actualQuantity"></el-input-number> | ||||
| 						</template> | ||||
| 					</el-table-column> | ||||
| 				</el-table> | ||||
| 				<pagination | ||||
| 					v-show="listQuery.total > 0" | ||||
| 					:total="listQuery.total" | ||||
| 					:page.sync="listQuery.pageNo" | ||||
| 					:limit.sync="listQuery.pageSize" | ||||
| 					:page-sizes="[5, 10, 15]" | ||||
| 					@pagination="getList" /> | ||||
| 			</div> | ||||
|  | ||||
| 			<div class="drawer-body__footer"> | ||||
| 				<el-button style="" type="primary" @click="goback()">关闭</el-button> | ||||
| 				<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> | ||||
| 					编辑 | ||||
| 				</el-button> | ||||
| 				<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button> --> | ||||
| 				<el-button plain type="primary" @click="goback()">关闭</el-button> | ||||
| 				<el-button type="primary" @click="saveData()" :disabled='isSaved'>保存</el-button> | ||||
| 			</div> | ||||
| 		</div> | ||||
|  | ||||
| 		<!-- <attr-add | ||||
| 			v-if="addOrUpdateVisible" | ||||
| 			ref="addOrUpdate" | ||||
| 			:material-id="dataForm.id" | ||||
| 			@refreshDataList="getList" /> --> | ||||
| 	</el-drawer> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import basicAdd from '../../core/mixins/basic-add'; | ||||
| import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder'; | ||||
| import { getConOrderList, updateBatch, getCoreWO } from '@/api/base/coreWorkOrder'; | ||||
| import SmallTitle from './SmallTitle'; | ||||
| // import { parseTime } from '../../core/mixins/code-filter'; | ||||
| // import attrAdd from './attr-add'; | ||||
|  | ||||
| export default { | ||||
| 	mixins: [basicAdd], | ||||
| @@ -118,100 +78,51 @@ export default { | ||||
| 			urlOptions: { | ||||
| 				infoURL: getCoreWO, | ||||
| 			}, | ||||
| 			listQuery: { | ||||
| 				pageSize: 10, | ||||
| 				pageNo: 1, | ||||
| 				total: 0, | ||||
| 			}, | ||||
| 			dataForm: { | ||||
|         id: undefined, | ||||
|         code: undefined, | ||||
|         productId: '', | ||||
|         remark: undefined, | ||||
| 			}, | ||||
| 			productList: [], | ||||
| 			materialAttrList: [], | ||||
| 			materialList: [], | ||||
| 			tableData: [], | ||||
| 			visible: false, | ||||
| 			isdetail: false, | ||||
| 			idAttrShow: false | ||||
| 			isSaved:false | ||||
| 		}; | ||||
| 	}, | ||||
| 	mounted() {}, | ||||
| 	methods: { | ||||
| 		initData() { | ||||
| 			// this.materialAttrList.splice(0); | ||||
| 			this.listQuery.total = 0; | ||||
| 		}, | ||||
| 		edit(row) { | ||||
| 			row.isEdit = true | ||||
| 		}, | ||||
| 		saveData(row) { | ||||
| 			if (row.actualAssignmentQuantity) { | ||||
| 				if (row.id) { | ||||
| 					// updateMaterialPBDet({ | ||||
| 					// 	...row | ||||
| 					// }).then((response) => { | ||||
| 					// 	this.$modal.msgSuccess('修改成功'); | ||||
| 					// 	// this.visible = false; | ||||
| 					// 	this.getList(); | ||||
| 					// }); | ||||
| 					// return; | ||||
| 				} | ||||
| 					// 添加的提交 | ||||
| 				createConCoreWOr({ | ||||
| 					...row, | ||||
| 					workOrderId: this.dataForm.id | ||||
| 				}).then((response) => { | ||||
| 					this.$modal.msgSuccess('分配成功'); | ||||
| 					// this.visible = false; | ||||
| 					this.getList(); | ||||
| 				}); | ||||
| 			} else { | ||||
| 				this.$message.warning('请填写实际分配数量'); | ||||
| 		saveData() { | ||||
| 			console.log(this.tableData) | ||||
| 			let sunNum = 0 | ||||
| 			this.tableData.forEach(row => { | ||||
| 			  sunNum+=(row.actualAssignmentQuantity || 0) | ||||
| 			}) | ||||
| 			if (sunNum > this.dataForm.actualQuantity) { | ||||
| 				this.$message.warning('各订单实际分配数量之和不能大于实际生产数量'); | ||||
| 				return | ||||
| 			} | ||||
| 			updateBatch(this.tableData).then((response) => { | ||||
| 				this.$modal.msgSuccess('分配成功'); | ||||
| 				this.isSaved = true; | ||||
| 			}); | ||||
| 		}, | ||||
| 		getList() { | ||||
| 			// 获取产品Bom详细列表 | ||||
| 			getConOrderList({ | ||||
| 				...this.listQuery, | ||||
| 				workOrderId: this.dataForm.id | ||||
| 			}).then((response) => { | ||||
| 				this.tableData = response.data.map(item => { | ||||
| 					item.isEdit = false | ||||
| 					item.actualAssignmentQuantity = item.actualAssignmentQuantity || 0 | ||||
| 					item.workOrderId = this.dataForm.id | ||||
| 					return item | ||||
| 				}); | ||||
| 				this.listQuery.total = response.data.total; | ||||
| 			}); | ||||
| 		}, | ||||
| 		// 构造一行 | ||||
| 		// addRow() { | ||||
| 		// 	const row = { | ||||
| 		// 		bomId: this.dataForm.id, | ||||
| 		// 		materialId: '', | ||||
| 		// 		num: 0, | ||||
| 		// 		materialCode: undefined, | ||||
| 		// 		unit: undefined, | ||||
| 		// 		remark: '', | ||||
| 		// 		isEdit: true | ||||
| 		// 	} | ||||
| 		// 	this.tableData.push(row) | ||||
| 		// }, | ||||
| 		init(id, isdetail) { | ||||
| 			this.initData(); | ||||
| 			this.isdetail = isdetail || false; | ||||
| 		init(id) { | ||||
| 			this.dataForm.id = id || undefined; | ||||
| 			this.visible = true; | ||||
| 			// if (id) { | ||||
| 			// 	this.idAttrShow = true | ||||
| 			// } else { | ||||
| 			// 	this.idAttrShow = false | ||||
| 			// } | ||||
|  | ||||
| 			this.isSaved = false; | ||||
| 			this.$nextTick(() => { | ||||
| 				// this.$refs['dataForm'].resetFields(); | ||||
|  | ||||
| 				if (this.dataForm.id) { | ||||
| 					// 获取工单详情 | ||||
| 					this.urlOptions.infoURL(id).then(response => { | ||||
| @@ -225,17 +136,6 @@ export default { | ||||
| 		goback() { | ||||
| 			this.$emit('refreshDataList'); | ||||
| 			this.visible = false; | ||||
| 			// this.initData(); | ||||
| 		}, | ||||
| 		goEdit() { | ||||
| 			this.isdetail = false; | ||||
| 		}, | ||||
| 		// 新增 / 修改 | ||||
| 		addNew(id) { | ||||
| 			this.addOrUpdateVisible = true; | ||||
| 			this.$nextTick(() => { | ||||
| 				this.$refs.addOrUpdate.init(id); | ||||
| 			}); | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
| @@ -279,8 +179,7 @@ export default { | ||||
| 	padding-right: 10px; /* 调整滚动条样式 */ | ||||
| } | ||||
|  | ||||
| .drawer >>> .el-form, | ||||
| .drawer >>> .attr-list { | ||||
| .drawer >>> .el-form { | ||||
| 	padding: 0 16px; | ||||
| } | ||||
|  | ||||
| @@ -289,10 +188,19 @@ export default { | ||||
| 	justify-content: flex-end; | ||||
| 	padding: 18px; | ||||
| } | ||||
| .formContent { | ||||
| 	font-size: 16px; | ||||
| 	line-height: 1.5; | ||||
| .formContainer { | ||||
|   .label { | ||||
| 		display: inline-block; | ||||
| 		padding: 5px 0px; | ||||
| 		font-size: 14px; | ||||
| 		font-weight: 600; | ||||
| 	} | ||||
| 	.text { | ||||
| 		display: inline-block; | ||||
| 		padding: 5px 0px; | ||||
| 		font-size: 14px; | ||||
| 		color:rgba(102, 102, 102, 0.75); | ||||
| 	} | ||||
| 	margin-bottom: 10px; | ||||
| 	width: 100%; | ||||
| } | ||||
| </style> | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -9,11 +9,12 @@ | ||||
| 			:table-props="tableProps" | ||||
| 			:page="listQuery.pageNo" | ||||
| 			:limit="listQuery.pageSize" | ||||
| 			:max-height="tableH" | ||||
| 			:table-data="tableData"> | ||||
| 			<method-btn | ||||
| 				v-if="tableBtn.length" | ||||
| 				slot="handleBtn" | ||||
| 				:width="350" | ||||
| 				:width="300" | ||||
| 				label="操作" | ||||
| 				:method-list="tableBtn" | ||||
| 				@clickBtn="handleClick" /> | ||||
| @@ -61,10 +62,11 @@ import { | ||||
| 	getCoreWOList | ||||
| } from '@/api/base/coreWorkOrder'; | ||||
| import { listDept } from '@/api/system/dept'; | ||||
| import tableHeightMixin from '@/mixins/tableHeightMixin'; | ||||
|  | ||||
|  | ||||
| export default { | ||||
| 	mixins: [basicPage], | ||||
| 	mixins: [basicPage,tableHeightMixin], | ||||
| 	components: { | ||||
| 		AddWorkOrder, | ||||
| 		AddOrUpdate, | ||||
| @@ -88,25 +90,25 @@ export default { | ||||
| 				// 			btnName: '原料信息', | ||||
| 				// 	  } | ||||
| 				// 	: undefined, | ||||
| 				// 	{ | ||||
| 				// 		type: 'active', | ||||
| 				// 		btnName: '激活', | ||||
| 				// 		showParam: { | ||||
| 				// 			type: '|', | ||||
| 				// 			data: [ | ||||
| 				// 				{ | ||||
| 				// 					name: 'status', | ||||
| 				// 					type: 'equal', | ||||
| 				// 					value: 1 | ||||
| 				// 				}, | ||||
| 				// 				{ | ||||
| 				// 					name: 'status', | ||||
| 				// 					type: 'equal', | ||||
| 				// 					value: 3 | ||||
| 				// 				} | ||||
| 				// 			] | ||||
| 				// 		} | ||||
| 				// 	}, | ||||
| 					{ | ||||
| 						type: 'active', | ||||
| 						btnName: '开始', | ||||
| 						showParam: { | ||||
| 							type: '|', | ||||
| 							data: [ | ||||
| 								{ | ||||
| 									name: 'status', | ||||
| 									type: 'equal', | ||||
| 									value: 1 | ||||
| 								}, | ||||
| 								{ | ||||
| 									name: 'status', | ||||
| 									type: 'equal', | ||||
| 									value: 3 | ||||
| 								} | ||||
| 							] | ||||
| 						} | ||||
| 					}, | ||||
| 					{ | ||||
| 						type: 'pause', | ||||
| 						btnName: '暂停', | ||||
| @@ -122,8 +124,8 @@ export default { | ||||
| 						} | ||||
| 					}, | ||||
| 					{ | ||||
| 						type: 'nullify', | ||||
| 						btnName: '作废', | ||||
| 						type: 'terminate', | ||||
| 						btnName: '终止', | ||||
| 						showParam: { | ||||
| 							type: '|', | ||||
| 							data: [ | ||||
| @@ -136,11 +138,6 @@ export default { | ||||
| 									name: 'status', | ||||
| 									type: 'equal', | ||||
| 									value: 3 | ||||
| 								}, | ||||
| 								{ | ||||
| 									name: 'status', | ||||
| 									type: 'equal', | ||||
| 									value: 4 | ||||
| 								} | ||||
| 							] | ||||
| 						} | ||||
| @@ -186,22 +183,36 @@ export default { | ||||
| 							} | ||||
| 					  } | ||||
| 					: undefined, | ||||
|           this.$auth.hasPermi(`base:core-work-order:delete`) | ||||
| 					? { | ||||
| 							type: 'delete', | ||||
| 							btnName: '删除', | ||||
| 							showParam: { | ||||
| 								type: '|', | ||||
| 								data: [ | ||||
| 									{ | ||||
| 										name: 'status', | ||||
| 										type: 'equal', | ||||
| 										value: 1 | ||||
| 									} | ||||
| 								] | ||||
| 							} | ||||
| 					  } | ||||
| 					: undefined | ||||
| 					{ | ||||
| 						type: 'nullify', | ||||
| 						btnName: '作废', | ||||
| 						showParam: { | ||||
| 							type: '|', | ||||
| 							data: [ | ||||
| 								{ | ||||
| 									name: 'status', | ||||
| 									type: 'equal', | ||||
| 									value: 1 | ||||
| 								} | ||||
| 							] | ||||
| 						} | ||||
| 					}, | ||||
|           // this.$auth.hasPermi(`base:core-work-order:delete`) | ||||
| 					// ? { | ||||
| 					// 		type: 'delete', | ||||
| 					// 		btnName: '删除', | ||||
| 					// 		showParam: { | ||||
| 					// 			type: '|', | ||||
| 					// 			data: [ | ||||
| 					// 				{ | ||||
| 					// 					name: 'status', | ||||
| 					// 					type: 'equal', | ||||
| 					// 					value: 1 | ||||
| 					// 				} | ||||
| 					// 			] | ||||
| 					// 		} | ||||
| 					//   } | ||||
| 					// : undefined | ||||
| 			].filter((v)=>v), | ||||
| 			tableData: [], | ||||
| 			formConfig: [ | ||||
| @@ -230,7 +241,8 @@ export default { | ||||
| 						{ id: 2, name: '激活' }, | ||||
| 						{ id: 3, name: '暂停' }, | ||||
| 						{ id: 4, name: '完成' }, | ||||
| 						{ id: 9, name: '作废' } | ||||
| 						{ id: 5, name: '作废' }, | ||||
| 						{ id: 6, name: '终止' } | ||||
| 					], | ||||
|           param: 'status', | ||||
|           clearable: true | ||||
| @@ -279,7 +291,7 @@ export default { | ||||
|         { | ||||
|           prop: 'name', | ||||
|           label: '工单名称', | ||||
|           minWidth: 120, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true | ||||
|         }, | ||||
|         { | ||||
| @@ -310,12 +322,20 @@ export default { | ||||
|         { | ||||
|           prop: 'triggerOrigin', | ||||
|           label: '来源', | ||||
| 					width: 120, | ||||
|           filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val] | ||||
|         }, | ||||
|         { | ||||
|           prop: 'status', | ||||
|           label: '工单状态', | ||||
|           filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val] | ||||
|           filter: (val) => ['', '等待', '激活', '暂停', '完成', '作废', '终止', '', '', ''][val] | ||||
|         }, | ||||
|         { | ||||
|           prop: 'startProduceTime', | ||||
|           label: '实际开始时间', | ||||
|           filter: parseTime, | ||||
|           minWidth: 150, | ||||
|           showOverflowtooltip: true | ||||
|         }, | ||||
|         { | ||||
|           prop: 'planFinishTime', | ||||
| @@ -362,20 +382,20 @@ export default { | ||||
| 			}) | ||||
| 		}, | ||||
| 		refreshWorkOrder(val) { | ||||
| 			console.log(val) | ||||
| 			if (val) { | ||||
| 				// 预使用原料信息 | ||||
| 				console.log('预使用原料信息') | ||||
| 				this.handleCancel() | ||||
|       	this.getDataList() | ||||
| 				this.materialVisible = true; | ||||
|         this.addOrEditTitle = "预使用主原料信息"; | ||||
|         this.$nextTick(() => { | ||||
|           this.$refs.material.init(val, true); | ||||
|         }); | ||||
| 			} else { | ||||
| 				this.successSubmit() | ||||
| 			} | ||||
| 			// if (val) { | ||||
| 			// 	// 预使用原料信息 | ||||
| 			// 	console.log('预使用原料信息') | ||||
| 			// 	this.handleCancel() | ||||
|       // 	this.getDataList() | ||||
| 			// 	this.materialVisible = true; | ||||
|       //   this.addOrEditTitle = "预使用主原料信息"; | ||||
|       //   this.$nextTick(() => { | ||||
|       //     this.$refs.material.init(val, true); | ||||
|       //   }); | ||||
| 			// } else { | ||||
| 			// 	this.successSubmit() | ||||
| 			// } | ||||
|       this.successSubmit() | ||||
| 		}, | ||||
| 		closeDetail() { | ||||
| 			this.detailVisible = false | ||||
| @@ -416,15 +436,18 @@ export default { | ||||
| 					param.status = 3 | ||||
| 					opration = '暂停' | ||||
| 				} | ||||
| 				if (val.type === 'terminate') { | ||||
| 					param.status = 6 | ||||
| 					opration = '终止' | ||||
| 				} | ||||
| 				if (val.type === 'nullify') { | ||||
| 					param.status = 9 | ||||
| 					opration = '报废' | ||||
| 					param.status = 5 | ||||
| 					opration = '作废' | ||||
| 				} | ||||
| 				if (val.type === 'finish') { | ||||
| 					param.status = 4 | ||||
| 					opration = '完成' | ||||
| 				} | ||||
| 				console.log('22',val) | ||||
| 				this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", { | ||||
| 					confirmButtonText: "确定", | ||||
| 					cancelButtonText: "取消", | ||||
| @@ -437,7 +460,9 @@ export default { | ||||
| 							type: 'success', | ||||
| 							duration: 1500, | ||||
| 							onClose: () => { | ||||
| 								this.getDataList(); | ||||
| 								setTimeout(() => { | ||||
| 									this.getDataList(); | ||||
| 								}, 1000); | ||||
| 								// 分配产量 | ||||
| 								if (param.status === 4) { | ||||
| 									this.allocationOrder(param); | ||||
| @@ -475,7 +500,6 @@ export default { | ||||
| 			switch (val.btnName) { | ||||
| 				case 'search': | ||||
| 					this.listQuery.pageNo = 1; | ||||
| 					this.listQuery.pageSize = 10; | ||||
| 					this.listQuery.name = val.name ? val.name : undefined; | ||||
| 					this.listQuery.status = val.status ? val.status : undefined; | ||||
| 					this.listQuery.startProduceTime = val.time ? val.time : undefined | ||||
| @@ -484,7 +508,6 @@ export default { | ||||
| 				case 'reset': | ||||
| 					this.$refs.searchBarForm.resetForm(); | ||||
| 					this.listQuery = { | ||||
| 						pageSize: 10, | ||||
| 						pageNo: 1, | ||||
| 						total: 1, | ||||
| 					}; | ||||
|   | ||||
| @@ -1,23 +1,20 @@ | ||||
| <!-- | ||||
|  * @Author: zhp | ||||
|  * @Date: 2024-09-09 15:39:08 | ||||
|  * @LastEditTime: 2024-09-11 10:25:54 | ||||
|  * @LastEditors: zhp | ||||
|  * @LastEditTime: 2024-11-18 16:43:54 | ||||
|  * @LastEditors: zwq | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
|   <div> | ||||
|     <div class="button-nav"> | ||||
|       <!-- <div class="text-carousel"> --> | ||||
|       <el-button style="flex: .1" type="text" @click="prevText" icon="el-icon-caret-left"></el-button> | ||||
|       <button @click="handleChange(item.id)" v-for="(item,index) in idList" :key="item.id" | ||||
|       <el-button class='btn' style="flex: .1" type="text" @click="prevText" icon="el-icon-caret-left"></el-button> | ||||
|       <button class='tap-btn' @click="handleChange(item.id)" v-for="(item,index) in idList" :key="item.id" | ||||
|         :class="[item.id === currentMenu ? 'active' : '']">{{ item.name }} | ||||
|       </button> | ||||
|       <el-button style="flex: .1" type="text" @click="nextText" icon="el-icon-caret-right"></el-button> | ||||
|       <button style="flex: .2;display: inline-block;" @click="goback()"> | ||||
|         <svg-icon style="width: 20px; height: 20px" :icon-class=" 'back' " /> | ||||
|         <span>返回</span> | ||||
|       </button> | ||||
|       <el-button class='btn' style="flex: .1" type="text" @click="nextText" icon="el-icon-caret-right"></el-button> | ||||
|       <el-button type="primary" plain style="flex: .2;margin-left: 0px;" @click="goback()"><svg-icon icon-class="return" />返回</el-button> | ||||
|     </div> | ||||
|     <!-- </div> --> | ||||
|   </div> | ||||
| @@ -84,16 +81,19 @@ export default { | ||||
| <style scoped lang="scss"> | ||||
| .button-nav { | ||||
|   width: 100%; | ||||
|   padding: 12px 0; | ||||
|   padding-bottom:5px; | ||||
|   display: flex; | ||||
|   // justify-content: space-around; | ||||
|   gap: 12px; | ||||
|  | ||||
|   * { | ||||
|     user-select: none; | ||||
|   } | ||||
|   .btn { | ||||
|     background: #fff; | ||||
|   } | ||||
|  | ||||
|   button { | ||||
|   .tap-btn { | ||||
|     font-size: 16px; | ||||
|     cursor: pointer; | ||||
|     appearance: none; | ||||
|     outline: none; | ||||
| @@ -102,7 +102,7 @@ export default { | ||||
|     border-radius: 8px; | ||||
|     border-bottom-left-radius: 5px; | ||||
|     border-bottom-right-radius: 5px; | ||||
|     padding: 20px; | ||||
|     height: 40px; | ||||
|     color: #888; | ||||
|     letter-spacing: 2px; | ||||
|     flex: 1; | ||||
|   | ||||
| @@ -50,6 +50,11 @@ export default { | ||||
| 					label: '工单名称', | ||||
| 					showOverflowtooltip: true, | ||||
| 				}, | ||||
| 				{ | ||||
| 					prop: 'productionName', | ||||
| 					label: '产品名称', | ||||
| 					showOverflowtooltip: true, | ||||
| 				}, | ||||
| 				...this.dynamicProps, | ||||
| 				{ | ||||
| 					prop: 'sumInput', | ||||
| @@ -70,7 +75,7 @@ export default { | ||||
| 		}; | ||||
| 	}, | ||||
| 	mounted() { | ||||
| 		// this.getList(); | ||||
| 		this.getList(); | ||||
| 	}, | ||||
| 	methods: { | ||||
| 		/** 查询列表 */ | ||||
| @@ -105,7 +110,7 @@ export default { | ||||
| 						}, | ||||
| 						{ | ||||
| 							prop: 'scrapRatio', | ||||
| 							label: '报废比例', | ||||
| 							label: '报废比例(%)', | ||||
| 						}, | ||||
| 					]; | ||||
| 					this.downList.push(obj); | ||||
| @@ -142,6 +147,7 @@ export default { | ||||
| 				return { | ||||
| 					inspectionContent: item.inspectionContent, | ||||
| 					workOrderName: item.workOrderName, | ||||
| 					productionName: item.productionName, | ||||
| 					...keyValuePairs, | ||||
| 					sumInput: item.sumInput, | ||||
| 					sumOutput: item.sumOutput, | ||||
|   | ||||
| @@ -1,10 +1,3 @@ | ||||
| <!-- | ||||
|     filename: index.vue | ||||
|     author: liubin | ||||
|     date: 2023-08-30 14:02:49 | ||||
|     description: 设备加工数量 | ||||
| --> | ||||
|  | ||||
| <template> | ||||
| 	<div style="flex: 1; display: flex; background: #f2f4f9"> | ||||
| 		<div | ||||
| @@ -21,7 +14,7 @@ | ||||
| 				title="点击切换工厂" | ||||
| 				@mouseenter="factoryListOpen = true" | ||||
| 				@mouseleave="factoryListOpen = false"> | ||||
| 				{{ currentFactory?.label || '点我选择设备' }} | ||||
| 				{{ currentFactory?.label || '点我选择工厂' }} | ||||
| 				<div class="factory-list__wrapper" :class="{ open: factoryListOpen }"> | ||||
| 					<ul | ||||
| 						class="factory-list" | ||||
| @@ -33,7 +26,7 @@ | ||||
| 							:data-value="fc.id" | ||||
| 							class="factory-list__item" | ||||
| 							:class="{ 'is-current': fc.id == currentFactory?.id }"> | ||||
| 							<span> | ||||
| 							<span :data-value="fc.id"> | ||||
| 								{{ fc.label }} | ||||
| 							</span> | ||||
| 							<svg-icon | ||||
| @@ -56,10 +49,6 @@ | ||||
| 					:empty-text="''" | ||||
| 					icon-class="custom-icon-class" | ||||
| 					@node-click="handleSidebarItemClick"> | ||||
| 					<!-- <div class="custom-tree-node" slot-scope="{ node, data }"> | ||||
| 						<span class="icon"></span> | ||||
| 						<span>{{ node.label }}</span> | ||||
| 					</div> --> | ||||
| 				</el-tree> | ||||
| 			</div> | ||||
| 		</div> | ||||
| @@ -106,20 +95,16 @@ | ||||
| 						<div v-else class="no-data-bg"></div> | ||||
| 					</el-col> | ||||
| 				</el-row> | ||||
|  | ||||
| 				<!-- <transition appear name="vvv" mode="out-in"></transition> --> | ||||
| 			</div> | ||||
| 		</div> | ||||
| 	</div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| // import Graph from './graph.vue'; | ||||
| import { getWorkOrderList, getTreeData } from '@/api/quality/deviceParameters'; | ||||
| import tableHeightMixin from '@/mixins/tableHeightMixin'; | ||||
| export default { | ||||
| 	name: 'EquipmentProcessAmount', | ||||
| 	// components: { Graph }, | ||||
| 	mixins: [tableHeightMixin], | ||||
| 	props: {}, | ||||
| 	data() { | ||||
| @@ -139,92 +124,7 @@ export default { | ||||
| 				{ name: '5', value: 5 }, | ||||
| 				{ name: '6', value: 6 }, | ||||
| 			], | ||||
| 			sidebarContent: [ | ||||
| 				// { | ||||
| 				// 	id: 'fc1', | ||||
| 				// 	name: '工厂', | ||||
| 				// 	lines: [ | ||||
| 				// 		{ | ||||
| 				// 			name: '产线1', | ||||
| 				// 			id: 'pl1', | ||||
| 				// 			sections: [ | ||||
| 				// 				{ | ||||
| 				// 					name: '工段1', | ||||
| 				// 					id: 'pl1ws1', | ||||
| 				// 					equipments: [ | ||||
| 				// 						{ | ||||
| 				// 							name: '设备1', | ||||
| 				// 							id: 'pl1ws1--eq1', | ||||
| 				// 						}, | ||||
| 				// 						{ | ||||
| 				// 							name: '设备2', | ||||
| 				// 							id: 'pl1ws1--eq2', | ||||
| 				// 						}, | ||||
| 				// 						{ | ||||
| 				// 							name: '设备3', | ||||
| 				// 							id: 'pl1ws1--eq3', | ||||
| 				// 						}, | ||||
| 				// 					], | ||||
| 				// 				}, | ||||
| 				// 				{ | ||||
| 				// 					name: '工段2', | ||||
| 				// 					id: 'pl1ws2', | ||||
| 				// 					equipments: [ | ||||
| 				// 						{ | ||||
| 				// 							name: '设备1', | ||||
| 				// 							id: 'pl2ws1--eq1', | ||||
| 				// 						}, | ||||
| 				// 						{ | ||||
| 				// 							name: '设备2', | ||||
| 				// 							id: 'pl2ws1--eq2', | ||||
| 				// 						}, | ||||
| 				// 						{ | ||||
| 				// 							name: '设备3', | ||||
| 				// 							id: 'pl2ws1--eq3', | ||||
| 				// 						}, | ||||
| 				// 					], | ||||
| 				// 				}, | ||||
| 				// 				{ | ||||
| 				// 					name: '工段3', | ||||
| 				// 					id: 'pl1ws3', | ||||
| 				// 					equipments: [ | ||||
| 				// 						{ | ||||
| 				// 							name: '设备1', | ||||
| 				// 							id: 'pl3ws1--eq1', | ||||
| 				// 						}, | ||||
| 				// 						{ | ||||
| 				// 							name: '设备2', | ||||
| 				// 							id: 'pl3ws1--eq2', | ||||
| 				// 						}, | ||||
| 				// 						{ | ||||
| 				// 							name: '设备3', | ||||
| 				// 							id: 'pl3ws1--eq3', | ||||
| 				// 						}, | ||||
| 				// 					], | ||||
| 				// 				}, | ||||
| 				// 			], | ||||
| 				// 		}, | ||||
| 				// 		{ | ||||
| 				// 			name: '产线2', | ||||
| 				// 			id: 'pl2', | ||||
| 				// 			sections: [ | ||||
| 				// 				{ | ||||
| 				// 					name: '工段1', | ||||
| 				// 					id: 'pl2ws1', | ||||
| 				// 				}, | ||||
| 				// 				{ | ||||
| 				// 					name: '工段2', | ||||
| 				// 					id: 'pl2ws2', | ||||
| 				// 				}, | ||||
| 				// 				{ | ||||
| 				// 					name: '工段3', | ||||
| 				// 					id: 'pl2ws3', | ||||
| 				// 				}, | ||||
| 				// 			], | ||||
| 				// 		}, | ||||
| 				// 	], | ||||
| 				// }, | ||||
| 			], | ||||
| 			sidebarContent: [], | ||||
| 			tableList: [], | ||||
| 			queryParams: { | ||||
| 				id: null, | ||||
| @@ -241,6 +141,7 @@ export default { | ||||
| 					param: 'workOrderId', | ||||
| 					onchange: true, | ||||
| 					filterable: true, | ||||
| 					clearable: false | ||||
| 				}, | ||||
| 				{ | ||||
| 					type: 'datePicker', | ||||
| @@ -264,20 +165,6 @@ export default { | ||||
| 				{ | ||||
| 					type: 'separate', | ||||
| 				}, | ||||
| 				// { | ||||
| 				// 	type: 'button', | ||||
| 				// 	btnName: '表格', | ||||
| 				// 	name: 'table', | ||||
| 				// 	plain: true, | ||||
| 				// 	color: 'success', | ||||
| 				// }, | ||||
| 				// { | ||||
| 				// 	type: 'button', | ||||
| 				// 	btnName: '图表', | ||||
| 				// 	name: 'graph', | ||||
| 				// 	plain: true, | ||||
| 				// 	color: 'warning', | ||||
| 				// }, | ||||
| 				{ | ||||
| 					type: this.$auth.hasPermi('base:equipment-group:export') | ||||
| 						? 'button' | ||||
| @@ -291,15 +178,12 @@ export default { | ||||
| 			tableProps: [ | ||||
| 				{ prop: 'lineName', label: '产线' }, | ||||
| 				{ prop: 'sectionName', label: '工段' }, | ||||
| 				// { prop: 'externalCode', label: '设备编码' }, | ||||
| 				{ prop: 'equipmentId', label: '设备编码' }, | ||||
| 				{ prop: 'equipmentName', label: '设备名称' }, | ||||
| 				{ prop: 'totalQuantity', label: '加工数量' }, | ||||
| 			], | ||||
| 			mode: 'table', // table | graph | ||||
| 			queryParams: { | ||||
| 				// pageNo: 1, | ||||
| 				// pageSize: 999, | ||||
| 				recordTime: [], | ||||
| 				equipmentId: null, | ||||
| 				lineId: null, | ||||
| @@ -313,28 +197,10 @@ export default { | ||||
| 			}, | ||||
| 		}; | ||||
| 	}, | ||||
| 	// mounted() { | ||||
| 	// }, | ||||
| 	computed: { | ||||
| 		// id() { | ||||
| 		//   return this.$route.params.equipmentId; | ||||
| 		// }, | ||||
| 		// code() { | ||||
| 		//   return this.$route.params.equipmentCode; | ||||
| 		// }, | ||||
| 		// name() { | ||||
| 		//   return this.$route.params.equipmentName; | ||||
| 		// }, | ||||
| 	}, | ||||
| 	mounted() { | ||||
| 		this.getDict(); | ||||
| 		// if (this.id) this.$set(this.queryParams, 'id', this.id); | ||||
| 		// if (this.code) | ||||
| 		//   this.$set(this.searchBarFormConfig[0], 'defaultSelect', this.code); | ||||
| 		// if (this.name) | ||||
| 		//   this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.name); | ||||
|  | ||||
| 		// this.handleResponse(); | ||||
| 	}, | ||||
| 	methods: { | ||||
| 		handleSearchBarChanged({ param, value }) { | ||||
| @@ -349,28 +215,14 @@ export default { | ||||
| 			} | ||||
| 		}, | ||||
| 		getDict() { | ||||
| 			// 获取产品的属性列表 | ||||
| 			// getCustomerList().then((response) => { | ||||
| 			//   console.log(response); | ||||
| 			//   this.customerList = response.data | ||||
| 			//   // this.listQuery.total = response.data.total; | ||||
| 			// }) | ||||
| 			// getModelList().then((response) => { | ||||
| 			//   console.log(response); | ||||
| 			//   this.modelList = response.data | ||||
| 			//   // this.listQuery.total = response.data.total; | ||||
| 			// }) | ||||
| 			getWorkOrderList().then((res) => { | ||||
| 				console.log(res); | ||||
| 				// console.log(response); | ||||
| 				this.searchBarFormConfig[0].selectOptions = res.data.map((item) => { | ||||
| 					return { | ||||
| 						name: item.name, | ||||
| 						id: item.id, | ||||
| 					}; | ||||
| 				}); | ||||
| 				// console.log(this.formConfig[0].selectOptions); | ||||
| 				// this.listQuery.total = response.data.total; | ||||
| 			}); | ||||
| 		}, | ||||
| 		buildProps(table) { | ||||
| @@ -532,12 +384,9 @@ export default { | ||||
| 				console.log(res.data); | ||||
| 				this.sidebarContent = res.data; | ||||
| 				this.buildTree(res.data); | ||||
| 				this.currentFactory = null | ||||
| 				console.log('tree', this.sidebarContent); | ||||
| 				// console.log(this.formConfig[0].selectOptions); | ||||
| 				// this.listQuery.total = response.data.total; | ||||
| 			}); | ||||
| 			// const { data } = await this.$axios('/base/core-factory/getTreeByWorkOrder'); | ||||
| 			// console.log(data) | ||||
| 		}, | ||||
|  | ||||
| 		handleTabClick(tab, event) { | ||||
| @@ -549,6 +398,7 @@ export default { | ||||
| 			const fcId = event.target.dataset.value; | ||||
| 			this.handleSidebarItemClick({ id: fcId, type: '工厂' }); | ||||
| 			this.currentFactory = this.sidebarContent.find((item) => item.id == fcId); | ||||
| 			console.log('factory change', this.currentFactory); | ||||
| 		}, | ||||
|  | ||||
| 		handleSidebarItemClick({ label, id, type }) { | ||||
|   | ||||
| @@ -172,6 +172,7 @@ export default { | ||||
| 						query: { | ||||
| 							id: val.data.processFlowId, | ||||
| 							orderId: val.data.id, | ||||
| 							lineId: val.data.lineId, | ||||
| 							name: val.data.name, | ||||
| 							specifications: res.data.specifications, | ||||
| 							productName: val.data.planProductName, | ||||
|   | ||||
| @@ -8,9 +8,6 @@ | ||||
| <template> | ||||
|   <section class="process-bom"> | ||||
|     <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> | ||||
|     <!-- <small-title :no-padding="true"> | ||||
|       设备名称: {{ name }} | ||||
|     </small-title> --> | ||||
|     <div class="btns" style=" | ||||
| 				text-align: right; | ||||
| 				position: absolute; | ||||
| @@ -18,14 +15,7 @@ | ||||
| 				right: 20px; | ||||
| 				display: flex; | ||||
| 			"> | ||||
|       <!-- <el-input icon="el-icon-search" placeholder="搜索" v-model="searchText" style="margin-left: 20px"> | ||||
|         <i slot="prefix" class="el-input__icon el-icon-search"></i> | ||||
|       </el-input> | ||||
|       <el-button type="primary" plain :disabled="currentDet == null" class="btn-create" icon="el-icon-plus"> | ||||
|         分配设备 | ||||
|       </el-button> --> | ||||
|     </div> | ||||
|  | ||||
|     <!-- 列表 --> | ||||
|     <el-row> | ||||
|       <div style="margin-bottom: 10px;font-size: 16px;">设备名称:{{ name }}</div> | ||||
| @@ -51,7 +41,6 @@ | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| // import SmallTitle from './SmallTitle'; | ||||
| import { | ||||
|   getDetMaterial, | ||||
|   getDetValue | ||||
| @@ -59,9 +48,6 @@ import { | ||||
| import StatusBtn from './statusBtn.vue' | ||||
| export default { | ||||
| 	name: 'ProcessBom', | ||||
|   components: { | ||||
|     // SmallTitle | ||||
|   }, | ||||
| 	props: { | ||||
| 		currentDet: { | ||||
| 			type: Object, | ||||
| @@ -77,7 +63,6 @@ export default { | ||||
|           type: 'datePicker', | ||||
|           label: '时间段', | ||||
|           dateType: 'daterange', // datetimerange | ||||
|           // format: 'yyyy-MM-dd HH:mm:ss', | ||||
|           format: 'yyyy-MM-dd', | ||||
|           valueFormat: 'yyyy-MM-dd HH:mm:ss', | ||||
|           rangeSeparator: '-', | ||||
| @@ -94,13 +79,6 @@ export default { | ||||
|           color: 'primary', | ||||
|         },], | ||||
| 			materialTableProps: [ | ||||
| 				// { | ||||
| 				// 	prop: 'createTime', | ||||
| 				// 	label: '添加时间', | ||||
| 				// 	fixed: true, | ||||
| 				// 	width: 180, | ||||
| 				// 	filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), | ||||
| 				// }, | ||||
|         { prop: 'name', label: '物料名称' }, | ||||
|         { prop: 'planNum', label: '预计使用数量' }, | ||||
|         { prop: 'actualNum', label: '实际使用数量' }, | ||||
| @@ -181,22 +159,13 @@ export default { | ||||
|   methods: { | ||||
|     handleSearchBarBtnClick(val) { | ||||
|       console.log(val) | ||||
|       getDetMaterial({ | ||||
|         pageNo: 1, | ||||
|         pageSize: 10, | ||||
|         orderId: this.$route.query.orderId, | ||||
|         flowDetId: [this.detId], | ||||
|         // orderId: this.$route.query.orderId, | ||||
|  | ||||
|       },).then((res) => { | ||||
|         console.log(res); | ||||
|       }) | ||||
|       // if (timeVal && timeVal.length > 0) { | ||||
|       //   this.queryParams.time = timeVal; | ||||
|       // } else { | ||||
|       //   this.queryParams.time = []; | ||||
|       // } | ||||
|       // await this.handleQuery(); | ||||
|       this.queryParams.startTime = val.timeVal.length > 0 ? val.timeVal[0] : '' | ||||
|       this.queryParams.endTime = val.timeVal.length > 0 ? val.timeVal[1] : '' | ||||
|       if (this.activeName === 'material') { | ||||
|         this.getDetMaterialMes() | ||||
|       }else { | ||||
|         this.getDetValueMes() | ||||
|       } | ||||
|     }, | ||||
| 		handleEmitFun() { }, | ||||
| 		handleTableBtnClick() { }, | ||||
| @@ -220,61 +189,44 @@ export default { | ||||
| 				data: method !== 'get' ? payload : null, | ||||
| 			}) | ||||
| 		}, | ||||
|  | ||||
| 		// getList({ detId, detName, detDesc, flowId, sectionName } = {}) { | ||||
| 		// 	console.log('get list') | ||||
|  | ||||
|     // }, | ||||
|     handleTabClick(val) { | ||||
|       // console.log(this.activeName); | ||||
|     handleTabClick() { | ||||
|       if (this.activeName === 'material') { | ||||
|         getDetMaterial({ | ||||
|           pageNo: 1, | ||||
|           pageSize: 10, | ||||
|           orderId: this.$route.query.orderId, | ||||
|           flowDetId: [this.detId], | ||||
|           // orderId: this.$route.query.orderId, | ||||
|  | ||||
|         },).then((res) => { | ||||
|           if (res.data.length != []) { | ||||
|             this.materialList = res.data[0].data | ||||
|             this.name = res.data[0].name | ||||
|           } | ||||
|         }) | ||||
|         this.getDetMaterialMes() | ||||
|       } else { | ||||
|         getDetValue({ | ||||
|           pageNo: 1, | ||||
|           pageSize: 10, | ||||
|         this.getDetValueMes() | ||||
|       } | ||||
|     }, | ||||
|     getList(val) { | ||||
|       this.getDetMaterialMes() | ||||
| 		}, | ||||
| 		clearList() { | ||||
| 			this.list = []; | ||||
|     }, | ||||
|     getDetMaterialMes() { | ||||
|       getDetMaterial({ | ||||
|         orderId: this.$route.query.orderId, | ||||
|         lineId: this.$route.query.lineId, | ||||
|         flowDetId: [this.detId], | ||||
|         ...this.queryParams | ||||
|       }).then((res) => { | ||||
|         if (res.data.length != []) { | ||||
|           this.materialList = res.data[0].data | ||||
|           this.name = res.data[0].name | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     getDetValueMes() { | ||||
|       getDetValue({ | ||||
|           orderId: this.$route.query.orderId, | ||||
|           flowDetId: [this.detId], | ||||
|           // orderId: this.$route.query.orderId, | ||||
|  | ||||
|           ...this.queryParams | ||||
|         }).then((res) => { | ||||
|           if (res.data.length != []) { | ||||
|             this.valueList = res.data[0].data | ||||
|             this.name = res.data[0].name | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     getList(val) { | ||||
|       console.log(val); | ||||
|       getDetMaterial({ | ||||
|         pageNo: 1, | ||||
|         pageSize: 10, | ||||
|         orderId: this.$route.query.orderId, | ||||
|         flowDetId: [this.detId], | ||||
|       }).then((res) => { | ||||
|         console.log(res); | ||||
|         if (res.data.length != []) { | ||||
|           this.materialList = res.data[0].data | ||||
|           this.name = res.data[0].name | ||||
|         } | ||||
|       }) | ||||
| 		}, | ||||
| 		clearList() { | ||||
| 			this.list = []; | ||||
| 		} | ||||
|     } | ||||
| 	}, | ||||
| }; | ||||
| </script> | ||||
|   | ||||
| @@ -71,7 +71,9 @@ export default { | ||||
| 	}, | ||||
| 	mounted() { | ||||
|     this.getInfo() | ||||
|     console.log(this.$route.query) | ||||
| 	}, | ||||
| 	activated() { | ||||
| 		this.getInfo() | ||||
| 	}, | ||||
| 	computed: {}, | ||||
| 	methods: { | ||||
|   | ||||
| @@ -85,7 +85,7 @@ export default { | ||||
| 				}, | ||||
| 				{ | ||||
| 					type: 'datePicker', | ||||
| 					label: '时间段', | ||||
| 					label: '检测时间', | ||||
| 					dateType: 'daterange', // datetimerange | ||||
| 					// format: 'yyyy-MM-dd HH:mm:ss', | ||||
| 					format: 'yyyy-MM-dd', | ||||
| @@ -182,7 +182,7 @@ export default { | ||||
| 				checkPerson: undefined, | ||||
| 				workOrderId: undefined, | ||||
| 				checkTime: undefined, | ||||
| 				source: undefined, | ||||
| 				source: 1, | ||||
| 				workOrderId: undefined, | ||||
| 				remark: undefined, | ||||
| 			}, | ||||
| @@ -257,7 +257,7 @@ export default { | ||||
| 				sectionId: undefined, | ||||
| 				checkPerson: undefined, | ||||
| 				checkTime: undefined, | ||||
| 				source: undefined, | ||||
| 				source: 1, | ||||
| 				workOrderId: undefined, | ||||
| 				remark: undefined, | ||||
| 				productionLineId: undefined, | ||||
|   | ||||
| @@ -133,8 +133,6 @@ import { | ||||
| 	getDetList, | ||||
| 	getLineList, | ||||
| } from '@/api/base/qualityScrapLog'; | ||||
| // import { getList } from '@/api/base/qualityScrapType'; | ||||
| import moment from 'moment'; | ||||
| export default { | ||||
| 	data() { | ||||
| 		return { | ||||
| @@ -166,16 +164,14 @@ export default { | ||||
| 			}, | ||||
| 			dataRule: { | ||||
| 				workOrderId: [ | ||||
| 					{ required: true, message: '工单号不能为空', trigger: 'change' }, | ||||
| 					{ required: true, message: '工单名称不能为空', trigger: 'change' }, | ||||
| 				], | ||||
| 				num: [{ required: true, message: '数量不能为空', trigger: 'blur' }], | ||||
| 				detId: [ | ||||
| 					{ required: true, message: '报废原因不能为空', trigger: 'change' }, | ||||
| 				], | ||||
|  | ||||
| 				logTime: [ | ||||
| 					{ required: true, message: '报废时间不能为空', trigger: 'change' }, | ||||
| 				], | ||||
| 				logTime: [{ required: true, message: '报废时间不能为空', trigger: 'change' }], | ||||
| 			}, | ||||
| 			showDetail: false, | ||||
| 		}; | ||||
| @@ -193,10 +189,9 @@ export default { | ||||
| 					console.log(res); | ||||
| 					this.dataForm = res.data; | ||||
| 					this.dataForm.logTime = res.data.logTime || null; | ||||
| 					console.log('=================='); | ||||
| 				}); | ||||
| 			} else { | ||||
| 				this.dataForm.logTime = moment().format('yyyy-MM-DD hh:mm:ss'); | ||||
| 				this.dataForm.logTime = Date.now(); | ||||
| 			} | ||||
| 		}, | ||||
| 		// 表单提交 | ||||
|   | ||||
| @@ -5,6 +5,7 @@ | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import { getDictDatas, DICT_TYPE } from '@/utils/dict'; | ||||
| export default { | ||||
|   name: "StatusBtn2", | ||||
|   props: { | ||||
| @@ -15,7 +16,14 @@ export default { | ||||
|   }, | ||||
|   computed: { | ||||
|     state() { | ||||
|       return this.injectData.status === 1 ? "关闭" : "开启"; | ||||
|       let label = '' | ||||
|       getDictDatas(DICT_TYPE.COMMON_STATUS).forEach((item) => { | ||||
|         if (parseInt(item.value) === this.injectData.status) { | ||||
|           label = item.label; | ||||
|         } | ||||
|       }) | ||||
|       return label | ||||
|       // return this.injectData.status === 1 ? "关闭" : "开启"; | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
|   | ||||
| @@ -21,12 +21,12 @@ | ||||
| 			<el-table-column | ||||
| 				prop="name" | ||||
| 				label="部门名称" | ||||
| 				width="260"></el-table-column> | ||||
| 				min-width="260"></el-table-column> | ||||
| 			<el-table-column | ||||
| 				prop="leader" | ||||
| 				label="负责人" | ||||
| 				:formatter="userNicknameFormat" | ||||
| 				width="120" /> | ||||
| 				min-width="120" /> | ||||
| 			<el-table-column prop="sort" label="排序" width="200"></el-table-column> | ||||
| 			<el-table-column prop="status" label="状态" width="100"> | ||||
| 				<template v-slot="scope"> | ||||
| @@ -37,7 +37,7 @@ | ||||
| 				label="创建时间" | ||||
| 				align="center" | ||||
| 				prop="createTime" | ||||
| 				width="200"> | ||||
| 				min-width="200"> | ||||
| 				<template v-slot="scope"> | ||||
| 					<span>{{ parseTime(scope.row.createTime) }}</span> | ||||
| 				</template> | ||||
| @@ -45,45 +45,45 @@ | ||||
| 			<el-table-column | ||||
| 				label="操作" | ||||
| 				align="center" | ||||
| 				width="160" | ||||
| 				class-name="small-padding fixed-width"> | ||||
| 				<template v-slot="scope"> | ||||
| 					<el-button | ||||
| 						size="mini" | ||||
| 						type="text" | ||||
| 						icon="el-icon-edit" | ||||
| 						@click="handleUpdate(scope.row)" | ||||
| 						v-hasPermi="['system:dept:update']"> | ||||
| 						修改 | ||||
| 					</el-button> | ||||
| 					<el-button | ||||
| 						size="mini" | ||||
| 						type="text" | ||||
| 						icon="el-icon-plus" | ||||
| 						@click="handleAdd(scope.row)" | ||||
| 						v-hasPermi="['system:dept:create']"> | ||||
| 						新增 | ||||
| 					</el-button> | ||||
| 					<span | ||||
| 							v-hasPermi="['system:dept:update']" | ||||
| 							style="margin: 0 4px; font-size: 18px; color: #e5e7eb" | ||||
| 							>|</span | ||||
| 						> | ||||
| 					<el-button | ||||
| 						type="text" | ||||
| 						@click="handleUpdate(scope.row)" | ||||
| 						v-hasPermi="['system:dept:update']"> | ||||
| 						<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon> | ||||
| 					</el-button> | ||||
| 					<span | ||||
| 						 v-if="scope.row.parentId !== 0" | ||||
| 							v-hasPermi="['system:dept:delete']" | ||||
| 							style="margin: 0 4px; font-size: 18px; color: #e5e7eb" | ||||
| 							>|</span | ||||
| 						> | ||||
| 					<el-button | ||||
| 						v-if="scope.row.parentId !== 0" | ||||
| 						size="mini" | ||||
| 						type="text" | ||||
| 						icon="el-icon-delete" | ||||
| 						@click="handleDelete(scope.row)" | ||||
| 						v-hasPermi="['system:dept:delete']"> | ||||
| 						删除 | ||||
| 						<svg-icon icon-class="table_delete"></svg-icon> | ||||
| 					</el-button> | ||||
| 				</template> | ||||
| 			</el-table-column> | ||||
| 		</el-table> | ||||
|  | ||||
| 		<!-- 添加或修改菜单对话框 --> | ||||
| 		<el-dialog :visible.sync="open" width="800px" append-to-body class="dialog"> | ||||
| 			<template #title> | ||||
| 				<slot name="title"> | ||||
| 					<div class="titleStyle">{{ title }}</div> | ||||
| 				</slot> | ||||
| 			</template> | ||||
| 			<slot /> | ||||
| 		<base-dialog :dialogVisible="open" :dialogTitle="title" width="800px" class="dialog" :before-close='cancel'> | ||||
| 			<el-form ref="form" :model="form" :rules="rules" label-width="80px"> | ||||
| 				<el-row> | ||||
| 					<el-col :span="24"> | ||||
| @@ -117,9 +117,9 @@ | ||||
| 								style="width: 100%"> | ||||
| 								<el-option | ||||
| 									v-for="item in users" | ||||
| 									:key="parseInt(item.id)" | ||||
| 									:key="item.id" | ||||
| 									:label="item.nickname" | ||||
| 									:value="parseInt(item.id)" /> | ||||
| 									:value="item.id" /> | ||||
| 							</el-select> | ||||
| 						</el-form-item> | ||||
| 					</el-col> | ||||
| @@ -157,7 +157,7 @@ | ||||
|         <el-button class="btnTextStyle"  @click="cancel">取 消</el-button> | ||||
| 				<el-button type="primary" class="btnTextStyle"  @click="submitForm">确 定</el-button> | ||||
| 			</div> | ||||
| 		</el-dialog> | ||||
| 		</base-dialog> | ||||
| 	</div> | ||||
| </template> | ||||
|  | ||||
| @@ -316,7 +316,7 @@ export default { | ||||
| 				return '未设置'; | ||||
| 			} | ||||
| 			for (const user of this.users) { | ||||
| 				if (row.leaderUserId === user.id) { | ||||
| 				if (row.leaderUserId == user.id) { | ||||
| 					return user.nickname; | ||||
| 				} | ||||
| 			} | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user