Compare commits
	
		
			28 Commits
		
	
	
		
			028c14a174
			...
			projects/m
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 787c994224 | |||
| cc1e237043 | |||
|  | 45e1fe4b47 | ||
|  | e823dee9ff | ||
| 932d35c14c | |||
| ceeb853783 | |||
| 6ed21030f5 | |||
| 73feff0d8b | |||
| d49a698136 | |||
| 6e774dfc5d | |||
| 3eeded056f | |||
| 881eace12f | |||
| dad3b2da95 | |||
| f5cfc5d2bb | |||
| 235b0a6512 | |||
| 13bf1e0fd0 | |||
|  | 97acb4faac | ||
|  | 04a5359eda | ||
| 7ae7dfad95 | |||
| e202ac542e | |||
| eb8736178a | |||
| 580a66549c | |||
| 30c45e6f74 | |||
| e9c2917c77 | |||
| 0a9bd0c6de | |||
| 84dbd8d5b2 | |||
|  | 00f54f3de6 | ||
|  | f26d7abc64 | 
							
								
								
									
										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 | VUE_CLI_BABEL_TRANSPILE_MODULES = true | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ | |||||||
|  * @Date: 2023-11-08 15:56:52 |  * @Date: 2023-11-08 15:56:52 | ||||||
|  * @LastEditTime: 2024-02-26 17:02:53 |  * @LastEditTime: 2024-02-26 17:02:53 | ||||||
|  * @LastEditors: DY |  * @LastEditors: DY | ||||||
|  * @Description:  |  * @Description: | ||||||
|  */ |  */ | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
|  |  | ||||||
| @@ -78,3 +78,11 @@ export function deleteLogDet(id) { | |||||||
|     method: 'delete' |     method: 'delete' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | export function getEqMaintainPlanPageData(query) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/base/equipment-maintain-log-det/page', | ||||||
|  |     method: 'get', | ||||||
|  |     params: query | ||||||
|  |   }) | ||||||
|  | } | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ export function getWorkOrderList(query) { | |||||||
|  |  | ||||||
| export function getCoreProduct(id) { | export function getCoreProduct(id) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/core-product/get?id=' + id, |     url: '/base/core-product-material/get?id=' + id, | ||||||
|     method: 'get' |     method: 'get' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
|   | |||||||
| @@ -44,11 +44,7 @@ export function updateRole(data) { | |||||||
| } | } | ||||||
|  |  | ||||||
| // 角色状态修改 | // 角色状态修改 | ||||||
| export function changeRoleStatus(id, status) { | export function changeRoleStatus(data) { | ||||||
|   const data = { |  | ||||||
|     id, |  | ||||||
|     status |  | ||||||
|   } |  | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/system/role/update-status', |     url: '/system/role/update-status', | ||||||
|     method: 'put', |     method: 'put', | ||||||
|   | |||||||
| @@ -1,10 +1,3 @@ | |||||||
| <!-- |  | ||||||
|     filename: index.vue |  | ||||||
|     author: liubin |  | ||||||
|     date: 2024-04-02 09:49:36 |  | ||||||
|     description: |  | ||||||
| --> |  | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
|   <!-- 按钮切换 --> |   <!-- 按钮切换 --> | ||||||
|   <div v-if="buttonMode" class="button-nav"> |   <div v-if="buttonMode" class="button-nav"> | ||||||
| @@ -12,9 +5,8 @@ | |||||||
|       v-for="m in menus" |       v-for="m in menus" | ||||||
|       :key="m" |       :key="m" | ||||||
|       @click="currentMenu = m" |       @click="currentMenu = m" | ||||||
|       :data-text="m" |  | ||||||
|       :class="[m === currentMenu ? 'active' : '']" |       :class="[m === currentMenu ? 'active' : '']" | ||||||
|     ></button> |     >{{m}}</button> | ||||||
|   </div> |   </div> | ||||||
|   <!-- 标签切换 --> |   <!-- 标签切换 --> | ||||||
|   <div v-else class="custom-tabs" style="height: 100%; width: 100%"> |   <div v-else class="custom-tabs" style="height: 100%; width: 100%"> | ||||||
| @@ -75,33 +67,24 @@ export default { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   button { |   button { | ||||||
|  |     height: 48px; | ||||||
|  |     line-height: 48px; | ||||||
|     cursor: pointer; |     cursor: pointer; | ||||||
|     appearance: none; |     appearance: none; | ||||||
|     outline: none; |     outline: none; | ||||||
|     border: none; |     border: none; | ||||||
|     background: #fff; |     background: #fff; | ||||||
|     border-radius: 8px; |     border-radius: 8px; | ||||||
|     padding: 15px; |     font-size: 16px; | ||||||
|     color: #888; |     font-weight: 500; | ||||||
|  |     color: rgba(22, 22, 22, 0.65); | ||||||
|     letter-spacing: 2px; |     letter-spacing: 2px; | ||||||
|     flex: 1; |     flex: 1; | ||||||
|     box-sizing: padding-box; |     box-sizing: padding-box; | ||||||
|     position: relative; |     position: relative; | ||||||
|  |  | ||||||
|     &::after { |  | ||||||
|       content: attr(data-text); |  | ||||||
|       position: absolute; |  | ||||||
|       top: 5px; |  | ||||||
|       left: 50%; |  | ||||||
|       font-size: 16px; |  | ||||||
|       font-weight: 500; |  | ||||||
|       transform: translate(-50%); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     &.active { |     &.active { | ||||||
|       color: #111; |       color: rgba(22, 22, 22, 1); | ||||||
|       //border-bottom: 2px solid #0b58ff; |       border-bottom: 4px solid #0b58ff; | ||||||
|       box-shadow: 0px 2px 1px 1px #0b58ff; |  | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -28,7 +28,7 @@ export default { | |||||||
| 			// tableBtn: [], // 占位 | 			// tableBtn: [], // 占位 | ||||||
| 			// searchBarFormConfig: [], // 占位 | 			// searchBarFormConfig: [], // 占位 | ||||||
| 			// // 弹窗表单配置 | 			// // 弹窗表单配置 | ||||||
| 			// dialogFormConfig: [], //  | 			// dialogFormConfig: [], // | ||||||
| 			updateUrl: '', | 			updateUrl: '', | ||||||
| 			addUrl: '', | 			addUrl: '', | ||||||
| 			pageUrl: '', | 			pageUrl: '', | ||||||
| @@ -109,9 +109,11 @@ export default { | |||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		// 处理搜索栏按钮 | 		// 处理搜索栏按钮 | ||||||
| 		handleSearchBarBtnClick(btn) { |     handleSearchBarBtnClick(btn) { | ||||||
|  |       console.log(btn); | ||||||
|  |  | ||||||
| 			// const keys = ['name', 'createTime']; // timeVal // 已被 searchBarKeys 替代 | 			// const keys = ['name', 'createTime']; // timeVal // 已被 searchBarKeys 替代 | ||||||
| 			switch (btn.btnName) { |       switch (btn.btnName) { | ||||||
| 				case 'search': | 				case 'search': | ||||||
| 					this.searchBarKeys.forEach((key) => { | 					this.searchBarKeys.forEach((key) => { | ||||||
| 						if (key == 'timeVal') { | 						if (key == 'timeVal') { | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ const permission = { | |||||||
|       state.topbarRouters = routes |       state.topbarRouters = routes | ||||||
|     }, |     }, | ||||||
|     SET_SIDEBAR_ROUTERS: (state, routes) => { |     SET_SIDEBAR_ROUTERS: (state, routes) => { | ||||||
|       console.log('==SET_SIDEBAR_ROUTERS==:',routes) |       // console.log('==SET_SIDEBAR_ROUTERS==:',routes) | ||||||
|       state.sidebarRouters = routes |       state.sidebarRouters = routes | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   | |||||||
| @@ -89,6 +89,7 @@ export const DICT_TYPE = { | |||||||
|  |  | ||||||
|   // ============== ENERGY - 能源模块 ============= |   // ============== ENERGY - 能源模块 ============= | ||||||
|   ENERGY_UNIT: 'energy_unit', |   ENERGY_UNIT: 'energy_unit', | ||||||
|  |   ENERGY_TYPE: 'energy_type', | ||||||
|   EQU_ALARM_LEVEL: 'equ_alarm_level', |   EQU_ALARM_LEVEL: 'equ_alarm_level', | ||||||
|   MONITOR_INDEX_TYPE: 'monitor_index_type', |   MONITOR_INDEX_TYPE: 'monitor_index_type', | ||||||
|   OBJECT_TYPE: 'object_type', |   OBJECT_TYPE: 'object_type', | ||||||
|   | |||||||
| @@ -93,6 +93,16 @@ const tableProps = [ | |||||||
|     label: '装箱规格(片/箱)', |     label: '装箱规格(片/箱)', | ||||||
|     width: 150 |     width: 150 | ||||||
|   }, |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'contactPerson', | ||||||
|  |     label: '车辆联系人', | ||||||
|  |     width: 150 | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'contactPersonCall', | ||||||
|  |     label: '联系方式', | ||||||
|  |     width: 150 | ||||||
|  |   }, | ||||||
|   { |   { | ||||||
|     prop: 'packagingNum', |     prop: 'packagingNum', | ||||||
|     label: '箱数' |     label: '箱数' | ||||||
| @@ -221,4 +231,4 @@ export default { | |||||||
|   padding:32px 32px 30px 30px; |   padding:32px 32px 30px 30px; | ||||||
|   height: calc(100vh - 125px); |   height: calc(100vh - 125px); | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|   | |||||||
| @@ -8,26 +8,29 @@ | |||||||
|       </el-col> |       </el-col> | ||||||
|       <el-col :span='12'> |       <el-col :span='12'> | ||||||
|         <el-form-item label="装车时间" prop="loadTime"> |         <el-form-item label="装车时间" prop="loadTime"> | ||||||
|           <el-date-picker |           <el-date-picker v-model="form.loadTime" type="datetime" format='yyyy-MM-dd HH:mm:ss' value-format="timestamp" | ||||||
|             v-model="form.loadTime" |             style="width: 100%;" placeholder="选择日期"> | ||||||
|             type="datetime" |  | ||||||
|             format='yyyy-MM-dd HH:mm:ss' |  | ||||||
|             value-format="timestamp" |  | ||||||
|             style="width: 100%;" |  | ||||||
|             placeholder="选择日期"> |  | ||||||
|           </el-date-picker> |           </el-date-picker> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|       </el-col> |       </el-col> | ||||||
|     </el-row> |     </el-row> | ||||||
|  |     <el-row :gutter="24"> | ||||||
|  |       <el-col :span='12'> | ||||||
|  |         <el-form-item label="车辆联系人" prop="contactPerson"> | ||||||
|  |           <el-input v-model="form.contactPerson"></el-input> | ||||||
|  |         </el-form-item> | ||||||
|  |       </el-col> | ||||||
|  |       <el-col :span='12'> | ||||||
|  |         <el-form-item label="联系方式" prop="contactPersonCall"> | ||||||
|  |           <el-input v-model="form.contactPersonCall"></el-input> | ||||||
|  |         </el-form-item> | ||||||
|  |       </el-col> | ||||||
|  |     </el-row> | ||||||
|     <el-row> |     <el-row> | ||||||
|       <el-col :span='12'> |       <el-col :span='12'> | ||||||
|         <el-form-item label="装车产品" prop="productId"> |         <el-form-item label="装车产品" prop="productId"> | ||||||
|           <el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;"> |           <el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;"> | ||||||
|             <el-option |             <el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id"> | ||||||
|               v-for="item in productList" |  | ||||||
|               :key="item.id" |  | ||||||
|               :label="item.name" |  | ||||||
|               :value="item.id"> |  | ||||||
|             </el-option> |             </el-option> | ||||||
|           </el-select> |           </el-select> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
| @@ -121,4 +124,4 @@ export default { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -44,14 +44,14 @@ | |||||||
|               :table-data="tableData" |               :table-data="tableData" | ||||||
|               :max-height="tableH" |               :max-height="tableH" | ||||||
|             > |             > | ||||||
|               <method-btn |               <!-- <method-btn | ||||||
|                 v-if="tableBtn.length" |                 v-if="tableBtn.length" | ||||||
|                 slot="handleBtn" |                 slot="handleBtn" | ||||||
|                 :width="80" |                 :width="80" | ||||||
|                 label="操作" |                 label="操作" | ||||||
|                 :method-list="tableBtn" |                 :method-list="tableBtn" | ||||||
|                 @clickBtn="viewDetDetail" |                 @clickBtn="viewDetDetail" | ||||||
|               /> |               /> --> | ||||||
|             </base-table> |             </base-table> | ||||||
|             <pagination |             <pagination | ||||||
|               :page.sync="queryParams.pageNo" |               :page.sync="queryParams.pageNo" | ||||||
| @@ -63,7 +63,7 @@ | |||||||
|         </el-tab-pane> |         </el-tab-pane> | ||||||
|         <el-tab-pane label="环形图" name="barChart"> |         <el-tab-pane label="环形图" name="barChart"> | ||||||
|           <div v-if="activeName === 'barChart'"> |           <div v-if="activeName === 'barChart'"> | ||||||
|             <div  |             <div | ||||||
|               id="logDetPieBar" |               id="logDetPieBar" | ||||||
|               style="width: 60%" |               style="width: 60%" | ||||||
|               :style="{ height: chartHeight + 'px' }" |               :style="{ height: chartHeight + 'px' }" | ||||||
| @@ -73,51 +73,14 @@ | |||||||
|       </el-tabs> |       </el-tabs> | ||||||
|     </div> |     </div> | ||||||
|     <!-- 详情抽屉 --> |     <!-- 详情抽屉 --> | ||||||
|     <el-drawer |  | ||||||
|       title="发货详情" |  | ||||||
|       size="50%" |  | ||||||
|       :append-to-body="true" |  | ||||||
|       :visible.sync="innerDrawer" |  | ||||||
|       @close='closeB' |  | ||||||
|       :show-close='false'> |  | ||||||
|       <div class="box3"> |  | ||||||
|         <el-row> |  | ||||||
|           <el-col :span='12'> |  | ||||||
|             <span class="title">订单名:</span> |  | ||||||
|             <span class="text">{{orderMsg.orderName ? orderMsg.orderName : '-'}}</span> |  | ||||||
|           </el-col> |  | ||||||
|           <el-col :span='12'> |  | ||||||
|             <span class="title">发货单号:</span> |  | ||||||
|             <span class="text">{{logCode ? logCode : '-'}}</span> |  | ||||||
|           </el-col> |  | ||||||
|         </el-row> |  | ||||||
|       </div> |  | ||||||
|       <div class="box4"> |  | ||||||
|         <div class="boxTitle"> |  | ||||||
|           <span class="blueTitle"></span> |  | ||||||
|           <span>详情</span> |  | ||||||
|         </div> |  | ||||||
|         <base-table |  | ||||||
|           :page="queryParams2.pageNo" |  | ||||||
|           :limit="queryParams2.pageSize" |  | ||||||
|           :table-props="tableProps2" |  | ||||||
|           :table-data="tableData2" |  | ||||||
|           :max-height="tableH2" |  | ||||||
|         /> |  | ||||||
|         <pagination |  | ||||||
|           :page.sync="queryParams2.pageNo" |  | ||||||
|           :limit.sync="queryParams2.pageSize" |  | ||||||
|           :total="total2" |  | ||||||
|           @pagination="getList2" |  | ||||||
|         /> |  | ||||||
|       </div> |  | ||||||
|     </el-drawer> |  | ||||||
|   </el-drawer> |   </el-drawer> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| import { deliveryLogPage, deliveryLogDetPage } from '@/api/base/delivery' | import { deliveryLogPage, deliveryLogDetPage } from '@/api/base/delivery' | ||||||
| import { parseTime } from '@/utils/ruoyi' | import { parseTime } from '@/utils/ruoyi' | ||||||
| import * as echarts from 'echarts' | import * as echarts from 'echarts' | ||||||
|  | import detailButton from './detailButton'; | ||||||
|  |  | ||||||
| import resize from '@/utils/chartMixins/resize' | import resize from '@/utils/chartMixins/resize' | ||||||
| const tableProps = [ | const tableProps = [ | ||||||
|   { |   { | ||||||
| @@ -142,55 +105,21 @@ const tableProps = [ | |||||||
|   { |   { | ||||||
|     prop: 'rate', |     prop: 'rate', | ||||||
|     label: '发货比列(%)', |     label: '发货比列(%)', | ||||||
|     width: 110 |     width: 110, | ||||||
|  |     filter: (val) => | ||||||
|  |       val != null ? `${(val).toFixed(2)}%` : '', | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     prop: 'principalCost', |     prop: 'principalCost', | ||||||
|     label: '运输费用' |     label: '运输费用' | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'desc', | ||||||
|  |     label: '装车详情', | ||||||
|  |     subcomponent: detailButton, | ||||||
|   } |   } | ||||||
| ] | ] | ||||||
| const tableProps2 = [ |  | ||||||
|   { |  | ||||||
|     prop: 'createTime', |  | ||||||
|     label: '添加时间', |  | ||||||
|     filter: parseTime, |  | ||||||
|     minWidth: 160 |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     prop: 'deliveryCarCode', |  | ||||||
|     label: '装车单号', |  | ||||||
|     showOverflowtooltip: true |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     prop: 'loadTime', |  | ||||||
|     label: '装车时间', |  | ||||||
|     filter: parseTime, |  | ||||||
|     minWidth: 160 |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     prop: 'productName', |  | ||||||
|     label: '装车产品', |  | ||||||
|     showOverflowtooltip: true |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     prop: 'packagingSize', |  | ||||||
|     label: '装箱规格(片/箱)', |  | ||||||
|     minWidth: 140 |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     prop: 'packagingNum', |  | ||||||
|     label: '箱数' |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     prop: 'quantity', |  | ||||||
|     label: '装车总量' |  | ||||||
|   }, |  | ||||||
|   { |  | ||||||
|     prop: 'productDate', |  | ||||||
|     label: '产品批次', |  | ||||||
|     showOverflowtooltip: true |  | ||||||
|   } |  | ||||||
| ] |  | ||||||
| export default { | export default { | ||||||
|   name: 'DeliveryLogDetDetail', |   name: 'DeliveryLogDetDetail', | ||||||
|   mixins: [resize], |   mixins: [resize], | ||||||
| @@ -224,7 +153,6 @@ export default { | |||||||
|         pageSize: 20, |         pageSize: 20, | ||||||
|         logId: '' |         logId: '' | ||||||
|       }, |       }, | ||||||
|       tableProps2, |  | ||||||
|       tableData2: [], |       tableData2: [], | ||||||
|       tableH2: this.tableHeight(275), |       tableH2: this.tableHeight(275), | ||||||
|       total2: 0, |       total2: 0, | ||||||
| @@ -288,7 +216,7 @@ export default { | |||||||
|         for (let i = 0; i < this.tableData.length; i++) { |         for (let i = 0; i < this.tableData.length; i++) { | ||||||
|           let obj = {} |           let obj = {} | ||||||
|           obj.value = this.tableData[i].num |           obj.value = this.tableData[i].num | ||||||
|           obj.name = this.tableData[i].name |           obj.name = this.tableData[i].code | ||||||
|           seriesData.push(obj) |           seriesData.push(obj) | ||||||
|           if (i < 5) { |           if (i < 5) { | ||||||
|             colorList.push(color[i]) |             colorList.push(color[i]) | ||||||
| @@ -394,14 +322,7 @@ export default { | |||||||
|         this.total2 = res.data.total || 0 |         this.total2 = res.data.total || 0 | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|     closeB() { |  | ||||||
|       this.logCode = '' |  | ||||||
|       this.queryParams2.pageNo = 1 |  | ||||||
|       this.queryParams2.pageSize = 20 |  | ||||||
|       this.queryParams2.logId = '' |  | ||||||
|       this.tableData2 = [] |  | ||||||
|       this.total2 = 0 |  | ||||||
|     } |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| @@ -498,4 +419,4 @@ export default { | |||||||
|     color: rgba(0, 0, 0, 0.45); |     color: rgba(0, 0, 0, 0.45); | ||||||
|   } |   } | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|   | |||||||
							
								
								
									
										253
									
								
								src/views/delivery/deliveryLogDet/components/detailButton.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										253
									
								
								src/views/delivery/deliveryLogDet/components/detailButton.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,253 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2023-08-03 14:09:18 | ||||||
|  |  * @LastEditors: DY | ||||||
|  |  * @LastEditTime: 2023-10-13 16:47:25 | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  |   <div class="tableInner"> | ||||||
|  |       <el-button @click="viewDetDetail" type="text" style="margin: 5px 0; padding: 0" > | ||||||
|  |         <span class="iconfont" :class="'icon-detail' + | ||||||
|  |                       ' primary-color' | ||||||
|  |                 "></span> | ||||||
|  |       </el-button> | ||||||
|  |     <el-drawer title="发货详情" size="50%" :append-to-body="true" :visible.sync="innerDrawer" @close='closeB' | ||||||
|  |       :show-close='false'> | ||||||
|  |       <div class="box3"> | ||||||
|  |         <el-row> | ||||||
|  |           <el-col :span='12'> | ||||||
|  |             <span class="title">订单名:</span> | ||||||
|  |             <span class="text">{{ orderMsg.orderName ? orderMsg.orderName : '-' }}</span> | ||||||
|  |           </el-col> | ||||||
|  |           <el-col :span='12'> | ||||||
|  |             <span class="title">发货单号:</span> | ||||||
|  |             <span class="text">{{ logCode ? logCode : '-' }}</span> | ||||||
|  |           </el-col> | ||||||
|  |         </el-row> | ||||||
|  |       </div> | ||||||
|  |       <div class="box4"> | ||||||
|  |         <div class="boxTitle"> | ||||||
|  |           <span class="blueTitle"></span> | ||||||
|  |           <span>详情</span> | ||||||
|  |         </div> | ||||||
|  |         <base-table :page="queryParams2.pageNo" :limit="queryParams2.pageSize" :table-props="tableProps2" | ||||||
|  |           :table-data="tableData2" :max-height="tableH2" /> | ||||||
|  |         <pagination :page.sync="queryParams2.pageNo" :limit.sync="queryParams2.pageSize" :total="total2" | ||||||
|  |           @pagination="getList2" /> | ||||||
|  |       </div> | ||||||
|  |     </el-drawer> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | <script> | ||||||
|  | import { deliveryLogDetPage } from '@/api/base/delivery' | ||||||
|  | import { parseTime } from '@/utils/ruoyi' | ||||||
|  |  | ||||||
|  | const tableProps2 = [ | ||||||
|  |   // { | ||||||
|  |   //   prop: 'createTime', | ||||||
|  |   //   label: '添加时间', | ||||||
|  |   //   filter: parseTime, | ||||||
|  |   //   minWidth: 160 | ||||||
|  |   // }, | ||||||
|  |   { | ||||||
|  |     prop: 'deliveryCarCode', | ||||||
|  |     label: '装车单号', | ||||||
|  |     showOverflowtooltip: true | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'loadTime', | ||||||
|  |     label: '装车时间', | ||||||
|  |     filter: parseTime, | ||||||
|  |     minWidth: 160 | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'productName', | ||||||
|  |     label: '装车产品', | ||||||
|  |     showOverflowtooltip: true | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'packagingSize', | ||||||
|  |     label: '装箱规格(片/箱)', | ||||||
|  |     minWidth: 140 | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'packagingNum', | ||||||
|  |     label: '箱数' | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'quantity', | ||||||
|  |     label: '装车总量' | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'productDate', | ||||||
|  |     label: '产品批次', | ||||||
|  |     showOverflowtooltip: true | ||||||
|  |   } | ||||||
|  | ] | ||||||
|  | export default { | ||||||
|  | 	props: { | ||||||
|  | 		injectData: { | ||||||
|  | 			type: Object, | ||||||
|  | 			default: () => ({}), | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 			list: this.injectData, | ||||||
|  |       visible: false, | ||||||
|  |       tableProps2, | ||||||
|  |       logCode:'', | ||||||
|  |       orderMsg: {}, | ||||||
|  |       tableData2: [], | ||||||
|  |       tableH2: this.tableHeight(275), | ||||||
|  |       total2: 0, | ||||||
|  |       innerDrawer:false, | ||||||
|  |       queryParams2: { | ||||||
|  |         pageNo: 1, | ||||||
|  |         pageSize: 20, | ||||||
|  |         logId: '' | ||||||
|  |       }, | ||||||
|  | 		}; | ||||||
|  |   }, | ||||||
|  |   mounted() { | ||||||
|  |     window.addEventListener('resize', () => { | ||||||
|  |       this.tableH2 = this.tableHeight(275) | ||||||
|  |     }) | ||||||
|  |   }, | ||||||
|  | 	methods: { | ||||||
|  |     viewDetDetail() { | ||||||
|  |       console.log(this.list); | ||||||
|  |  | ||||||
|  |       this.logCode = this.list.code | ||||||
|  |       this.orderMsg.orderName = this.list.orderName | ||||||
|  |       this.innerDrawer = true | ||||||
|  |       this.queryParams2.logId = this.list.id | ||||||
|  |       this.getList2() | ||||||
|  |     }, | ||||||
|  |     closeB() { | ||||||
|  |       this.logCode = '' | ||||||
|  |       this.queryParams2.pageNo = 1 | ||||||
|  |       this.queryParams2.pageSize = 20 | ||||||
|  |       this.queryParams2.logId = '' | ||||||
|  |       this.tableData2 = [] | ||||||
|  |       this.total2 = 0 | ||||||
|  |     }, | ||||||
|  |     getList2() { | ||||||
|  |       deliveryLogDetPage({ ...this.queryParams2 }).then(res => { | ||||||
|  |         this.tableData2 = res.data.list || [] | ||||||
|  |         this.total2 = res.data.total || 0 | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
|  | <style scoped lang='scss'> | ||||||
|  | .box1 { | ||||||
|  |   height: 76px; | ||||||
|  |   border-bottom: 1px solid #E9E9E9; | ||||||
|  |   margin: 0px 8px 20px 30px; | ||||||
|  |  | ||||||
|  |   .box_col { | ||||||
|  |     display: inline-block; | ||||||
|  |     width: 20%; | ||||||
|  |     padding: 8px 8px 8px 8px; | ||||||
|  |  | ||||||
|  |     .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); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .box2 { | ||||||
|  |   padding: 0px 32px 30px 30px; | ||||||
|  |   height: calc(100vh - 150px); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .boxTitle { | ||||||
|  |   display: inline-block; | ||||||
|  |   font-size: 16px; | ||||||
|  |   font-weight: 400; | ||||||
|  |   color: #000000; | ||||||
|  |   margin: 0 10px 10px 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .blueTitle { | ||||||
|  |   content: ''; | ||||||
|  |   display: inline-block; | ||||||
|  |   width: 4px; | ||||||
|  |   height: 18px; | ||||||
|  |   background-color: #0B58FF; | ||||||
|  |   border-radius: 1px; | ||||||
|  |   margin-right: 8px; | ||||||
|  |   vertical-align: bottom; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .box3 { | ||||||
|  |   padding: 8px 8px 8px 40px; | ||||||
|  |  | ||||||
|  |   .title { | ||||||
|  |     height: 16px; | ||||||
|  |     font-size: 14px; | ||||||
|  |     font-weight: 600; | ||||||
|  |     color: rgba(0, 0, 0, 0.85); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   .text { | ||||||
|  |     height: 16px; | ||||||
|  |     font-size: 14px; | ||||||
|  |     font-weight: 400; | ||||||
|  |     color: rgba(102, 102, 102, 0.75); | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .box4 { | ||||||
|  |   padding: 32px 32px 30px 30px; | ||||||
|  |   height: calc(100vh - 125px); | ||||||
|  | } | ||||||
|  | </style> | ||||||
|  | <style lang='scss'> | ||||||
|  | .deliveryLogDetail { | ||||||
|  |   .el-tabs__nav::after { | ||||||
|  |     content: ""; | ||||||
|  |     position: absolute; | ||||||
|  |     left: 0; | ||||||
|  |     bottom: 0; | ||||||
|  |     width: 100%; | ||||||
|  |     height: 2px; | ||||||
|  |     background-color: #e4e7ed; | ||||||
|  |     /* z-index: 1; */ | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   .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); | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </style> | ||||||
							
								
								
									
										153
									
								
								src/views/delivery/deliveryLogDet/components/shippingBtn.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										153
									
								
								src/views/delivery/deliveryLogDet/components/shippingBtn.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,153 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2023-08-03 14:09:18 | ||||||
|  |  * @LastEditors: DY | ||||||
|  |  * @LastEditTime: 2023-10-13 16:47:25 | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  |   <div class="tableInner"> | ||||||
|  |     <el-button @click="handleClick" type="text" style="margin: 5px 0; padding: 0"> | ||||||
|  |       <span class="iconfont" :class="'icon-detail' + | ||||||
|  |                       ' primary-color' | ||||||
|  |                 "></span> | ||||||
|  |     </el-button> | ||||||
|  |     <delivery-log-det-detail ref='deliveryLogDetail' /> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | <script> | ||||||
|  | import DeliveryLogDetDetail from './deliveryLogDetDetail.vue' | ||||||
|  | export default { | ||||||
|  | 	props: { | ||||||
|  | 		injectData: { | ||||||
|  | 			type: Object, | ||||||
|  | 			default: () => ({}), | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 			list: this.injectData, | ||||||
|  | 		}; | ||||||
|  |   }, | ||||||
|  |   components: { DeliveryLogDetDetail }, | ||||||
|  |  | ||||||
|  |   mounted() { | ||||||
|  |   }, | ||||||
|  | 	methods: { | ||||||
|  |     handleClick() { | ||||||
|  |       this.$nextTick(() => { | ||||||
|  |         this.$refs.deliveryLogDetail.init(this.list) | ||||||
|  |       }) | ||||||
|  |     } | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
|  | <style scoped lang='scss'> | ||||||
|  | .box1 { | ||||||
|  |   height: 76px; | ||||||
|  |   border-bottom: 1px solid #E9E9E9; | ||||||
|  |   margin: 0px 8px 20px 30px; | ||||||
|  |  | ||||||
|  |   .box_col { | ||||||
|  |     display: inline-block; | ||||||
|  |     width: 20%; | ||||||
|  |     padding: 8px 8px 8px 8px; | ||||||
|  |  | ||||||
|  |     .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); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .box2 { | ||||||
|  |   padding: 0px 32px 30px 30px; | ||||||
|  |   height: calc(100vh - 150px); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .boxTitle { | ||||||
|  |   display: inline-block; | ||||||
|  |   font-size: 16px; | ||||||
|  |   font-weight: 400; | ||||||
|  |   color: #000000; | ||||||
|  |   margin: 0 10px 10px 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .blueTitle { | ||||||
|  |   content: ''; | ||||||
|  |   display: inline-block; | ||||||
|  |   width: 4px; | ||||||
|  |   height: 18px; | ||||||
|  |   background-color: #0B58FF; | ||||||
|  |   border-radius: 1px; | ||||||
|  |   margin-right: 8px; | ||||||
|  |   vertical-align: bottom; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .box3 { | ||||||
|  |   padding: 8px 8px 8px 40px; | ||||||
|  |  | ||||||
|  |   .title { | ||||||
|  |     height: 16px; | ||||||
|  |     font-size: 14px; | ||||||
|  |     font-weight: 600; | ||||||
|  |     color: rgba(0, 0, 0, 0.85); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   .text { | ||||||
|  |     height: 16px; | ||||||
|  |     font-size: 14px; | ||||||
|  |     font-weight: 400; | ||||||
|  |     color: rgba(102, 102, 102, 0.75); | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .box4 { | ||||||
|  |   padding: 32px 32px 30px 30px; | ||||||
|  |   height: calc(100vh - 125px); | ||||||
|  | } | ||||||
|  | </style> | ||||||
|  | <style lang='scss'> | ||||||
|  | .deliveryLogDetail { | ||||||
|  |   .el-tabs__nav::after { | ||||||
|  |     content: ""; | ||||||
|  |     position: absolute; | ||||||
|  |     left: 0; | ||||||
|  |     bottom: 0; | ||||||
|  |     width: 100%; | ||||||
|  |     height: 2px; | ||||||
|  |     background-color: #e4e7ed; | ||||||
|  |     /* z-index: 1; */ | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   .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); | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </style> | ||||||
| @@ -14,14 +14,14 @@ | |||||||
|       :table-data="list" |       :table-data="list" | ||||||
|       :max-height="tableH" |       :max-height="tableH" | ||||||
|     > |     > | ||||||
|       <method-btn |       <!-- <method-btn | ||||||
|         v-if="tableBtn.length" |         v-if="tableBtn.length" | ||||||
|         slot="handleBtn" |         slot="handleBtn" | ||||||
|         :width="80" |         :width="80" | ||||||
|         label="操作" |         label="操作" | ||||||
|         :method-list="tableBtn" |         :method-list="tableBtn" | ||||||
|         @clickBtn="handleClick" |         @clickBtn="handleClick" | ||||||
|       /> |       /> --> | ||||||
|     </base-table> |     </base-table> | ||||||
|     <pagination |     <pagination | ||||||
|       :page.sync="queryParams.pageNo" |       :page.sync="queryParams.pageNo" | ||||||
| @@ -30,12 +30,13 @@ | |||||||
|       @pagination="getList" |       @pagination="getList" | ||||||
|     /> |     /> | ||||||
|     <!-- 详情抽屉 --> |     <!-- 详情抽屉 --> | ||||||
|     <delivery-log-det-detail ref='deliveryLogDetail'/> |     <!-- <delivery-log-det-detail ref='deliveryLogDetail'/> --> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| import { deliveryProgressPage } from '@/api/base/delivery' | import { deliveryProgressPage } from '@/api/base/delivery' | ||||||
| import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue' |  | ||||||
|  | import shippingBtn from './components/shippingBtn.vue'; | ||||||
| const tableProps = [ | const tableProps = [ | ||||||
|   { |   { | ||||||
|     prop: 'orderName', |     prop: 'orderName', | ||||||
| @@ -61,7 +62,12 @@ const tableProps = [ | |||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     prop: 'rate', |     prop: 'rate', | ||||||
|     label: '累计发货比例(%)' |     label: '发货进度(%)' | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'desc', | ||||||
|  |     label: '发货详情', | ||||||
|  |     subcomponent: shippingBtn, | ||||||
|   } |   } | ||||||
| ] | ] | ||||||
| export default { | export default { | ||||||
| @@ -101,7 +107,7 @@ export default { | |||||||
|       ].filter((v) => v) |       ].filter((v) => v) | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   components: { DeliveryLogDetDetail }, |   // components: { DeliveryLogDetDetail }, | ||||||
|   created() { |   created() { | ||||||
|     window.addEventListener('resize', () => { |     window.addEventListener('resize', () => { | ||||||
|       this.tableH = this.tableHeight(260) |       this.tableH = this.tableHeight(260) | ||||||
| @@ -119,12 +125,12 @@ export default { | |||||||
|       this.queryParams.orderName = val.orderName |       this.queryParams.orderName = val.orderName | ||||||
|       this.getList() |       this.getList() | ||||||
|     }, |     }, | ||||||
|     handleClick(val) { |     // handleClick(val) { | ||||||
|       console.log(val) |     //   console.log(val) | ||||||
|       this.$nextTick(() => { |     //   this.$nextTick(() => { | ||||||
|         this.$refs.deliveryLogDetail.init(val.data) |     //     this.$refs.deliveryLogDetail.init(val.data) | ||||||
|       }) |     //   }) | ||||||
|     } |     // } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -92,7 +92,8 @@ export default { | |||||||
|           type: 'select', |           type: 'select', | ||||||
|           label: '能源类型', |           label: '能源类型', | ||||||
|           selectOptions: [], |           selectOptions: [], | ||||||
|           param: 'energyTypeId' |           param: 'energyTypeId', | ||||||
|  |           clearable: false | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|           type: 'select', |           type: 'select', | ||||||
| @@ -162,7 +163,6 @@ export default { | |||||||
|     window.addEventListener('resize', () => { |     window.addEventListener('resize', () => { | ||||||
|       this.tableH = this.tableHeight(260) |       this.tableH = this.tableHeight(260) | ||||||
|     }) |     }) | ||||||
|     this.getList(); |  | ||||||
|     this.getTypeList() |     this.getTypeList() | ||||||
|     // 获取对象树形结构 |     // 获取对象树形结构 | ||||||
|     this.getObjTree() |     this.getObjTree() | ||||||
| @@ -171,7 +171,10 @@ export default { | |||||||
|     getTypeList() { |     getTypeList() { | ||||||
|       getEnergyTypeListAll().then((res) => { |       getEnergyTypeListAll().then((res) => { | ||||||
|         this.formConfig[0].selectOptions = res.data || [] |         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.energyTypeList = res.data || [] | ||||||
|  |         this.getList(); | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|     buttonClick(val) { |     buttonClick(val) { | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ | |||||||
|     <el-row> |     <el-row> | ||||||
|       <el-col :span="12"> |       <el-col :span="12"> | ||||||
|         <el-form-item label="能源类型" prop="typeId"> |         <el-form-item label="能源类型" prop="typeId"> | ||||||
|           <el-select v-model="form.typeId" placeholder="请选择" style="width: 100%;" filterable> |           <el-select v-model="form.typeId" placeholder="请选择" style="width: 100%;" filterable @change="getUnit"> | ||||||
|             <el-option |             <el-option | ||||||
|               v-for="item in energyListType" |               v-for="item in energyListType" | ||||||
|               :key="item.id" |               :key="item.id" | ||||||
| @@ -79,9 +79,17 @@ export default { | |||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|  |     getUnit(val) { | ||||||
|  |       this.energyListType.forEach((item) => { | ||||||
|  |         if (val === item.id) { | ||||||
|  |           this.form.unit = item.unit | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|     init(param) { |     init(param) { | ||||||
|       this.form.connectId = param.connectId |       this.form.connectId = param.connectId | ||||||
|       getEnergyTypeListAll().then((res) => { |       getEnergyTypeListAll().then((res) => { | ||||||
|  |         console.log(res) | ||||||
|         this.energyListType = res.data || [] |         this.energyListType = res.data || [] | ||||||
|       }) |       }) | ||||||
|       if (param.id) { |       if (param.id) { | ||||||
|   | |||||||
| @@ -37,7 +37,7 @@ | |||||||
|       @cancel="handleCancel" |       @cancel="handleCancel" | ||||||
|       @confirm="handleConfirm" |       @confirm="handleConfirm" | ||||||
|       :before-close="handleCancel" |       :before-close="handleCancel" | ||||||
|       width='30%' |       width='50%' | ||||||
|     > |     > | ||||||
|       <energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" /> |       <energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" /> | ||||||
|     </base-dialog> |     </base-dialog> | ||||||
| @@ -60,7 +60,8 @@ const tableProps = [ | |||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     prop: 'objCode', |     prop: 'objCode', | ||||||
|     label: '对象编码' |     label: '对象编码', | ||||||
|  |     minWidth: 160, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     prop: 'plcTableName', |     prop: 'plcTableName', | ||||||
| @@ -69,7 +70,8 @@ const tableProps = [ | |||||||
|   { |   { | ||||||
|     prop: 'plcTableCode', |     prop: 'plcTableCode', | ||||||
|     label: '关联表编码', |     label: '关联表编码', | ||||||
|     showOverflowtooltip: true |     showOverflowtooltip: true, | ||||||
|  |     minWidth: 160, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     prop: 'cnName', |     prop: 'cnName', | ||||||
|   | |||||||
| @@ -60,7 +60,8 @@ export default { | |||||||
|         name: '', |         name: '', | ||||||
|         code: '', |         code: '', | ||||||
|         type: '', |         type: '', | ||||||
|         energyTypeId: '' |         energyTypeId: '', | ||||||
|  |         remark: '' | ||||||
|       }, |       }, | ||||||
|       plcList: [], |       plcList: [], | ||||||
|       objList: [], |       objList: [], | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ | |||||||
|       type="text" |       type="text" | ||||||
|       class="tableInnerButton" |       class="tableInnerButton" | ||||||
|       @click="showInnerTable(injectData)" |       @click="showInnerTable(injectData)" | ||||||
|       >详情</el-button |       >价格详情</el-button | ||||||
|     > |     > | ||||||
|   </el-popover> |   </el-popover> | ||||||
| </template> | </template> | ||||||
|   | |||||||
| @@ -3,7 +3,14 @@ | |||||||
|     <el-row> |     <el-row> | ||||||
|       <el-col :span="12"> |       <el-col :span="12"> | ||||||
|         <el-form-item label="能源类型" prop="name"> |         <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-form-item> | ||||||
|       </el-col> |       </el-col> | ||||||
|       <el-col :span="12"> |       <el-col :span="12"> | ||||||
| @@ -213,10 +220,6 @@ export default { | |||||||
|     // 增加 |     // 增加 | ||||||
|     emitButtonClick1() { |     emitButtonClick1() { | ||||||
|       let n = this.tableData1.length |       let n = this.tableData1.length | ||||||
|       if (n >=3) { |  | ||||||
|         this.$modal.msgWarning('最多可添加3档计价') |  | ||||||
|         return false |  | ||||||
|       } |  | ||||||
|       let obj = {} |       let obj = {} | ||||||
|       obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime |       obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime | ||||||
|       obj.endTime = '' |       obj.endTime = '' | ||||||
| @@ -225,10 +228,6 @@ export default { | |||||||
|     }, |     }, | ||||||
|     emitButtonClick2() { |     emitButtonClick2() { | ||||||
|       let n = this.tableData2.length |       let n = this.tableData2.length | ||||||
|       if (n >=3) { |  | ||||||
|         this.$modal.msgWarning('最多可添加3档计价') |  | ||||||
|         return false |  | ||||||
|       } |  | ||||||
|       let obj = {} |       let obj = {} | ||||||
|       obj.startUsed = n === 0 ? 0 : this.tableData2[n-1].endUsed |       obj.startUsed = n === 0 ? 0 : this.tableData2[n-1].endUsed | ||||||
|       obj.endUsed = 0 |       obj.endUsed = 0 | ||||||
|   | |||||||
| @@ -80,10 +80,14 @@ export default { | |||||||
|     return { |     return { | ||||||
|       formConfig: [ |       formConfig: [ | ||||||
|         { |         { | ||||||
|           type: 'input', |           type: 'select', | ||||||
|           label: '能源类型', |           label: '能源类型', | ||||||
|  |           selectOptions: this.getDictDatas(this.DICT_TYPE.ENERGY_TYPE), | ||||||
|           placeholder: '能源类型', |           placeholder: '能源类型', | ||||||
|           param: 'name' |           labelField: 'label', | ||||||
|  |           valueField: 'label', | ||||||
|  |           param: 'name', | ||||||
|  |           flilterable: true | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|           type: 'button', |           type: 'button', | ||||||
|   | |||||||
| @@ -13,60 +13,6 @@ | |||||||
| 		v-loading="formLoading"> | 		v-loading="formLoading"> | ||||||
| 		<el-row :gutter="20"> | 		<el-row :gutter="20"> | ||||||
| 			<el-col :span="12"> | 			<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 | 				<el-form-item | ||||||
| 					label="产线" | 					label="产线" | ||||||
| 					prop="productionLineId" | 					prop="productionLineId" | ||||||
| @@ -130,13 +76,22 @@ | |||||||
| 						placeholder="请输入整数" /> | 						placeholder="请输入整数" /> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</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-col :span="12"> | ||||||
| 				<el-form-item | 				<el-form-item | ||||||
| 					label="按钮值" | 					label="按钮值" | ||||||
| 					prop="keyValue" | 					prop="keyValue" | ||||||
| 					:rules="[ | 					:rules="[ | ||||||
| 						{ required: true, message: '不能为空', trigger: 'blur' }, | 						{ required: true, message: '按钮值不能为空', trigger: 'blur' }, | ||||||
| 						{ | 						{ | ||||||
| 							type: 'number', | 							type: 'number', | ||||||
| 							message: '请输入100以内的整数', | 							message: '请输入100以内的整数', | ||||||
| @@ -154,17 +109,22 @@ | |||||||
| 						min="0" | 						min="0" | ||||||
| 						max="100" | 						max="100" | ||||||
| 						@change="$emit('update', dataForm)" | 						@change="$emit('update', dataForm)" | ||||||
| 						placeholder="请输入按钮盒模式" /> | 						placeholder="请输入按钮值" /> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
|  |  | ||||||
| 			<el-col :span="12"> | 			<el-col :span="12"> | ||||||
| 				<el-form-item label="检测内容" prop="inspectionDetId"> | 				<el-form-item  | ||||||
|  | 					label="检测内容" | ||||||
|  | 					prop="inspectionDetId" | ||||||
|  | 					:rules="[ | ||||||
|  | 						{ required: true, message: '检测内容不能为空', trigger: 'blur' }, | ||||||
|  | 					]"> | ||||||
| 					<el-select | 					<el-select | ||||||
| 						v-model="dataForm.inspectionDetId" | 						v-model="dataForm.inspectionDetId" | ||||||
| 						placeholder="请选择检测内容" | 						placeholder="请选择检测内容" | ||||||
| 						filterable | 						filterable | ||||||
| 						@change="$emit('update', dataForm)"> | 						@change="handleInspectionDetChange"> | ||||||
| 						<el-option | 						<el-option | ||||||
| 							v-for="opt in inspectionDetList" | 							v-for="opt in inspectionDetList" | ||||||
| 							:key="opt.value" | 							:key="opt.value" | ||||||
| @@ -203,14 +163,9 @@ export default { | |||||||
| 	mounted() { | 	mounted() { | ||||||
| 		this.getProductionLineList(); | 		this.getProductionLineList(); | ||||||
| 		this.getQualityInspectionDetList(); | 		this.getQualityInspectionDetList(); | ||||||
| 		// this.getWorksectionList(); | 		if (this.dataForm.productionLineId) { | ||||||
| 		// this.getCode('/base/equipment-group-alarm/getCode').then((code) => { | 			this.getWorksectionList(this.dataForm.productionLineId); | ||||||
| 		// 	this.formLoading = false; | 		} | ||||||
| 		// 	this.$emit('update', { |  | ||||||
| 		// 		...this.dataForm, |  | ||||||
| 		// 		code, |  | ||||||
| 		// 	}); |  | ||||||
| 		// }); |  | ||||||
| 	}, | 	}, | ||||||
| 	watch: { | 	watch: { | ||||||
| 		'dataForm.productionId': { | 		'dataForm.productionId': { | ||||||
| @@ -279,11 +234,18 @@ export default { | |||||||
| 			this.dataForm.sectionId = null; | 			this.dataForm.sectionId = null; | ||||||
| 			this.$emit('update', this.dataForm); | 			this.$emit('update', this.dataForm); | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		async getCode(url) { | 		async getCode(url) { | ||||||
| 			const response = await this.$axios(url); | 			const response = await this.$axios(url); | ||||||
| 			return response.data; | 			return response.data; | ||||||
| 		}, | 		}, | ||||||
|  | 		handleInspectionDetChange(id) { | ||||||
|  | 			this.inspectionDetList.forEach((item) => { | ||||||
|  | 				if (item.value == id) { | ||||||
|  | 					this.dataForm.inspectionDetContent = item.label; | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 			this.$emit('update', this.dataForm); | ||||||
|  | 		} | ||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -40,7 +40,7 @@ | |||||||
| 			@close="cancel" | 			@close="cancel" | ||||||
| 			@cancel="cancel" | 			@cancel="cancel" | ||||||
| 			@confirm="submitForm"> | 			@confirm="submitForm"> | ||||||
| 			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> | 			<DialogForm v-if="open" ref="form" v-model="form"/> | ||||||
| 		</base-dialog> | 		</base-dialog> | ||||||
| 	</div> | 	</div> | ||||||
| </template> | </template> | ||||||
| @@ -65,78 +65,6 @@ export default { | |||||||
| 	components: { DialogForm }, | 	components: { DialogForm }, | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		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: [ | 			searchBarFormConfig: [ | ||||||
| 				{ | 				{ | ||||||
| 					type: 'input', | 					type: 'input', | ||||||
| @@ -230,6 +158,7 @@ export default { | |||||||
| 				id: null, | 				id: null, | ||||||
| 				buttonId: null, | 				buttonId: null, | ||||||
| 				inspectionDetId: null, | 				inspectionDetId: null, | ||||||
|  | 				inspectionDetContent: null, | ||||||
| 				productionLineId: null, | 				productionLineId: null, | ||||||
| 				sectionId: null, | 				sectionId: null, | ||||||
| 				model: null, | 				model: null, | ||||||
| @@ -256,12 +185,13 @@ export default { | |||||||
| 			this.form = { | 			this.form = { | ||||||
| 				id: null, | 				id: null, | ||||||
| 				buttonId: null, | 				buttonId: null, | ||||||
|  | 				inspectionDetId: null, | ||||||
| 				inspectionDetContent: null, | 				inspectionDetContent: null, | ||||||
| 				productionId: null, | 				productionLineId: null, | ||||||
| 				sectionId: null, | 				sectionId: null, | ||||||
| 				model: null, | 				model: null, | ||||||
| 				keyValue: null, | 				keyValue: null, | ||||||
| 			}; | 			}, | ||||||
| 			this.resetForm('form'); | 			this.resetForm('form'); | ||||||
| 		}, | 		}, | ||||||
| 		/** 新增按钮操作 */ | 		/** 新增按钮操作 */ | ||||||
|   | |||||||
| @@ -219,6 +219,7 @@ export default { | |||||||
|     getTypeList() { |     getTypeList() { | ||||||
|       getEnergyTypeListAll().then((res) => { |       getEnergyTypeListAll().then((res) => { | ||||||
|         this.energyTypeList = res.data || [] |         this.energyTypeList = res.data || [] | ||||||
|  |         this.queryParams.energyTypeId = res.data[0].id | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|     // 范围选择器 |     // 范围选择器 | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ | |||||||
| --> | --> | ||||||
| <template> | <template> | ||||||
| 	<div> | 	<div> | ||||||
| 		<div style="background: #f2f4f9; height: 40px; width: 100%"> | 		<div style="background: #f2f4f9; height: 56px; width: 100%"> | ||||||
| 			<ButtonNav | 			<ButtonNav | ||||||
| 				:menus="['走势分析', '对比分析', '同比分析', '环比分析']" | 				:menus="['走势分析', '对比分析', '同比分析', '环比分析']" | ||||||
| 				@change="currentMenu"> | 				@change="currentMenu"> | ||||||
|   | |||||||
| @@ -205,6 +205,7 @@ export default { | |||||||
| 		getTypeList() { | 		getTypeList() { | ||||||
| 			getEnergyTypeListAll().then((res) => { | 			getEnergyTypeListAll().then((res) => { | ||||||
| 				this.energyTypeList = res.data || []; | 				this.energyTypeList = res.data || []; | ||||||
|  | 				this.queryParams.energyTypeId = res.data[0].id | ||||||
| 			}); | 			}); | ||||||
| 		}, | 		}, | ||||||
| 		getObjTree() { | 		getObjTree() { | ||||||
|   | |||||||
| @@ -331,7 +331,7 @@ export default { | |||||||
| 			queryParams: { | 			queryParams: { | ||||||
| 				lineId: null, | 				lineId: null, | ||||||
| 				factoryId: null, | 				factoryId: null, | ||||||
| 				recordTime: [], | 				recordTime: undefined, | ||||||
| 			}, | 			}, | ||||||
| 			// 表单参数 | 			// 表单参数 | ||||||
| 			form: {}, | 			form: {}, | ||||||
| @@ -410,15 +410,13 @@ export default { | |||||||
| 				this.queryParams.factoryId = payload.factoryId || null; | 				this.queryParams.factoryId = payload.factoryId || null; | ||||||
| 				this.queryParams.lineId = payload.lineId || null; | 				this.queryParams.lineId = payload.lineId || null; | ||||||
| 				if (0 == payload.dateFilterType) { | 				if (0 == payload.dateFilterType) { | ||||||
| 					this.queryParams.recordTime = payload.timerange; |           this.queryParams.recordTime = payload.timerange ? payload.timerange :undefined | ||||||
| 				} else if (1 == payload.dateFilterType) { | 				} else if (1 == payload.dateFilterType) { | ||||||
| 					this.queryParams.recordTime = [ | 					this.queryParams.recordTime = [ | ||||||
| 						`${payload.timeday} 00:00:00`, | 						`${payload.timeday} 00:00:00`, | ||||||
| 						`${payload.timeday} 23:59:59`, | 						`${payload.timeday} 23:59:59`, | ||||||
| 					]; | 					]; | ||||||
| 				} | 				} | ||||||
| 			} else { |  | ||||||
| 				this.queryParams.recordTime = null; |  | ||||||
| 			} | 			} | ||||||
| 			this.getList(); | 			this.getList(); | ||||||
| 		}, | 		}, | ||||||
|   | |||||||
| @@ -39,13 +39,6 @@ | |||||||
| 			@close="cancel" | 			@close="cancel" | ||||||
| 			@cancel="cancel" | 			@cancel="cancel" | ||||||
| 			@confirm="submitForm"> | 			@confirm="submitForm"> | ||||||
| 			<!-- <DialogForm |  | ||||||
| 				v-if="open" |  | ||||||
| 				ref="form" |  | ||||||
| 				v-model="form" |  | ||||||
| 				:disabled="mode == 'detail'" |  | ||||||
| 				:has-files="false" |  | ||||||
| 				:rows="rows" /> --> |  | ||||||
| 			<AddOrUpdate | 			<AddOrUpdate | ||||||
| 				v-if="open" | 				v-if="open" | ||||||
| 				ref="addOrUpdate" | 				ref="addOrUpdate" | ||||||
| @@ -119,22 +112,22 @@ export default { | |||||||
| 				// 	: undefined, | 				// 	: undefined, | ||||||
| 			].filter((v) => v), | 			].filter((v) => v), | ||||||
| 			tableProps: [ | 			tableProps: [ | ||||||
| 				{ prop: 'productionLine', label: '产线', width: 120, showOverflowtooltip: true }, | 				{ prop: 'productionLine', label: '产线', showOverflowtooltip: true }, | ||||||
| 				{ prop: 'workshopSection', label: '工段', width: 120, showOverflowtooltip: true }, | 				{ prop: 'workshopSection', label: '工段',showOverflowtooltip: true }, | ||||||
| 				{ prop: 'equipment', label: '设备名称', width: 120, showOverflowtooltip: true }, | 				{ prop: 'equipment', label: '设备名称', showOverflowtooltip: true }, | ||||||
| 				{ | 				{ | ||||||
| 					prop: 'alarmGrade', | 					prop: 'alarmGrade', | ||||||
| 					label: '报警级别', | 					label: '报警级别', | ||||||
| 					filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), | 					filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), | ||||||
| 				}, | 				}, | ||||||
| 				{ prop: 'createTime', label: '报警时间', filter: timeFilter, width: 150, showOverflowtooltip: true }, | 				{ prop: 'createTime', label: '报警时间', filter: timeFilter, showOverflowtooltip: true }, | ||||||
| 				{ prop: 'alarmCode', label: '设备报警码', width: 180, showOverflowtooltip: true }, | 				{ prop: 'alarmCode', label: '设备报警码',  showOverflowtooltip: true }, | ||||||
| 				{ prop: 'alarmContent', label: '报警内容', width: 150, showOverflowtooltip: true }, | 				{ prop: 'alarmContent', label: '报警内容',  showOverflowtooltip: true }, | ||||||
| 				this.$auth.hasPermiAnd([ | 				this.$auth.hasPermiAnd([ | ||||||
| 					'monitoring:equipment-alarm-log:query', | 					'monitoring:equipment-alarm-log:query', | ||||||
| 					'base:equipment-alarm-hand:query' | 					'base:equipment-alarm-hand:query' | ||||||
| 				]) ? | 				]) ? | ||||||
| 				{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn } : undefined, | 				{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn } : '', | ||||||
| 				this.$auth.hasPermiAnd([ | 				this.$auth.hasPermiAnd([ | ||||||
| 					'monitoring:equipment-alarm-log:query', | 					'monitoring:equipment-alarm-log:query', | ||||||
| 					'base:equipment-alarm-hand:query', | 					'base:equipment-alarm-hand:query', | ||||||
| @@ -143,7 +136,7 @@ export default { | |||||||
| 					'base:equipment-alarm-hand:update', | 					'base:equipment-alarm-hand:update', | ||||||
| 					'monitoring:equipment-alarm-log:update' | 					'monitoring:equipment-alarm-log:update' | ||||||
| 				]) ? | 				]) ? | ||||||
| 				{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn } : undefined, | 				{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn } : '', | ||||||
| 				// { prop: 'remark', label: '备注' }, | 				// { prop: 'remark', label: '备注' }, | ||||||
| 			], | 			], | ||||||
| 			searchBarFormConfig: [ | 			searchBarFormConfig: [ | ||||||
|   | |||||||
| @@ -119,12 +119,12 @@ export default { | |||||||
| 		return { | 		return { | ||||||
| 			searchBarKeys: ['groupId', 'equipmentName'], | 			searchBarKeys: ['groupId', 'equipmentName'], | ||||||
| 			tableBtn: [ | 			tableBtn: [ | ||||||
| 				this.$auth.hasPermi('equipment:bind-group:update') | 				// this.$auth.hasPermi('equipment:bind-group:update') | ||||||
| 					? { | 				// 	? { | ||||||
| 							type: 'detail', | 				// 			type: 'detail', | ||||||
| 							btnName: '查看报警', | 				// 			btnName: '查看报警', | ||||||
| 					  } | 				// 	  } | ||||||
| 					: undefined, | 				// 	: undefined, | ||||||
| 				this.$auth.hasPermi('equipment:bind-group:update') | 				this.$auth.hasPermi('equipment:bind-group:update') | ||||||
| 					? { | 					? { | ||||||
| 							type: 'edit', | 							type: 'edit', | ||||||
| @@ -371,8 +371,8 @@ export default { | |||||||
| 		}, | 		}, | ||||||
| 		handleTableBtnClick({ data, type }) { | 		handleTableBtnClick({ data, type }) { | ||||||
| 			switch (type) { | 			switch (type) { | ||||||
| 				case 'edit': |         case 'edit': | ||||||
| 					this.handleDetail(data, 'edit'); |           this.handleUpdate(data) | ||||||
| 					break; | 					break; | ||||||
| 				case 'delete': | 				case 'delete': | ||||||
| 					this.handleDelete(data); | 					this.handleDelete(data); | ||||||
| @@ -397,7 +397,7 @@ export default { | |||||||
| 			this.reset(); | 			this.reset(); | ||||||
| 			this.open = true; | 			this.open = true; | ||||||
| 			this.title = '添加设备与分组绑定'; | 			this.title = '添加设备与分组绑定'; | ||||||
| 		}, |     }, | ||||||
| 		/** 修改按钮操作 */ | 		/** 修改按钮操作 */ | ||||||
| 		handleUpdate(row) { | 		handleUpdate(row) { | ||||||
| 			this.reset(); | 			this.reset(); | ||||||
| @@ -432,19 +432,19 @@ export default { | |||||||
| 			}); | 			}); | ||||||
| 		}, | 		}, | ||||||
| 		// 查看报警 | 		// 查看报警 | ||||||
| 		handleDetail(row, mode = 'detail') { | 		// handleDetail(row, mode = 'detail') { | ||||||
| 			const { equipmentId, equipmentName, groupCode, groupId, groupName, id } = | 		// 	const { equipmentId, equipmentName, groupCode, groupId, groupName, id } = | ||||||
| 				row; | 		// 		row; | ||||||
| 			// 打开抽屉 | 		// 	// 打开抽屉 | ||||||
| 			this.editMode = mode; | 		// 	this.editMode = mode; | ||||||
| 			this.alarmForm.id = groupId; | 		// 	this.alarmForm.id = groupId; | ||||||
| 			this.alarmForm.equipmentGroupCode = groupCode; | 		// 	this.alarmForm.equipmentGroupCode = groupCode; | ||||||
| 			this.alarmForm.equipmentGroupName = groupName; | 		// 	this.alarmForm.equipmentGroupName = groupName; | ||||||
| 			this.editVisible = true; | 		// 	this.editVisible = true; | ||||||
| 			this.$nextTick(() => { | 		// 	this.$nextTick(() => { | ||||||
| 				this.$refs['drawer'].init(); | 		// 		this.$refs['drawer'].init(); | ||||||
| 			}); | 		// 	}); | ||||||
| 		}, | 		// }, | ||||||
| 		/** 删除按钮操作 */ | 		/** 删除按钮操作 */ | ||||||
| 		handleDelete(row) { | 		handleDelete(row) { | ||||||
| 			const id = row.id; | 			const id = row.id; | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| <!--  | <!-- | ||||||
|     filename: CollectionConfig.vue |     filename: CollectionConfig.vue | ||||||
|     author: liubin |     author: liubin | ||||||
|     date: 2023-10-30 10:09:03 |     date: 2023-10-30 10:09:03 | ||||||
|     description:  |     description: | ||||||
| --> | --> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| @@ -198,8 +198,8 @@ export default { | |||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'select', | 					type: 'select', | ||||||
| 					label: '关联表编码', |           label: '标识名称', | ||||||
| 					placeholder: '请选择关联表编码', | 					placeholder: '请选择标识名称', | ||||||
| 					param: 'plcId', | 					param: 'plcId', | ||||||
| 					selectOptions: [], | 					selectOptions: [], | ||||||
| 					filterable: true, | 					filterable: true, | ||||||
|   | |||||||
| @@ -168,7 +168,8 @@ export default { | |||||||
| 				pageSize: 20, | 				pageSize: 20, | ||||||
| 				maintainPlanId: null, | 				maintainPlanId: null, | ||||||
| 				startTime: null, | 				startTime: null, | ||||||
| 				special: false, |         special: false, | ||||||
|  |         name:undefined, | ||||||
| 				status: 1, | 				status: 1, | ||||||
| 			}, | 			}, | ||||||
| 			// 表单参数 | 			// 表单参数 | ||||||
| @@ -195,7 +196,9 @@ export default { | |||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
| 		/** 批量确认 */ | 		/** 批量确认 */ | ||||||
| 		async searchBarClicked(btn) { |     async handleSearchBarBtnClick(btn) { | ||||||
|  |       console.log(btn); | ||||||
|  |  | ||||||
| 			switch (btn.btnName) { | 			switch (btn.btnName) { | ||||||
| 				case 'batchConfirm': | 				case 'batchConfirm': | ||||||
| 					if (this.$refs['waiting-list-table'].selectedPlan.length == 0) { | 					if (this.$refs['waiting-list-table'].selectedPlan.length == 0) { | ||||||
| @@ -258,7 +261,18 @@ export default { | |||||||
| 							res.code == 0 && this.$modal.msgSuccess('确认成功'); | 							res.code == 0 && this.$modal.msgSuccess('确认成功'); | ||||||
| 							res.code != 0 && this.$modal.msgError('确认失败'); | 							res.code != 0 && this.$modal.msgError('确认失败'); | ||||||
| 						}) | 						}) | ||||||
| 						.catch(() => {}); |             .catch(() => { }); | ||||||
|  |           break; | ||||||
|  |         case 'search': | ||||||
|  |           console.log(btn); | ||||||
|  |           this.queryParams.name = btn.name || null; | ||||||
|  |           this.getList() | ||||||
|  |           break; | ||||||
|  |         case 'add': | ||||||
|  |           this.addOrUpdateVisible = true; | ||||||
|  |           this.$nextTick(() => { | ||||||
|  |             this.$refs.addOrUpdate.init(); | ||||||
|  |           }); | ||||||
| 					break; | 					break; | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
|   | |||||||
| @@ -201,7 +201,7 @@ export default { | |||||||
| 			this.groupOptions = | 			this.groupOptions = | ||||||
| 				res1.data.map((item) => { | 				res1.data.map((item) => { | ||||||
| 					item.label = | 					item.label = | ||||||
| 						item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict); |             item.name + (getDictDataLabel('workshop', item.roomNameDict) ? ' - ' + getDictDataLabel('workshop', item.roomNameDict) : '') | ||||||
| 					return item; | 					return item; | ||||||
| 				}) || []; | 				}) || []; | ||||||
| 			// const res = await getEquipmentAll() | 			// const res = await getEquipmentAll() | ||||||
|   | |||||||
| @@ -29,9 +29,9 @@ export default { | |||||||
|   }, |   }, | ||||||
|   created() { |   created() { | ||||||
|   }, |   }, | ||||||
|   mounted() { |   // mounted() { | ||||||
|     this.getDataList() |   //   this.getDataList() | ||||||
|   }, |   // }, | ||||||
|   methods: { |   methods: { | ||||||
|     // 获取数据列表 |     // 获取数据列表 | ||||||
|     getDataList() { |     getDataList() { | ||||||
|   | |||||||
| @@ -28,7 +28,6 @@ import moment from 'moment'; | |||||||
| import basicPageMixin from '@/mixins/lb/basicPageMixin'; | import basicPageMixin from '@/mixins/lb/basicPageMixin'; | ||||||
| import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items' | import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items' | ||||||
| import showDetail  from './showDetail.vue' | import showDetail  from './showDetail.vue' | ||||||
| import { publicFormatter } from '@/utils/dict'; |  | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
|   name: 'PlanConfig', |   name: 'PlanConfig', | ||||||
| @@ -40,7 +39,7 @@ export default { | |||||||
| 		const t = new Date(); | 		const t = new Date(); | ||||||
| 		const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()]; | 		const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()]; | ||||||
| 		return { | 		return { | ||||||
|       searchBarKeys: ['equipmentName', 'createTime'], |       searchBarKeys: ['equipmentTypeId'], | ||||||
|       equipmentTypeList:[], |       equipmentTypeList:[], | ||||||
| 			tableBtn: [ | 			tableBtn: [ | ||||||
| 				{ | 				{ | ||||||
| @@ -125,7 +124,7 @@ export default { | |||||||
|   created() { |   created() { | ||||||
|     this.initSearchBar() |     this.initSearchBar() | ||||||
| 		this.getList(); | 		this.getList(); | ||||||
| 	}, |   }, | ||||||
| 	methods: { | 	methods: { | ||||||
| 		/** 查询列表 */ | 		/** 查询列表 */ | ||||||
| 		getList() { | 		getList() { | ||||||
| @@ -231,13 +230,14 @@ export default { | |||||||
| 					return; | 					return; | ||||||
| 				} | 				} | ||||||
|         // 添加的提交 |         // 添加的提交 | ||||||
| 				this.post(this.form).then((response) => { |         this.post(this.form).then((res) => { | ||||||
|  |           console.log('res', res) | ||||||
| 					this.$modal.msgSuccess('新增成功'); | 					this.$modal.msgSuccess('新增成功'); | ||||||
| 					this.open = false; | 					this.open = false; | ||||||
|           this.getList() |           this.getList() | ||||||
|           this.showDetailVisible = true |           this.showDetailVisible = true | ||||||
|           this.$nextTick(() => { |           this.$nextTick(() => { | ||||||
|             this.$refs.showDetail.init(this.form.equipmentTypeId) |             this.$refs.showDetail.init(res.data) | ||||||
|           }) |           }) | ||||||
| 				}); | 				}); | ||||||
| 			}); | 			}); | ||||||
|   | |||||||
| @@ -100,9 +100,10 @@ export default { | |||||||
|       // console.log(this.tableData) |       // console.log(this.tableData) | ||||||
|     }, |     }, | ||||||
|     getDataList(id) { |     getDataList(id) { | ||||||
|  |       console.log(id) | ||||||
|       this.dataListLoading = true; |       this.dataListLoading = true; | ||||||
|       this.queryParams.equipmentTypeId = id |       this.queryParams.equipmentTypeId = id | ||||||
|       console.log(id); |       console.log(this.queryParams.equipmentTypeId) | ||||||
|       this.urlOptions.getDataListURL(this.queryParams).then(response => { |       this.urlOptions.getDataListURL(this.queryParams).then(response => { | ||||||
|         this.tableData = response.data.list; |         this.tableData = response.data.list; | ||||||
|         this.listQuery.total = response.data.total; |         this.listQuery.total = response.data.total; | ||||||
|   | |||||||
| @@ -37,8 +37,8 @@ | |||||||
|         </el-form> |         </el-form> | ||||||
|         <div class="blue-title">保养内容</div> |         <div class="blue-title">保养内容</div> | ||||||
|         <base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData"> |         <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" |           <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn" | ||||||
|             @clickBtn="handleClick" /> |             @clickBtn="handleClick" /> --> | ||||||
|         </base-table> |         </base-table> | ||||||
|       </div> |       </div> | ||||||
|     </el-drawer> |     </el-drawer> | ||||||
| @@ -101,6 +101,7 @@ export default { | |||||||
|         addOrUpdateVisible: false, |         addOrUpdateVisible: false, | ||||||
|         addOrEditTitle: '', |         addOrEditTitle: '', | ||||||
|         queryParams: { |         queryParams: { | ||||||
|  |           logId:null, | ||||||
|           pageNo:1, |           pageNo:1, | ||||||
|           pageSize:10, |           pageSize:10, | ||||||
|           planId:null, |           planId:null, | ||||||
| @@ -124,8 +125,10 @@ export default { | |||||||
|   methods: { |   methods: { | ||||||
|     getDataList(id) { |     getDataList(id) { | ||||||
|       this.dataListLoading = true; |       this.dataListLoading = true; | ||||||
|       this.queryParams.planId = id |       console.log(id); | ||||||
|       this.urlOptions.getDataListURL(this.listQuery).then(response => { |  | ||||||
|  |       this.queryParams.logId = id | ||||||
|  |       this.urlOptions.getDataListURL(this.queryParams).then(response => { | ||||||
|         this.tableData = response.data.list; |         this.tableData = response.data.list; | ||||||
|         // this.listQuery.total = response.data.total; |         // this.listQuery.total = response.data.total; | ||||||
|         this.dataListLoading = false |         this.dataListLoading = false | ||||||
| @@ -147,6 +150,8 @@ export default { | |||||||
|     init(obj) { |     init(obj) { | ||||||
|       this.drawer = true |       this.drawer = true | ||||||
|       this.dataForm = obj |       this.dataForm = obj | ||||||
|  |       console.log(obj.id); | ||||||
|  |  | ||||||
|       this.getDataList(obj.id) |       this.getDataList(obj.id) | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|   | |||||||
| @@ -44,8 +44,8 @@ | |||||||
|           <el-input oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.minValue" placeholder="请输入最小值" /> |           <el-input oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.minValue" placeholder="请输入最小值" /> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|       </el-col> |       </el-col> | ||||||
|       <el-col :span="4"> |       <el-col :span="4" style="text-align: center;"> | ||||||
|        ————— |        ——  | ||||||
|       </el-col> |       </el-col> | ||||||
|       <el-col :span="9"> |       <el-col :span="9"> | ||||||
|         <el-form-item prop="maxValue" label-width="20"> |         <el-form-item prop="maxValue" label-width="20"> | ||||||
|   | |||||||
| @@ -186,7 +186,7 @@ export default { | |||||||
|     handleDetail(row) { |     handleDetail(row) { | ||||||
|       this.showDetailVisible = true |       this.showDetailVisible = true | ||||||
|       this.$nextTick(() => { |       this.$nextTick(() => { | ||||||
|         this.$refs.showDetail.init(row.id) |         this.$refs.showDetail.init(row.equipmentTypeId) | ||||||
|       }) |       }) | ||||||
| 				// alert('跳转到 保养记录') | 				// alert('跳转到 保养记录') | ||||||
| 				// console.log(row) | 				// console.log(row) | ||||||
|   | |||||||
| @@ -103,9 +103,17 @@ export default { | |||||||
|       this.tableData[val._pageIndex - 1][val.prop] = val[val.prop] |       this.tableData[val._pageIndex - 1][val.prop] = val[val.prop] | ||||||
|       // console.log(this.tableData) |       // console.log(this.tableData) | ||||||
|     }, |     }, | ||||||
|     getDataList(id) { |     handleCancel() { | ||||||
|  |       this.$refs.addOrUpdate.formClear() | ||||||
|  |       this.addOrUpdateVisible = false | ||||||
|  |       this.addOrEditTitle = '' | ||||||
|  |     }, | ||||||
|  |     successSubmit() { | ||||||
|  |       this.handleCancel() | ||||||
|  |       this.getDataList() | ||||||
|  |     }, | ||||||
|  |     getDataList() { | ||||||
|       this.dataListLoading = true; |       this.dataListLoading = true; | ||||||
|       this.queryParams.mainId = id |  | ||||||
|       this.urlOptions.getDataListURL(this.queryParams).then(response => { |       this.urlOptions.getDataListURL(this.queryParams).then(response => { | ||||||
|         this.tableData = response.data.list; |         this.tableData = response.data.list; | ||||||
|         this.queryParams.total = response.data.total; |         this.queryParams.total = response.data.total; | ||||||
| @@ -121,7 +129,8 @@ export default { | |||||||
|     }, |     }, | ||||||
|     init(id) { |     init(id) { | ||||||
|       this.drawer = true |       this.drawer = true | ||||||
|       this.getDataList(id) |       this.queryParams.mainId = id || '' | ||||||
|  |       this.getDataList() | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -8,10 +8,7 @@ | |||||||
| <template> | <template> | ||||||
|   <!-- <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer" |   <!-- <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer" | ||||||
|     custom-class="mes-drawer" size="50%" @closed="$emit('destroy')"> --> |     custom-class="mes-drawer" size="50%" @closed="$emit('destroy')"> --> | ||||||
|   <el-dialog |   <el-dialog :visible.sync="visible" width="50%" :before-close="closed"> | ||||||
|   :visible.sync="visible" |  | ||||||
|   width="50%" |  | ||||||
|   :before-close="closed"> |  | ||||||
|     <small-title slot="title" :no-padding="true"> |     <small-title slot="title" :no-padding="true"> | ||||||
|       详情 |       详情 | ||||||
|       <!-- {{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }} --> |       <!-- {{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }} --> | ||||||
| @@ -20,55 +17,73 @@ | |||||||
|       <div class="drawer-body__content"> |       <div class="drawer-body__content"> | ||||||
|         <div> |         <div> | ||||||
|           <el-row :gutter="20"> |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">维修单号</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.repairOrderNumber }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">产线名</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.lineName }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">工段名</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.sectionName }}</div> | ||||||
|  |             </el-col> | ||||||
|             <el-col :span="6"> |             <el-col :span="6"> | ||||||
|               <div class="blodTip">故障发生时间</div> |               <div class="blodTip">故障发生时间</div> | ||||||
|               <div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div> |               <div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div> | ||||||
|             </el-col> |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <!-- <el-col :span="6"> | ||||||
|  |               <div class="blodTip">故障发生时间</div> | ||||||
|  |               <div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div> | ||||||
|  |             </el-col> --> | ||||||
|             <el-col :span="6"> |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">设备名</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.equipmentName }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">维修时长</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.maintenanceDuration }}</div> | ||||||
|  |             </el-col> | ||||||
|  |  | ||||||
|  |             <!-- <el-col :span="6"> | ||||||
|               <div class="blodTip">故障级别</div> |               <div class="blodTip">故障级别</div> | ||||||
|               <div class="lightTip">{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</div> |               <div class="lightTip">{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</div> | ||||||
|             </el-col> |             </el-col> | ||||||
|             <el-col :span="6"> |             <el-col :span="6"> | ||||||
|               <div class="blodTip">故障类型</div> |               <div class="blodTip">故障类型</div> | ||||||
|               <div class="lightTip">{{ getDictDataLabel('fault-type', dataForm.faultType) }}</div> |               <div class="lightTip">{{ getDictDataLabel('fault-type', dataForm.faultType) }}</div> | ||||||
|             </el-col> |             </el-col> --> | ||||||
|             <el-col :span="6"> |             <el-col :span="6"> | ||||||
|               <div class="blodTip">维修工</div> |               <div class="blodTip">维修工</div> | ||||||
|               <div class="lightTip">{{ dataForm.repairman }}</div> |               <div class="lightTip">{{ dataForm.repairman }}</div> | ||||||
|             </el-col> |             </el-col> | ||||||
|           </el-row> |  | ||||||
|           <el-row :gutter="20"> |  | ||||||
|             <el-col :span="6"> |             <el-col :span="6"> | ||||||
|               <div class="blodTip">联系方式</div> |               <div class="blodTip">联系方式</div> | ||||||
|               <div class="lightTip">{{ dataForm.repairmanPhone }}</div> |               <div class="lightTip">{{ dataForm.repairmanPhone }}</div> | ||||||
|             </el-col> |             </el-col> | ||||||
|             <el-col :span="6"> |  | ||||||
|               <div class="blodTip">维修方式</div> |  | ||||||
|               <div class="lightTip">{{ getDictDataLabel('repair-mode', dataForm.repairMode) }}</div> |  | ||||||
|             </el-col> |  | ||||||
|             <el-col :span="6"> |  | ||||||
|               <div class="blodTip">创建时间</div> |  | ||||||
|               <div class="lightTip">{{ parseTime(dataForm.createTime) }}</div> |  | ||||||
|             </el-col> |  | ||||||
|             <el-col :span="6"> |  | ||||||
|               <div class="blodTip">创建人</div> |  | ||||||
|               <div class="lightTip">{{ dataForm.creator }}</div> |  | ||||||
|             </el-col> |  | ||||||
|           </el-row> |           </el-row> | ||||||
|           <el-row> |           <el-row :gutter="20"> | ||||||
|             <div class="blodTip">备注</div> |             <el-col :span="6"> | ||||||
|             <div class="lightTip">{{ dataForm.remark }}</div> |               <div class="blodTip">备注</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.remark }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">故障明细</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.faultDetail.replace(/<\/?p>/g, '') }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">维修明细</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.maintenanceDetail.replace(/<\/?p>/g, '') }}</div> | ||||||
|  |             </el-col> | ||||||
|           </el-row> |           </el-row> | ||||||
|           <el-row> |           <el-row> | ||||||
|             <div class="blodTip">维修附件</div> |             <div class="blodTip">维修附件</div> | ||||||
|             <div v-if="dataForm.files && dataForm.files.length > 0"> |             <div v-if="dataForm.files && dataForm.files.length > 0"> | ||||||
|               <uploadedFile |               <uploadedFile class="file" v-for="file in dataForm.files" :file="file" :key="file.fileUrl" | ||||||
|                 class="file" |                 :disabled="disabled" @delete="!disabled && handleDeleteFile(file, col.prop)" /> | ||||||
|                 v-for="file in dataForm.files" |  | ||||||
|                 :file="file" |  | ||||||
|                 :key="file.fileUrl" |  | ||||||
|                 :disabled="disabled" |  | ||||||
|                 @delete="!disabled && handleDeleteFile(file, col.prop)" /> |  | ||||||
|             </div> |             </div> | ||||||
|             <p v-else>暂无附件</p> |             <p v-else>暂无附件</p> | ||||||
|           </el-row> |           </el-row> | ||||||
| @@ -170,65 +185,65 @@ import { getDictDataLabel } from '@/utils/dict'; | |||||||
| import tupleImg from '@/assets/images/tuple.png'; | import tupleImg from '@/assets/images/tuple.png'; | ||||||
|  |  | ||||||
| const uploadedFile = { | const uploadedFile = { | ||||||
| 	name: 'UploadedFile', |   name: 'UploadedFile', | ||||||
| 	props: ['file', 'disabled'], |   props: ['file', 'disabled'], | ||||||
| 	data() { |   data() { | ||||||
| 		return {}; |     return {}; | ||||||
| 	}, |   }, | ||||||
| 	methods: { |   methods: { | ||||||
| 		handleDelete() { |     handleDelete() { | ||||||
| 			this.$emit('delete', this.file); |       this.$emit('delete', this.file); | ||||||
| 		}, |     }, | ||||||
| 		async handleDownload() { |     async handleDownload() { | ||||||
| 			const data = await this.$axios({ |       const data = await this.$axios({ | ||||||
| 				url: this.file.fileUrl, |         url: this.file.fileUrl, | ||||||
| 				method: 'get', |         method: 'get', | ||||||
| 				responseType: 'blob', |         responseType: 'blob', | ||||||
| 			}); |       }); | ||||||
|  |  | ||||||
| 			await this.$message.success('开始下载'); |       await this.$message.success('开始下载'); | ||||||
| 			// create download link |       // create download link | ||||||
| 			const url = window.URL.createObjectURL(data); |       const url = window.URL.createObjectURL(data); | ||||||
| 			const link = document.createElement('a'); |       const link = document.createElement('a'); | ||||||
| 			link.href = url; |       link.href = url; | ||||||
| 			link.download = this.file.fileName; |       link.download = this.file.fileName; | ||||||
| 			document.body.appendChild(link); |       document.body.appendChild(link); | ||||||
| 			link.click(); |       link.click(); | ||||||
| 			document.body.removeChild(link); |       document.body.removeChild(link); | ||||||
| 		}, |     }, | ||||||
| 	}, |   }, | ||||||
| 	mounted() { |   mounted() { | ||||||
| 	}, |   }, | ||||||
| 	render: function (h) { |   render: function (h) { | ||||||
| 		return ( |     return ( | ||||||
| 			<div |       <div | ||||||
| 				title={this.file.fileName} |         title={this.file.fileName} | ||||||
| 				onClick={this.handleDownload} |         onClick={this.handleDownload} | ||||||
| 				style={{ |         style={{ | ||||||
| 					background: `url(${tupleImg}) no-repeat`, |           background: `url(${tupleImg}) no-repeat`, | ||||||
| 					backgroundSize: '14px', |           backgroundSize: '14px', | ||||||
| 					backgroundPosition: '0 55%', |           backgroundPosition: '0 55%', | ||||||
| 					paddingLeft: '20px', |           paddingLeft: '20px', | ||||||
| 					paddingRight: '24px', |           paddingRight: '24px', | ||||||
| 					textOverflow: 'ellipsis', |           textOverflow: 'ellipsis', | ||||||
| 					whiteSpace: 'nowrap', |           whiteSpace: 'nowrap', | ||||||
| 					overflow: 'hidden', |           overflow: 'hidden', | ||||||
| 					cursor: 'pointer', |           cursor: 'pointer', | ||||||
| 					display: 'inline-block', |           display: 'inline-block', | ||||||
| 				}}> |         }}> | ||||||
| 				{this.file.fileName} |         {this.file.fileName} | ||||||
| 				{!this.disabled && ( |         {!this.disabled && ( | ||||||
| 					<el-button |           <el-button | ||||||
| 						type="text" |             type="text" | ||||||
| 						icon="el-icon-close" |             icon="el-icon-close" | ||||||
| 						style="float: right; position: relative; top: 2px; left: 8px; z-index: 100" |             style="float: right; position: relative; top: 2px; left: 8px; z-index: 100" | ||||||
| 						class="dialog__upload_component__close" |             class="dialog__upload_component__close" | ||||||
| 						onClick={this.handleDelete} |             onClick={this.handleDelete} | ||||||
| 					/> |           /> | ||||||
| 				)} |         )} | ||||||
| 			</div> |       </div> | ||||||
| 		); |     ); | ||||||
| 	}, |   }, | ||||||
| }; | }; | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
| @@ -392,18 +407,20 @@ export default { | |||||||
|   justify-content: flex-end; |   justify-content: flex-end; | ||||||
|   padding: 18px; |   padding: 18px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .blodTip { | .blodTip { | ||||||
| 	height: 16px; |   height: 16px; | ||||||
| 	font-size: 14px; |   font-size: 14px; | ||||||
| 	font-weight: 600; |   font-weight: 600; | ||||||
| 	color: rgba(0,0,0,0.85); |   color: rgba(0, 0, 0, 0.85); | ||||||
| 	margin-bottom: 8px; |   margin-bottom: 8px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .lightTip { | .lightTip { | ||||||
| 	/* height: 16px; */ |   /* height: 16px; */ | ||||||
| 	font-size: 14px; |   font-size: 14px; | ||||||
| 	font-weight: 400; |   font-weight: 400; | ||||||
| 	color: rgba(102,102,102,0.75); |   color: rgba(102, 102, 102, 0.75); | ||||||
| 	margin-bottom: 12px; |   margin-bottom: 12px; | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|   | |||||||
| @@ -63,106 +63,6 @@ | |||||||
|             value-format="timestamp" format="yyyy-MM-dd HH:mm:ss" clearable @change="$emit('update', form)" /> |             value-format="timestamp" format="yyyy-MM-dd HH:mm:ss" clearable @change="$emit('update', form)" /> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|       </el-col> |       </el-col> | ||||||
|  |  | ||||||
|       <!-- 故障级别  --> |  | ||||||
|       <!-- <el-col :span="8"> |  | ||||||
| 				<el-form-item |  | ||||||
| 					label="故障级别" |  | ||||||
| 					prop="faultLevel" |  | ||||||
| 					:rules="[ |  | ||||||
| 						{ |  | ||||||
| 							required: true, |  | ||||||
| 							message: '故障级别不能为空', |  | ||||||
| 							trigger: 'blur', |  | ||||||
| 						}, |  | ||||||
| 					]"> |  | ||||||
| 					<el-select |  | ||||||
| 						v-model="form.faultLevel" |  | ||||||
| 						placeholder="故障级别" |  | ||||||
| 						:disabled="disabled" |  | ||||||
| 						@change="$emit('update', form)"> |  | ||||||
| 						<el-option |  | ||||||
| 							v-for="opt in getDictDatas(DICT_TYPE.FAULT_LEVEL)" |  | ||||||
| 							: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="faultType" |  | ||||||
| 					:rules="[ |  | ||||||
| 						{ |  | ||||||
| 							required: true, |  | ||||||
| 							message: '故障类型不能为空', |  | ||||||
| 							trigger: 'blur', |  | ||||||
| 						}, |  | ||||||
| 					]"> |  | ||||||
| 					<el-select |  | ||||||
| 						v-model="form.faultType" |  | ||||||
| 						placeholder="故障类型" |  | ||||||
| 						:disabled="disabled" |  | ||||||
| 						@change="$emit('update', form)"> |  | ||||||
| 						<el-option |  | ||||||
| 							v-for="opt in getDictDatas(DICT_TYPE.FAULT_TYPE)" |  | ||||||
| 							: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="maintenanceStartTime" |  | ||||||
| 					:rules="[ |  | ||||||
| 						{ |  | ||||||
| 							required: true, |  | ||||||
| 							message: '维修开始时间不能为空', |  | ||||||
| 							trigger: 'blur', |  | ||||||
| 						}, |  | ||||||
| 					]"> |  | ||||||
| 					<el-date-picker |  | ||||||
| 						v-model="form.maintenanceStartTime" |  | ||||||
| 						type="datetime" |  | ||||||
| 						:disabled="disabled" |  | ||||||
| 						:placeholder="`请选择维修开始时间`" |  | ||||||
| 						value-format="timestamp" |  | ||||||
| 						format="yyyy-MM-dd HH:mm:ss" |  | ||||||
| 						clearable |  | ||||||
| 						@change="$emit('update', form)" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> --> |  | ||||||
|  |  | ||||||
|       <!-- 维修结束时间  --> |  | ||||||
|       <!-- <el-col :span="8"> |  | ||||||
| 				<el-form-item |  | ||||||
| 					label="维修结束时间" |  | ||||||
| 					prop="maintenanceFinishTime" |  | ||||||
| 					:rules="[ |  | ||||||
| 						{ |  | ||||||
| 							required: true, |  | ||||||
| 							message: '维修结束时间不能为空', |  | ||||||
| 							trigger: 'blur', |  | ||||||
| 						}, |  | ||||||
| 					]"> |  | ||||||
| 					<el-date-picker |  | ||||||
| 						v-model="form.maintenanceFinishTime" |  | ||||||
| 						type="datetime" |  | ||||||
| 						:disabled="disabled" |  | ||||||
| 						:placeholder="`请选择维修结束时间`" |  | ||||||
| 						value-format="timestamp" |  | ||||||
| 						format="yyyy-MM-dd HH:mm:ss" |  | ||||||
| 						clearable |  | ||||||
| 						@change="$emit('update', form)" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> --> |  | ||||||
|       <el-col :span="8"> |       <el-col :span="8"> | ||||||
|         <el-form-item label="维修时长(h)" prop="maintenanceDuration"> |         <el-form-item label="维修时长(h)" prop="maintenanceDuration"> | ||||||
|           <el-input-number v-model="dataForm.maintenanceDuration" :min="0" controls-position="right" style="width: 100%" |           <el-input-number v-model="dataForm.maintenanceDuration" :min="0" controls-position="right" style="width: 100%" | ||||||
| @@ -433,8 +333,8 @@ export default { | |||||||
| 			sectionOptions: [], | 			sectionOptions: [], | ||||||
| 			lineOptions: [], | 			lineOptions: [], | ||||||
| 			uploadOpen: false, | 			uploadOpen: false, | ||||||
| 			uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 上传有关的headers,url都是固定的 |       uploadHeaders: { Authorization: 'Bearer ' + getAccessToken() }, | ||||||
| 			uploadHeaders: { Authorization: 'Bearer ' + getAccessToken() }, |       uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 上传有关的headers,url都是固定的 | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	watch: { | 	watch: { | ||||||
| @@ -633,17 +533,17 @@ export default { | |||||||
|  |  | ||||||
| 		handleUploadSuccess(response, file, prop) { | 		handleUploadSuccess(response, file, prop) { | ||||||
| 			console.log('response', response); | 			console.log('response', response); | ||||||
| 			if (response.code != 0) { | 			// if (response.code != 0) { | ||||||
| 				this.$modal.msgError('上传失败: ', response.msg || '-'); | 			// 	this.$modal.msgError('上传失败: ', response.msg || '-'); | ||||||
| 				return; | 			// 	return; | ||||||
| 			} | 			// } | ||||||
| 			this.form.files.push({ |       this.form.files.push({ | ||||||
| 				fileName: file.name, |         fileName: file.name, | ||||||
| 				fileUrl: response.data, |         fileUrl: response.data, | ||||||
| 				fileType: prop == 'files' ? 2 : 1, |         fileType: prop == 'files' ? 2 : 1, | ||||||
| 			}); |       }); | ||||||
| 			this.$modal.msgSuccess('上传成功'); |       this.$modal.msgSuccess('上传成功'); | ||||||
| 			this.$emit('update', this.form); |       this.$emit('update', this.form); | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		handleDeleteFile(file, prop) { | 		handleDeleteFile(file, prop) { | ||||||
|   | |||||||
							
								
								
									
										53
									
								
								src/views/equipment/base/repair/detail-btn.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								src/views/equipment/base/repair/detail-btn.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,53 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zhp | ||||||
|  |  * @Date: 2023-11-08 14:00:52 | ||||||
|  |  * @LastEditTime: 2023-12-01 10:12:27 | ||||||
|  |  * @LastEditors: DY | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  |   <div> | ||||||
|  |     <el-button type="text" @click="handleDetail">查看更多</el-button> | ||||||
|  |     <CustomDialogForm v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getList" /> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | import CustomDialogForm from './CustomDialogForm.vue'; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  |   name: 'EquipmentRepairDetail', | ||||||
|  |   components: { CustomDialogForm }, | ||||||
|  |   props: { | ||||||
|  |     injectData: { | ||||||
|  |       type: Object, | ||||||
|  |       default: () => ({}) | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       addOrUpdateVisible:false, | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   mounted() { | ||||||
|  |     this.getContent() | ||||||
|  |   }, | ||||||
|  |  | ||||||
|  |   methods: { | ||||||
|  |     handleDetail() { | ||||||
|  |       // this.reset(); | ||||||
|  |       // const id = row.id; | ||||||
|  |       // this.info({ id }).then((response) => { | ||||||
|  |       // 	this.form = response.data; | ||||||
|  |       // 	// this.form.repairman = this.form.repairman.split(',') | ||||||
|  |       // 	this.open = true; | ||||||
|  |       // 	this.title = '修改维修记录'; | ||||||
|  |       // }); | ||||||
|  |       this.addOrUpdateVisible = true | ||||||
|  |       this.$nextTick(() => { | ||||||
|  |         this.$refs.addOrUpdate.init({ id: this.injectData.id }); | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </script> | ||||||
							
								
								
									
										421
									
								
								src/views/equipment/base/repair/detail.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										421
									
								
								src/views/equipment/base/repair/detail.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,421 @@ | |||||||
|  | <!-- | ||||||
|  |     filename: dialogForm.vue | ||||||
|  |     author: liubin | ||||||
|  |     date: 2023-10-31 15:55:13 | ||||||
|  |     description: | ||||||
|  | --> | ||||||
|  |  | ||||||
|  | <template> | ||||||
|  |   <!-- <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer" | ||||||
|  |     custom-class="mes-drawer" size="50%" @closed="$emit('destroy')"> --> | ||||||
|  |   <el-dialog :visible.sync="visible" width="50%" :before-close="closed"> | ||||||
|  |     <small-title slot="title" :no-padding="true"> | ||||||
|  |       详情 | ||||||
|  |       <!-- {{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }} --> | ||||||
|  |     </small-title> | ||||||
|  |     <div class="drawer-body flex"> | ||||||
|  |       <div class="drawer-body__content"> | ||||||
|  |         <div> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">维修单号</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.repairOrderNumber }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">产线名</div> | ||||||
|  |               <div class="lightTip">{{  dataForm.lineName }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">工段名</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.sectionName }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <!-- <el-col :span="6"> | ||||||
|  |               <div class="blodTip">维修工</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.repairman }}</div> | ||||||
|  |             </el-col> --> | ||||||
|  |           </el-row> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">故障发生时间</div> | ||||||
|  |               <div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">故障级别</div> | ||||||
|  |               <div class="lightTip">{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">故障类型</div> | ||||||
|  |               <div class="lightTip">{{ getDictDataLabel('fault-type', dataForm.faultType) }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">维修工</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.repairman }}</div> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">联系方式</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.repairmanPhone }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">维修方式</div> | ||||||
|  |               <div class="lightTip">{{ getDictDataLabel('repair-mode', dataForm.repairMode) }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">创建时间</div> | ||||||
|  |               <div class="lightTip">{{ parseTime(dataForm.createTime) }}</div> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <div class="blodTip">创建人</div> | ||||||
|  |               <div class="lightTip">{{ dataForm.creator }}</div> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |           <el-row> | ||||||
|  |             <div class="blodTip">备注</div> | ||||||
|  |             <div class="lightTip">{{ dataForm.remark }}</div> | ||||||
|  |           </el-row> | ||||||
|  |           <el-row> | ||||||
|  |             <div class="blodTip">维修附件</div> | ||||||
|  |             <div v-if="dataForm.files && dataForm.files.length > 0"> | ||||||
|  |               <uploadedFile class="file" v-for="file in dataForm.files" :file="file" :key="file.fileUrl" | ||||||
|  |                 :disabled="disabled" @delete="!disabled && handleDeleteFile(file, col.prop)" /> | ||||||
|  |             </div> | ||||||
|  |             <p v-else>暂无附件</p> | ||||||
|  |           </el-row> | ||||||
|  |         </div> | ||||||
|  |         <!-- <el-divider style="margin-top: -10px" /> | ||||||
|  |         <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true"> | ||||||
|  |           {{ '设备维修信息' }} | ||||||
|  |         </small-title> --> | ||||||
|  |         <!-- <el-form ref="form" :model="dataForm" label-width="100px" label-position="top" v-loading="formLoading"> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <el-form-item label="维修开始时间" prop="maintenanceStartTime" | ||||||
|  |                 :rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]"> | ||||||
|  |                 <el-date-picker v-model="dataForm.maintenanceStartTime" type="datetime" :disabled="disabled" | ||||||
|  |                   placeholder="请选择维修开始时间" value-format="timestamp" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <el-form-item label="维修结束时间" prop="maintenanceFinishTime" | ||||||
|  |                 :rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]"> | ||||||
|  |                 <el-date-picker v-model="dataForm.maintenanceFinishTime" type="datetime" :disabled="disabled" | ||||||
|  |                   placeholder="请选择维修开始时间" value-format="timestamp" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <el-form-item label="维修方式" prop="repairMode" | ||||||
|  |                 :rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]"> | ||||||
|  |                 <el-select :disabled="disabled" v-model="dataForm.repairMode" placeholder="请选择维修方式"> | ||||||
|  |                   <el-option v-for="opt in getDictDatas('repair-mode')" :key="opt.value" :label="opt.label" | ||||||
|  |                     :value="opt.value" /> | ||||||
|  |                 </el-select> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="6"> | ||||||
|  |               <el-form-item label="故障类型" prop="faultType"> | ||||||
|  |                 <el-select :disabled="disabled" v-model="dataForm.faultType" placeholder="请选择故障类型"> | ||||||
|  |                   <el-option v-for="opt in getDictDatas('fault-type')" :key="opt.value" :label="opt.label" | ||||||
|  |                     :value="opt.value" /> | ||||||
|  |                 </el-select> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |  | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col> | ||||||
|  |               <el-form-item label="故障明细" prop="faultDetail" | ||||||
|  |                 :rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]"> | ||||||
|  |                 <editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |  | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col> | ||||||
|  |               <el-form-item label="维修记录" prop="maintenanceDetail"> | ||||||
|  |                 <editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |  | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col> | ||||||
|  |               <el-form-item label="维修附件" prop="file"> | ||||||
|  |                 <FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |  | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col> | ||||||
|  |               <el-form-item label="备注" prop="remark"> | ||||||
|  |                 <el-input v-model="dataForm.remark" :placeholder="`请输入备注`" :disabled="disabled" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |         </el-form> --> | ||||||
|  |  | ||||||
|  |         <!-- <div v-if="!disabled" class="drawer-body__footer"> | ||||||
|  |           <el-button style="" @click="goback()">取消</el-button> | ||||||
|  |           <el-button type="primary" @click="dataFormSubmit()">确定</el-button> | ||||||
|  |         </div> --> | ||||||
|  |       </div> | ||||||
|  |     </div> | ||||||
|  |     <span slot="footer" class="dialog-footer"> | ||||||
|  |       <el-button @click="visible = false">取 消</el-button> | ||||||
|  |     </span> | ||||||
|  |   </el-dialog> | ||||||
|  |   <!-- </el-drawer> --> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | import SmallTitle from '../../base/alarm/Record/SmallTitle.vue'; | ||||||
|  | import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair' | ||||||
|  | import Editor from "@/components/Editor"; | ||||||
|  | // import FileUpload from "@/components/FileUpload"; | ||||||
|  | import { getDictDatas } from "@/utils/dict"; | ||||||
|  | import { parseTime } from '@/utils/ruoyi' | ||||||
|  | import { getDictDataLabel } from '@/utils/dict'; | ||||||
|  | import tupleImg from '@/assets/images/tuple.png'; | ||||||
|  |  | ||||||
|  | const uploadedFile = { | ||||||
|  |   name: 'UploadedFile', | ||||||
|  |   props: ['file', 'disabled'], | ||||||
|  |   data() { | ||||||
|  |     return {}; | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     handleDelete() { | ||||||
|  |       this.$emit('delete', this.file); | ||||||
|  |     }, | ||||||
|  |     async handleDownload() { | ||||||
|  |       const data = await this.$axios({ | ||||||
|  |         url: this.file.fileUrl, | ||||||
|  |         method: 'get', | ||||||
|  |         responseType: 'blob', | ||||||
|  |       }); | ||||||
|  |  | ||||||
|  |       await this.$message.success('开始下载'); | ||||||
|  |       // create download link | ||||||
|  |       const url = window.URL.createObjectURL(data); | ||||||
|  |       const link = document.createElement('a'); | ||||||
|  |       link.href = url; | ||||||
|  |       link.download = this.file.fileName; | ||||||
|  |       document.body.appendChild(link); | ||||||
|  |       link.click(); | ||||||
|  |       document.body.removeChild(link); | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  |   mounted() { | ||||||
|  |   }, | ||||||
|  |   render: function (h) { | ||||||
|  |     return ( | ||||||
|  |       <div | ||||||
|  |         title={this.file.fileName} | ||||||
|  |         onClick={this.handleDownload} | ||||||
|  |         style={{ | ||||||
|  |           background: `url(${tupleImg}) no-repeat`, | ||||||
|  |           backgroundSize: '14px', | ||||||
|  |           backgroundPosition: '0 55%', | ||||||
|  |           paddingLeft: '20px', | ||||||
|  |           paddingRight: '24px', | ||||||
|  |           textOverflow: 'ellipsis', | ||||||
|  |           whiteSpace: 'nowrap', | ||||||
|  |           overflow: 'hidden', | ||||||
|  |           cursor: 'pointer', | ||||||
|  |           display: 'inline-block', | ||||||
|  |         }}> | ||||||
|  |         {this.file.fileName} | ||||||
|  |         {!this.disabled && ( | ||||||
|  |           <el-button | ||||||
|  |             type="text" | ||||||
|  |             icon="el-icon-close" | ||||||
|  |             style="float: right; position: relative; top: 2px; left: 8px; z-index: 100" | ||||||
|  |             class="dialog__upload_component__close" | ||||||
|  |             onClick={this.handleDelete} | ||||||
|  |           /> | ||||||
|  |         )} | ||||||
|  |       </div> | ||||||
|  |     ); | ||||||
|  |   }, | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  |   name: 'DialogForm', | ||||||
|  |   model: { | ||||||
|  |     prop: 'dataForm', | ||||||
|  |     event: 'update', | ||||||
|  |   }, | ||||||
|  |   emits: ['update'], | ||||||
|  |   components: { SmallTitle, Editor, uploadedFile }, | ||||||
|  |   props: { | ||||||
|  |     // dataForm: { | ||||||
|  |     // 	type: Object, | ||||||
|  |     // 	default: () => ({}), | ||||||
|  |     // }, | ||||||
|  |     // disabled: { | ||||||
|  |     // 	type: Boolean, | ||||||
|  |     // 	default: false | ||||||
|  |     // }, | ||||||
|  |   }, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       formLoading: true, | ||||||
|  |       visible: false, | ||||||
|  |       disabled: false, | ||||||
|  |       dataForm: {}, | ||||||
|  |       file: '', | ||||||
|  |       fileName: '' | ||||||
|  |     }; | ||||||
|  |   }, | ||||||
|  |   mounted() { }, | ||||||
|  |   methods: { | ||||||
|  |     closed() { | ||||||
|  |       this.$emit('destroy') | ||||||
|  |     }, | ||||||
|  |     setFileName(val) { | ||||||
|  |       this.fileName = val | ||||||
|  |     }, | ||||||
|  |     goback() { | ||||||
|  |       this.$emit('refreshDataList'); | ||||||
|  |       this.visible = false; | ||||||
|  |     }, | ||||||
|  |     goEdit() { | ||||||
|  |       this.disabled = false; | ||||||
|  |     }, | ||||||
|  |     /** 模拟透传 ref  */ | ||||||
|  |     validate(cb) { | ||||||
|  |       return this.$refs.form.validate(cb); | ||||||
|  |     }, | ||||||
|  |     resetFields(args) { | ||||||
|  |       return this.$refs.form.resetFields(args); | ||||||
|  |     }, | ||||||
|  |     initData() { | ||||||
|  |       this.file = '' | ||||||
|  |       this.fileName = '' | ||||||
|  |     }, | ||||||
|  |     init(row, isdetail) { | ||||||
|  |       this.initData(); | ||||||
|  |       this.disabled = isdetail || false; | ||||||
|  |       this.dataForm.id = row.id || undefined; | ||||||
|  |       this.visible = true; | ||||||
|  |  | ||||||
|  |       this.$nextTick(() => { | ||||||
|  |         // this.$refs['form'].resetFields(); | ||||||
|  |  | ||||||
|  |         if (this.dataForm.id) { | ||||||
|  |           // 获取设备维修 | ||||||
|  |           getEqRepair(this.dataForm.id).then(response => { | ||||||
|  |             this.formLoading = false | ||||||
|  |             this.dataForm = response.data; | ||||||
|  |             // this.dataForm.maintenanceStatus = row.maintenanceStatus || 0 | ||||||
|  |             // if (this.dataForm.files.length > 0) { | ||||||
|  |             //   this.file = this.dataForm.files[0].fileUrl | ||||||
|  |             //   this.fileName = this.dataForm.files[0].fileName | ||||||
|  |             // } | ||||||
|  |           }); | ||||||
|  |         } else { | ||||||
|  |           // if (this.urlOptions.isGetCode) { | ||||||
|  |           //   this.getCode() | ||||||
|  |           // } | ||||||
|  |         } | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     // 表单提交 | ||||||
|  |     dataFormSubmit() { | ||||||
|  |       this.$refs["form"].validate((valid) => { | ||||||
|  |         if (!valid) { | ||||||
|  |           return false; | ||||||
|  |         } | ||||||
|  |         // 修改的提交 | ||||||
|  |         if (this.file) { | ||||||
|  |           const temp = this.file.split(',') // 获取文件个数 | ||||||
|  |           let arry = [] | ||||||
|  |           temp.forEach(item => { | ||||||
|  |             arry.push({ | ||||||
|  |               fileName: this.fileName, | ||||||
|  |               fileType: 2, | ||||||
|  |               fileUrl: item | ||||||
|  |             }) | ||||||
|  |           }) | ||||||
|  |           this.dataForm.files = arry | ||||||
|  |         } | ||||||
|  |         if (this.dataForm.id) { | ||||||
|  |           updateEqRepair(this.dataForm).then(response => { | ||||||
|  |             this.$modal.msgSuccess("修改成功"); | ||||||
|  |             this.visible = false; | ||||||
|  |             this.$emit("refreshDataList"); | ||||||
|  |           }); | ||||||
|  |           return; | ||||||
|  |         } | ||||||
|  |         // 添加的提交 | ||||||
|  |         // this.urlOptions.createURL(this.dataForm).then(response => { | ||||||
|  |         //   this.$modal.msgSuccess("新增成功"); | ||||||
|  |         //   this.visible = false; | ||||||
|  |         //   this.$emit("refreshDataList"); | ||||||
|  |         // }); | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style scoped> | ||||||
|  | .drawer>>>.el-drawer { | ||||||
|  |   border-radius: 8px 0 0 8px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer>>>.el-drawer__header { | ||||||
|  |   margin: 0; | ||||||
|  |   padding: 32px 32px 24px; | ||||||
|  |   border-bottom: 1px solid #dcdfe6; | ||||||
|  |   margin-bottom: 0px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .small-title::before { | ||||||
|  |   content: ''; | ||||||
|  |   display: inline-block; | ||||||
|  |   vertical-align: top; | ||||||
|  |   width: 4px; | ||||||
|  |   height: 22px; | ||||||
|  |   border-radius: 1px; | ||||||
|  |   margin-right: 8px; | ||||||
|  |   background-color: #0b58ff; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer-body { | ||||||
|  |   display: flex; | ||||||
|  |   flex-direction: column; | ||||||
|  |   height: 100%; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer-body__content { | ||||||
|  |   flex: 1; | ||||||
|  |   /* background: #eee; */ | ||||||
|  |   padding: 5px 10px; | ||||||
|  |   overflow-y: auto; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer-body__footer { | ||||||
|  |   display: flex; | ||||||
|  |   justify-content: flex-end; | ||||||
|  |   padding: 18px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .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; | ||||||
|  | } | ||||||
|  | </style> | ||||||
| @@ -1,54 +1,26 @@ | |||||||
| <template> | <template> | ||||||
| 	<div class="app-container"> |   <div class="app-container"> | ||||||
| 		<!-- 搜索工作栏 --> |     <!-- 搜索工作栏 --> | ||||||
| 		<SearchBar |     <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> | ||||||
| 			:formConfigs="searchBarFormConfig" |  | ||||||
| 			ref="search-bar" |  | ||||||
| 			@headBtnClick="handleSearchBarBtnClick" /> |  | ||||||
|  |  | ||||||
| 		<!-- 列表 --> |     <!-- 列表 --> | ||||||
| 		<base-table |     <base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list" | ||||||
| 			:table-props="tableProps" |       @emitFun="handleEmitFun" :max-height="tableH"> | ||||||
| 			:page="queryParams.pageNo" |       <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="90" :method-list="tableBtn" | ||||||
| 			:limit="queryParams.pageSize" |         @clickBtn="handleTableBtnClick" /> | ||||||
| 			:table-data="list" |     </base-table> | ||||||
| 			@emitFun="handleEmitFun" |  | ||||||
| 			:max-height="tableH"> |  | ||||||
| 			<method-btn |  | ||||||
| 				v-if="tableBtn.length" |  | ||||||
| 				slot="handleBtn" |  | ||||||
| 				label="操作" |  | ||||||
| 				:width="90" |  | ||||||
| 				:method-list="tableBtn" |  | ||||||
| 				@clickBtn="handleTableBtnClick" /> |  | ||||||
| 		</base-table> |  | ||||||
|  |  | ||||||
| 		<!-- 分页组件 --> |     <!-- 分页组件 --> | ||||||
| 		<pagination |     <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | ||||||
| 			v-show="total > 0" |       @pagination="getList" /> | ||||||
| 			:total="total" |  | ||||||
| 			:page.sync="queryParams.pageNo" |  | ||||||
| 			:limit.sync="queryParams.pageSize" |  | ||||||
| 			@pagination="getList" /> |  | ||||||
|  |  | ||||||
| 		<!-- 对话框(添加 / 修改) --> |     <!-- 对话框(添加 / 修改) --> | ||||||
| 		<base-dialog |     <base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" @cancel="cancel" @confirm="submitForm"> | ||||||
| 			:dialogTitle="title" |       <DialogForm v-if="open" ref="form" v-model="form" :disabled="mode === 'detail'" /> | ||||||
| 			:dialogVisible="open" |     </base-dialog> | ||||||
| 			@close="cancel" |     <CustomDialogForm v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getList" /> | ||||||
| 			@cancel="cancel" |     <!-- <detail v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="getList" /> --> | ||||||
| 			@confirm="submitForm"> |   </div> | ||||||
| 			<DialogForm |  | ||||||
| 				v-if="open" |  | ||||||
| 				ref="form" |  | ||||||
| 				v-model="form" |  | ||||||
| 				:disabled="mode == 'detail'" /> |  | ||||||
| 		</base-dialog> |  | ||||||
| 		<CustomDialogForm |  | ||||||
| 			v-if="addOrUpdateVisible" |  | ||||||
| 			ref="addOrUpdate" |  | ||||||
| 			@refreshDataList="getList" /> |  | ||||||
| 	</div> |  | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
| @@ -57,26 +29,31 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin'; | |||||||
| import CustomDialogForm from './CustomDialogForm.vue'; | import CustomDialogForm from './CustomDialogForm.vue'; | ||||||
| import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair' | import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair' | ||||||
| import { parseTime } from '@/utils/ruoyi' | import { parseTime } from '@/utils/ruoyi' | ||||||
|  | import detailBtn from './detail-btn.vue' | ||||||
| import htmls from './htmls.vue' | import htmls from './htmls.vue' | ||||||
|  | // import detail from './detail.vue' | ||||||
|  |  | ||||||
|  |  | ||||||
| import DialogForm from './Repair--add.vue'; | import DialogForm from './Repair--add.vue'; | ||||||
| import tableHeightMixin from '@/mixins/tableHeightMixin'; | import tableHeightMixin from '@/mixins/tableHeightMixin'; | ||||||
| // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); | // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
| 	name: 'EquipmentRepair', | 	name: 'EquipmentRepair', | ||||||
| 	components: { CustomDialogForm, DialogForm }, |   components: { CustomDialogForm, DialogForm }, | ||||||
| 	mixins: [basicPageMixin, tableHeightMixin], | 	mixins: [basicPageMixin, tableHeightMixin], | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			addOrUpdateVisible: false, |       addOrUpdateVisible: false, | ||||||
|  |       detailOrUpdateVisible:false, | ||||||
| 			searchBarKeys: ['maintenanceResult', 'createTime', 'equipmentId'], | 			searchBarKeys: ['maintenanceResult', 'createTime', 'equipmentId'], | ||||||
| 			tableBtn: [ | 			tableBtn: [ | ||||||
| 				this.$auth.hasPermi('equipment:repair:query') | 				// this.$auth.hasPermi('equipment:repair:query') | ||||||
| 					? { | 				// 	? { | ||||||
| 							type: 'detail', | 				// 			type: 'detail', | ||||||
| 							btnName: '详情', | 				// 			btnName: '详情', | ||||||
| 					  } | 				// 	  } | ||||||
| 					: undefined, | 				// 	: undefined, | ||||||
| 				// this.$auth.hasPermi('equipment:repair:finish') | 				// this.$auth.hasPermi('equipment:repair:finish') | ||||||
| 				// 	? { | 				// 	? { | ||||||
| 				// 			type: 'finish', | 				// 			type: 'finish', | ||||||
| @@ -108,31 +85,33 @@ export default { | |||||||
| 				{ prop: 'lineName', label: '产线名', width: 120, showOverflowtooltip: true }, | 				{ prop: 'lineName', label: '产线名', width: 120, showOverflowtooltip: true }, | ||||||
| 				{ prop: 'sectionName', label: '工段名', width: 120, showOverflowtooltip: true }, | 				{ prop: 'sectionName', label: '工段名', width: 120, showOverflowtooltip: true }, | ||||||
| 				{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true }, | 				{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true }, | ||||||
| 				{ prop: 'faultDetail', label: '故障明细', subcomponent: htmls, width: 180, showOverflowtooltip: true }, |         { prop: 'faultDetail', label: '故障明细', subcomponent: htmls, width: 180, showOverflowtooltip: true }, | ||||||
| 				// { prop: 'maintenanceDetail', label: '维修明细', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true }, | 				// { prop: 'maintenanceDetail', label: '维修明细', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true }, | ||||||
| 				{ | 				{ | ||||||
| 					prop: 'maintenanceStartTime', |           prop: 'faultTime', | ||||||
| 					label: '维修开始时间', | 					label: '故障开始时间', | ||||||
| 					width: 150, |  | ||||||
| 					filter: parseTime, |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					prop: 'maintenanceFinishTime', |  | ||||||
| 					label: '维修结束时间', |  | ||||||
| 					width: 150, | 					width: 150, | ||||||
| 					filter: parseTime, | 					filter: parseTime, | ||||||
| 				}, | 				}, | ||||||
|  | 				// { | ||||||
|  | 				// 	prop: 'maintenanceFinishTime', | ||||||
|  | 				// 	label: '维修结束时间', | ||||||
|  | 				// 	width: 150, | ||||||
|  | 				// 	filter: parseTime, | ||||||
|  | 				// }, | ||||||
| 				// { prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime }, | 				// { prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime }, | ||||||
| 				{ | 				// { | ||||||
| 					prop: 'maintenanceResult', | 				// 	prop: 'maintenanceResult', | ||||||
| 					label: '维修结果', | 				// 	label: '维修结果', | ||||||
| 					filter: (v) => (v != null ? ['成功', '失败'][v] : ''), | 				// 	filter: (v) => (v != null ? ['成功', '失败'][v] : ''), | ||||||
| 				}, | 				// }, | ||||||
| 				// { prop: 'maintenanceDuration', label: '维修时长(h)' }, | 				{ prop: 'maintenanceDuration', label: '维修时长(时)' },// | ||||||
| 				{ prop: 'maintenanceDetail', label: '维修描述', subcomponent: htmls }, // 没有参数 |         { prop: 'maintenanceDetail', label: '维修描述', subcomponent: htmls }, // 没有参数 | ||||||
|  |  | ||||||
| 				// { prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true }, | 				// { prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true }, | ||||||
| 				// { prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true }, | 				// { prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true }, | ||||||
| 				{ prop: 'remark', label: '备注', minWidth: 90, showOverflowtooltip: true } |         { prop: 'remark', label: '备注', minWidth: 90, showOverflowtooltip: true }, | ||||||
|  |         { prop: 'detail', label: '查看详情', subcomponent: detailBtn }, // 没有参数 | ||||||
| 			], | 			], | ||||||
| 			searchBarFormConfig: [ | 			searchBarFormConfig: [ | ||||||
| 				{ | 				{ | ||||||
| @@ -142,16 +121,16 @@ export default { | |||||||
| 					param: 'equipmentId', | 					param: 'equipmentId', | ||||||
| 					filterable: true, | 					filterable: true, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				// { | ||||||
| 					type: 'select', | 				// 	type: 'select', | ||||||
| 					label: '维修结果', | 				// 	label: '维修结果', | ||||||
| 					placeholder: '请选择状态', | 				// 	placeholder: '请选择状态', | ||||||
| 					param: 'maintenanceResult', | 				// 	param: 'maintenanceResult', | ||||||
| 					selectOptions: [ | 				// 	selectOptions: [ | ||||||
| 						{ name: '成功', id: '0' }, | 				// 		{ name: '成功', id: '0' }, | ||||||
| 						{ name: '失败', id: '1' } | 				// 		{ name: '失败', id: '1' } | ||||||
| 					], | 				// 	], | ||||||
| 				}, | 				// }, | ||||||
| 				// 时间段 | 				// 时间段 | ||||||
| 				{ | 				{ | ||||||
| 					type: 'datePicker', | 					type: 'datePicker', | ||||||
| @@ -214,7 +193,7 @@ export default { | |||||||
| 			// 表单参数 | 			// 表单参数 | ||||||
| 			form: {}, | 			form: {}, | ||||||
| 			basePath: '/base/equipment-repair-log', | 			basePath: '/base/equipment-repair-log', | ||||||
| 			mode: null | 			mode: 'add' | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	created() { | 	created() { | ||||||
| @@ -249,7 +228,7 @@ export default { | |||||||
| 		/** 取消按钮 */ | 		/** 取消按钮 */ | ||||||
| 		cancel() { | 		cancel() { | ||||||
| 			this.open = false; | 			this.open = false; | ||||||
| 			this.mode = null; | 			// this.mode = null; | ||||||
| 			this.reset(); | 			this.reset(); | ||||||
| 		}, | 		}, | ||||||
| 		/** 表单重置 */ | 		/** 表单重置 */ | ||||||
| @@ -369,9 +348,9 @@ export default { | |||||||
| 				.catch(() => {}); | 				.catch(() => {}); | ||||||
| 		}, | 		}, | ||||||
| 		handleDetail({ id }) { | 		handleDetail({ id }) { | ||||||
| 			this.addOrUpdateVisible = true |       this.detailOrUpdateVisible = true | ||||||
| 			this.$nextTick(() => { | 			this.$nextTick(() => { | ||||||
| 				this.$refs.addOrUpdate.init({id: id}, true); |         this.$refs.detailOrUpdate.init({id: id}, true); | ||||||
| 			}); | 			}); | ||||||
| 		}, | 		}, | ||||||
| 		/** 导出按钮操作 */ | 		/** 导出按钮操作 */ | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| <!--  | <!-- | ||||||
|     filename: dialogForm.vue |     filename: dialogForm.vue | ||||||
|     author: liubin |     author: liubin | ||||||
|     date: 2023-10-31 15:55:13 |     date: 2023-10-31 15:55:13 | ||||||
|     description:  |     description: | ||||||
| --> | --> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| @@ -41,11 +41,11 @@ | |||||||
| 					</el-col> | 					</el-col> | ||||||
| 				</el-row> | 				</el-row> | ||||||
| 				<el-form-item label="描述" prop="description"> | 				<el-form-item label="描述" prop="description"> | ||||||
| 					<div v-html="dataForm.description" style="padding: 5px; margin: 0; border: 1px solid #dfdfdf" /> | 					<div v-html="dataForm.description" style="padding: 5px; margin: 0; border: 1px solid #dfdfdf;" /> | ||||||
| 					<!-- <editor v-model="dataForm.description" read-only :min-height="200"/> --> | 					<!-- <editor v-model="dataForm.description" read-only :min-height="200"/> --> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-form> | 			</el-form> | ||||||
| 			 |  | ||||||
| 			<div> | 			<div> | ||||||
| 				<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true"> | 				<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true"> | ||||||
| 					{{ '备品备件' }} | 					{{ '备品备件' }} | ||||||
| @@ -78,7 +78,7 @@ | |||||||
| 					:limit.sync="listQuery.pageSize" | 					:limit.sync="listQuery.pageSize" | ||||||
| 					:page-sizes="[5, 10, 15]" | 					:page-sizes="[5, 10, 15]" | ||||||
| 					@pagination="getList" /> | 					@pagination="getList" /> | ||||||
| 			</div>	 | 			</div> | ||||||
|  |  | ||||||
| 			<div v-if="!disabled" class="drawer-body__footer"> | 			<div v-if="!disabled" class="drawer-body__footer"> | ||||||
| 				<el-button type="primary" @click="goback()">关闭</el-button> | 				<el-button type="primary" @click="goback()">关闭</el-button> | ||||||
|   | |||||||
| @@ -289,7 +289,7 @@ export default { | |||||||
| 			const id = row.id; | 			const id = row.id; | ||||||
| 			this.info({ id }).then((response) => { | 			this.info({ id }).then((response) => { | ||||||
| 				this.form = response.data; | 				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.open = true; | ||||||
| 				this.title = '修改备品备件配置'; | 				this.title = '修改备品备件配置'; | ||||||
| 			}); | 			}); | ||||||
| @@ -300,7 +300,7 @@ export default { | |||||||
| 				if (!valid) { | 				if (!valid) { | ||||||
| 					return; | 					return; | ||||||
| 				} | 				} | ||||||
| 				this.form.responsible = this.form.responsible.join(',') | 				// this.form.responsible = this.form.responsible.join(',')/ | ||||||
| 				// 修改的提交 | 				// 修改的提交 | ||||||
| 				if (this.form.id != null) { | 				if (this.form.id != null) { | ||||||
| 					this.put(this.form).then((response) => { | 					this.put(this.form).then((response) => { | ||||||
|   | |||||||
| @@ -136,8 +136,8 @@ export default { | |||||||
| 						select: true, | 						select: true, | ||||||
| 						label: '备件名称', | 						label: '备件名称', | ||||||
|             prop: 'productMaterialId', |             prop: 'productMaterialId', | ||||||
|             url: '/base/core-product-material/listAll', // TODO: 供应商 |             // url: '/base/core-product-material/listAll', // TODO: 供应商 | ||||||
| 						// options: [], | 						options: [], | ||||||
| 						bind: { | 						bind: { | ||||||
| 							filterable: true, | 							filterable: true, | ||||||
| 							clearable: false, | 							clearable: false, | ||||||
| @@ -404,19 +404,19 @@ export default { | |||||||
| 				.catch(() => {}); | 				.catch(() => {}); | ||||||
| 		}, | 		}, | ||||||
| 		async getDict() { | 		async getDict() { | ||||||
| 			const materRes = await getMaterialTree(); // | 			// const materRes = await getMaterialTree(); | ||||||
| 			let typeId = materRes.data.find((item) => item.product === 2).id; | 			// let typeId = materRes.data.find((item) => item.product === 2); | ||||||
| 			const listQuery = { | 			// const listQuery = { | ||||||
| 				typeId: typeId, | 			// 	typeId: typeId, | ||||||
| 			}; | 			// }; | ||||||
| 			const materData = await getMaterialList(listQuery); | 			const materData = await getMaterialList(); | ||||||
| 			this.rows[0][0].options = (materData.data || []).map((item) => ({ |       this.rows[0][0].options = (materData.data || []).filter(item => item.typeId === 3) | ||||||
| 				label: item.name, |         .map(item => ({ label: item.name, value: item.id,...item })) | ||||||
| 				value: item.id, |       console.log(this.rows[0][0].options); | ||||||
|         ...item |  | ||||||
| 			})); |  | ||||||
| 		}, | 		}, | ||||||
| 		updateDialogFormZ(val) { |     updateDialogFormZ(val) { | ||||||
|  |       // console.log(this.rows[0][0].options) | ||||||
| 			const selectData = this.rows[0][0].options.find( | 			const selectData = this.rows[0][0].options.find( | ||||||
| 				(item) => item.id === val.productMaterialId | 				(item) => item.id === val.productMaterialId | ||||||
| 			); | 			); | ||||||
|   | |||||||
| @@ -61,9 +61,9 @@ function getTodayStart(today) { | |||||||
|  |  | ||||||
| /** 颜色配置 */ | /** 颜色配置 */ | ||||||
| const types = [ | const types = [ | ||||||
|     { name: '运行', color: '#288AFF' }, |      { name: '运行', color: '#288AFF' }, | ||||||
|     { name: '故障', color: '#FC9C91' }, |  | ||||||
|     { name: '计划停机', color: '#FFDC94' }, |     { name: '计划停机', color: '#FFDC94' }, | ||||||
|  |     { name: '故障', color: '#FC9C91' }, | ||||||
|     { name: '空白', color: '#F2F4F9' }, |     { name: '空白', color: '#F2F4F9' }, | ||||||
| ]; | ]; | ||||||
|  |  | ||||||
| @@ -86,7 +86,7 @@ export default class GanttGraph { | |||||||
|                         <span class="eq-name" style="margin-left: 4px;">${params.seriesName}</span> |                         <span class="eq-name" style="margin-left: 4px;">${params.seriesName}</span> | ||||||
|                     </div> |                     </div> | ||||||
|                     <span class="run-status" style="margin-left: 8px; opacity: 0.6">${params.name}</span> |                     <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, |                     y: 0, | ||||||
|                 }, |                 }, | ||||||
|                 data: arr.map(item => ({ |                 data: arr.map(item => ({ | ||||||
|                     name: ['运行', '故障', '计划停机'][item.status], |                     name: ['运行', '计划停机', '故障'][item.status], | ||||||
|                     value: [0, item.startTime, item.startTime + item.duration * 60 * 1000, 0], |                     value: [0, item.startTime, item.startTime + item.duration * 60 * 1000, 0], | ||||||
|                     itemStyle: { |                     itemStyle: { | ||||||
|                         color: types[item.status].color, |                         color: types[item.status].color, | ||||||
| @@ -325,4 +325,4 @@ export default class GanttGraph { | |||||||
|         console.log(JSON.stringify(this.option, null, 2)); |         console.log(JSON.stringify(this.option, null, 2)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -6,29 +6,19 @@ | |||||||
| --> | --> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| 	<div |   <div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column"> | ||||||
| 		class="status-timegraph-container" |     <el-row class="" style=" | ||||||
| 		style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column"> |  | ||||||
| 		<el-row |  | ||||||
| 			class="" |  | ||||||
| 			style=" |  | ||||||
| 				margin-bottom: 12px; | 				margin-bottom: 12px; | ||||||
| 				background: #fff; | 				background: #fff; | ||||||
| 				padding: 16px 16px 0; | 				padding: 16px 16px 0; | ||||||
| 				border-radius: 8px; | 				border-radius: 8px; | ||||||
| 			"> | 			"> | ||||||
| 			<div class="blue-title">生产节拍时序图</div> |       <div class="blue-title">生产节拍时序图</div> | ||||||
| 			<SearchBar |       <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" :remove-blue="true" | ||||||
| 				:formConfigs="searchBarFormConfig" |         @select-changed="handleSearchBarSelectChange" @headBtnClick="handleSearchBarBtnClick" /> | ||||||
| 				ref="search-bar" |     </el-row> | ||||||
| 				:remove-blue="true" |  | ||||||
| 				@select-changed="handleSearchBarSelectChange" |  | ||||||
| 				@headBtnClick="handleSearchBarBtnClick" /> |  | ||||||
| 		</el-row> |  | ||||||
|  |  | ||||||
| 		<el-row |     <el-row class="" style=" | ||||||
| 			class="" |  | ||||||
| 			style=" |  | ||||||
| 				height: 1px; | 				height: 1px; | ||||||
| 				flex: 1; | 				flex: 1; | ||||||
| 				margin-bottom: 12px; | 				margin-bottom: 12px; | ||||||
| @@ -38,60 +28,40 @@ | |||||||
| 				display: flex; | 				display: flex; | ||||||
| 				flex-direction: column; | 				flex-direction: column; | ||||||
| 			"> | 			"> | ||||||
| 			<el-row :gutter="20"> |       <el-row :gutter="20"> | ||||||
| 				<el-col :span="6"> |         <el-col :span="6"> | ||||||
| 					<div class="blue-title">设备状态时序图</div> |           <div class="blue-title">设备状态时序图</div> | ||||||
| 				</el-col> |         </el-col> | ||||||
| 				<el-col :span="18" class="legend-row"> |         <el-col :span="18" class="legend-row"> | ||||||
| 					<div class="legend"> |           <div class="legend"> | ||||||
| 						<div class="icon running"></div> |             <div class="icon running"></div> | ||||||
| 						<div>运行中</div> |             <div>运行中</div> | ||||||
| 					</div> |           </div> | ||||||
| 					<div class="legend"> |           <div class="legend"> | ||||||
| 						<div class="icon fault"></div> |             <div class="icon stop"></div> | ||||||
| 						<div>故障</div> |             <div>计划停机</div> | ||||||
| 					</div> |           </div> | ||||||
| 					<div class="legend"> |           <div class="legend"> | ||||||
| 						<div class="icon stop"></div> |             <div class="icon fault"></div> | ||||||
| 						<div>计划停机</div> |             <div>故障</div> | ||||||
| 					</div> |           </div> | ||||||
| 				</el-col> |         </el-col> | ||||||
| 			</el-row> |       </el-row> | ||||||
| 			<div |       <div class="main-area" style="flex: 1; display: flex; flex-direction: column"> | ||||||
| 				class="main-area" |         <div class="graphs" v-show="graphList.length" id="status-chart" style="height: 1px; flex: 1"></div> | ||||||
| 				style="flex: 1; display: flex; flex-direction: column"> |         <h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2> | ||||||
| 				<div |       </div> | ||||||
| 					class="graphs" |     </el-row> | ||||||
| 					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 |     <base-dialog dialogTitle="添加设备" :dialogVisible="open" width="500px" @close="open = false" @cancel="open = false" | ||||||
| 			dialogTitle="添加设备" |       @confirm="submitForm"> | ||||||
| 			:dialogVisible="open" |       <el-select v-if="open" style="width: 100%" filterable clearable v-model="queryParams.equipmentId" | ||||||
| 			width="500px" |         placeholder="请选择一个设备"> | ||||||
| 			@close="open = false" |         <el-option v-for="eq in eqList" :key="eq.id" :value="eq.id" :label="eq.name"></el-option> | ||||||
| 			@cancel="open = false" |       </el-select> | ||||||
| 			@confirm="submitForm"> |     </base-dialog> | ||||||
| 			<el-select |   </div> | ||||||
| 				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> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
| @@ -103,12 +73,6 @@ export default { | |||||||
| 	components: {}, | 	components: {}, | ||||||
| 	props: {}, | 	props: {}, | ||||||
| 	data() { | 	data() { | ||||||
| 		const today = new Date(); |  | ||||||
| 		const todayStart = new Date( |  | ||||||
| 			today.getFullYear(), |  | ||||||
| 			today.getMonth(), |  | ||||||
| 			today.getDate() |  | ||||||
| 		); |  | ||||||
| 		return { | 		return { | ||||||
| 			chart: null, | 			chart: null, | ||||||
| 			searchBarFormConfig: [ | 			searchBarFormConfig: [ | ||||||
| @@ -138,7 +102,7 @@ export default { | |||||||
| 					placeholder: '选择日期', | 					placeholder: '选择日期', | ||||||
| 					param: 'recordTime', | 					param: 'recordTime', | ||||||
| 					required: true, | 					required: true, | ||||||
| 					defaultSelect: moment(todayStart).format('YYYY-MM-DD HH:mm:ss'), | 					defaultSelect:null, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: 'button', | ||||||
| @@ -191,14 +155,24 @@ export default { | |||||||
| 			// ], | 			// ], | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	computed: {}, |   computed: {}, | ||||||
| 	created() { |   created () { | ||||||
| 		this.initProductline(); |     this.initProductline(); | ||||||
| 		this.initWorksection(); |     this.initWorksection(); | ||||||
| 		this.initEquipment(); |     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(); | 		// this.getList(); | ||||||
| 	}, | 	}, | ||||||
| 	mounted() {}, | 	// mounted() {}, | ||||||
| 	watch: { | 	watch: { | ||||||
| 		graphList: { | 		graphList: { | ||||||
| 			handler(val) { | 			handler(val) { | ||||||
| @@ -246,7 +220,7 @@ export default { | |||||||
| 			}); | 			}); | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		async getList() { |     async getList() { | ||||||
| 			const { code, data } = await this.$axios({ | 			const { code, data } = await this.$axios({ | ||||||
| 				url: '/monitoring/equipment-monitor/status-series', | 				url: '/monitoring/equipment-monitor/status-series', | ||||||
| 				method: 'get', | 				method: 'get', | ||||||
| @@ -312,7 +286,7 @@ export default { | |||||||
| 			if (!value) { | 			if (!value) { | ||||||
| 				this.searchBarFormConfig[1].selectOptions = []; | 				this.searchBarFormConfig[1].selectOptions = []; | ||||||
| 				return; | 				return; | ||||||
| 			} |       } | ||||||
| 			switch (param) { | 			switch (param) { | ||||||
| 				case 'lineId': | 				case 'lineId': | ||||||
| 					this.$axios({ | 					this.$axios({ | ||||||
| @@ -322,7 +296,8 @@ export default { | |||||||
| 							id: value, | 							id: value, | ||||||
| 						}, | 						}, | ||||||
| 					}).then(({ code, data }) => { | 					}).then(({ code, data }) => { | ||||||
| 						if (code == 0) { |             if (code == 0) { | ||||||
|  |               this.searchBarFormConfig[1].defaultSelect = null | ||||||
| 							this.searchBarFormConfig[1].selectOptions = data.map((item) => { | 							this.searchBarFormConfig[1].selectOptions = data.map((item) => { | ||||||
| 								return { | 								return { | ||||||
| 									name: item.name, | 									name: item.name, | ||||||
|   | |||||||
| @@ -177,7 +177,7 @@ export default { | |||||||
|         name: '', |         name: '', | ||||||
| 				equipmentId: undefined, | 				equipmentId: undefined, | ||||||
|         equipmentCode: undefined, |         equipmentCode: undefined, | ||||||
|         enabled:undefined, |         enabled:1, | ||||||
|         // area: undefined, |         // area: undefined, | ||||||
| 				// specifications: undefined, | 				// specifications: undefined, | ||||||
| 				// processTime: 0, | 				// processTime: 0, | ||||||
|   | |||||||
| @@ -1,13 +1,8 @@ | |||||||
| <!-- | <!-- | ||||||
|  * @Author: zwq |  * @Author: zwq | ||||||
|  * @Date: 2021-11-18 14:16:25 |  * @Date: 2021-11-18 14:16:25 | ||||||
| <<<<<<< HEAD |  | ||||||
|  * @LastEditors: zhp |  * @LastEditors: zhp | ||||||
|  * @LastEditTime: 2023-11-28 10:09:20 |  * @LastEditTime: 2023-11-28 10:09:20 | ||||||
| ======= |  | ||||||
|  * @LastEditors: DY |  | ||||||
|  * @LastEditTime: 2023-11-27 16:37:17 |  | ||||||
| >>>>>>> projects/mes-test |  | ||||||
|  * @Description: |  * @Description: | ||||||
| --> | --> | ||||||
| <template> | <template> | ||||||
|   | |||||||
| @@ -274,7 +274,8 @@ export default { | |||||||
| 		async handleCopy(id) { | 		async handleCopy(id) { | ||||||
| 			this.$confirm('确认拷贝操作?', '提示', { | 			this.$confirm('确认拷贝操作?', '提示', { | ||||||
| 				confirmButtonText: '确 认', | 				confirmButtonText: '确 认', | ||||||
| 				cancelButtonText: '取 消', |         cancelButtonText: '取 消', | ||||||
|  |         type: 'info' | ||||||
| 			}) | 			}) | ||||||
| 				.then(async () => { | 				.then(async () => { | ||||||
| 					const { code } = await this.http( | 					const { code } = await this.http( | ||||||
| @@ -294,7 +295,8 @@ export default { | |||||||
| 		async handleDelete(id) { | 		async handleDelete(id) { | ||||||
| 			this.$confirm('确认删除这个工艺吗?', '提示', { | 			this.$confirm('确认删除这个工艺吗?', '提示', { | ||||||
| 				confirmButtonText: '确 认', | 				confirmButtonText: '确 认', | ||||||
| 				cancelButtonText: '取 消', |         cancelButtonText: '取 消', | ||||||
|  |         type: 'warning' | ||||||
| 			}) | 			}) | ||||||
| 				.then(async () => { | 				.then(async () => { | ||||||
| 					const { code } = await this.http( | 					const { code } = await this.http( | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| <!--  | <!-- | ||||||
|     filename: BomSelector.vue |     filename: BomSelector.vue | ||||||
|     author: liubin |     author: liubin | ||||||
|     date: 2023-11-17 16:23:28 |     date: 2023-11-17 16:23:28 | ||||||
|     description:  |     description: | ||||||
| --> | --> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| @@ -20,7 +20,7 @@ | |||||||
| 		</el-row> | 		</el-row> | ||||||
|  |  | ||||||
| 		<el-row v-if="filteredBomList.length" style="border: 1px solid #ccc; display: flex"> | 		<el-row v-if="filteredBomList.length" style="border: 1px solid #ccc; display: flex"> | ||||||
| 			<el-col :span="8"> | 			<el-col :span="12"> | ||||||
| 				<div class="select-list"> | 				<div class="select-list"> | ||||||
| 					<div class="sl__header" style="background: #f3f4fb; padding: 12px"> | 					<div class="sl__header" style="background: #f3f4fb; padding: 12px"> | ||||||
| 						<span style="">可分配设备</span> | 						<span style="">可分配设备</span> | ||||||
| @@ -47,7 +47,7 @@ | |||||||
| 					</div> | 					</div> | ||||||
| 				</div> | 				</div> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| 			<el-col :span="8" style="border-left: 1px solid #ccc"> | 			<el-col :span="6" style="border-left: 1px solid #ccc"> | ||||||
| 				<div class="select-list"> | 				<div class="select-list"> | ||||||
| 					<div class="sl__header" style="background: #f3f4fb; padding: 12px"> | 					<div class="sl__header" style="background: #f3f4fb; padding: 12px"> | ||||||
| 						<span style="">物料BOM</span> | 						<span style="">物料BOM</span> | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| <!--  | <!-- | ||||||
|     filename: ProcessBomList.vue |     filename: ProcessBomList.vue | ||||||
|     author: liubin |     author: liubin | ||||||
|     date: 2023-10-20 15:00:58 |     date: 2023-10-20 15:00:58 | ||||||
|     description:  |     description: | ||||||
| --> | --> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| @@ -185,7 +185,13 @@ export default { | |||||||
| 			this.btnLoading = true; | 			this.btnLoading = true; | ||||||
| 			// 现将子组件的修改提交更新至本组件 | 			// 现将子组件的修改提交更新至本组件 | ||||||
| 			this.$refs.bomSelector.commit(); | 			this.$refs.bomSelector.commit(); | ||||||
| 			// 再提交至后端 |       // 再提交至后端 | ||||||
|  |       const equMaterialBomId = this.selectedBoms.every(item => item.equMaterialBomId !== undefined && item.equMaterialBomId !== null && item.equMaterialBomId !== ''); | ||||||
|  |       const equValueBomId = this.selectedBoms.every(item => item.equValueBomId !== undefined && item.equValueBomId !== null && item.equValueBomId !== '') | ||||||
|  |       if (!equMaterialBomId || !equValueBomId) { | ||||||
|  |         this.btnLoading = false | ||||||
|  |         return this.$message.warning('请选择物料bom和参数bom'); | ||||||
|  |       } | ||||||
| 			this.$nextTick(async () => { | 			this.$nextTick(async () => { | ||||||
| 				console.log('selectedBoms', this.selectedBoms); | 				console.log('selectedBoms', this.selectedBoms); | ||||||
| 				if (this.selectedBoms.length) { | 				if (this.selectedBoms.length) { | ||||||
|   | |||||||
| @@ -1,41 +1,42 @@ | |||||||
| <!--  | <!-- | ||||||
|     filename: ProcessInfo.vue |     filename: ProcessInfo.vue | ||||||
|     author: liubin |     author: liubin | ||||||
|     date: 2023-10-20 15:00:58 |     date: 2023-10-20 15:00:58 | ||||||
|     description:  |     description: | ||||||
| --> | --> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
| 	<section class="process-info"> |   <section class="process-info"> | ||||||
| 		<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" /> |     <el-button style="position: absolute;right: 30px;z-index: 9999;" type="primary" plain @click="goBack">返回</el-button> | ||||||
|  |     <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" /> | ||||||
|  |  | ||||||
| 		<el-row :gutter="20"> |     <el-row :gutter="20"> | ||||||
| 			<el-col :span="6"> |       <el-col :span="6"> | ||||||
| 				<InfoItem label="工艺名称" :value="form.name" /> |         <InfoItem label="工艺名称" :value="form.name" /> | ||||||
| 			</el-col> |       </el-col> | ||||||
| 			<el-col :span="6"> |       <el-col :span="6"> | ||||||
| 				<InfoItem label="产线" :value="form.lineName" /> |         <InfoItem label="产线" :value="form.lineName" /> | ||||||
| 			</el-col> |       </el-col> | ||||||
| 			<el-col :span="12"> |       <el-col :span="12"> | ||||||
| 				<InfoItem label="工艺描述" :value="form.remark" /> |         <InfoItem label="工艺描述" :value="form.remark" /> | ||||||
| 			</el-col> |       </el-col> | ||||||
| 		</el-row> |     </el-row> | ||||||
|  |  | ||||||
| 		<el-row :gutter="20" style="margin-top: 12px"> |     <el-row :gutter="20" style="margin-top: 12px"> | ||||||
| 			<el-col :span="6"> |       <el-col :span="6"> | ||||||
| 				<!-- <InfoItem label="创建人" value="xxse" /> --> |         <!-- <InfoItem label="创建人" value="xxse" /> --> | ||||||
| 			</el-col> |       </el-col> | ||||||
| 			<el-col :span="6"> |       <el-col :span="6"> | ||||||
| 				<InfoItem label="创建时间" :value="form.createTime" :time-format="true" /> |         <InfoItem label="创建时间" :value="form.createTime" :time-format="true" /> | ||||||
| 			</el-col> |       </el-col> | ||||||
| 			<el-col :span="6"> |       <el-col :span="6"> | ||||||
| 				<!-- <InfoItem label="更新人" value="xxse" /> --> |         <!-- <InfoItem label="更新人" value="xxse" /> --> | ||||||
| 			</el-col> |       </el-col> | ||||||
| 			<el-col :span="6"> |       <el-col :span="6"> | ||||||
| 				<!-- <InfoItem label="更新时间" value="2023-10-22 10:11:00" /> --> |         <!-- <InfoItem label="更新时间" value="2023-10-22 10:11:00" /> --> | ||||||
| 			</el-col> |       </el-col> | ||||||
| 		</el-row> |     </el-row> | ||||||
| 	</section> |   </section> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
| @@ -49,7 +50,9 @@ const InfoItem = { | |||||||
| 		return {}; | 		return {}; | ||||||
| 	}, | 	}, | ||||||
| 	computed: {}, | 	computed: {}, | ||||||
| 	methods: {}, |   methods: { | ||||||
|  |  | ||||||
|  |   }, | ||||||
| 	render: function (h) { | 	render: function (h) { | ||||||
| 		return ( | 		return ( | ||||||
| 			<div style="display: flex; align-items: center; font-size: 14px; line-height: 1.5"> | 			<div style="display: flex; align-items: center; font-size: 14px; line-height: 1.5"> | ||||||
| @@ -99,7 +102,10 @@ export default { | |||||||
| 				params: method === 'get' ? payload : null, | 				params: method === 'get' ? payload : null, | ||||||
| 				data: method !== 'get' ? payload : null, | 				data: method !== 'get' ? payload : null, | ||||||
| 			}); | 			}); | ||||||
| 		}, |     }, | ||||||
|  |     goBack() { | ||||||
|  |       this.$router.go(-1); | ||||||
|  |     }, | ||||||
| 		put(payload) { | 		put(payload) { | ||||||
| 			return this.http(this.updateUrl, 'put', payload); | 			return this.http(this.updateUrl, 'put', payload); | ||||||
| 		}, | 		}, | ||||||
|   | |||||||
| @@ -177,7 +177,7 @@ export default { | |||||||
| 			immediate: true, | 			immediate: true, | ||||||
| 			deep: true | 			deep: true | ||||||
| 		} | 		} | ||||||
| 	}, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     handleSearchBarBtnClick(val) { |     handleSearchBarBtnClick(val) { | ||||||
|       console.log(val) |       console.log(val) | ||||||
| @@ -281,7 +281,7 @@ export default { | |||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|  | ` ` | ||||||
| <style scoped lang="scss"> | <style scoped lang="scss"> | ||||||
| .process-bom { | .process-bom { | ||||||
| 	position: relative; | 	position: relative; | ||||||
|   | |||||||
| @@ -288,7 +288,7 @@ export default { | |||||||
| 			if ( | 			if ( | ||||||
| 				moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM') | 				moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM') | ||||||
| 			) { | 			) { | ||||||
| 				num = Number(moment().format('DD')); | 				num = Number(moment().format('DD'))-1; | ||||||
| 			} else { | 			} else { | ||||||
| 				num = 0; | 				num = 0; | ||||||
| 			} | 			} | ||||||
|   | |||||||
| @@ -177,7 +177,9 @@ export default { | |||||||
|           res.data.list.forEach(item => { |           res.data.list.forEach(item => { | ||||||
|             if(item.isProduction){ |             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.list = res.data.list; | ||||||
| 					this.total = res.data.total; | 					this.total = res.data.total; | ||||||
|   | |||||||
| @@ -125,13 +125,15 @@ export default { | |||||||
| 			addButtonShow: '', | 			addButtonShow: '', | ||||||
| 			planArr: [], //排班计划数组 | 			planArr: [], //排班计划数组 | ||||||
| 			rules: { | 			rules: { | ||||||
| 				name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }], |  | ||||||
| 				startDay: [ | 				startDay: [ | ||||||
| 					{ required: true, message: '请选择排班开始时间', trigger: 'change' }, | 					{ required: true, message: '请选择排班开始时间', trigger: 'change' }, | ||||||
| 				], | 				], | ||||||
| 				endDay: [ | 				endDay: [ | ||||||
| 					{ required: true, message: '请选择排班结束时间', trigger: 'change' }, | 					{ required: true, message: '请选择排班结束时间', trigger: 'change' }, | ||||||
| 				], | 				], | ||||||
|  | 				planId:[ | ||||||
|  | 					{ required: true, message: '请选择排班计划', trigger: 'change' }, | ||||||
|  | 				] | ||||||
| 			}, | 			}, | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| @@ -231,6 +233,10 @@ export default { | |||||||
| 							}; | 							}; | ||||||
| 							list.push(obj); | 							list.push(obj); | ||||||
| 						}); | 						}); | ||||||
|  | 						if (list.length === 0) { | ||||||
|  | 							this.$modal.msgError('班组上班顺序不能为空'); | ||||||
|  | 							return false; | ||||||
|  | 						} | ||||||
| 						this.form.list = list; | 						this.form.list = list; | ||||||
| 						updateGroupRule({ ...this.form }).then((res) => { | 						updateGroupRule({ ...this.form }).then((res) => { | ||||||
| 							this.$modal.msgSuccess('操作成功'); | 							this.$modal.msgSuccess('操作成功'); | ||||||
| @@ -246,6 +252,10 @@ export default { | |||||||
| 							}; | 							}; | ||||||
| 							list.push(obj); | 							list.push(obj); | ||||||
| 						}); | 						}); | ||||||
|  | 						if (list.length === 0) { | ||||||
|  | 							this.$modal.msgError('班组上班顺序不能为空'); | ||||||
|  | 							return false; | ||||||
|  | 						} | ||||||
| 						this.form.list = list; | 						this.form.list = list; | ||||||
| 						createGroupRule({ ...this.form }).then((res) => { | 						createGroupRule({ ...this.form }).then((res) => { | ||||||
| 							this.$modal.msgSuccess('操作成功'); | 							this.$modal.msgSuccess('操作成功'); | ||||||
| @@ -268,13 +278,8 @@ export default { | |||||||
| 	margin-bottom: 5px; | 	margin-bottom: 5px; | ||||||
| } | } | ||||||
| .min-title::before { | .min-title::before { | ||||||
| 	content: ''; | 	content: "*"; | ||||||
| 	display: inline-block; | 	color: #ff5454; | ||||||
| 	vertical-align: middle; | 	margin-right: 4px; | ||||||
| 	width: 6px; |  | ||||||
| 	height: 6px; |  | ||||||
| 	border-radius: 50%; |  | ||||||
| 	margin: auto 5px; |  | ||||||
| 	background-color: #0b58ff; |  | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|   | |||||||
| @@ -46,6 +46,7 @@ import { | |||||||
| 	getGroupRule, | 	getGroupRule, | ||||||
| 	disableGroupRule | 	disableGroupRule | ||||||
| } from '@/api/base/groupSchedulingRule'; | } from '@/api/base/groupSchedulingRule'; | ||||||
|  | import { groupClassesListAll } from '@/api/monitoring/teamProduction'; | ||||||
| import schedulingRuleConfigAdd from './components/schedulingRuleConfigAdd.vue'; | import schedulingRuleConfigAdd from './components/schedulingRuleConfigAdd.vue'; | ||||||
| import { formatDate } from '@/utils'; | import { formatDate } from '@/utils'; | ||||||
| import tableHeightMixin from '@/mixins/tableHeightMixin'; | import tableHeightMixin from '@/mixins/tableHeightMixin'; | ||||||
| @@ -77,11 +78,13 @@ export default { | |||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			formConfig: [ | 			formConfig: [ | ||||||
| 				{ | 			{ | ||||||
| 					type: 'input', | 					type: 'select', | ||||||
| 					label: '班次', | 					label: '班次', | ||||||
| 					placeholder: '班次', | 					selectOptions: [], | ||||||
| 					param: 'name', | 					param: 'id', | ||||||
|  | 					defaultSelect: '', | ||||||
|  | 					filterable: true, | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					type: 'button', | 					type: 'button', | ||||||
| @@ -155,19 +158,35 @@ export default { | |||||||
| 			queryParams: { | 			queryParams: { | ||||||
| 				pageNo: 1, | 				pageNo: 1, | ||||||
| 				pageSize: 20, | 				pageSize: 20, | ||||||
| 				name: null, | 				id: null, | ||||||
| 			}, | 			}, | ||||||
|  | 			classNameList:[] | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	created() { | 	created() { | ||||||
|  | 		this.getClassNameList(); | ||||||
| 		this.getList(); | 		this.getList(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		getClassNameList() { | ||||||
|  | 		  groupClassesListAll().then((res) => { | ||||||
|  | 				this.formConfig[0].selectOptions = res.data; | ||||||
|  | 				this.classNameList = res.data; | ||||||
|  | 		  }) | ||||||
|  | 		}, | ||||||
| 		buttonClick(val) { | 		buttonClick(val) { | ||||||
| 			switch (val.btnName) { | 			switch (val.btnName) { | ||||||
| 				case 'search': | 				case 'search': | ||||||
| 					this.queryParams.pageNo = 1; | 					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(); | 					this.getList(); | ||||||
| 					break; | 					break; | ||||||
| 				default: | 				default: | ||||||
| @@ -187,7 +206,7 @@ export default { | |||||||
| 							formatDate(item.startDay) + | 							formatDate(item.startDay) + | ||||||
| 							'至' + | 							'至' + | ||||||
| 							(item.endDay ? formatDate(item.endDay) : '永久'); | 							(item.endDay ? formatDate(item.endDay) : '永久'); | ||||||
| 						item.str = item.strList.join(','); | 						item.str = item.strList.join(','); | ||||||
| 					}); | 					}); | ||||||
| 					this.list = res.data.list; | 					this.list = res.data.list; | ||||||
| 					this.total = res.data.total; | 					this.total = res.data.total; | ||||||
|   | |||||||
| @@ -13,6 +13,8 @@ | |||||||
|           </el-col> |           </el-col> | ||||||
|         </el-row> |         </el-row> | ||||||
|         <base-table |         <base-table | ||||||
|  |           :page="1" | ||||||
|  |           :limit="5000" | ||||||
|           :table-props="tableProps" |           :table-props="tableProps" | ||||||
|           :table-data="tableData" |           :table-data="tableData" | ||||||
|           :max-height="tableH" |           :max-height="tableH" | ||||||
| @@ -43,7 +45,7 @@ const tableProps = [ | |||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     prop: 'workTime', |     prop: 'workTime', | ||||||
|     label: '工作时长' |     label: '工作时长(h)' | ||||||
|   } |   } | ||||||
| ] | ] | ||||||
| export default { | export default { | ||||||
|   | |||||||
| @@ -62,7 +62,8 @@ export default { | |||||||
|           selectOptions: [], |           selectOptions: [], | ||||||
|           param: 'workOrderId', |           param: 'workOrderId', | ||||||
|           clearable: false, |           clearable: false, | ||||||
|           filterable: true |           filterable: true, | ||||||
|  |           required: true | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|           type: 'button', |           type: 'button', | ||||||
|   | |||||||
| @@ -38,6 +38,7 @@ import { groupTeamSchedulingPage, groupClassesListAll } from '@/api/monitoring/t | |||||||
| import { parseTime } from '@/utils/ruoyi' | import { parseTime } from '@/utils/ruoyi' | ||||||
| import TeamProductionDetail from './components/teamProductionDetail' | import TeamProductionDetail from './components/teamProductionDetail' | ||||||
| import tableHeightMixin from '@/mixins/tableHeightMixin'; | import tableHeightMixin from '@/mixins/tableHeightMixin'; | ||||||
|  | import moment from 'moment' | ||||||
| const tableProps = [ | const tableProps = [ | ||||||
|   { |   { | ||||||
|     prop: 'createTime', |     prop: 'createTime', | ||||||
| @@ -53,14 +54,12 @@ const tableProps = [ | |||||||
|   { |   { | ||||||
|     prop: 'startTime', |     prop: 'startTime', | ||||||
|     label: '上班时间', |     label: '上班时间', | ||||||
|     filter: parseTime, |     filter: (val) => moment(val).format('HH:mm') | ||||||
|     minWidth: 160 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     prop: 'endTime', |     prop: 'endTime', | ||||||
|     label: '下班时间', |     label: '下班时间', | ||||||
|     filter: parseTime, |     filter: (val) => moment(val).format('HH:mm') | ||||||
|     minWidth: 160 |  | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     prop: 'classesName', |     prop: 'classesName', | ||||||
| @@ -70,7 +69,8 @@ const tableProps = [ | |||||||
|   { |   { | ||||||
|     prop: 'teamName', |     prop: 'teamName', | ||||||
|     label: '班组名称', |     label: '班组名称', | ||||||
|     showOverflowtooltip: true |     showOverflowtooltip: true, | ||||||
|  |     minWidth: 100 | ||||||
|   } |   } | ||||||
| ] | ] | ||||||
| export default { | export default { | ||||||
|   | |||||||
| @@ -176,7 +176,6 @@ import { | |||||||
| } from "@/utils/constants"; | } from "@/utils/constants"; | ||||||
| import { getSpuSimpleList } from "@/api/mall/product/spu"; | import { getSpuSimpleList } from "@/api/mall/product/spu"; | ||||||
| import { parseTime } from "@/utils/ruoyi"; | import { parseTime } from "@/utils/ruoyi"; | ||||||
| import {changeRoleStatus} from "@/api/system/role"; |  | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
|   name: "PromotionCouponTemplate", |   name: "PromotionCouponTemplate", | ||||||
|   | |||||||
| @@ -154,8 +154,15 @@ export default { | |||||||
| 						required: true, | 						required: true, | ||||||
| 						message: '物料产品类型不能为空', | 						message: '物料产品类型不能为空', | ||||||
| 						trigger: 'blur', | 						trigger: 'blur', | ||||||
| 					}, |           }, | ||||||
| 				], |         ], | ||||||
|  |         specifications: [ | ||||||
|  |           { | ||||||
|  |             required: true, | ||||||
|  |             message: '规格不能为空', | ||||||
|  |             trigger: 'blur', | ||||||
|  |           }, | ||||||
|  |         ], | ||||||
| 			}, | 			}, | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
|   | |||||||
| @@ -123,8 +123,10 @@ export default { | |||||||
|         typeId:typeId |         typeId:typeId | ||||||
|       } |       } | ||||||
| 			const materData = await getMaterialList(listQuery); | 			const materData = await getMaterialList(listQuery); | ||||||
| 			this.materialList = []; |       this.materialList = []; | ||||||
| 			this.materialList = materData.data; |       console.log('materData', materData); | ||||||
|  |  | ||||||
|  |       this.materialList = materData.data.filter(item => item.typeId === 2) | ||||||
| 		}, | 		}, | ||||||
| 		init(id) { | 		init(id) { | ||||||
| 			this.dataForm.id = id || ''; | 			this.dataForm.id = id || ''; | ||||||
|   | |||||||
| @@ -6,138 +6,75 @@ | |||||||
|  * @Description: |  * @Description: | ||||||
| --> | --> | ||||||
| <template> | <template> | ||||||
| 	<el-form |   <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px" | ||||||
| 		:model="dataForm" |     label-position="top"> | ||||||
| 		:rules="dataRule" |     <el-row :gutter="20"> | ||||||
| 		ref="dataForm" |       <el-col :span="8"> | ||||||
| 		@keyup.enter.native="dataFormSubmit()" |         <el-form-item label="物料名称" prop="materialId"> | ||||||
| 		label-width="80px" |           <el-select v-model="dataForm.materialId" placeholder="请选择物料" clearable filterable @change="setCode" | ||||||
| 		label-position="top"> |             style="width: 100%"> | ||||||
| 		<el-row :gutter="20"> |             <el-option v-for="dict in materialList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||||
| 			<el-col :span="8"> |           </el-select> | ||||||
| 				<el-form-item label="物料名称" prop="materialId"> |         </el-form-item> | ||||||
| 					<el-select |       </el-col> | ||||||
| 						v-model="dataForm.materialId" |       <el-col :span="8"> | ||||||
| 						placeholder="请选择物料" |         <el-form-item label="物料编码" prop="materialCode"> | ||||||
| 						clearable |           <el-input v-model="dataForm.materialCode" clearable disabled placeholder="请输入物料编码" /> | ||||||
| 						filterable |         </el-form-item> | ||||||
| 						@change="setCode" |       </el-col> | ||||||
| 						style="width: 100%"> |       <el-col :span="8"> | ||||||
| 						<el-option |         <el-form-item label="物料批次" prop="materialDate"> | ||||||
| 							v-for="dict in materialList" |           <el-select v-model="dataForm.materialDate" clearable filterable allow-create placeholder="请选择物料批次" | ||||||
| 							:key="dict.id" |             style="width: 100%"> | ||||||
| 							:label="dict.name" |             <el-option v-for="dict in materialDateList" :key="dict.id" :label="dict.code" :value="dict.code" /> | ||||||
| 							:value="dict.id" /> |           </el-select> | ||||||
| 					</el-select> |         </el-form-item> | ||||||
| 				</el-form-item> |       </el-col> | ||||||
| 			</el-col> |     </el-row> | ||||||
| 			<el-col :span="8"> |     <el-row :gutter="20"> | ||||||
| 				<el-form-item label="物料编码" prop="materialCode"> |       <el-col :span="8"> | ||||||
| 					<el-input |         <el-form-item label="使用设备" prop="equipmentId"> | ||||||
| 						v-model="dataForm.materialCode" |           <el-select v-model="dataForm.equipmentId" clearable filterable placeholder="请选择使用设备" style="width: 100%"> | ||||||
| 						clearable |             <el-option v-for="dict in eqList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||||
| 						disabled |           </el-select> | ||||||
| 						placeholder="请输入物料编码" /> |         </el-form-item> | ||||||
| 				</el-form-item> |       </el-col> | ||||||
| 			</el-col> |       <el-col :span="8"> | ||||||
| 			<el-col :span="8"> |         <el-form-item label="使用时间" prop="useTime"> | ||||||
| 				<el-form-item label="物料批次" prop="materialDate"> |           <el-date-picker v-model="dataForm.useTime" type="datetime" style="width: 100%" format="yyyy-MM-dd HH:mm:ss" | ||||||
| 					<el-select |             value-format="timestamp" placeholder="选择日期时间" /> | ||||||
| 						v-model="dataForm.materialDate" |         </el-form-item> | ||||||
| 						clearable |       </el-col> | ||||||
| 						filterable |       <el-col :span="8"> | ||||||
| 						allow-create |         <el-form-item label="操作员" prop="userNames"> | ||||||
| 						placeholder="请选择物料批次" |           <el-select v-model="dataForm.userNames" clearable filterable multiple placeholder="请选择操作员" | ||||||
| 						style="width: 100%"> |             style="width: 100%"> | ||||||
| 						<el-option |             <el-option v-for="dict in workersList" :key="dict.id" :label="dict.nickname" :value="dict.nickname" /> | ||||||
| 							v-for="dict in materialDateList" |           </el-select> | ||||||
| 							:key="dict.id" |         </el-form-item> | ||||||
| 							:label="dict.code" |       </el-col> | ||||||
| 							:value="dict.code" /> |     </el-row> | ||||||
| 					</el-select> |     <el-row :gutter="20"> | ||||||
| 				</el-form-item> |       <el-col :span="8"> | ||||||
| 			</el-col> |         <el-form-item label="使用数量" prop="num"> | ||||||
| 		</el-row> |           <el-input-number v-model="dataForm.num" clearable controls-position="right" placeholder="请输入使用数量" | ||||||
| 		<el-row :gutter="20"> |             style="width: 100%" /> | ||||||
| 			<el-col :span="8"> |         </el-form-item> | ||||||
| 				<el-form-item label="使用设备" prop="equipmentId"> |       </el-col> | ||||||
| 					<el-select |       <el-col :span="8"> | ||||||
| 						v-model="dataForm.equipmentId" |         <el-form-item label="数据来源" prop="source"> | ||||||
| 						clearable |           <el-select v-model="dataForm.source" clearable placeholder="请选择数据来源" style="width: 100%"> | ||||||
| 						filterable |             <el-option v-for="dict in this.dataSourceList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||||
| 						placeholder="请选择使用设备" |           </el-select> | ||||||
| 						style="width: 100%"> |         </el-form-item> | ||||||
| 						<el-option |       </el-col> | ||||||
| 							v-for="dict in eqList" |       <el-col :span="8"> | ||||||
| 							:key="dict.id" |         <el-form-item label="备注" prop="remark"> | ||||||
| 							:label="dict.name" |           <el-input v-model="dataForm.remark" clearable placeholder="请输入备注" /> | ||||||
| 							:value="dict.id" /> |         </el-form-item> | ||||||
| 					</el-select> |       </el-col> | ||||||
| 				</el-form-item> |     </el-row> | ||||||
| 			</el-col> |   </el-form> | ||||||
| 			<el-col :span="8"> |  | ||||||
| 				<el-form-item label="使用时间" prop="useTime"> |  | ||||||
| 					<el-date-picker |  | ||||||
| 						v-model="dataForm.useTime" |  | ||||||
| 						type="datetime" |  | ||||||
| 						format="yyyy-MM-dd HH:mm:ss" |  | ||||||
| 						value-format="timestamp" |  | ||||||
| 						placeholder="选择日期时间" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="8"> |  | ||||||
| 				<el-form-item label="操作员" prop="userNames"> |  | ||||||
| 					<el-select |  | ||||||
| 						v-model="dataForm.userNames" |  | ||||||
| 						clearable |  | ||||||
| 						filterable |  | ||||||
| 						multiple |  | ||||||
| 						placeholder="请选择操作员" |  | ||||||
| 						style="width: 100%"> |  | ||||||
| 						<el-option |  | ||||||
| 							v-for="dict in workersList" |  | ||||||
| 							:key="dict.id" |  | ||||||
| 							:label="dict.nickname" |  | ||||||
| 							:value="dict.nickname" /> |  | ||||||
| 					</el-select> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 		</el-row> |  | ||||||
| 		<el-row :gutter="20"> |  | ||||||
| 			<el-col :span="8"> |  | ||||||
| 				<el-form-item label="使用数量" prop="num"> |  | ||||||
| 					<el-input-number |  | ||||||
| 						v-model="dataForm.num" |  | ||||||
| 						clearable |  | ||||||
| 						controls-position="right" |  | ||||||
| 						placeholder="请输入使用数量" |  | ||||||
| 						style="width: 100%" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="8"> |  | ||||||
| 				<el-form-item label="数据来源" prop="source"> |  | ||||||
| 					<el-select |  | ||||||
| 						v-model="dataForm.source" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请选择数据来源"> |  | ||||||
| 						<el-option |  | ||||||
| 							v-for="dict in this.dataSourceList" |  | ||||||
| 							:key="dict.id" |  | ||||||
| 							:label="dict.name" |  | ||||||
| 							:value="dict.id" /> |  | ||||||
| 					</el-select> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 			<el-col :span="8"> |  | ||||||
| 				<el-form-item label="备注" prop="remark"> |  | ||||||
| 					<el-input |  | ||||||
| 						v-model="dataForm.remark" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请输入备注" /> |  | ||||||
| 				</el-form-item> |  | ||||||
| 			</el-col> |  | ||||||
| 		</el-row> |  | ||||||
| 	</el-form> |  | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
|   | |||||||
| @@ -91,7 +91,13 @@ export default { | |||||||
| 					btnName: '查询', | 					btnName: '查询', | ||||||
| 					name: 'search', | 					name: 'search', | ||||||
| 					color: 'primary', | 					color: 'primary', | ||||||
| 				}, |         }, | ||||||
|  |         { | ||||||
|  |           type: 'button', | ||||||
|  |           btnName: '返回', | ||||||
|  |           name: 'return', | ||||||
|  |           color: 'primary', | ||||||
|  |         }, | ||||||
| 			], | 			], | ||||||
| 			queryParams: { | 			queryParams: { | ||||||
| 				equipmentId: null, | 				equipmentId: null, | ||||||
| @@ -278,19 +284,24 @@ export default { | |||||||
| 			); | 			); | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
| 		async handleSearchBarBtnClick({ btnName, timeVal }) { |     async handleSearchBarBtnClick({ btnName, timeVal }) { | ||||||
| 			if (timeVal && timeVal.length > 0) { |       console.log(btnName); | ||||||
| 				console.log('nihc ', timeVal) |       if (btnName === 'search') { | ||||||
| 				if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 30 * 60 * 1000) { |         if (timeVal && timeVal.length > 0) { | ||||||
| 					this.queryParams.recordTime = timeVal; |           console.log('nihc ', timeVal) | ||||||
| 					await this.handleQuery(); |           if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 30 * 60 * 1000) { | ||||||
| 				} else { |             this.queryParams.recordTime = timeVal; | ||||||
| 					this.$message.warning('时间范围最大30分钟限制!') |             await this.handleQuery(); | ||||||
| 				} |           } else { | ||||||
| 			} else { |             this.$message.warning('时间范围最大30分钟限制!') | ||||||
| 				this.queryParams.recordTime = []; |           } | ||||||
| 				this.$message.warning('时间段必选!') |         } 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> |  | ||||||
							
								
								
									
										65
									
								
								src/views/packaging/custom/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								src/views/packaging/custom/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,65 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2023-08-01 15:27:31 | ||||||
|  |  * @LastEditors: zwq | ||||||
|  |  * @LastEditTime: 2023-08-01 16:25:54 | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  | 	<div :class="[className, { 'p-0': noPadding }]"> | ||||||
|  | 		<slot /> | ||||||
|  | 	</div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  | 	props: { | ||||||
|  | 		size: { | ||||||
|  | 			// 取值范围:  xl lg md sm | ||||||
|  | 			type: String, | ||||||
|  | 			default: 'de', | ||||||
|  | 			validator: function (val) { | ||||||
|  | 				return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1; | ||||||
|  | 			}, | ||||||
|  | 		}, | ||||||
|  | 		noPadding: { | ||||||
|  | 			type: Boolean, | ||||||
|  | 			default: false, | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | 	computed: { | ||||||
|  | 		className: function () { | ||||||
|  | 			return `${this.size}-title`; | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | $pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px); | ||||||
|  | $mgr: 8px; | ||||||
|  | @each $size, $height in $pxls { | ||||||
|  | 	.#{$size}-title { | ||||||
|  | 		font-size: 18px; | ||||||
|  | 		line-height: $height; | ||||||
|  | 		color: #000; | ||||||
|  | 		font-weight: 500; | ||||||
|  | 		font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif; | ||||||
|  |  | ||||||
|  | 		&::before { | ||||||
|  | 			content: ''; | ||||||
|  | 			display: inline-block; | ||||||
|  | 			vertical-align: top; | ||||||
|  | 			width: 4px; | ||||||
|  | 			height: $height + 2px; | ||||||
|  | 			border-radius: 1px; | ||||||
|  | 			margin-right: $mgr; | ||||||
|  | 			background-color: #0b58ff; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .p-0 { | ||||||
|  | 	padding: 0; | ||||||
|  | } | ||||||
|  | </style> | ||||||
							
								
								
									
										409
									
								
								src/views/packaging/custom/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										409
									
								
								src/views/packaging/custom/index.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,409 @@ | |||||||
|  | <template> | ||||||
|  |   <el-drawer :visible.sync="drawer" :append-to-body="true" size="80%" > | ||||||
|  |     <small-title slot="title" :no-padding="true"> | ||||||
|  |       <!-- <template v-for="demo in demoList"> --> | ||||||
|  |       <!-- <el-button :key="demo.name" :type="demo.name === curDemo ? 'primary' : ' '" @click="curDemo = demo.name"> --> | ||||||
|  |       <!-- {{ $t('module.packingManage.printModelDesign') }} --> | ||||||
|  |       模板设计 | ||||||
|  |       <!-- </el-button> --> | ||||||
|  |       <!-- </template> --> | ||||||
|  |     </small-title> | ||||||
|  |     <el-card> | ||||||
|  |       <el-row style="margin-bottom: 10px"> | ||||||
|  |         <el-col :span="4"> | ||||||
|  |           <!-- 模板选择 --> | ||||||
|  |  | ||||||
|  |           <!-- <el-select | ||||||
|  |           v-model="mode" | ||||||
|  |           filterable | ||||||
|  |           :default-value="0" | ||||||
|  |           option-label-prop="label" | ||||||
|  |           style="width: 100%;" | ||||||
|  |           @change="changeMode" | ||||||
|  |         > | ||||||
|  |           <el-option v-for="(opt,idx) in modeList" :key="idx" :label="opt.name" :value="idx"> | ||||||
|  |             {{ opt.name }} | ||||||
|  |           </el-option> | ||||||
|  |         </el-select> --> | ||||||
|  |         </el-col> | ||||||
|  |         <el-col :span="20"> | ||||||
|  |           <!-- 纸张设置 --> | ||||||
|  |           <el-button-group style="margin:0 10px"> | ||||||
|  |             <el-button v-for="(value,type) in paperTypes" :key="type" :type="curPaperType === type ? 'primary' : ' '" | ||||||
|  |               @click="setPaper(type,value)"> | ||||||
|  |               {{ type }} | ||||||
|  |             </el-button> | ||||||
|  |           </el-button-group> | ||||||
|  |           <el-input-number style="margin:0 10px" :value="scaleValue " :precision="2" :step="0.1" :min="scaleMin" | ||||||
|  |             :max="scaleMax" @change="changeScale" /> | ||||||
|  |           <el-popover v-model="paperPopVisible" placement="bottom" width="300" title="设置纸张宽高(mm)"> | ||||||
|  |             <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px"> | ||||||
|  |               <el-input v-model="paperWidth" type="number" style=" width: 100px; text-align: center" place="宽(mm)" />~ | ||||||
|  |               <el-input v-model="paperHeight" type="number" style=" width: 100px; text-align: center" place="高(mm)" /> | ||||||
|  |             </div> | ||||||
|  |             <div> | ||||||
|  |               <el-button type="primary" style="width: 100%" size="mini" @click="otherPaper">确定</el-button> | ||||||
|  |             </div> | ||||||
|  |             <el-button slot="reference" type="primary" style="margin:0 10px">自定义宽高</el-button> | ||||||
|  |           </el-popover> | ||||||
|  |  | ||||||
|  |           <!--          <a-button-group>--> | ||||||
|  |           <!--            <template v-for="(value,type) in paperTypes">--> | ||||||
|  |           <!--              <a-button :type="curPaperType === type ? 'primary' : 'info'" @click="setPaper(type,value)" :key="type">--> | ||||||
|  |           <!--                {{ type }}--> | ||||||
|  |           <!--              </a-button>--> | ||||||
|  |           <!--            </template>--> | ||||||
|  |           <!--            <a-popover v-model="paperPopVisible" title="设置纸张宽高(mm)" trigger="click">--> | ||||||
|  |           <!--              <div slot="content">--> | ||||||
|  |           <!--                <a-input-group compact style="margin: 10px 10px">--> | ||||||
|  |           <!--                  <a-input type="number" v-model="paperWidth" style=" width: 100px; text-align: center"--> | ||||||
|  |           <!--                           placeholder="宽(mm)"/>--> | ||||||
|  |           <!--                  <a-input style=" width: 30px; border-left: 0; pointer-events: none; backgroundColor: #fff"--> | ||||||
|  |           <!--                           placeholder="~" disabled--> | ||||||
|  |           <!--                  />--> | ||||||
|  |           <!--                  <a-input type="number" v-model="paperHeight" style="width: 100px; text-align: center; border-left: 0"--> | ||||||
|  |           <!--                           placeholder="高(mm)"/>--> | ||||||
|  |           <!--                </a-input-group>--> | ||||||
|  |           <!--                <a-button type="primary" style="width: 100%" @click="otherPaper">确定</a-button>--> | ||||||
|  |           <!--              </div>--> | ||||||
|  |           <!--              <a-button :type="'other'==curPaperType?'primary':''">自定义纸张</a-button>--> | ||||||
|  |           <!--            </a-popover>--> | ||||||
|  |           <!--          </a-button-group>--> | ||||||
|  |  | ||||||
|  |           <!-- 预览/打印 --> | ||||||
|  |           <el-button-group> | ||||||
|  |             <el-button type="primary" icon="redo" @click="rotatePaper()">旋转</el-button> | ||||||
|  |             <el-button type="primary" icon="el-icon-view" @click="preView"> | ||||||
|  |               预览 | ||||||
|  |             </el-button> | ||||||
|  |             <!-- <el-button type="primary" icon="el-icon-printer" @click="print"> | ||||||
|  |             直接打印 | ||||||
|  |           </el-button> --> | ||||||
|  |             <el-button type="primary" icon="el-icon-s-management" @click="save"> | ||||||
|  |               保存 | ||||||
|  |             </el-button> | ||||||
|  |             <el-button type="danger" icon="el-icon-delete" @click="clearPaper"> | ||||||
|  |               清空 | ||||||
|  |             </el-button> | ||||||
|  |           </el-button-group> | ||||||
|  |           <!-- 保存/清空 --> | ||||||
|  |  | ||||||
|  |         </el-col> | ||||||
|  |       </el-row> | ||||||
|  |       <el-row :gutter="24"> | ||||||
|  |         <el-col :span="4"> | ||||||
|  |           <el-card style="height: 100vh"> | ||||||
|  |             <el-row> | ||||||
|  |               <el-col :span="24" class="rect-printElement-types hiprintEpContainer" /> | ||||||
|  |             </el-row> | ||||||
|  |           </el-card> | ||||||
|  |         </el-col> | ||||||
|  |         <el-col :span="16"> | ||||||
|  |           <el-card class="card-design"> | ||||||
|  |             <div id="hiprint-printTemplate" class="hiprint-printTemplate" /> | ||||||
|  |           </el-card> | ||||||
|  |         </el-col> | ||||||
|  |         <el-col :span="4" class="params_setting_container"> | ||||||
|  |           <el-card> | ||||||
|  |             <el-row class="hinnn-layout-sider"> | ||||||
|  |               <div id="PrintElementOptionSetting" /> | ||||||
|  |             </el-row> | ||||||
|  |           </el-card> | ||||||
|  |         </el-col> | ||||||
|  |       </el-row> | ||||||
|  |       <!-- 预览 --> | ||||||
|  |       <print-preview ref="preView" /> | ||||||
|  |     </el-card> | ||||||
|  |   </el-drawer> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  |  | ||||||
|  | import printPreview from './preview' | ||||||
|  | import { MessageBox } from 'element-ui' | ||||||
|  | import { hiprint } from 'vue-plugin-hiprint' | ||||||
|  | import providers from './providers' | ||||||
|  | // import printData from './print-data' | ||||||
|  | import $ from 'jquery' | ||||||
|  | import SmallTitle from './SmallTitle.vue' | ||||||
|  | let hiprintTemplate = null | ||||||
|  | export default { | ||||||
|  |   name: 'PrintCustom', | ||||||
|  |   components: { printPreview, SmallTitle }, | ||||||
|  |   // props: { | ||||||
|  |   //   modelData: { | ||||||
|  |   //     type: String, | ||||||
|  |   //     default: '' | ||||||
|  |   //   } | ||||||
|  |   // }, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       // paperPopVisible: false, | ||||||
|  |       // 模板选择 | ||||||
|  |       mode: 0, | ||||||
|  |       template: null, | ||||||
|  |       modeList: [], | ||||||
|  |       // 当前纸张 | ||||||
|  |       curPaper: { | ||||||
|  |         // type: 'other', | ||||||
|  |         // width: 220, | ||||||
|  |         // height: 80 | ||||||
|  |       }, | ||||||
|  |       printData:{}, | ||||||
|  |       drawer: false, | ||||||
|  |       // 纸张类型 | ||||||
|  |       paperTypes: { | ||||||
|  |         'A3': { | ||||||
|  |           width: 420, | ||||||
|  |           height: 296.6 | ||||||
|  |         }, | ||||||
|  |         'A4': { | ||||||
|  |           width: 210, | ||||||
|  |           height: 297 | ||||||
|  |         }, | ||||||
|  |         'A5': { | ||||||
|  |           width: 210, | ||||||
|  |           height: 147.6 | ||||||
|  |         }, | ||||||
|  |         'B3': { | ||||||
|  |           width: 500, | ||||||
|  |           height: 352.6 | ||||||
|  |         }, | ||||||
|  |         'B4': { | ||||||
|  |           width: 250, | ||||||
|  |           height: 352.6 | ||||||
|  |         }, | ||||||
|  |         'B5': { | ||||||
|  |           width: 250, | ||||||
|  |           height: 175.6 | ||||||
|  |         } | ||||||
|  |       }, | ||||||
|  |       scaleValue: 1, | ||||||
|  |       scaleMax: 5, | ||||||
|  |       scaleMin: 0.5, | ||||||
|  |       // 自定义纸张 | ||||||
|  |       paperPopVisible: false, | ||||||
|  |       paperWidth: '210', | ||||||
|  |       paperHeight: '297' | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   computed: { | ||||||
|  |     curPaperType() { | ||||||
|  |       let type = 'other' | ||||||
|  |       const types = this.paperTypes | ||||||
|  |       for (const key in types) { | ||||||
|  |         const item = types[key] | ||||||
|  |         const { width, height } = this.curPaper | ||||||
|  |         if (item.width === width && item.height === height) { | ||||||
|  |           type = key | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       return type | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   created() { | ||||||
|  |     // $('.hiprintEpContainer').empty() | ||||||
|  |   }, | ||||||
|  |   destroyed () { | ||||||
|  |     $('.hiprintEpContainer').empty() | ||||||
|  |     console.log(11111) | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     // handleClose() { | ||||||
|  |     //   $('.hiprintEpContainer').empty() | ||||||
|  |     // }, | ||||||
|  |     closed() { | ||||||
|  |       $('.hiprintEpContainer').empty() | ||||||
|  |       $('.hiprint-printTemplate').empty() | ||||||
|  |     }, | ||||||
|  |     init(data) { | ||||||
|  |       this.drawer = true | ||||||
|  |       this.modelData = data | ||||||
|  |       this.modeList = providers.map((e) => { | ||||||
|  |         return { type: e.type, name: e.name, value: e.value } | ||||||
|  |       }) | ||||||
|  |       this.changeMode() | ||||||
|  |     }, | ||||||
|  |     changeMode() { | ||||||
|  |       // hiprintTemplate.clear() | ||||||
|  |       // console.log(this.modelData) | ||||||
|  |       this.$nextTick(() => { | ||||||
|  |         const { mode } = this | ||||||
|  |         const provider = providers[mode] | ||||||
|  |         hiprint.init({ | ||||||
|  |           providers: [provider.f] | ||||||
|  |         }) | ||||||
|  |  | ||||||
|  |         // $('#hiprint-printTemplate').empty() | ||||||
|  |         // console.log(JSON.parse(this.modelData)) | ||||||
|  |         hiprint.setConfig() | ||||||
|  |         // 替换配置 | ||||||
|  |         hiprint.setConfig({ | ||||||
|  |           movingDistance: 2.5, | ||||||
|  |           text: { | ||||||
|  |             supportOptions: [ | ||||||
|  |               { | ||||||
|  |                 name: 'styler', | ||||||
|  |                 hidden: true | ||||||
|  |               }, | ||||||
|  |               { | ||||||
|  |                 name: 'formatter', | ||||||
|  |                 hidden: true | ||||||
|  |               } | ||||||
|  |             ] | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |  | ||||||
|  |         // console.log(this.modelData) | ||||||
|  |         // console.log($('#hiprint-printTemplate').empty()) | ||||||
|  |         // if () { | ||||||
|  |           // console.log(this.modelData); | ||||||
|  |           // $('.hiprintEpContainer').empty() | ||||||
|  |           // hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value) | ||||||
|  |           // $('.hiprint-printTemplate').empty() | ||||||
|  |           // hiprintTemplate = new hiprint.PrintTemplate({ | ||||||
|  |           //   template: JSON.parse(this.modelData), | ||||||
|  |           //   settingContainer: '#PrintElementOptionSetting', | ||||||
|  |           //   paginationContainer: '.hiprint-printPagination' | ||||||
|  |           // }) | ||||||
|  |         // } else { | ||||||
|  |           $('.hiprintEpContainer').empty() | ||||||
|  |           console.log(this.modelData); | ||||||
|  |           hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value) | ||||||
|  |           $('.hiprint-printTemplate').empty() | ||||||
|  |           // const templates = this.$ls.get('KEY_TEMPLATES', {}) | ||||||
|  |           const template = provider.value | ||||||
|  |           // console.log(template) | ||||||
|  |           hiprintTemplate = new hiprint.PrintTemplate({ | ||||||
|  |             template: this.modelData != '' ? JSON.parse(this.modelData) : {}, | ||||||
|  |             settingContainer: '#PrintElementOptionSetting', | ||||||
|  |             paginationContainer: '.hiprint-printPagination' | ||||||
|  |           }) | ||||||
|  |         // } | ||||||
|  |         hiprintTemplate.design('#hiprint-printTemplate') | ||||||
|  |         // console.log(hiprintTemplate) | ||||||
|  |         console.log(hiprintTemplate); | ||||||
|  |         // hiprintTemplate.design('#hiprint-printTemplate', { grid: true }) | ||||||
|  |         // 获取当前放大比例, 当zoom时传true 才会有 | ||||||
|  |         this.scaleValue = hiprintTemplate.editingPanel.scale || 1 | ||||||
|  |         // this.scaleValue = hiprintTemplate.editingPanel.scale || 1 | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |     /** | ||||||
|  |      * 设置纸张大小 | ||||||
|  |      * @param type [A3, A4, A5, B3, B4, B5, other] | ||||||
|  |      * @param value {width,height} mm | ||||||
|  |      */ | ||||||
|  |     setPaper(type, value) { | ||||||
|  |       try { | ||||||
|  |         if (Object.keys(this.paperTypes).includes(type)) { | ||||||
|  |           this.curPaper = { type: type, width: value.width, height: value.height } | ||||||
|  |           hiprintTemplate.setPaper(value.width, value.height) | ||||||
|  |         } else { | ||||||
|  |           this.curPaper = { type: 'other', width: value.width, height: value.height } | ||||||
|  |           hiprintTemplate.setPaper(value.width, value.height) | ||||||
|  |         } | ||||||
|  |       } catch (error) { | ||||||
|  |         this.$message.error(`操作失败: ${error}`) | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     changeScale(currentValue, oldValue) { | ||||||
|  |       let big = false | ||||||
|  |       currentValue <= oldValue ? big = false : big = true | ||||||
|  |       let scaleValue = this.scaleValue | ||||||
|  |       if (big) { | ||||||
|  |         scaleValue += 0.1 | ||||||
|  |         if (scaleValue > this.scaleMax) scaleValue = 5 | ||||||
|  |       } else { | ||||||
|  |         scaleValue -= 0.1 | ||||||
|  |         if (scaleValue < this.scaleMin) scaleValue = 0.5 | ||||||
|  |       } | ||||||
|  |       if (hiprintTemplate) { | ||||||
|  |         // scaleValue: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大 | ||||||
|  |         hiprintTemplate.zoom(scaleValue) | ||||||
|  |         this.scaleValue = scaleValue | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     clearPaper() { | ||||||
|  |       MessageBox.confirm('是否确认清空模板信息?', '警告', { | ||||||
|  |         confirmButtonText: '确定', | ||||||
|  |         cancelButtonText: '取消', | ||||||
|  |         type: 'warning' | ||||||
|  |       }).then(() => { | ||||||
|  |         try { | ||||||
|  |           hiprintTemplate.clear() | ||||||
|  |         } catch (error) { | ||||||
|  |           this.$message.error(`操作失败: ${error}`) | ||||||
|  |         } | ||||||
|  |       }).catch((err) => { | ||||||
|  |         console.log(err) | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |     otherPaper() { | ||||||
|  |       const value = {} | ||||||
|  |       value.width = this.paperWidth | ||||||
|  |       value.height = this.paperHeight | ||||||
|  |       this.paperPopVisible = false | ||||||
|  |       this.setPaper('other', value) | ||||||
|  |     }, | ||||||
|  |     rotatePaper() { | ||||||
|  |       if (hiprintTemplate) { | ||||||
|  |         hiprintTemplate.rotatePaper() | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     preView() { | ||||||
|  |       const { width } = this.curPaper | ||||||
|  |       this.$refs.preView.show(hiprintTemplate, this.printData, width) | ||||||
|  |     }, | ||||||
|  |     print() { | ||||||
|  |       // if (window.hiwebSocket.opened) { | ||||||
|  |       const printerList = hiprintTemplate.getPrinterList() | ||||||
|  |       console.log(printerList) | ||||||
|  |       hiprintTemplate.print2(this.printData, { printer: '', title: '预览打印' }) | ||||||
|  |       // return | ||||||
|  |       // } | ||||||
|  |       // this.$message.error('客户端未连接,无法直接打印') | ||||||
|  |     }, | ||||||
|  |     save() { | ||||||
|  |       // console.log(hiprintTemplate.getJson()) | ||||||
|  |       const { mode } = this | ||||||
|  |       const provider = providers[mode] | ||||||
|  |       // console.log(hiprintTemplate.getJson()) | ||||||
|  |       this.setTemplate({ | ||||||
|  |         name: provider.value, | ||||||
|  |         json: hiprintTemplate.getJson() | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |     setTemplate(payload) { | ||||||
|  |       // const templates = this.$ls.get('KEY_TEMPLATES', {}) | ||||||
|  |       // console.log(payload.json) | ||||||
|  |       // templates[payload.name] = payload.json | ||||||
|  |       // this.$ls.set('KEY_TEMPLATES', templates) | ||||||
|  |       this.$message.info('保存成功') | ||||||
|  |       // console.log(JSON.stringify(payload.json)) | ||||||
|  |       this.drawer = false | ||||||
|  |       this.$emit('saveData', payload.json) | ||||||
|  |       $('.hiprintEpContainer').empty() | ||||||
|  |       // this.$parent.$parent.getModelData(payload.json) | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | // build 拖拽 | ||||||
|  | ::v-deep .hiprint-printElement-type >li>ul>li>a { | ||||||
|  |   padding: 4px 4px; | ||||||
|  |   color: #1296db; | ||||||
|  |   line-height: 1; | ||||||
|  |   height: auto; | ||||||
|  |   text-overflow: ellipsis; | ||||||
|  | } | ||||||
|  | // 设计容器 | ||||||
|  | .card-design { | ||||||
|  |   // overflow: hidden; | ||||||
|  |   overflow-x: auto; | ||||||
|  |   overflow-y: auto; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | </style> | ||||||
							
								
								
									
										89
									
								
								src/views/packaging/custom/preview.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								src/views/packaging/custom/preview.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,89 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zhp | ||||||
|  |  * @Date: 2023-09-27 14:23:54 | ||||||
|  |  * @LastEditTime: 2023-10-19 11:20:36 | ||||||
|  |  * @LastEditors: zhp | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  |   <el-dialog :visible="visible" :mask-closable="false" width="50%" @close="hideModal" :append-to-body="true"> | ||||||
|  |     <div id="preview_content" /> | ||||||
|  |     <template slot="title"> | ||||||
|  |       <div style="margin-right: 20px">打印预览</div> | ||||||
|  |       <el-button :loading="waitShowPrinter" type="primary" icon="printer" @click.stop="print">打印</el-button> | ||||||
|  |       <el-button type="primary" icon="printer" @click.stop="toPdf">pdf</el-button> | ||||||
|  |     </template> | ||||||
|  |     <template slot="footer"> | ||||||
|  |       <el-button key="close" type="info" @click="hideModal"> | ||||||
|  |         关闭 | ||||||
|  |       </el-button> | ||||||
|  |     </template> | ||||||
|  |   </el-dialog> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  |   name: 'PrintPreview', | ||||||
|  |   props: {}, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       visible: false, | ||||||
|  |       spinning: true, | ||||||
|  |       waitShowPrinter: false, | ||||||
|  |       // 纸张宽 mm | ||||||
|  |       width: 0, | ||||||
|  |       // 模板 | ||||||
|  |       hiprintTemplate: {}, | ||||||
|  |       // 数据 | ||||||
|  |       printData: {} | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   computed: {}, | ||||||
|  |   watch: {}, | ||||||
|  |   created() { | ||||||
|  |   }, | ||||||
|  |   mounted() { | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     hideModal() { | ||||||
|  |       this.visible = false | ||||||
|  |     }, | ||||||
|  |     show(hiprintTemplate, printData, width = '210') { | ||||||
|  |       this.visible = true | ||||||
|  |       this.spinning = true | ||||||
|  |       this.width = width | ||||||
|  |       this.hiprintTemplate = hiprintTemplate | ||||||
|  |       this.printData = printData | ||||||
|  |       console.log(hiprintTemplate) | ||||||
|  |       console.log(printData) | ||||||
|  |       setTimeout(() => { | ||||||
|  |         // eslint-disable-next-line no-undef | ||||||
|  |         $('#preview_content').html(hiprintTemplate.getHtml(printData)) | ||||||
|  |         this.spinning = false | ||||||
|  |       }, 500) | ||||||
|  |     }, | ||||||
|  |     print() { | ||||||
|  |       this.waitShowPrinter = true | ||||||
|  |       this.hiprintTemplate.print(this.printData, {}, { | ||||||
|  |         callback: () => { | ||||||
|  |           console.log('callback') | ||||||
|  |           this.waitShowPrinter = false | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |     toPdf() { | ||||||
|  |       this.hiprintTemplate.toPdf({}, '打印预览') | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | </script> | ||||||
|  | <!-- <style lang="less" scoped> | ||||||
|  | /deep/ .ant-modal-body { | ||||||
|  |   padding: 0px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | /deep/ .ant-modal-content { | ||||||
|  |   margin-bottom: 24px; | ||||||
|  | } | ||||||
|  | </style> --> | ||||||
							
								
								
									
										90
									
								
								src/views/packaging/custom/print-data.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										90
									
								
								src/views/packaging/custom/print-data.js
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										245
									
								
								src/views/packaging/custom/providers.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										245
									
								
								src/views/packaging/custom/providers.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,245 @@ | |||||||
|  | /* eslint-disable */ | ||||||
|  | import {hiprint} from 'vue-plugin-hiprint' | ||||||
|  |  | ||||||
|  | /* eslint-disable */ | ||||||
|  | // import {hiprint} from '../../index' | ||||||
|  |  | ||||||
|  | // 自定义设计元素1 | ||||||
|  | export const aProvider = function (ops) { | ||||||
|  |   var addElementTypes = function (context) { | ||||||
|  |     context.removePrintElementTypes("aProviderModule"); | ||||||
|  |     context.addPrintElementTypes( | ||||||
|  |       "aProviderModule", | ||||||
|  |       [ | ||||||
|  |         new hiprint.PrintElementTypeGroup("平台", [ | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.header', title: '单据表头', data: '单据表头', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               testData: '单据表头', | ||||||
|  |               height: 17, | ||||||
|  |               fontSize: 16.5, | ||||||
|  |               fontWeight: "700", | ||||||
|  |               textAlign: "center", | ||||||
|  |               hideTitle: true | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.type', title: '单据类型', data: '单据类型', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               testData: '单据类型', | ||||||
|  |               height: 16, | ||||||
|  |               fontSize: 15, | ||||||
|  |               fontWeight: "700", | ||||||
|  |               textAlign: "center", | ||||||
|  |               hideTitle: true | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.order', title: '订单编号', data: 'XS888888888', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               field: 'orderId', | ||||||
|  |               testData: 'XS888888888', | ||||||
|  |               height: 16, | ||||||
|  |               fontSize: 6.75, | ||||||
|  |               fontWeight: "700", | ||||||
|  |               textAlign: "left", | ||||||
|  |               textContentVerticalAlign: "middle" | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.date', title: '业务日期', data: '2020-01-01', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               field: 'date', | ||||||
|  |               testData: '2020-01-01', | ||||||
|  |               height: 16, | ||||||
|  |               fontSize: 6.75, | ||||||
|  |               fontWeight: "700", | ||||||
|  |               textAlign: "left", | ||||||
|  |               textContentVerticalAlign: "middle" | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.barcode', title: '条形码', data: 'XS888888888', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               field: 'barcode', | ||||||
|  |               testData: 'XS888888888', | ||||||
|  |               height: 32, | ||||||
|  |               fontSize: 12, | ||||||
|  |               lineHeight: 18, | ||||||
|  |               textType: "barcode" | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.qrcode', title: '二维码', data: 'XS888888888', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               field: 'qrcode', | ||||||
|  |               testData: 'XS888888888', | ||||||
|  |               height: 32, | ||||||
|  |               fontSize: 12, | ||||||
|  |               lineHeight: 18, | ||||||
|  |               textType: "qrcode" | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.platform', title: '平台名称', data: '平台名称', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               testData: '平台名称', | ||||||
|  |               height: 17, | ||||||
|  |               fontSize: 16.5, | ||||||
|  |               fontWeight: "700", | ||||||
|  |               textAlign: "center", | ||||||
|  |               hideTitle: true | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |           {tid: 'aProviderModule.logo', title: 'Logo', data: '', type: 'image'}, | ||||||
|  |         ]), | ||||||
|  |         new hiprint.PrintElementTypeGroup("库管", [ | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.creater', title: '制单人', data: '李四', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               field: 'creater', | ||||||
|  |               testData: '李四', | ||||||
|  |               height: 16, | ||||||
|  |               fontSize: 6.75, | ||||||
|  |               fontWeight: "700", | ||||||
|  |               textAlign: "left", | ||||||
|  |               textContentVerticalAlign: "middle" | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.printDate', title: '打印时间', data: '2022-01-01 09:00', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               field: 'printDate', | ||||||
|  |               testData: '2022-01-01 09:00', | ||||||
|  |               height: 16, | ||||||
|  |               fontSize: 6.75, | ||||||
|  |               fontWeight: "700", | ||||||
|  |               textAlign: "left", | ||||||
|  |               textContentVerticalAlign: "middle" | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.signer', title: '库管签字', data: '', type: 'text', | ||||||
|  |             options: { | ||||||
|  |               title: '库管签字:', | ||||||
|  |               height: 16, | ||||||
|  |               fontSize: 6.75, | ||||||
|  |               fontWeight: "700", | ||||||
|  |               textAlign: "left", | ||||||
|  |               textContentVerticalAlign: "middle" | ||||||
|  |             } | ||||||
|  |           }, | ||||||
|  |         ]), | ||||||
|  |         new hiprint.PrintElementTypeGroup("表格/其他", [ | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.table', title: '订单数据', | ||||||
|  |             type: 'table', | ||||||
|  |             options: { | ||||||
|  |               field: 'table', | ||||||
|  |               tableHeaderRepeat: 'first', | ||||||
|  |               tableFooterRepeat: 'last', | ||||||
|  |               fields: [ | ||||||
|  |                 {text: '名称', field: 'NAME'}, | ||||||
|  |                 {text: '数量', field: 'SL'}, | ||||||
|  |                 {text: '规格', field: 'GG'}, | ||||||
|  |                 {text: '条码', field: 'TM'}, | ||||||
|  |                 {text: '单价', field: 'DJ'}, | ||||||
|  |                 {text: '金额', field: 'JE'}, | ||||||
|  |               ], | ||||||
|  |             }, | ||||||
|  |             editable: true, | ||||||
|  |             columnDisplayEditable: true,//列显示是否能编辑 | ||||||
|  |             columnDisplayIndexEditable: true,//列顺序显示是否能编辑 | ||||||
|  |             columnTitleEditable: true,//列标题是否能编辑 | ||||||
|  |             columnResizable: true, //列宽是否能调整 | ||||||
|  |             columnAlignEditable: true,//列对齐是否调整 | ||||||
|  |             isEnableEditField: true, //编辑字段 | ||||||
|  |             isEnableContextMenu: true, //开启右键菜单 默认true | ||||||
|  |             isEnableInsertRow: true, //插入行 | ||||||
|  |             isEnableDeleteRow: true, //删除行 | ||||||
|  |             isEnableInsertColumn: true, //插入列 | ||||||
|  |             isEnableDeleteColumn: true, //删除列 | ||||||
|  |             isEnableMergeCell: true, //合并单元格 | ||||||
|  |             columns: [ | ||||||
|  |               [ | ||||||
|  |                 {title: '名称', align: 'center', field: 'NAME', width: 150}, | ||||||
|  |                 {title: '数量', align: 'center', field: 'SL', width: 80}, | ||||||
|  |                 {title: '规格', align: 'center', field: 'GG', width: 80, checked: false}, | ||||||
|  |                 {title: '条码', align: 'center', field: 'TM', width: 100, checked: false}, | ||||||
|  |                 {title: '单价', align: 'center', field: 'DJ', width: 100}, | ||||||
|  |                 {title: '金额', align: 'center', field: 'JE', width: 100, checked: false}, | ||||||
|  |               ], | ||||||
|  |             ], | ||||||
|  |             rowsColumnsMerge: function (data, col, index) { | ||||||
|  |               // 返回一个数组,参数一为行(rowspan)合并数,参数二为列(colspan)合并数, 被合并的行或者列值设为0 | ||||||
|  |               if (index == 0) { | ||||||
|  |                 return [1, data.INDEX % 2 == 1 ? 2 : 1] | ||||||
|  |               } else if (index > 0 && index < 2) { | ||||||
|  |                 return [data.INDEX % 2 == 1 ? 0 : 1, 1] | ||||||
|  |               } else { | ||||||
|  |                 return [data.INDEX % 2 == 1 ? 2 : 0, 1] | ||||||
|  |               } | ||||||
|  |             }, | ||||||
|  |             footerFormatter: function (options, rows, data, currentPageGridRowsData) { | ||||||
|  |               if (data && data['totalCap']) { | ||||||
|  |                 return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>` | ||||||
|  |               } | ||||||
|  |               return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>' | ||||||
|  |             }, | ||||||
|  |           }, | ||||||
|  |           {tid: 'aProviderModule.customText', title: '文本', customText: '自定义文本', custom: true, type: 'text'}, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.longText', title: '长文本', type: 'longText', options: { | ||||||
|  |               field: 'test.longText', | ||||||
|  |               width: 200, | ||||||
|  |               testData: '长文本分页/不分页测试' | ||||||
|  |             }, | ||||||
|  |           } | ||||||
|  |         ]), | ||||||
|  |         new hiprint.PrintElementTypeGroup("辅助", [ | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.hline', | ||||||
|  |             title: '横线', | ||||||
|  |             type: 'hline' | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.vline', | ||||||
|  |             title: '竖线', | ||||||
|  |             type: 'vline' | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.rect', | ||||||
|  |             title: '矩形', | ||||||
|  |             type: 'rect' | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.oval', | ||||||
|  |             title: '椭圆', | ||||||
|  |             type: 'oval' | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.barcode', | ||||||
|  |             title: '条形码', | ||||||
|  |             type: 'barcode', | ||||||
|  |           }, | ||||||
|  |           { | ||||||
|  |             tid: 'aProviderModule.qrcode', | ||||||
|  |             title: '二维码', | ||||||
|  |             type: 'qrcode', | ||||||
|  |           } | ||||||
|  |         ]) | ||||||
|  |       ] | ||||||
|  |     ); | ||||||
|  |   }; | ||||||
|  |   return { | ||||||
|  |     addElementTypes: addElementTypes | ||||||
|  |   }; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | // type: 1供货商 2经销商 | ||||||
|  | export default [{ | ||||||
|  |   name: 'A设计', | ||||||
|  |   value: 'aProviderModule', | ||||||
|  |   type: 1, | ||||||
|  |   f: aProvider() | ||||||
|  | }] | ||||||
							
								
								
									
										100
									
								
								src/views/packaging/mixins/basic-add.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								src/views/packaging/mixins/basic-add.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,100 @@ | |||||||
|  | /* | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2022-08-24 11:19:43 | ||||||
|  |  * @LastEditors: zwq | ||||||
|  |  * @LastEditTime: 2023-08-03 14:21:04 | ||||||
|  |  * @Description: | ||||||
|  |  */ | ||||||
|  | export default { | ||||||
|  |   data() { | ||||||
|  |     /* eslint-disable */ | ||||||
|  |     return { | ||||||
|  |       urlOptions: { | ||||||
|  |         createURL: '', | ||||||
|  |         updateURL: '', | ||||||
|  |         infoURL: '', | ||||||
|  |         codeURL: '', | ||||||
|  |         getOption: false, | ||||||
|  |         isGetCode: false, | ||||||
|  |         optionArrUrl: [], | ||||||
|  |         optionArr: {} | ||||||
|  |       }, | ||||||
|  |       visible: false, | ||||||
|  |       setData: false | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   created() { | ||||||
|  |   }, | ||||||
|  |   activated() { | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     init(id) { | ||||||
|  |       this.dataForm.id = id || ""; | ||||||
|  |       this.visible = true; | ||||||
|  |       if (this.urlOptions.getOption) { | ||||||
|  |         this.getArr() | ||||||
|  |       } | ||||||
|  |       this.$nextTick(() => { | ||||||
|  |         this.$refs["dataForm"].resetFields(); | ||||||
|  |         if (this.dataForm.id) { | ||||||
|  |           this.urlOptions.infoURL(id).then(response => { | ||||||
|  |             this.dataForm = response.data; | ||||||
|  |             if (this.setData) { | ||||||
|  |               this.setDataForm() | ||||||
|  |             } | ||||||
|  |           }); | ||||||
|  |         } else { | ||||||
|  |           if (this.urlOptions.isGetCode) { | ||||||
|  |             this.getCode() | ||||||
|  |           } | ||||||
|  | 				} | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  | 		getCode() { | ||||||
|  | 			this.urlOptions.codeURL() | ||||||
|  | 				.then(({ data: res }) => { | ||||||
|  | 					this.dataForm.code = res; | ||||||
|  | 				}) | ||||||
|  | 				.catch(() => {}); | ||||||
|  | 		}, | ||||||
|  |     getArr() { | ||||||
|  |       const params = { | ||||||
|  |         pageSize: 100, | ||||||
|  |         pageNo: 1, | ||||||
|  |       } | ||||||
|  |       this.urlOptions.optionArrUrl.forEach((item, index) => { | ||||||
|  |         item(params).then(({ data: res }) => { | ||||||
|  |           this.$set(this.urlOptions.optionArr, `arr${index}`, res.list) | ||||||
|  |         }) | ||||||
|  |           .catch(() => { | ||||||
|  |           }); | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     // 表单提交 | ||||||
|  |     dataFormSubmit() { | ||||||
|  |       this.$refs["dataForm"].validate((valid) => { | ||||||
|  |         if (!valid) { | ||||||
|  |           return false; | ||||||
|  |         } | ||||||
|  |         // 修改的提交 | ||||||
|  |         if (this.dataForm.id) { | ||||||
|  |           this.urlOptions.updateURL(this.dataForm).then(response => { | ||||||
|  |             this.$modal.msgSuccess("修改成功"); | ||||||
|  |             this.visible = false; | ||||||
|  |             this.$emit("refreshDataList"); | ||||||
|  |           }); | ||||||
|  |           return; | ||||||
|  |         } | ||||||
|  |         // 添加的提交 | ||||||
|  |         this.urlOptions.createURL(this.dataForm).then(response => { | ||||||
|  |           this.$modal.msgSuccess("新增成功"); | ||||||
|  |           this.visible = false; | ||||||
|  |           this.$emit("refreshDataList"); | ||||||
|  |         }); | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     formClear() { | ||||||
|  |       this.$refs.dataForm.resetFields() | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										170
									
								
								src/views/packaging/mixins/basic-page.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										170
									
								
								src/views/packaging/mixins/basic-page.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,170 @@ | |||||||
|  | /* | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2022-08-24 11:19:43 | ||||||
|  |  * @LastEditors: zwq | ||||||
|  |  * @LastEditTime: 2024-07-05 10:10:12 | ||||||
|  |  * @Description: | ||||||
|  |  */ | ||||||
|  | export default { | ||||||
|  |   data() { | ||||||
|  |     /* eslint-disable */ | ||||||
|  |     return { | ||||||
|  |       urlOptions: { | ||||||
|  |         getDataListURL: '', | ||||||
|  |         deleteURL: '', | ||||||
|  |         statusUrl: '', | ||||||
|  |         exportURL: '' | ||||||
|  |       }, | ||||||
|  |       tableData: [], | ||||||
|  |       listQuery: { | ||||||
|  |         pageSize: 10, | ||||||
|  |         pageNo: 1, | ||||||
|  |         total: 1, | ||||||
|  |       }, | ||||||
|  |       exportLoading: false, | ||||||
|  |       dataListLoading: false, | ||||||
|  |       addOrEditTitle: '', | ||||||
|  |       addOrUpdateVisible: false, | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   created() { | ||||||
|  |   }, | ||||||
|  |   mounted() { | ||||||
|  |     this.getDataList() | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     // 获取数据列表 | ||||||
|  |     getDataList() { | ||||||
|  |       this.dataListLoading = true; | ||||||
|  |       this.urlOptions.getDataListURL(this.listQuery).then(response => { | ||||||
|  |         this.tableData = response.data.list; | ||||||
|  |         this.listQuery.total = response.data.total; | ||||||
|  |         this.dataListLoading = false; | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     // 每页数 | ||||||
|  |     sizeChangeHandle(val) { | ||||||
|  |       this.listQuery.pageSize = val; | ||||||
|  |       this.listQuery.pageNo = 1; | ||||||
|  |       this.getDataList(); | ||||||
|  |     }, | ||||||
|  |     // 当前页 | ||||||
|  |     currentChangeHandle(val) { | ||||||
|  |       this.listQuery.pageNo = val; | ||||||
|  |       this.getDataList(); | ||||||
|  |     }, | ||||||
|  |     // 新增 | ||||||
|  |     addOrUpdateHandle() { | ||||||
|  |       this.addOrEditTitle = '新增'; | ||||||
|  |       this.addOrUpdateVisible = true; | ||||||
|  |       this.$nextTick(() => { | ||||||
|  |         this.$refs.addOrUpdate.init(); | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     cancel(id) { | ||||||
|  |       this.$refs["popover-" + id].showPopper = false; | ||||||
|  |     }, | ||||||
|  |     //改变状态 | ||||||
|  |     changeStatus(id) { | ||||||
|  |       this.$http | ||||||
|  |         .post(this.urlOptions.statusUrl, { id }) | ||||||
|  |         .then(({ data: res }) => { | ||||||
|  |           if (res.code !== 0) { | ||||||
|  |             return this.$message.error(res.msg); | ||||||
|  |           } | ||||||
|  |           this.$refs["popover-" + id].showPopper = false; | ||||||
|  |           this.$message({ | ||||||
|  |             message: this.$t("prompt.success"), | ||||||
|  |             type: "success", | ||||||
|  |             duration: 500, | ||||||
|  |             onClose: () => { | ||||||
|  |               this.getDataList(); | ||||||
|  |             }, | ||||||
|  |           }); | ||||||
|  |         }) | ||||||
|  |         .catch(() => { }); | ||||||
|  |     }, | ||||||
|  |     //tableBtn点击 | ||||||
|  |     handleClick(val) { | ||||||
|  |       console.log(val.data.packagingCode); | ||||||
|  |       if (val.type === "edit") { | ||||||
|  |         this.addOrUpdateVisible = true; | ||||||
|  |         this.addOrEditTitle = "编辑"; | ||||||
|  |         this.$nextTick(() => { | ||||||
|  |           this.$refs.addOrUpdate.init(val.data.id); | ||||||
|  |         }); | ||||||
|  |       } else if (val.type === "delete") { | ||||||
|  |         this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data.packagingCode ) | ||||||
|  |       } else if (val.type === "change") { | ||||||
|  |         this.changeStatus(val.data.id) | ||||||
|  |       } else { | ||||||
|  |         this.otherMethods(val) | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     // 删除 | ||||||
|  |     deleteHandle(id, name, index) { | ||||||
|  |       this.$confirm(`是否确认删除${name ? ' 名称为'+ name : '[' + index + ']'}数据项?`, "提示", { | ||||||
|  |         confirmButtonText: "确定", | ||||||
|  |         cancelButtonText: "取消", | ||||||
|  |         type: "warning", | ||||||
|  |       }) | ||||||
|  |         .then(() => { | ||||||
|  |           this.urlOptions.deleteURL(id).then(({ data }) => { | ||||||
|  |             this.$message({ | ||||||
|  |               message: "操作成功", | ||||||
|  |               type: "success", | ||||||
|  |               duration: 1500, | ||||||
|  |               onClose: () => { | ||||||
|  |                 this.getDataList(); | ||||||
|  |               }, | ||||||
|  |             }); | ||||||
|  |           }); | ||||||
|  |         }) | ||||||
|  |         .catch(() => { }); | ||||||
|  |     }, | ||||||
|  |     //search-bar点击 | ||||||
|  |     buttonClick(val) { | ||||||
|  |       switch (val.btnName) { | ||||||
|  |         case "search": | ||||||
|  |           this.listQuery.xm1 = val.xm1; | ||||||
|  |           this.listQuery.xm2 = val.xm2; | ||||||
|  |           this.listQuery.pageNo = 1; | ||||||
|  |           this.getDataList(); | ||||||
|  |           break; | ||||||
|  |         case "add": | ||||||
|  |           this.addOrEditTitle = '新增' | ||||||
|  |           this.addOrUpdateVisible = true; | ||||||
|  |           this.addOrUpdateHandle() | ||||||
|  |           break; | ||||||
|  |         default: | ||||||
|  |           console.log(val) | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     handleCancel() { | ||||||
|  |       this.$refs.addOrUpdate.formClear() | ||||||
|  |       this.addOrUpdateVisible = false | ||||||
|  |       this.addOrEditTitle = '' | ||||||
|  |     }, | ||||||
|  |     handleConfirm() { | ||||||
|  |       this.$refs.addOrUpdate.dataFormSubmit() | ||||||
|  |     }, | ||||||
|  |     successSubmit() { | ||||||
|  |       this.handleCancel() | ||||||
|  |       this.getDataList() | ||||||
|  |     }, | ||||||
|  |     /** 导出按钮操作 */ | ||||||
|  |     handleExport() { | ||||||
|  |       // 处理查询参数 | ||||||
|  |       let params = { ...this.queryParams }; | ||||||
|  |       params.pageNo = undefined; | ||||||
|  |       params.pageSize = undefined; | ||||||
|  |       this.$modal.confirm('是否确认导出所有数据项?').then(() => { | ||||||
|  |         this.exportLoading = true; | ||||||
|  |         return this.urlOptions.exportURL(params); | ||||||
|  |       }).then(response => { | ||||||
|  |         this.$download.excel(response, '工厂.xls'); | ||||||
|  |         this.exportLoading = false; | ||||||
|  |       }).catch(() => { }); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										85
									
								
								src/views/packaging/mixins/code-filter.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								src/views/packaging/mixins/code-filter.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,85 @@ | |||||||
|  |  | ||||||
|  | /* | ||||||
|  |  * @Date: 2020-12-29 16:49:28 | ||||||
|  |  * @LastEditors: zwq | ||||||
|  |  * @LastEditTime: 2024-07-08 16:27:39 | ||||||
|  |  * @FilePath: \basic-admin\src\filters\basicData\index.js | ||||||
|  |  * @Description: | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | const table = { | ||||||
|  |   lineStatus: { | ||||||
|  |     1: '生产中', | ||||||
|  |     2: '停止', | ||||||
|  |     3: '未知', | ||||||
|  |   }, | ||||||
|  |   reportType: { | ||||||
|  |     1: '日', | ||||||
|  |     2: '周', | ||||||
|  |     3: '月' | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // 日期格式化 | ||||||
|  | export function parseTime(time, pattern) { | ||||||
|  |   if (arguments.length === 0 || !time) { | ||||||
|  |     return null | ||||||
|  |   } | ||||||
|  |   const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' | ||||||
|  |   let date | ||||||
|  |   if (typeof time === 'object') { | ||||||
|  |     date = time | ||||||
|  |   } else { | ||||||
|  |     if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { | ||||||
|  |       time = parseInt(time) | ||||||
|  |     } else if (typeof time === 'string') { | ||||||
|  |       time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm), ''); | ||||||
|  |     } | ||||||
|  |     if ((typeof time === 'number') && (time.toString().length === 10)) { | ||||||
|  |       time = time * 1000 | ||||||
|  |     } | ||||||
|  |     date = new Date(time) | ||||||
|  |   } | ||||||
|  |   const formatObj = { | ||||||
|  |     y: date.getFullYear(), | ||||||
|  |     m: date.getMonth() + 1, | ||||||
|  |     d: date.getDate(), | ||||||
|  |     h: date.getHours(), | ||||||
|  |     i: date.getMinutes(), | ||||||
|  |     s: date.getSeconds(), | ||||||
|  |     a: date.getDay() | ||||||
|  |   } | ||||||
|  |   const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { | ||||||
|  |     let value = formatObj[key] | ||||||
|  |     // Note: getDay() returns 0 on Sunday | ||||||
|  |     if (key === 'a') { | ||||||
|  |       return ['日', '一', '二', '三', '四', '五', '六'][value] | ||||||
|  |     } | ||||||
|  |     if (result.length > 0 && value < 10) { | ||||||
|  |       value = '0' + value | ||||||
|  |     } | ||||||
|  |     return value || 0 | ||||||
|  |   }) | ||||||
|  |   return time_str | ||||||
|  | } | ||||||
|  | // 遍历树结构返回数组 | ||||||
|  | export function getTreeArr(arr) { | ||||||
|  |   let result =[] | ||||||
|  |   arr.forEach(item => { | ||||||
|  |     if(item.children && item.children.length>0){ | ||||||
|  |       let {children,...obj} = item | ||||||
|  |       result.push(obj) | ||||||
|  |       result = result.concat(getTreeArr(children)) | ||||||
|  |     }else{ | ||||||
|  |       let {children,...obj} = item | ||||||
|  |       result.push(obj) | ||||||
|  |     } | ||||||
|  |   }); | ||||||
|  |   return result | ||||||
|  | } | ||||||
|  |  | ||||||
|  | export default function (dictTable) { | ||||||
|  |   return function (val) { | ||||||
|  |     return table?.[dictTable]?.[val] | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										65
									
								
								src/views/packaging/packagingPrintLog/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								src/views/packaging/packagingPrintLog/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,65 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2023-08-01 15:27:31 | ||||||
|  |  * @LastEditors: zwq | ||||||
|  |  * @LastEditTime: 2023-08-01 16:25:54 | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  | 	<div :class="[className, { 'p-0': noPadding }]"> | ||||||
|  | 		<slot /> | ||||||
|  | 	</div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  | 	props: { | ||||||
|  | 		size: { | ||||||
|  | 			// 取值范围:  xl lg md sm | ||||||
|  | 			type: String, | ||||||
|  | 			default: 'de', | ||||||
|  | 			validator: function (val) { | ||||||
|  | 				return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1; | ||||||
|  | 			}, | ||||||
|  | 		}, | ||||||
|  | 		noPadding: { | ||||||
|  | 			type: Boolean, | ||||||
|  | 			default: false, | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | 	computed: { | ||||||
|  | 		className: function () { | ||||||
|  | 			return `${this.size}-title`; | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | $pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px); | ||||||
|  | $mgr: 8px; | ||||||
|  | @each $size, $height in $pxls { | ||||||
|  | 	.#{$size}-title { | ||||||
|  | 		font-size: 18px; | ||||||
|  | 		line-height: $height; | ||||||
|  | 		color: #000; | ||||||
|  | 		font-weight: 500; | ||||||
|  | 		font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif; | ||||||
|  |  | ||||||
|  | 		&::before { | ||||||
|  | 			content: ''; | ||||||
|  | 			display: inline-block; | ||||||
|  | 			vertical-align: top; | ||||||
|  | 			width: 4px; | ||||||
|  | 			height: $height + 2px; | ||||||
|  | 			border-radius: 1px; | ||||||
|  | 			margin-right: $mgr; | ||||||
|  | 			background-color: #0b58ff; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .p-0 { | ||||||
|  | 	padding: 0; | ||||||
|  | } | ||||||
|  | </style> | ||||||
							
								
								
									
										418
									
								
								src/views/packaging/packagingPrintLog/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										418
									
								
								src/views/packaging/packagingPrintLog/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,418 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zhp | ||||||
|  |  * @Date: 2023-10-17 16:50:19 | ||||||
|  |  * @LastEditTime: 2023-10-30 10:47:13 | ||||||
|  |  * @LastEditors: zhp | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  |   <el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%"> | ||||||
|  |     <small-title slot="title" :no-padding="true"> | ||||||
|  |       {{ !dataForm.id ? '新增' : '编辑' }} | ||||||
|  |     </small-title> | ||||||
|  |  | ||||||
|  |     <div class="content"> | ||||||
|  |       <div class="visual-part"> | ||||||
|  |         <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" | ||||||
|  |           @keyup.enter.native="dataFormSubmit"> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="包装流水号" prop="packagingCode"> | ||||||
|  |                 <el-input v-model="dataForm.packagingCode" clearable placeholder="请输入包装流水号" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="内容" prop="content"> | ||||||
|  |                 <el-input v-model="dataForm.content" clearable placeholder="请输入内容" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="所属工单" prop="workOrderId"> | ||||||
|  |                 <el-select v-model="dataForm.workOrderId" style="width: 100%;" placeholder="请选择所属工单" clearable> | ||||||
|  |                   <el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||||
|  |                 </el-select> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="客户" prop="customerId"> | ||||||
|  |                 <el-select v-model="dataForm.customerId" style="width: 100%;" placeholder="请选择客户" clearable> | ||||||
|  |                   <el-option v-for="dict in customerList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||||
|  |                 </el-select> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="标签模板" prop="modelId"> | ||||||
|  |                 <el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable> | ||||||
|  |                   <el-option v-for="dict in modelList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||||
|  |                 </el-select> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <!-- <el-col :span="12"> | ||||||
|  |               <el-form-item label="单位平方数" prop="area"> | ||||||
|  |                 <el-input v-model="dataForm.area" placeholder="请输入单位平方数" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> --> | ||||||
|  |           </el-row> | ||||||
|  |           <!-- <el-row :gutter="20"> | ||||||
|  |             <el-col :span="24"> | ||||||
|  |               <el-form-item label="完成单位产品用时" prop="processTime"> | ||||||
|  |                 <el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> --> | ||||||
|  |         </el-form> | ||||||
|  |  | ||||||
|  |         <!-- <small-title | ||||||
|  | 					style="margin: 16px 0; padding-left: 8px" | ||||||
|  | 					:no-padding="true"> | ||||||
|  | 					产品属性列表 | ||||||
|  | 				</small-title> | ||||||
|  |  | ||||||
|  | 				<div class="attr-list"> | ||||||
|  | 					<base-table | ||||||
|  | 						:table-props="tableProps" | ||||||
|  | 						:page="listQuery.pageNo" | ||||||
|  | 						:limit="listQuery.pageSize" | ||||||
|  | 						:add-button-show="isdetail ? null : '添加属性'" | ||||||
|  | 						@emitButtonClick="addNew()" | ||||||
|  | 						:table-data="productAttributeList"> | ||||||
|  | 						<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> | ||||||
|  |     </div> | ||||||
|  |  | ||||||
|  |     <!-- <div style="position: absolute; bottom: 24px; right: 24px"> | ||||||
|  | 			<el-button style="margin-right: 10px" @click="goback()">返回</el-button> | ||||||
|  | 			<el-button v-if="isdetail" type="primary" @click="goEdit()"> | ||||||
|  | 				编辑 | ||||||
|  | 			</el-button> | ||||||
|  | 			<span v-if="!isdetail"> | ||||||
|  | 				<el-button type="primary" @click="dataFormSubmit()">保存</el-button> | ||||||
|  | 				<el-button | ||||||
|  | 					v-if="dataForm.id && !isdetail" | ||||||
|  | 					type="primary" | ||||||
|  | 					@click="addNew()"> | ||||||
|  | 					添加属性 | ||||||
|  | 				</el-button> | ||||||
|  | 			</span> | ||||||
|  | 		</div> --> | ||||||
|  |     <template slot="footer"> | ||||||
|  |       <el-button style="" @click="goback()">取消</el-button> | ||||||
|  |       <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> | ||||||
|  | 				编辑 | ||||||
|  | 			</el-button> --> | ||||||
|  |       <el-button type="primary" @click="dataFormSubmit()">确定</el-button> | ||||||
|  |     </template> | ||||||
|  |   </el-dialog> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  |  | ||||||
|  | import { | ||||||
|  | 	createPacking, | ||||||
|  | 	updatePacking, | ||||||
|  |   getPacking, | ||||||
|  |   getWorkOrderList, | ||||||
|  |   getCode, | ||||||
|  |   getCustomerList, | ||||||
|  |   getModelList | ||||||
|  | } from '@/api/base/packingInfo.js'; | ||||||
|  | // import productAttrAdd from './attr-add'; | ||||||
|  | import { parseTime } from '../mixins/code-filter'; | ||||||
|  | import SmallTitle from './SmallTitle'; | ||||||
|  |  | ||||||
|  | const tableBtn = [ | ||||||
|  | 	{ | ||||||
|  | 		type: 'edit', | ||||||
|  | 		btnName: '编辑', | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		type: 'delete', | ||||||
|  | 		btnName: '删除', | ||||||
|  | 	}, | ||||||
|  | ]; | ||||||
|  | const tableProps = [ | ||||||
|  | 	{ | ||||||
|  | 		prop: 'createTime', | ||||||
|  | 		label: '添加时间', | ||||||
|  | 		filter: parseTime, | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		prop: 'name', | ||||||
|  | 		label: '属性名', | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		prop: 'value', | ||||||
|  | 		label: '属性值', | ||||||
|  | 	}, | ||||||
|  | ]; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  | 	components: { SmallTitle }, | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 			visible: false, | ||||||
|  | 			addOrUpdateVisible: false, | ||||||
|  | 			tableBtn, | ||||||
|  |       tableProps, | ||||||
|  |       customerList: [], | ||||||
|  |       modelList:[], | ||||||
|  |       workOrderList:[], | ||||||
|  | 			productAttributeList: [], | ||||||
|  | 			dataForm: { | ||||||
|  | 				id: null, | ||||||
|  | 				// name: '', // 产品名称 | ||||||
|  |         packagingCode: '', // 产品编码 | ||||||
|  | 				// area: 0, // 单位平方数(float only) | ||||||
|  |         modelId: null, // 产品类型id | ||||||
|  |         workOrderId: null, // 单位产品用时 (s) | ||||||
|  |         customerId: '', // 规格 | ||||||
|  |         content: '', // 单位id | ||||||
|  | 			}, | ||||||
|  | 			listQuery: { | ||||||
|  | 				pageSize: 10, | ||||||
|  | 				pageNo: 1, | ||||||
|  | 				total: 0, | ||||||
|  | 			}, | ||||||
|  | 			dataRule: { | ||||||
|  |         content: [ | ||||||
|  | 					{ | ||||||
|  | 						required: true, | ||||||
|  | 						message: '内容不能为空', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 					}, | ||||||
|  | 					// { | ||||||
|  | 					// 	type: 'number', | ||||||
|  | 					// 	message: '产品编码为数字类型', | ||||||
|  | 					// 	trigger: 'blur', | ||||||
|  | 					// 	transfom: 'val => Number(val)', | ||||||
|  | 					// }, | ||||||
|  | 				], | ||||||
|  |         workOrderId: [ | ||||||
|  | 					{ | ||||||
|  | 						required: true, | ||||||
|  | 						message: '所属工单不能为空', | ||||||
|  | 						trigger: 'change', | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 				typeDictValue: [ | ||||||
|  | 					{ | ||||||
|  | 						required: true, | ||||||
|  | 						message: '产品类型不能为空', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 				area: [ | ||||||
|  | 					{ | ||||||
|  | 						type: 'number', | ||||||
|  | 						message: '请输入正确的数值', | ||||||
|  | 						trigger: 'change', | ||||||
|  | 						transform: (val) => Number(val), | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 				processTime: [ | ||||||
|  | 					{ | ||||||
|  | 						required: true, | ||||||
|  | 						message: '完成单位产品用时不能为空', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 					}, | ||||||
|  | 					{ | ||||||
|  | 						type: 'number', | ||||||
|  | 						message: '请输入正确的数值', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 						transform: (val) => Number(val), | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 			}, | ||||||
|  | 			// isdetail: false, | ||||||
|  | 		}; | ||||||
|  |   }, | ||||||
|  | 	methods: { | ||||||
|  | 		// initData() { | ||||||
|  | 		// 	this.productAttributeList.splice(0); | ||||||
|  | 		// 	this.listQuery.total = 0; | ||||||
|  | 		// }, | ||||||
|  |     init(id) { | ||||||
|  |       this.getDict() | ||||||
|  | 			// this.initData(); | ||||||
|  | 			// this.isdetail = isdetail || false; | ||||||
|  | 			this.dataForm.id = id || null; | ||||||
|  | 			this.visible = true; | ||||||
|  |  | ||||||
|  | 			this.$nextTick(() => { | ||||||
|  | 				this.$refs['dataForm'].resetFields(); | ||||||
|  |  | ||||||
|  | 				if (this.dataForm.id) { | ||||||
|  | 					// 获取产品详情 | ||||||
|  | 					getPacking(id).then((response) => { | ||||||
|  | 						this.dataForm = response.data; | ||||||
|  | 					}); | ||||||
|  | 					// 获取产品的属性列表 | ||||||
|  | 					// this.getList(); | ||||||
|  | 				} else { | ||||||
|  | 					getCode().then((res) => { | ||||||
|  |             this.dataForm.packagingCode = res.data; | ||||||
|  | 					}); | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
|  |  | ||||||
|  | 		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((response) => { | ||||||
|  |         // console.log(response); | ||||||
|  |         this.workOrderList = response.data | ||||||
|  | 				// this.listQuery.total = response.data.total; | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
|  | 		// handleClick(raw) { | ||||||
|  | 		// 	if (raw.type === 'delete') { | ||||||
|  | 		// 		this.$confirm( | ||||||
|  | 		// 			`确定对${ | ||||||
|  | 		// 				raw.data.name | ||||||
|  | 		// 					? '[名称=' + raw.data.name + ']' | ||||||
|  | 		// 					: '[序号=' + raw.data._pageIndex + ']' | ||||||
|  | 		// 			}进行删除操作?`, | ||||||
|  | 		// 			'提示', | ||||||
|  | 		// 			{ | ||||||
|  | 		// 				confirmButtonText: '确定', | ||||||
|  | 		// 				cancelButtonText: '取消', | ||||||
|  | 		// 				type: 'warning', | ||||||
|  | 		// 			} | ||||||
|  | 		// 		) | ||||||
|  | 		// 			.then(() => { | ||||||
|  | 		// 				deleteProductAttr(raw.data.id).then(({ data }) => { | ||||||
|  | 		// 					this.$message({ | ||||||
|  | 		// 						message: '操作成功', | ||||||
|  | 		// 						type: 'success', | ||||||
|  | 		// 						duration: 1500, | ||||||
|  | 		// 						onClose: () => { | ||||||
|  | 		// 							this.getList(); | ||||||
|  | 		// 						}, | ||||||
|  | 		// 					}); | ||||||
|  | 		// 				}); | ||||||
|  | 		// 			}) | ||||||
|  | 		// 			.catch(() => {}); | ||||||
|  | 		// 	} else { | ||||||
|  | 		// 		this.addNew(raw.data.id); | ||||||
|  | 		// 	} | ||||||
|  | 		// }, | ||||||
|  | 		// 表单提交 | ||||||
|  | 		dataFormSubmit() { | ||||||
|  | 			this.$refs['dataForm'].validate((valid) => { | ||||||
|  | 				if (valid) { | ||||||
|  | 					// 修改的提交 | ||||||
|  | 					if (this.dataForm.id) { | ||||||
|  | 						updatePacking(this.dataForm).then((response) => { | ||||||
|  | 							this.$modal.msgSuccess('修改成功'); | ||||||
|  | 							this.visible = false; | ||||||
|  | 							this.$emit('refreshDataList'); | ||||||
|  | 						}); | ||||||
|  | 						return; | ||||||
|  | 					} | ||||||
|  | 					// 添加的提交 | ||||||
|  | 					createPacking(this.dataForm).then((response) => { | ||||||
|  | 						this.$modal.msgSuccess('新增成功'); | ||||||
|  | 						this.visible = false; | ||||||
|  | 						this.$emit('refreshDataList'); | ||||||
|  | 					}); | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
|  | 		// goEdit() { | ||||||
|  | 		// 	this.isdetail = false; | ||||||
|  | 		// }, | ||||||
|  | 		// // 新增 / 修改 | ||||||
|  | 		// addNew(id) { | ||||||
|  | 		// 	this.addOrUpdateVisible = true; | ||||||
|  | 		// 	this.$nextTick(() => { | ||||||
|  | 		// 		this.$refs.addOrUpdate.init(id); | ||||||
|  | 		// 	}); | ||||||
|  | 		// }, | ||||||
|  | 		goback() { | ||||||
|  | 			this.$emit('refreshDataList'); | ||||||
|  | 			this.visible = false; | ||||||
|  | 			// this.initData(); | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </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: 76vh; | ||||||
|  | 	overflow: hidden; | ||||||
|  | 	overflow-y: scroll; | ||||||
|  | 	padding-right: 10px; /* 调整滚动条样式 */ | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer >>> .el-form, | ||||||
|  | .drawer >>> .attr-list { | ||||||
|  | 	padding: 0 16px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer-body__footer { | ||||||
|  | 	display: flex; | ||||||
|  | 	justify-content: flex-end; | ||||||
|  | 	padding: 18px; | ||||||
|  | } | ||||||
|  | </style> --> | ||||||
							
								
								
									
										356
									
								
								src/views/packaging/packagingPrintLog/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										356
									
								
								src/views/packaging/packagingPrintLog/index.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,356 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2023-08-01 14:55:51 | ||||||
|  |  * @LastEditors: zhp | ||||||
|  |  * @LastEditTime: 2023-11-24 09:13:50 | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  | 	<div class="app-container"> | ||||||
|  | 		<search-bar | ||||||
|  | 			:formConfigs="formConfig" | ||||||
|  | 			ref="searchBarForm" | ||||||
|  | 			@headBtnClick="buttonClick" /> | ||||||
|  | 		<base-table | ||||||
|  | 			:table-props="tableProps" | ||||||
|  | 			:page="listQuery.pageNo" | ||||||
|  | 			:limit="listQuery.pageSize" | ||||||
|  | 			:table-data="tableData"> | ||||||
|  | 			<method-btn | ||||||
|  | 				v-if="tableBtn.length" | ||||||
|  | 				slot="handleBtn" | ||||||
|  | 				:width="120" | ||||||
|  | 				label="操作" | ||||||
|  | 				:method-list="tableBtn" | ||||||
|  | 				@clickBtn="handleClick" /> | ||||||
|  | 		</base-table> | ||||||
|  | 		<pagination | ||||||
|  | 			:limit.sync="listQuery.pageSize" | ||||||
|  | 			:page.sync="listQuery.pageNo" | ||||||
|  | 			:total="listQuery.total" | ||||||
|  | 			@pagination="getDataList" /> | ||||||
|  | 		<add-or-update | ||||||
|  | 			v-if="addOrUpdateVisible" | ||||||
|  | 			ref="addOrUpdate" | ||||||
|  | 			@refreshDataList="getDataList" /> | ||||||
|  | 	</div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | import AddOrUpdate from './add-or-updata'; | ||||||
|  | // import unitDict from './unitDict'; | ||||||
|  | import basicPage from '../mixins/basic-page'; | ||||||
|  | import { parseTime } from '../mixins/code-filter'; | ||||||
|  | import { | ||||||
|  |   getPackingModel, | ||||||
|  | } from '@/api/base/printModel.js' | ||||||
|  | import { | ||||||
|  | 	deletePacking, | ||||||
|  |   getPackingPage, | ||||||
|  |   getWorkOrderList, | ||||||
|  | 	exportPackingExcel, | ||||||
|  | } from '@/api/base/packingInfo'; | ||||||
|  |  | ||||||
|  | const tableProps = [ | ||||||
|  | 	{ | ||||||
|  |     prop: 'packagingCode', | ||||||
|  |     label: '包装流水号' | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  |     prop: 'workOrderName', | ||||||
|  | 		label: '所属工单' | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  |     prop: 'customerName', | ||||||
|  | 		label: '客户' | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  |     prop: 'content', | ||||||
|  | 		label: '内容', | ||||||
|  | 		// subcomponent: unitDict, | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'modelName', | ||||||
|  |     label: '标签模板', | ||||||
|  |     // subcomponent: unitDict, | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     prop: 'printStatus', | ||||||
|  |     label: '打印状态', | ||||||
|  |     filter: (val) => val == 1 ? '未打印' : '已打印', | ||||||
|  |   }, | ||||||
|  | 	{ | ||||||
|  |     prop: 'createTime', | ||||||
|  | 		label: '生成日期', | ||||||
|  | 		filter: parseTime | ||||||
|  | 	}, | ||||||
|  | ]; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  | 	mixins: [basicPage], | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 			urlOptions: { | ||||||
|  |         getDataListURL: getPackingPage, | ||||||
|  | 				deleteURL: deletePacking, | ||||||
|  | 				exportURL: exportPackingExcel, | ||||||
|  | 			}, | ||||||
|  | 			tableProps, | ||||||
|  |       tableBtn: [ | ||||||
|  |         { | ||||||
|  |           type: 'print', | ||||||
|  |           btnName: '打印', | ||||||
|  |         }, | ||||||
|  |         this.$auth.hasPermi(`base:packaging-print-log:update`) | ||||||
|  | 					? { | ||||||
|  | 							type: 'edit', | ||||||
|  | 							btnName: '编辑', | ||||||
|  | 					  } | ||||||
|  |           : undefined, | ||||||
|  |         this.$auth.hasPermi(`base:packaging-print-log:delete`) | ||||||
|  | 					? { | ||||||
|  | 							type: 'delete', | ||||||
|  | 							btnName: '删除', | ||||||
|  | 					  } | ||||||
|  |           : undefined, | ||||||
|  | 			].filter((v) => v), | ||||||
|  | 			tableData: [], | ||||||
|  |       formConfig: [ | ||||||
|  |         { | ||||||
|  |           type: 'select', | ||||||
|  |           label: '工单', | ||||||
|  |           selectOptions: [], | ||||||
|  |           labelField: 'name', | ||||||
|  |           valueField: 'id', | ||||||
|  |           param: 'workOrderId', | ||||||
|  |           filterable: true, | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |           // parent: 'dateFilterType', | ||||||
|  |           // 时间段选择 | ||||||
|  |           type: 'datePicker', | ||||||
|  |           // label: '时间段', | ||||||
|  |           dateType: 'daterange', | ||||||
|  |           format: 'yyyy-MM-dd HH:mm:ss', | ||||||
|  |           valueFormat: 'yyyy-MM-dd HH:mm:ss', | ||||||
|  |           defaultTime: ['00:00:00', '00:00:00'], | ||||||
|  |           rangeSeparator: '-', | ||||||
|  |           startPlaceholder: '开始时间', | ||||||
|  |           endPlaceholder: '结束时间', | ||||||
|  |           param: 'createTime', | ||||||
|  |         }, | ||||||
|  | 				{ | ||||||
|  | 					type: 'button', | ||||||
|  | 					btnName: '搜索', | ||||||
|  | 					name: 'search', | ||||||
|  | 					color: 'primary', | ||||||
|  | 				}, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'separate', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'button', | ||||||
|  | 				// 	btnName: '重置', | ||||||
|  | 				// 	name: 'reset', | ||||||
|  | 				// }, | ||||||
|  | 				{ | ||||||
|  | 					type: 'separate', | ||||||
|  | 				}, | ||||||
|  | 				{ | ||||||
|  |           type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '', | ||||||
|  | 					btnName: '新增', | ||||||
|  | 					name: 'add', | ||||||
|  | 					color: 'success', | ||||||
|  | 					plain: true, | ||||||
|  | 				}, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'separate', | ||||||
|  | 				// 	type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: this.$auth.hasPermi('base:product:export') ? 'button' : '', | ||||||
|  | 				// 	btnName: '导出', | ||||||
|  | 				// 	name: 'export', | ||||||
|  | 				// 	color: 'warning', | ||||||
|  | 				// }, | ||||||
|  | 			], | ||||||
|  | 		}; | ||||||
|  | 	}, | ||||||
|  | 	components: { | ||||||
|  | 		AddOrUpdate, | ||||||
|  | 	}, | ||||||
|  |   created() { | ||||||
|  |     this.getDict() | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     getDataList() { | ||||||
|  |       this.dataListLoading = true; | ||||||
|  |       this.urlOptions.getDataListURL(this.listQuery).then(response => { | ||||||
|  |         this.tableData = response.data.records; | ||||||
|  |         this.listQuery.total = response.data.total; | ||||||
|  |         this.dataListLoading = false; | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     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((response) => { | ||||||
|  |         // console.log(response); | ||||||
|  |         this.formConfig[0].selectOptions = response.data.map((item) => { | ||||||
|  |           return { | ||||||
|  |             name: item.name, | ||||||
|  |             id: item.id | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |         console.log(this.formConfig[0].selectOptions); | ||||||
|  |         // this.listQuery.total = response.data.total; | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |     deleteHandle(id, name, index, packagingCode) { | ||||||
|  |       this.$confirm(`是否确认删除${'[' + packagingCode + ']'}数据项?`, "提示", { | ||||||
|  |         confirmButtonText: "确定", | ||||||
|  |         cancelButtonText: "取消", | ||||||
|  |         type: "warning", | ||||||
|  |       }) | ||||||
|  |         .then(() => { | ||||||
|  |           this.urlOptions.deleteURL(id).then(({ data }) => { | ||||||
|  |             this.$message({ | ||||||
|  |               message: "操作成功", | ||||||
|  |               type: "success", | ||||||
|  |               duration: 1500, | ||||||
|  |               onClose: () => { | ||||||
|  |                 this.getDataList(); | ||||||
|  |               }, | ||||||
|  |             }); | ||||||
|  |           }); | ||||||
|  |         }) | ||||||
|  |         .catch(() => { }); | ||||||
|  |     }, | ||||||
|  |     handlePrint(id) { | ||||||
|  |       if (id) { | ||||||
|  |         getPackingModel(id).then(res => { | ||||||
|  |           var obj = { | ||||||
|  |             code: '11111222', | ||||||
|  |             test: '11111', | ||||||
|  |             test2: '3333333', | ||||||
|  |             test1: '222222', | ||||||
|  |           } | ||||||
|  |           console.log(res); | ||||||
|  |           // getPackingListInfo({ | ||||||
|  |           //   size: 20, | ||||||
|  |           //   current: 1, | ||||||
|  |           //   boxNo: printModel.boxNo | ||||||
|  |           // }).then(result => { | ||||||
|  |           //   this.substrateList = result.data.records | ||||||
|  |           //   var obj = { | ||||||
|  |           //     // time: this.getNewDate(), | ||||||
|  |           //     boxNo: this.currentData.boxNo, | ||||||
|  |           //     orderNum: this.currentData.orderNum, | ||||||
|  |           //     powerLevel: this.currentData.powerLevel, | ||||||
|  |           //     sapMaterial: this.currentData.sapMaterial, | ||||||
|  |           //     img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/2T5eSAlvFilwgQUH+eLACaUxEiJLAxdh44MDZi2ChUIrSFtoCgbbSP4GDdwgeEA8kRTAI0iIGBL1ITLxgLAlCsCKBYndnx7zd35pl2+7On/de387OJ9l00515/z7z/szMmzfs7869mD0yCjw2gZAB4VhAiln4/dUaRGdU18aOnzw9dn24ioGJj0soFsJr1z2yNm+qN2/fvRFL8XyMYqTmFfxZ+TwMc1xKDsL/f2Ms8xGeLwuIRpCKx99MHf/i4uPrw5GQ9jIAfsCMXfw2HkuOX03Wb1qLh4+uIGFJjzecPoS5iEhUTg1hDMaM2GuRk6cGMTQUCYmPQQq86CMAkkPDkQirGAzXf7Du34ejN9IHmETCRjQGPL6D+4NnYDEJDQmXbaY6on/dm2Vm/jHdZe0Almm6Ll+YNQbzasX7765BNHI1o0sOYRghwExg7MG9dDQSiqsdwHuZmlFKMjLwQ3QcFtjlSxHTenLO3Lp7vfU09AOS41Ka+HC6CjIDIaqmguvIPgBtIgOcDhjVlMTQtarKOScumR/teCdpxoeNZGJCapjFt7Rcywrb2MYtnQBatCpZTzCkYCF+5suKRXf+6EvOmv0GSzwrhB/QpmGkBYZSpqvIZAlp8ZeMLFwKUH3z2gqWyd/+3F/5b1yRQQMCN8gQspeaKt+SAItSCxCiPjIjhDEkjRAMxmCZSbgZkYke537qdxl57KM8C0OkkD0ADohMXIlwgPIuBFFC9uS3p2XGflFSRAgpdxlZeBl84jUQr0ImjDTKGWZZBwE0eCkCL0J20UgjgGCwEDHNPjB86PbiilshfGRxOBCRD0tLCSWTnzMLO9yE4EbIzjIdTdmGpc8/rB4qK0c4FcKbqe7pyWZJ0k1lZhsnQnZq3EzV00dHDjupKXaFNGtcM7YA+Io+WzRIz2R0UxkWxY6QJgCHlCbfPlzAsZytj2ks5RCVZUGKCdkOoEt+Wl3RkCcjyzGv5wIS6aIynZJCQni7d0TTjPFaMFDg9wGNa8qRQn3KVEI+1rjPmKpm5KNzTemmMp7AZEK2AehXmz7bbC1SM/IZoH10pJ/K+hnyhXBrvZpmoBHAURf7HaV9daQ3v6Zk7hhWVr4AYDOAzzRNeKPHAyW7r459Yj/deUynMcyqqpY9/fXW+RTwkiF/ms5pADcd7nMbwAkBcfMM3wOwwOF+rys46TxCt+T72d2NG0YSg2fnC58ANDkbAZyVH41QNgAYVBTXNiMxeLYG6qawvagmGqGoTHOfwcAe6T8TvWwYlTC7OsALgRDNCIRoRiBEMwIhmhEI0YxAiGYEQjRDtZCY9iUyEaVpVi3kvuL4RKA0zSqF8Ad5TimMTxSnKO1KUCWEZ6hDVaYk0KFKigohbSUuI0uHiieKZQtp89kM+U7ZUmQKafHp4wpSH/eWJaTT5zPkD8g62GQI8cXqDTZok/HEsWgh+3Of2y4D2kU/0idKyEOaJdgqKLxSotXlfLFJESXkicKZGTrys6g0iRIyD8AvAFYLCq+UWC1yACOyD+Hrf1wAUCcwTN2pozzXiEqn6E59JoBvANQKDldHaimvM0WmTcawlydw2Oc1pY7yKFQGJJ4YxqiTXyEp/OlkBeVNyn0SmZdO5gC47rOOfjXlaY6sCGRfXKwA8LVP+pRaykuFzEhUXH7nR9P3AFYqiEsWKykP0mpGFlU3qKI0IlmlKD6RrKK0R1VEpvIW7uwSHXnVUdqVoHqSwz+K4xOB0jQH87I0IxCiGYEQzQiEaEYgRDMCIZoRCNGMQIhmBEI0gwuJK0xScKZemHiY1mzqUxThYgBLHO7zQOAzGnMBPOdwn8WC4rbDNjaSWVajQaEUp9wBsB7ALY/hLAVwHsB89VmwRXrhuGwf0q/xIl/z6f6105qVyxIKQ1cZjdlV/HI79V6N1yjk/dxlAMtc7LuM9lXZVzqhIXdxtvxR1kCxZUynkbl0o2ihgyQspH3mapqn7flrSE427O3TuKbwGZI/AlhuY9vltO08Belyw6T99lTnIQN2VmGeJqppskGhpfoW0DbVmuahaarVVQudGPZo3tH/RCOnfJbSbzp34D1T/VjsTL3X6esWFMJngJwDsCgnykX0P+mzQ1yyq9jqqtnzkGI0a7wgPz9pfJm+/6ZxB77bzus+7L7pkwdkarr8OBdwJee7jjQVaqZysVtDsuwK3j3lmGYnb5hwerW3S+PRl440OX3dh5vL7z0iXzXqY/bYbaZycXs/5KDdV/iUKc1URo7xcoOqq0yfui1Gq5e3EoUava1qzS/aJQGs8xKIj2jx+gCoVyGcoUBKGs8yIEgIAiliZEDwJAehL3ovIYS+2F9UDckyRH/fFhmoxuwTvdaJaCGc7+gyi9+br1YZSzTJEAIaffHrZG/JCFwDpK16JEsI5yK9uMdvzVe7zAUxZQrhXKKBwxqZkSikQ8aiZbnIFgKS4oea0i5bBhQJgQ+kKJEBhUJAUkqxo+cduJqVrQH8B6xBgBhvJFNDAAAAAElFTkSuQmCC', | ||||||
|  |           //     // lineBody: this.currentData.lineBody == 1 ? 'F ' : 'S', | ||||||
|  |           //     createTime: moment(this.currentData.createTime).format('YYYY-MM-DD HH:mm:ss') | ||||||
|  |           //     // modul1: '20210320000012', | ||||||
|  |           //     // modul2: '20210320000012', | ||||||
|  |           //     // modul3: '20210320000012' | ||||||
|  |           //   } | ||||||
|  |           //   for (var i = 0; i < this.substrateList.length; i++) { | ||||||
|  |           //     var model = 'model' + Number(i + 1) | ||||||
|  |           //     var pmpp = 'PMPP' + Number(i + 1) | ||||||
|  |           //     var m = 'm' + Number(i + 1) | ||||||
|  |  | ||||||
|  |           //     console.log(model) | ||||||
|  |           //     // console.log(this.list[i].woSubstrateId) | ||||||
|  |           //     // console.log(this.list[i].woSubstrateId) | ||||||
|  |           //     obj['' + model + ''] = this.substrateList[i].woSubstrateId | ||||||
|  |           //     obj['' + pmpp + ''] = this.substrateList[i].pmpp | ||||||
|  |           //     obj['' + m + ''] = i + 1 | ||||||
|  |           //   } | ||||||
|  |           //   console.log(obj) | ||||||
|  |           // this.printPreview('预览', res.data) | ||||||
|  |           const hiprintTemplate = this.$print(undefined, JSON.parse(res.data.content), obj, {}, { | ||||||
|  |             // styleHandler: () => { | ||||||
|  |             //   const css = '<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">' | ||||||
|  |             //   return css | ||||||
|  |             // } | ||||||
|  |           }) | ||||||
|  |  | ||||||
|  |           hiprintTemplate.on('printSuccess', function () { | ||||||
|  |             console.log(1111); | ||||||
|  |             // that.$notification.success({ | ||||||
|  |             //   // key: key, | ||||||
|  |             //   placement: 'topRight', | ||||||
|  |             //   message: key + ' 打印成功', | ||||||
|  |             //   description: 'Api单独直接打印回调', | ||||||
|  |             // }); | ||||||
|  |           }); | ||||||
|  |           console.log(hiprintTemplate) | ||||||
|  |         }) | ||||||
|  |       } else { | ||||||
|  |         this.$message({ | ||||||
|  |           message: '请选择打印标签模板', | ||||||
|  |           type: 'warning' | ||||||
|  |         }); | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     closeCallback(vue) { | ||||||
|  |       console.log('关闭了打印工具') | ||||||
|  |     }, | ||||||
|  | 		buttonClick(val) { | ||||||
|  | 			switch (val.btnName) { | ||||||
|  | 				case 'search': | ||||||
|  | 					this.listQuery.pageNo = 1; | ||||||
|  | 					this.listQuery.pageSize = 10; | ||||||
|  |           this.listQuery.workOrderId = val.workOrderId; | ||||||
|  |           if (val.createTime && val.createTime.length != 0) { | ||||||
|  |             this.listQuery.createTime = val.createTime | ||||||
|  |             // this.listQuery.createTime[1] = val.timeVal[1] | ||||||
|  |           } else { | ||||||
|  |             this.listQuery.createTime = undefined | ||||||
|  |             // this.listQuery.endTime = undefined | ||||||
|  |           } | ||||||
|  |           this.getDataList(); | ||||||
|  |           console.log(this.tableData) | ||||||
|  | 					break; | ||||||
|  | 				case 'reset': | ||||||
|  | 					this.$refs.searchBarForm.resetForm(); | ||||||
|  | 					this.listQuery = { | ||||||
|  | 						pageSize: 10, | ||||||
|  | 						pageNo: 1, | ||||||
|  | 						total: 1, | ||||||
|  | 					}; | ||||||
|  | 					this.getDataList(); | ||||||
|  | 					break; | ||||||
|  | 				case 'add': | ||||||
|  | 					this.addOrEditTitle = '新增'; | ||||||
|  | 					this.addOrUpdateVisible = true; | ||||||
|  | 					this.addOrUpdateHandle(); | ||||||
|  | 					break; | ||||||
|  | 				case 'export': | ||||||
|  | 					this.handleExport(); | ||||||
|  | 					break; | ||||||
|  | 				default: | ||||||
|  | 					console.log(val); | ||||||
|  | 			} | ||||||
|  | 		}, | ||||||
|  |     otherMethods(val) { | ||||||
|  |       this.handlePrint(val.data.modelId) | ||||||
|  | 			// this.addOrUpdateVisible = true; | ||||||
|  | 			// this.addOrEditTitle = '详情'; | ||||||
|  | 			// this.$nextTick(() => { | ||||||
|  | 			// 	this.$refs.addOrUpdate.init(val.data.id, true); | ||||||
|  | 			// }); | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
							
								
								
									
										15
									
								
								src/views/packaging/packagingPrintLog/unitDict.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/views/packaging/packagingPrintLog/unitDict.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | <template> | ||||||
|  |   <dict-tag | ||||||
|  |     :type="DICT_TYPE.UNIT_DICT" | ||||||
|  |     :value="injectData.unitDictValue" /> | ||||||
|  | </template> | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  | 	props: { | ||||||
|  | 		injectData: { | ||||||
|  | 			type: Object, | ||||||
|  | 			default: () => ({}), | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
							
								
								
									
										65
									
								
								src/views/packaging/packagingPrintModel/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								src/views/packaging/packagingPrintModel/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,65 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2023-08-01 15:27:31 | ||||||
|  |  * @LastEditors: zwq | ||||||
|  |  * @LastEditTime: 2023-08-01 16:25:54 | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  | 	<div :class="[className, { 'p-0': noPadding }]"> | ||||||
|  | 		<slot /> | ||||||
|  | 	</div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  | 	props: { | ||||||
|  | 		size: { | ||||||
|  | 			// 取值范围:  xl lg md sm | ||||||
|  | 			type: String, | ||||||
|  | 			default: 'de', | ||||||
|  | 			validator: function (val) { | ||||||
|  | 				return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1; | ||||||
|  | 			}, | ||||||
|  | 		}, | ||||||
|  | 		noPadding: { | ||||||
|  | 			type: Boolean, | ||||||
|  | 			default: false, | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | 	computed: { | ||||||
|  | 		className: function () { | ||||||
|  | 			return `${this.size}-title`; | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | $pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px); | ||||||
|  | $mgr: 8px; | ||||||
|  | @each $size, $height in $pxls { | ||||||
|  | 	.#{$size}-title { | ||||||
|  | 		font-size: 18px; | ||||||
|  | 		line-height: $height; | ||||||
|  | 		color: #000; | ||||||
|  | 		font-weight: 500; | ||||||
|  | 		font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif; | ||||||
|  |  | ||||||
|  | 		&::before { | ||||||
|  | 			content: ''; | ||||||
|  | 			display: inline-block; | ||||||
|  | 			vertical-align: top; | ||||||
|  | 			width: 4px; | ||||||
|  | 			height: $height + 2px; | ||||||
|  | 			border-radius: 1px; | ||||||
|  | 			margin-right: $mgr; | ||||||
|  | 			background-color: #0b58ff; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .p-0 { | ||||||
|  | 	padding: 0; | ||||||
|  | } | ||||||
|  | </style> | ||||||
							
								
								
									
										441
									
								
								src/views/packaging/packagingPrintModel/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										441
									
								
								src/views/packaging/packagingPrintModel/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,441 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zhp | ||||||
|  |  * @Date: 2023-10-17 16:50:19 | ||||||
|  |  * @LastEditTime: 2023-10-30 10:41:07 | ||||||
|  |  * @LastEditors: zhp | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  |   <el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="30%"> | ||||||
|  |     <small-title slot="title" :no-padding="true"> | ||||||
|  |       {{ !dataForm.id ? '新增' : '编辑' }} | ||||||
|  |     </small-title> | ||||||
|  |  | ||||||
|  |     <div class="content"> | ||||||
|  |       <div class="visual-part"> | ||||||
|  |         <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" | ||||||
|  |           @keyup.enter.native="dataFormSubmit"> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="模板名称" prop="name"> | ||||||
|  |                 <el-input v-model="dataForm.name" clearable placeholder="请输入模板名称" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="标签类型" prop="typeId"> | ||||||
|  |                 <el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择打印方式" clearable> | ||||||
|  |                   <el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||||
|  |                 </el-select> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="打印方式" prop="printModel"> | ||||||
|  |                 <el-select v-model="dataForm.printModel" style="width: 100%;" placeholder="请选择打印方式" clearable> | ||||||
|  |                   <el-option v-for="dict in printModelList" :key="dict.id" :label="dict.name" :value="dict.id" /> | ||||||
|  |                 </el-select> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="标签备注" prop="remark"> | ||||||
|  |                 <el-input v-model="dataForm.remark" clearable placeholder="请输入标签备注" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="模板设计" prop="content"> | ||||||
|  |                 <el-button type="primary" @click="btnClickDesign()">模板设计</el-button> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <!-- <el-col :span="12"> | ||||||
|  |               <el-form-item label="单位平方数" prop="area"> | ||||||
|  |                 <el-input v-model="dataForm.area" placeholder="请输入单位平方数" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> --> | ||||||
|  |           </el-row> | ||||||
|  |           <!-- <el-row :gutter="20"> | ||||||
|  |             <el-col :span="24"> | ||||||
|  |               <el-form-item label="完成单位产品用时" prop="processTime"> | ||||||
|  |                 <el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> --> | ||||||
|  |         </el-form> | ||||||
|  |  | ||||||
|  |         <!-- <small-title | ||||||
|  | 					style="margin: 16px 0; padding-left: 8px" | ||||||
|  | 					:no-padding="true"> | ||||||
|  | 					产品属性列表 | ||||||
|  | 				</small-title> | ||||||
|  |  | ||||||
|  | 				<div class="attr-list"> | ||||||
|  | 					<base-table | ||||||
|  | 						:table-props="tableProps" | ||||||
|  | 						:page="listQuery.pageNo" | ||||||
|  | 						:limit="listQuery.pageSize" | ||||||
|  | 						:add-button-show="isdetail ? null : '添加属性'" | ||||||
|  | 						@emitButtonClick="addNew()" | ||||||
|  | 						:table-data="productAttributeList"> | ||||||
|  | 						<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> | ||||||
|  |     </div> | ||||||
|  |  | ||||||
|  |     <!-- <div style="position: absolute; bottom: 24px; right: 24px"> | ||||||
|  | 			<el-button style="margin-right: 10px" @click="goback()">返回</el-button> | ||||||
|  | 			<el-button v-if="isdetail" type="primary" @click="goEdit()"> | ||||||
|  | 				编辑 | ||||||
|  | 			</el-button> | ||||||
|  | 			<span v-if="!isdetail"> | ||||||
|  | 				<el-button type="primary" @click="dataFormSubmit()">保存</el-button> | ||||||
|  | 				<el-button | ||||||
|  | 					v-if="dataForm.id && !isdetail" | ||||||
|  | 					type="primary" | ||||||
|  | 					@click="addNew()"> | ||||||
|  | 					添加属性 | ||||||
|  | 				</el-button> | ||||||
|  | 			</span> | ||||||
|  | 		</div> --> | ||||||
|  |     <template slot="footer"> | ||||||
|  |       <el-button style="" @click="goback()">取消</el-button> | ||||||
|  |       <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> | ||||||
|  | 				编辑 | ||||||
|  | 			</el-button> --> | ||||||
|  |       <el-button type="primary" @click="dataFormSubmit()">确定</el-button> | ||||||
|  |     </template> | ||||||
|  |     <print-model-design v-if="modelShow" ref="printModelDesign" @saveData="getModelData" /> | ||||||
|  |   </el-dialog> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  |  | ||||||
|  | import { | ||||||
|  |   createPackingModel, | ||||||
|  |   updatePackingModel, | ||||||
|  |   getPackingModel, | ||||||
|  |   // getWorkOrderList, | ||||||
|  |   // getCode, | ||||||
|  |   // getCustomerList, | ||||||
|  |   getTypeList | ||||||
|  | } from '@/api/base/printModel.js'; | ||||||
|  | // import productAttrAdd from './attr-add'; | ||||||
|  | import { parseTime } from '../mixins/code-filter'; | ||||||
|  | import SmallTitle from './SmallTitle'; | ||||||
|  | import printModelDesign from '../custom/index' | ||||||
|  |  | ||||||
|  | const tableBtn = [ | ||||||
|  | 	{ | ||||||
|  | 		type: 'edit', | ||||||
|  | 		btnName: '编辑', | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		type: 'delete', | ||||||
|  | 		btnName: '删除', | ||||||
|  | 	}, | ||||||
|  | ]; | ||||||
|  | const tableProps = [ | ||||||
|  | 	{ | ||||||
|  | 		prop: 'createTime', | ||||||
|  | 		label: '添加时间', | ||||||
|  | 		filter: parseTime, | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		prop: 'name', | ||||||
|  | 		label: '属性名', | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		prop: 'value', | ||||||
|  | 		label: '属性值', | ||||||
|  | 	}, | ||||||
|  | ]; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  |   components: { SmallTitle, printModelDesign }, | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 			visible: false, | ||||||
|  | 			addOrUpdateVisible: false, | ||||||
|  | 			tableBtn, | ||||||
|  |       tableProps, | ||||||
|  |       modelShow:false, | ||||||
|  |       typeList:[], | ||||||
|  | 			dataForm: { | ||||||
|  | 				id: null, | ||||||
|  | 				// name: '', // 产品名称 | ||||||
|  |         name: '', // 产品编码 | ||||||
|  | 				// area: 0, // 单位平方数(float only) | ||||||
|  |         typeId: null, // 产品类型id | ||||||
|  |         printModel: null, // 单位产品用时 (s) | ||||||
|  |         content: '', // 规格 | ||||||
|  |         remark: '', // 单位id | ||||||
|  |       }, | ||||||
|  |       printModelList: [ | ||||||
|  |         { | ||||||
|  |           id: 1, | ||||||
|  |           name:'自动' | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |           id: 2, | ||||||
|  |           name: '手动' | ||||||
|  |         }, | ||||||
|  |       ], | ||||||
|  | 			listQuery: { | ||||||
|  | 				pageSize: 10, | ||||||
|  | 				pageNo: 1, | ||||||
|  | 				total: 0, | ||||||
|  | 			}, | ||||||
|  | 			dataRule: { | ||||||
|  |         typeId: [ | ||||||
|  | 					{ | ||||||
|  | 						required: true, | ||||||
|  | 						message: '打印类型不能为空', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 					}, | ||||||
|  | 					// { | ||||||
|  | 					// 	type: 'number', | ||||||
|  | 					// 	message: '产品编码为数字类型', | ||||||
|  | 					// 	trigger: 'blur', | ||||||
|  | 					// 	transfom: 'val => Number(val)', | ||||||
|  | 					// }, | ||||||
|  | 				], | ||||||
|  | 				name: [ | ||||||
|  | 					{ | ||||||
|  | 						required: true, | ||||||
|  | 						message: '模板名称不能为空', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  |         printModel: [ | ||||||
|  | 					{ | ||||||
|  | 						required: true, | ||||||
|  | 						message: '模板类型不能为空', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 				content: [ | ||||||
|  |           { | ||||||
|  |             required: true, | ||||||
|  |             message: '模板不能为空', | ||||||
|  |             trigger: 'blur', | ||||||
|  |           }, | ||||||
|  | 				], | ||||||
|  | 				processTime: [ | ||||||
|  | 					{ | ||||||
|  | 						required: true, | ||||||
|  | 						message: '完成单位产品用时不能为空', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 					}, | ||||||
|  | 					{ | ||||||
|  | 						type: 'number', | ||||||
|  | 						message: '请输入正确的数值', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 						transform: (val) => Number(val), | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 			}, | ||||||
|  | 			// isdetail: false, | ||||||
|  | 		}; | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     getModelData(data) { | ||||||
|  |       console.log(data) | ||||||
|  |       this.content = JSON.stringify(data) | ||||||
|  |       this.dataForm.content = JSON.stringify(data) | ||||||
|  |     }, | ||||||
|  |     btnClickDesign() { | ||||||
|  |       console.log(11111) | ||||||
|  |       this.modelShow = true | ||||||
|  |       this.$nextTick(() => { | ||||||
|  |         this.$refs.printModelDesign.init(this.dataForm.content) | ||||||
|  |         console.log(this.dataForm.content) | ||||||
|  |       }) | ||||||
|  |       // this.$router.push({ | ||||||
|  |       //   path: '/printModelDesign' | ||||||
|  |       // }) | ||||||
|  |     }, | ||||||
|  | 		// initData() { | ||||||
|  | 		// 	this.productAttributeList.splice(0); | ||||||
|  | 		// 	this.listQuery.total = 0; | ||||||
|  | 		// }, | ||||||
|  |     init(id) { | ||||||
|  |       this.getDict() | ||||||
|  | 			// this.initData(); | ||||||
|  | 			// this.isdetail = isdetail || false; | ||||||
|  | 			this.dataForm.id = id || null; | ||||||
|  | 			this.visible = true; | ||||||
|  |  | ||||||
|  | 			this.$nextTick(() => { | ||||||
|  | 				this.$refs['dataForm'].resetFields(); | ||||||
|  |  | ||||||
|  | 				if (this.dataForm.id) { | ||||||
|  | 					// 获取产品详情 | ||||||
|  |           getPackingModel(id).then((response) => { | ||||||
|  | 						this.dataForm = response.data; | ||||||
|  | 					}); | ||||||
|  | 					// 获取产品的属性列表 | ||||||
|  | 					// this.getList(); | ||||||
|  | 				} else { | ||||||
|  | 					// getCode().then((res) => { | ||||||
|  |           //   this.dataForm.packagingCode = res.data; | ||||||
|  | 					// }); | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
|  |  | ||||||
|  | 		getDict() { | ||||||
|  |       // 获取产品的属性列表 | ||||||
|  |       // getCustomerList().then((response) => { | ||||||
|  |       //   console.log(response); | ||||||
|  |       //   this.customerList = response.data | ||||||
|  |       //   // this.listQuery.total = response.data.total; | ||||||
|  |       // }) | ||||||
|  |       getTypeList().then((response) => { | ||||||
|  |         console.log(response); | ||||||
|  |         this.typeList = response.data | ||||||
|  |         // this.listQuery.total = response.data.total; | ||||||
|  |       }) | ||||||
|  |       // getWorkOrderList().then((response) => { | ||||||
|  |       //   // console.log(response); | ||||||
|  |       //   this.workOrderList = response.data | ||||||
|  | 			// 	// this.listQuery.total = response.data.total; | ||||||
|  | 			// }) | ||||||
|  | 		}, | ||||||
|  | 		// handleClick(raw) { | ||||||
|  | 		// 	if (raw.type === 'delete') { | ||||||
|  | 		// 		this.$confirm( | ||||||
|  | 		// 			`确定对${ | ||||||
|  | 		// 				raw.data.name | ||||||
|  | 		// 					? '[名称=' + raw.data.name + ']' | ||||||
|  | 		// 					: '[序号=' + raw.data._pageIndex + ']' | ||||||
|  | 		// 			}进行删除操作?`, | ||||||
|  | 		// 			'提示', | ||||||
|  | 		// 			{ | ||||||
|  | 		// 				confirmButtonText: '确定', | ||||||
|  | 		// 				cancelButtonText: '取消', | ||||||
|  | 		// 				type: 'warning', | ||||||
|  | 		// 			} | ||||||
|  | 		// 		) | ||||||
|  | 		// 			.then(() => { | ||||||
|  | 		// 				deleteProductAttr(raw.data.id).then(({ data }) => { | ||||||
|  | 		// 					this.$message({ | ||||||
|  | 		// 						message: '操作成功', | ||||||
|  | 		// 						type: 'success', | ||||||
|  | 		// 						duration: 1500, | ||||||
|  | 		// 						onClose: () => { | ||||||
|  | 		// 							this.getList(); | ||||||
|  | 		// 						}, | ||||||
|  | 		// 					}); | ||||||
|  | 		// 				}); | ||||||
|  | 		// 			}) | ||||||
|  | 		// 			.catch(() => {}); | ||||||
|  | 		// 	} else { | ||||||
|  | 		// 		this.addNew(raw.data.id); | ||||||
|  | 		// 	} | ||||||
|  | 		// }, | ||||||
|  | 		// 表单提交 | ||||||
|  | 		dataFormSubmit() { | ||||||
|  | 			this.$refs['dataForm'].validate((valid) => { | ||||||
|  | 				if (valid) { | ||||||
|  | 					// 修改的提交 | ||||||
|  | 					if (this.dataForm.id) { | ||||||
|  |             updatePackingModel(this.dataForm).then((response) => { | ||||||
|  | 							this.$modal.msgSuccess('修改成功'); | ||||||
|  | 							this.visible = false; | ||||||
|  | 							this.$emit('refreshDataList'); | ||||||
|  | 						}); | ||||||
|  | 						return; | ||||||
|  | 					} | ||||||
|  | 					// 添加的提交 | ||||||
|  |           createPackingModel(this.dataForm).then((response) => { | ||||||
|  | 						this.$modal.msgSuccess('新增成功'); | ||||||
|  | 						this.visible = false; | ||||||
|  | 						this.$emit('refreshDataList'); | ||||||
|  | 					}); | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
|  | 		// goEdit() { | ||||||
|  | 		// 	this.isdetail = false; | ||||||
|  | 		// }, | ||||||
|  | 		// // 新增 / 修改 | ||||||
|  | 		// addNew(id) { | ||||||
|  | 		// 	this.addOrUpdateVisible = true; | ||||||
|  | 		// 	this.$nextTick(() => { | ||||||
|  | 		// 		this.$refs.addOrUpdate.init(id); | ||||||
|  | 		// 	}); | ||||||
|  | 		// }, | ||||||
|  | 		goback() { | ||||||
|  | 			this.$emit('refreshDataList'); | ||||||
|  | 			this.visible = false; | ||||||
|  | 			// this.initData(); | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </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: 76vh; | ||||||
|  | 	overflow: hidden; | ||||||
|  | 	overflow-y: scroll; | ||||||
|  | 	padding-right: 10px; /* 调整滚动条样式 */ | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer >>> .el-form, | ||||||
|  | .drawer >>> .attr-list { | ||||||
|  | 	padding: 0 16px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer-body__footer { | ||||||
|  | 	display: flex; | ||||||
|  | 	justify-content: flex-end; | ||||||
|  | 	padding: 18px; | ||||||
|  | } | ||||||
|  | </style> --> | ||||||
							
								
								
									
										215
									
								
								src/views/packaging/packagingPrintModel/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										215
									
								
								src/views/packaging/packagingPrintModel/index.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,215 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2023-08-01 14:55:51 | ||||||
|  |  * @LastEditors: zhp | ||||||
|  |  * @LastEditTime: 2023-11-22 14:40:07 | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  |   <div class="app-container"> | ||||||
|  |     <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> | ||||||
|  |     <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData"> | ||||||
|  |       <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" | ||||||
|  |         @clickBtn="handleClick" /> | ||||||
|  |     </base-table> | ||||||
|  |     <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" | ||||||
|  |       @pagination="getDataList" /> | ||||||
|  |     <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> | ||||||
|  |     <print-model-design v-if="modelShow" ref="printModelDesign" @saveData="getModelData" /> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | import AddOrUpdate from './add-or-updata'; | ||||||
|  | // import unitDict from './unitDict'; | ||||||
|  | import basicPage from '../mixins/basic-page'; | ||||||
|  |  | ||||||
|  | import { parseTime } from '../mixins/code-filter'; | ||||||
|  | import printModelDesign from '../custom/index' | ||||||
|  | import { updatePackingModel,} from '@/api/base/printModel.js'; | ||||||
|  | import { | ||||||
|  |   deletePackingModel, | ||||||
|  |   getPackingModelPage, | ||||||
|  | 	// exportPackingExcel, | ||||||
|  | } from '@/api/base/printModel'; | ||||||
|  |  | ||||||
|  | const tableProps = [ | ||||||
|  |   { | ||||||
|  |     prop: 'createTime', | ||||||
|  |     label: '创建时间', | ||||||
|  |     filter: parseTime | ||||||
|  |   }, | ||||||
|  | 	{ | ||||||
|  |     prop: 'name', | ||||||
|  |     label: '模板名称' | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  |     prop: 'typeName', | ||||||
|  | 		label: '标签类型' | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  |     prop: 'printModel', | ||||||
|  |     label: '打印方式', | ||||||
|  |     filter: (val) => val ==1 ? '自动打印' : '手动打印', | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  |     prop: 'remark', | ||||||
|  | 		label: '备注', | ||||||
|  | 		// subcomponent: unitDict, | ||||||
|  |   }, | ||||||
|  | ]; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  | 	mixins: [basicPage], | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 			urlOptions: { | ||||||
|  |         getDataListURL: getPackingModelPage, | ||||||
|  |         deleteURL: deletePackingModel, | ||||||
|  | 				// exportURL: exportPackingExcel, | ||||||
|  | 			}, | ||||||
|  |       tableProps, | ||||||
|  |       modelShow:false, | ||||||
|  |       tableBtn: [ | ||||||
|  |         { | ||||||
|  |           type: 'print', | ||||||
|  |           btnName: '查看', | ||||||
|  |         }, | ||||||
|  |         this.$auth.hasPermi(`base:packaging-print-model:update`) | ||||||
|  | 					? { | ||||||
|  | 							type: 'edit', | ||||||
|  | 							btnName: '编辑', | ||||||
|  | 					  } | ||||||
|  |           : undefined, | ||||||
|  |         this.$auth.hasPermi(`base:packaging-print-model:delete`) | ||||||
|  | 					? { | ||||||
|  | 							type: 'delete', | ||||||
|  | 							btnName: '删除', | ||||||
|  | 					  } | ||||||
|  |           : undefined, | ||||||
|  | 			].filter((v) => v), | ||||||
|  | 			tableData: [], | ||||||
|  | 			formConfig: [ | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'input', | ||||||
|  |         //   label: '工单', | ||||||
|  |         //   placeholder: '工单', | ||||||
|  |         //   param: 'workOrderId', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  |         //   // parent: 'dateFilterType', | ||||||
|  |         //   // 日期选择 | ||||||
|  |         //   type: 'datePicker', | ||||||
|  |         //   label: '时间', | ||||||
|  |         //   dateType: 'date', | ||||||
|  |         //   placeholder: '选择日期', | ||||||
|  |         //   format: 'yyyy-MM-dd', | ||||||
|  |         //   valueFormat: 'yyyy-MM-dd', | ||||||
|  |         //   param: 'createTime', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'button', | ||||||
|  | 				// 	btnName: '搜索', | ||||||
|  | 				// 	name: 'search', | ||||||
|  | 				// 	color: 'primary', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'separate', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'button', | ||||||
|  | 				// 	btnName: '重置', | ||||||
|  | 				// 	name: 'reset', | ||||||
|  | 				// }, | ||||||
|  | 				{ | ||||||
|  | 					type: 'separate', | ||||||
|  | 				}, | ||||||
|  | 				{ | ||||||
|  |           type: this.$auth.hasPermi('base:packaging-print-model:create') ? 'button' : '', | ||||||
|  | 					btnName: '新增模板', | ||||||
|  | 					name: 'add', | ||||||
|  | 					color: 'success', | ||||||
|  | 					plain: true, | ||||||
|  | 				}, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'separate', | ||||||
|  | 				// 	type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: this.$auth.hasPermi('base:product:export') ? 'button' : '', | ||||||
|  | 				// 	btnName: '导出', | ||||||
|  | 				// 	name: 'export', | ||||||
|  | 				// 	color: 'warning', | ||||||
|  | 				// }, | ||||||
|  | 			], | ||||||
|  | 		}; | ||||||
|  | 	}, | ||||||
|  | 	components: { | ||||||
|  |     AddOrUpdate, | ||||||
|  |     printModelDesign | ||||||
|  | 	}, | ||||||
|  | 	created() {}, | ||||||
|  |   methods: { | ||||||
|  |     getDataList() { | ||||||
|  |       this.dataListLoading = true; | ||||||
|  |       this.urlOptions.getDataListURL(this.listQuery).then(response => { | ||||||
|  |         this.tableData = response.data.records; | ||||||
|  |         this.listQuery.total = response.data.total; | ||||||
|  |         this.dataListLoading = false; | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  | 		buttonClick(val) { | ||||||
|  | 			switch (val.btnName) { | ||||||
|  | 				case 'search': | ||||||
|  | 					this.listQuery.pageNo = 1; | ||||||
|  | 					this.listQuery.pageSize = 10; | ||||||
|  |           this.listQuery.packagingCode = val.packagingCode; | ||||||
|  |           this.listQuery.createTime = val.createTime; | ||||||
|  | 					this.getDataList(); | ||||||
|  | 					break; | ||||||
|  | 				case 'reset': | ||||||
|  | 					this.$refs.searchBarForm.resetForm(); | ||||||
|  | 					this.listQuery = { | ||||||
|  | 						pageSize: 10, | ||||||
|  | 						pageNo: 1, | ||||||
|  | 						total: 1, | ||||||
|  | 					}; | ||||||
|  | 					this.getDataList(); | ||||||
|  | 					break; | ||||||
|  | 				case 'add': | ||||||
|  | 					this.addOrEditTitle = '新增'; | ||||||
|  | 					this.addOrUpdateVisible = true; | ||||||
|  | 					this.addOrUpdateHandle(); | ||||||
|  | 					break; | ||||||
|  | 				case 'export': | ||||||
|  | 					this.handleExport(); | ||||||
|  | 					break; | ||||||
|  | 				default: | ||||||
|  | 					console.log(val); | ||||||
|  | 			} | ||||||
|  |     }, | ||||||
|  |     getModelData(data) { | ||||||
|  |       // console.log(data) | ||||||
|  |       // this.content = JSON.stringify(data) | ||||||
|  |       // this.dataForm.content = JSON.stringify(data) | ||||||
|  |       console.log(data) | ||||||
|  |       // this.content = JSON.stringify(data) | ||||||
|  |       this.obj.content = JSON.stringify(data) | ||||||
|  |       updatePackingModel(this.obj).then((response) => { | ||||||
|  |         // this.$modal.msgSuccess('修改成功'); | ||||||
|  |         // this.visible = false; | ||||||
|  |         // this.$emit('refreshDataList'); | ||||||
|  |       }); | ||||||
|  |  | ||||||
|  |     }, | ||||||
|  |     otherMethods(val) { | ||||||
|  |       console.log(val) | ||||||
|  |       this.modelShow = true | ||||||
|  |       this.$nextTick(() => { | ||||||
|  |         this.obj = val.data | ||||||
|  |         this.$refs.printModelDesign.init(val.data.content) | ||||||
|  |       }) | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
							
								
								
									
										15
									
								
								src/views/packaging/packagingPrintModel/unitDict.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/views/packaging/packagingPrintModel/unitDict.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | <template> | ||||||
|  |   <dict-tag | ||||||
|  |     :type="DICT_TYPE.UNIT_DICT" | ||||||
|  |     :value="injectData.unitDictValue" /> | ||||||
|  | </template> | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  | 	props: { | ||||||
|  | 		injectData: { | ||||||
|  | 			type: Object, | ||||||
|  | 			default: () => ({}), | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
							
								
								
									
										65
									
								
								src/views/packaging/packagingPrintType/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								src/views/packaging/packagingPrintType/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,65 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2023-08-01 15:27:31 | ||||||
|  |  * @LastEditors: zwq | ||||||
|  |  * @LastEditTime: 2023-08-01 16:25:54 | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  | 	<div :class="[className, { 'p-0': noPadding }]"> | ||||||
|  | 		<slot /> | ||||||
|  | 	</div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  | 	props: { | ||||||
|  | 		size: { | ||||||
|  | 			// 取值范围:  xl lg md sm | ||||||
|  | 			type: String, | ||||||
|  | 			default: 'de', | ||||||
|  | 			validator: function (val) { | ||||||
|  | 				return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1; | ||||||
|  | 			}, | ||||||
|  | 		}, | ||||||
|  | 		noPadding: { | ||||||
|  | 			type: Boolean, | ||||||
|  | 			default: false, | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | 	computed: { | ||||||
|  | 		className: function () { | ||||||
|  | 			return `${this.size}-title`; | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | $pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px); | ||||||
|  | $mgr: 8px; | ||||||
|  | @each $size, $height in $pxls { | ||||||
|  | 	.#{$size}-title { | ||||||
|  | 		font-size: 18px; | ||||||
|  | 		line-height: $height; | ||||||
|  | 		color: #000; | ||||||
|  | 		font-weight: 500; | ||||||
|  | 		font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif; | ||||||
|  |  | ||||||
|  | 		&::before { | ||||||
|  | 			content: ''; | ||||||
|  | 			display: inline-block; | ||||||
|  | 			vertical-align: top; | ||||||
|  | 			width: 4px; | ||||||
|  | 			height: $height + 2px; | ||||||
|  | 			border-radius: 1px; | ||||||
|  | 			margin-right: $mgr; | ||||||
|  | 			background-color: #0b58ff; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .p-0 { | ||||||
|  | 	padding: 0; | ||||||
|  | } | ||||||
|  | </style> | ||||||
							
								
								
									
										347
									
								
								src/views/packaging/packagingPrintType/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										347
									
								
								src/views/packaging/packagingPrintType/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,347 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zhp | ||||||
|  |  * @Date: 2023-10-17 16:50:19 | ||||||
|  |  * @LastEditTime: 2023-10-18 16:07:39 | ||||||
|  |  * @LastEditors: zhp | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  |   <el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%"> | ||||||
|  |     <small-title slot="title" :no-padding="true"> | ||||||
|  |       {{ !dataForm.id ? '新增' : '编辑' }} | ||||||
|  |     </small-title> | ||||||
|  |  | ||||||
|  |     <div class="content"> | ||||||
|  |       <div class="visual-part"> | ||||||
|  |         <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" | ||||||
|  |           @keyup.enter.native="dataFormSubmit"> | ||||||
|  |           <el-row :gutter="20"> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="名称" prop="name"> | ||||||
|  |                 <el-input v-model="dataForm.name" clearable placeholder="名称" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |             <el-col :span="12"> | ||||||
|  |               <el-form-item label="类型描述" prop="description"> | ||||||
|  |                 <el-input v-model="dataForm.description" clearable placeholder="类型描述" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> | ||||||
|  |           <!-- <el-row :gutter="20"> | ||||||
|  |             <el-col :span="24"> | ||||||
|  |               <el-form-item label="完成单位产品用时" prop="processTime"> | ||||||
|  |                 <el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" /> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row> --> | ||||||
|  |         </el-form> | ||||||
|  |  | ||||||
|  |         <!-- <small-title | ||||||
|  | 					style="margin: 16px 0; padding-left: 8px" | ||||||
|  | 					:no-padding="true"> | ||||||
|  | 					产品属性列表 | ||||||
|  | 				</small-title> | ||||||
|  |  | ||||||
|  | 				<div class="attr-list"> | ||||||
|  | 					<base-table | ||||||
|  | 						:table-props="tableProps" | ||||||
|  | 						:page="listQuery.pageNo" | ||||||
|  | 						:limit="listQuery.pageSize" | ||||||
|  | 						:add-button-show="isdetail ? null : '添加属性'" | ||||||
|  | 						@emitButtonClick="addNew()" | ||||||
|  | 						:table-data="productAttributeList"> | ||||||
|  | 						<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> | ||||||
|  |     </div> | ||||||
|  |  | ||||||
|  |     <!-- <div style="position: absolute; bottom: 24px; right: 24px"> | ||||||
|  | 			<el-button style="margin-right: 10px" @click="goback()">返回</el-button> | ||||||
|  | 			<el-button v-if="isdetail" type="primary" @click="goEdit()"> | ||||||
|  | 				编辑 | ||||||
|  | 			</el-button> | ||||||
|  | 			<span v-if="!isdetail"> | ||||||
|  | 				<el-button type="primary" @click="dataFormSubmit()">保存</el-button> | ||||||
|  | 				<el-button | ||||||
|  | 					v-if="dataForm.id && !isdetail" | ||||||
|  | 					type="primary" | ||||||
|  | 					@click="addNew()"> | ||||||
|  | 					添加属性 | ||||||
|  | 				</el-button> | ||||||
|  | 			</span> | ||||||
|  | 		</div> --> | ||||||
|  |     <template slot="footer"> | ||||||
|  |       <el-button style="" @click="goback()">取消</el-button> | ||||||
|  |       <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> | ||||||
|  | 				编辑 | ||||||
|  | 			</el-button> --> | ||||||
|  |       <el-button type="primary" @click="dataFormSubmit()">确定</el-button> | ||||||
|  |     </template> | ||||||
|  |   </el-dialog> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  |  | ||||||
|  | import { | ||||||
|  |   createPackingType, | ||||||
|  |   updatePackingType, | ||||||
|  |   getPackingType, | ||||||
|  |   // getWorkOrderList, | ||||||
|  |   // getCode, | ||||||
|  |   // getCustomerList, | ||||||
|  |   // getModelList | ||||||
|  | } from '@/api/base/modelType.js'; | ||||||
|  | // import productAttrAdd from './attr-add'; | ||||||
|  | import { parseTime } from '../mixins/code-filter'; | ||||||
|  | import SmallTitle from './SmallTitle'; | ||||||
|  |  | ||||||
|  | const tableBtn = [ | ||||||
|  | 	{ | ||||||
|  | 		type: 'edit', | ||||||
|  | 		btnName: '编辑', | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		type: 'delete', | ||||||
|  | 		btnName: '删除', | ||||||
|  | 	}, | ||||||
|  | ]; | ||||||
|  | const tableProps = [ | ||||||
|  | 	{ | ||||||
|  | 		prop: 'createTime', | ||||||
|  | 		label: '添加时间', | ||||||
|  | 		filter: parseTime, | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		prop: 'name', | ||||||
|  | 		label: '属性名', | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		prop: 'value', | ||||||
|  | 		label: '属性值', | ||||||
|  | 	}, | ||||||
|  | ]; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  | 	components: { SmallTitle }, | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 			visible: false, | ||||||
|  | 			addOrUpdateVisible: false, | ||||||
|  | 			tableBtn, | ||||||
|  |       tableProps, | ||||||
|  |       customerList: [], | ||||||
|  |       modelList:[], | ||||||
|  |       workOrderList:[], | ||||||
|  | 			productAttributeList: [], | ||||||
|  | 			dataForm: { | ||||||
|  | 				id: null, | ||||||
|  | 				// name: '', // 产品名称 | ||||||
|  |         name: '', // 产品编码 | ||||||
|  | 				// area: 0, // 单位平方数(float only) | ||||||
|  |         description: null, // 产品类型id | ||||||
|  |         // workOrderId: null, // 单位产品用时 (s) | ||||||
|  |         // customerId: '', // 规格 | ||||||
|  |         // content: '', // 单位id | ||||||
|  | 			}, | ||||||
|  | 			listQuery: { | ||||||
|  | 				pageSize: 10, | ||||||
|  | 				pageNo: 1, | ||||||
|  | 				total: 0, | ||||||
|  | 			}, | ||||||
|  | 			dataRule: { | ||||||
|  | 				name: [ | ||||||
|  | 					{ | ||||||
|  | 						required: true, | ||||||
|  | 						message: '名称不能为空', | ||||||
|  | 						trigger: 'blur', | ||||||
|  | 					}, | ||||||
|  | 				], | ||||||
|  | 			}, | ||||||
|  | 			// isdetail: false, | ||||||
|  | 		}; | ||||||
|  |   }, | ||||||
|  | 	methods: { | ||||||
|  | 		// initData() { | ||||||
|  | 		// 	this.productAttributeList.splice(0); | ||||||
|  | 		// 	this.listQuery.total = 0; | ||||||
|  | 		// }, | ||||||
|  |     init(id) { | ||||||
|  |       // this.getDict() | ||||||
|  | 			// this.initData(); | ||||||
|  | 			// this.isdetail = isdetail || false; | ||||||
|  | 			this.dataForm.id = id || null; | ||||||
|  | 			this.visible = true; | ||||||
|  |  | ||||||
|  | 			this.$nextTick(() => { | ||||||
|  | 				this.$refs['dataForm'].resetFields(); | ||||||
|  |  | ||||||
|  | 				if (this.dataForm.id) { | ||||||
|  | 					// 获取产品详情 | ||||||
|  |           getPackingType(id).then((response) => { | ||||||
|  | 						this.dataForm = response.data; | ||||||
|  | 					}); | ||||||
|  | 					// 获取产品的属性列表 | ||||||
|  | 					// this.getList(); | ||||||
|  | 				} else { | ||||||
|  | 					// getCode().then((res) => { | ||||||
|  |           //   this.dataForm.packagingCode = res.data; | ||||||
|  | 					// }); | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
|  |  | ||||||
|  | 		// 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((response) => { | ||||||
|  |     //     // console.log(response); | ||||||
|  |     //     this.workOrderList = response.data | ||||||
|  | 		// 		// this.listQuery.total = response.data.total; | ||||||
|  | 		// 	}) | ||||||
|  | 		// }, | ||||||
|  | 		// handleClick(raw) { | ||||||
|  | 		// 	if (raw.type === 'delete') { | ||||||
|  | 		// 		this.$confirm( | ||||||
|  | 		// 			`确定对${ | ||||||
|  | 		// 				raw.data.name | ||||||
|  | 		// 					? '[名称=' + raw.data.name + ']' | ||||||
|  | 		// 					: '[序号=' + raw.data._pageIndex + ']' | ||||||
|  | 		// 			}进行删除操作?`, | ||||||
|  | 		// 			'提示', | ||||||
|  | 		// 			{ | ||||||
|  | 		// 				confirmButtonText: '确定', | ||||||
|  | 		// 				cancelButtonText: '取消', | ||||||
|  | 		// 				type: 'warning', | ||||||
|  | 		// 			} | ||||||
|  | 		// 		) | ||||||
|  | 		// 			.then(() => { | ||||||
|  | 		// 				deleteProductAttr(raw.data.id).then(({ data }) => { | ||||||
|  | 		// 					this.$message({ | ||||||
|  | 		// 						message: '操作成功', | ||||||
|  | 		// 						type: 'success', | ||||||
|  | 		// 						duration: 1500, | ||||||
|  | 		// 						onClose: () => { | ||||||
|  | 		// 							this.getList(); | ||||||
|  | 		// 						}, | ||||||
|  | 		// 					}); | ||||||
|  | 		// 				}); | ||||||
|  | 		// 			}) | ||||||
|  | 		// 			.catch(() => {}); | ||||||
|  | 		// 	} else { | ||||||
|  | 		// 		this.addNew(raw.data.id); | ||||||
|  | 		// 	} | ||||||
|  | 		// }, | ||||||
|  | 		// 表单提交 | ||||||
|  | 		dataFormSubmit() { | ||||||
|  | 			this.$refs['dataForm'].validate((valid) => { | ||||||
|  | 				if (valid) { | ||||||
|  | 					// 修改的提交 | ||||||
|  | 					if (this.dataForm.id) { | ||||||
|  |             updatePackingType(this.dataForm).then((response) => { | ||||||
|  | 							this.$modal.msgSuccess('修改成功'); | ||||||
|  | 							this.visible = false; | ||||||
|  | 							this.$emit('refreshDataList'); | ||||||
|  | 						}); | ||||||
|  | 						return; | ||||||
|  | 					} | ||||||
|  | 					// 添加的提交 | ||||||
|  |           createPackingType(this.dataForm).then((response) => { | ||||||
|  | 						this.$modal.msgSuccess('新增成功'); | ||||||
|  | 						this.visible = false; | ||||||
|  | 						this.$emit('refreshDataList'); | ||||||
|  | 					}); | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
|  | 		// goEdit() { | ||||||
|  | 		// 	this.isdetail = false; | ||||||
|  | 		// }, | ||||||
|  | 		// // 新增 / 修改 | ||||||
|  | 		// addNew(id) { | ||||||
|  | 		// 	this.addOrUpdateVisible = true; | ||||||
|  | 		// 	this.$nextTick(() => { | ||||||
|  | 		// 		this.$refs.addOrUpdate.init(id); | ||||||
|  | 		// 	}); | ||||||
|  | 		// }, | ||||||
|  | 		goback() { | ||||||
|  | 			this.$emit('refreshDataList'); | ||||||
|  | 			this.visible = false; | ||||||
|  | 			// this.initData(); | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </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: 76vh; | ||||||
|  | 	overflow: hidden; | ||||||
|  | 	overflow-y: scroll; | ||||||
|  | 	padding-right: 10px; /* 调整滚动条样式 */ | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer >>> .el-form, | ||||||
|  | .drawer >>> .attr-list { | ||||||
|  | 	padding: 0 16px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .drawer-body__footer { | ||||||
|  | 	display: flex; | ||||||
|  | 	justify-content: flex-end; | ||||||
|  | 	padding: 18px; | ||||||
|  | } | ||||||
|  | </style> --> | ||||||
							
								
								
									
										191
									
								
								src/views/packaging/packagingPrintType/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										191
									
								
								src/views/packaging/packagingPrintType/index.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,191 @@ | |||||||
|  | <!-- | ||||||
|  |  * @Author: zwq | ||||||
|  |  * @Date: 2023-08-01 14:55:51 | ||||||
|  |  * @LastEditors: zhp | ||||||
|  |  * @LastEditTime: 2023-11-22 14:36:33 | ||||||
|  |  * @Description: | ||||||
|  | --> | ||||||
|  | <template> | ||||||
|  | 	<div class="app-container"> | ||||||
|  | 		<search-bar | ||||||
|  | 			:formConfigs="formConfig" | ||||||
|  | 			ref="searchBarForm" | ||||||
|  | 			@headBtnClick="buttonClick" /> | ||||||
|  | 		<base-table | ||||||
|  | 			:table-props="tableProps" | ||||||
|  | 			:page="listQuery.pageNo" | ||||||
|  | 			:limit="listQuery.pageSize" | ||||||
|  | 			:table-data="tableData"> | ||||||
|  | 			<method-btn | ||||||
|  | 				v-if="tableBtn.length" | ||||||
|  | 				slot="handleBtn" | ||||||
|  | 				:width="120" | ||||||
|  | 				label="操作" | ||||||
|  | 				:method-list="tableBtn" | ||||||
|  | 				@clickBtn="handleClick" /> | ||||||
|  | 		</base-table> | ||||||
|  | 		<pagination | ||||||
|  | 			:limit.sync="listQuery.pageSize" | ||||||
|  | 			:page.sync="listQuery.pageNo" | ||||||
|  | 			:total="listQuery.total" | ||||||
|  | 			@pagination="getDataList" /> | ||||||
|  | 		<add-or-update | ||||||
|  | 			v-if="addOrUpdateVisible" | ||||||
|  | 			ref="addOrUpdate" | ||||||
|  | 			@refreshDataList="getDataList" /> | ||||||
|  | 	</div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | import AddOrUpdate from './add-or-updata'; | ||||||
|  | // import unitDict from './unitDict'; | ||||||
|  | import basicPage from '../mixins/basic-page'; | ||||||
|  | import { parseTime } from '../mixins/code-filter'; | ||||||
|  | import { | ||||||
|  | 	deletePackingType, | ||||||
|  |   getPackingTypePage, | ||||||
|  | 	// exportPackingExcel, | ||||||
|  | } from '@/api/base/modelType'; | ||||||
|  |  | ||||||
|  | const tableProps = [ | ||||||
|  | 	{ | ||||||
|  |     prop: 'name', | ||||||
|  |     label: '名称' | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  |     prop: 'description', | ||||||
|  | 		label: '描述' | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  |     prop: 'createTime', | ||||||
|  | 		label: '生成日期', | ||||||
|  | 		filter: parseTime | ||||||
|  | 	}, | ||||||
|  | ]; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  | 	mixins: [basicPage], | ||||||
|  | 	data() { | ||||||
|  | 		return { | ||||||
|  | 			urlOptions: { | ||||||
|  |         getDataListURL: getPackingTypePage, | ||||||
|  | 				deleteURL: deletePackingType, | ||||||
|  | 				// exportURL: exportPackingExcel, | ||||||
|  | 			}, | ||||||
|  | 			tableProps, | ||||||
|  | 			tableBtn: [ | ||||||
|  |         this.$auth.hasPermi(`base:packaging-print-log:update`) | ||||||
|  | 					? { | ||||||
|  | 							type: 'edit', | ||||||
|  | 							btnName: '编辑', | ||||||
|  | 					  } | ||||||
|  |           : undefined, | ||||||
|  |         this.$auth.hasPermi(`base:packaging-print-log:delete`) | ||||||
|  | 					? { | ||||||
|  | 							type: 'delete', | ||||||
|  | 							btnName: '删除', | ||||||
|  | 					  } | ||||||
|  |           : undefined, | ||||||
|  |  | ||||||
|  | 			].filter((v) => v), | ||||||
|  | 			tableData: [], | ||||||
|  | 			formConfig: [ | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'input', | ||||||
|  |         //   label: '工单', | ||||||
|  |         //   placeholder: '工单', | ||||||
|  |         //   param: 'workOrderId', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  |         //   // parent: 'dateFilterType', | ||||||
|  |         //   // 日期选择 | ||||||
|  |         //   type: 'datePicker', | ||||||
|  |         //   label: '时间', | ||||||
|  |         //   dateType: 'date', | ||||||
|  |         //   placeholder: '选择日期', | ||||||
|  |         //   format: 'yyyy-MM-dd', | ||||||
|  |         //   valueFormat: 'yyyy-MM-dd', | ||||||
|  |         //   param: 'createTime', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'button', | ||||||
|  | 				// 	btnName: '搜索', | ||||||
|  | 				// 	name: 'search', | ||||||
|  | 				// 	color: 'primary', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'separate', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'button', | ||||||
|  | 				// 	btnName: '重置', | ||||||
|  | 				// 	name: 'reset', | ||||||
|  | 				// }, | ||||||
|  | 				{ | ||||||
|  | 					type: 'separate', | ||||||
|  | 				}, | ||||||
|  | 				{ | ||||||
|  |           type: this.$auth.hasPermi('base:packaging-print-type:create') ? 'button' : '', | ||||||
|  | 					btnName: '新增', | ||||||
|  | 					name: 'add', | ||||||
|  | 					color: 'success', | ||||||
|  | 					plain: true, | ||||||
|  | 				}, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: 'separate', | ||||||
|  | 				// 	type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', | ||||||
|  | 				// }, | ||||||
|  | 				// { | ||||||
|  | 				// 	type: this.$auth.hasPermi('base:product:export') ? 'button' : '', | ||||||
|  | 				// 	btnName: '导出', | ||||||
|  | 				// 	name: 'export', | ||||||
|  | 				// 	color: 'warning', | ||||||
|  | 				// }, | ||||||
|  | 			], | ||||||
|  | 		}; | ||||||
|  | 	}, | ||||||
|  | 	components: { | ||||||
|  | 		AddOrUpdate, | ||||||
|  | 	}, | ||||||
|  | 	created() {}, | ||||||
|  | 	methods: { | ||||||
|  | 		buttonClick(val) { | ||||||
|  | 			switch (val.btnName) { | ||||||
|  | 				case 'search': | ||||||
|  | 					this.listQuery.pageNo = 1; | ||||||
|  | 					this.listQuery.pageSize = 10; | ||||||
|  |           this.listQuery.packagingCode = val.packagingCode; | ||||||
|  |           this.listQuery.createTime = val.createTime; | ||||||
|  | 					this.getDataList(); | ||||||
|  | 					break; | ||||||
|  | 				case 'reset': | ||||||
|  | 					this.$refs.searchBarForm.resetForm(); | ||||||
|  | 					this.listQuery = { | ||||||
|  | 						pageSize: 10, | ||||||
|  | 						pageNo: 1, | ||||||
|  | 						total: 1, | ||||||
|  | 					}; | ||||||
|  | 					this.getDataList(); | ||||||
|  | 					break; | ||||||
|  | 				case 'add': | ||||||
|  | 					this.addOrEditTitle = '新增'; | ||||||
|  | 					this.addOrUpdateVisible = true; | ||||||
|  | 					this.addOrUpdateHandle(); | ||||||
|  | 					break; | ||||||
|  | 				case 'export': | ||||||
|  | 					this.handleExport(); | ||||||
|  | 					break; | ||||||
|  | 				default: | ||||||
|  | 					console.log(val); | ||||||
|  | 			} | ||||||
|  | 		}, | ||||||
|  | 		otherMethods(val) { | ||||||
|  | 			this.addOrUpdateVisible = true; | ||||||
|  | 			this.addOrEditTitle = '详情'; | ||||||
|  | 			this.$nextTick(() => { | ||||||
|  | 				this.$refs.addOrUpdate.init(val.data.id, true); | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
							
								
								
									
										15
									
								
								src/views/packaging/packagingPrintType/unitDict.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/views/packaging/packagingPrintType/unitDict.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | <template> | ||||||
|  |   <dict-tag | ||||||
|  |     :type="DICT_TYPE.UNIT_DICT" | ||||||
|  |     :value="injectData.unitDictValue" /> | ||||||
|  | </template> | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  | 	props: { | ||||||
|  | 		injectData: { | ||||||
|  | 			type: Object, | ||||||
|  | 			default: () => ({}), | ||||||
|  | 		}, | ||||||
|  | 	}, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
| @@ -103,21 +103,6 @@ | |||||||
| 						style="width: 100%"></el-input-number> | 						style="width: 100%"></el-input-number> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</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-col :span="6"> | ||||||
| 				<el-form-item label="工单类型" prop="type"> | 				<el-form-item label="工单类型" prop="type"> | ||||||
| 					<el-select | 					<el-select | ||||||
| @@ -148,11 +133,6 @@ | |||||||
| 					</el-select> | 					</el-select> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</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-row> | 		</el-row> | ||||||
| 		<el-row :gutter="20"> | 		<el-row :gutter="20"> | ||||||
| 			<el-col :span="24"> | 			<el-col :span="24"> | ||||||
| @@ -293,10 +273,8 @@ export default { | |||||||
| 				deptId: undefined, | 				deptId: undefined, | ||||||
| 				planQuantity: 0, | 				planQuantity: 0, | ||||||
| 				materialMethod: 1, | 				materialMethod: 1, | ||||||
| 				priority: '', |  | ||||||
| 				productLineIds: [{ lineId: null, processId: null, num: null }], | 				productLineIds: [{ lineId: null, processId: null, num: null }], | ||||||
| 				type: '', | 				type: '', | ||||||
| 				workers: '', |  | ||||||
| 				planAssignmentQuantity: '', | 				planAssignmentQuantity: '', | ||||||
| 			}, | 			}, | ||||||
| 			deptList: [], | 			deptList: [], | ||||||
| @@ -304,6 +282,9 @@ export default { | |||||||
| 				name: [ | 				name: [ | ||||||
| 					{ required: true, message: '工单名称不能为空', trigger: 'blur' }, | 					{ required: true, message: '工单名称不能为空', trigger: 'blur' }, | ||||||
| 				], | 				], | ||||||
|  | 				workOrderId:[ | ||||||
|  | 				{ required: true, message: '工单名称不能为空', trigger: 'change' }, | ||||||
|  | 				], | ||||||
| 				planProductId: [ | 				planProductId: [ | ||||||
| 					{ required: true, message: '产品名称不能为空', trigger: 'change' }, | 					{ required: true, message: '产品名称不能为空', trigger: 'change' }, | ||||||
| 				], | 				], | ||||||
| @@ -476,9 +457,6 @@ export default { | |||||||
| 							? moment(res.data.planFinishTime) | 							? moment(res.data.planFinishTime) | ||||||
| 									.format('YYYY-MM-DD HH:mm:ss') | 									.format('YYYY-MM-DD HH:mm:ss') | ||||||
| 							: null; | 							: null; | ||||||
| 						this.form.priority = res.data.priority |  | ||||||
| 							? res.data.priority + '' |  | ||||||
| 							: ''; |  | ||||||
| 						// 根据产线获取工艺 | 						// 根据产线获取工艺 | ||||||
| 						if (this.form.materialMethod === 2) { | 						if (this.form.materialMethod === 2) { | ||||||
| 							this.form.productLineIds.forEach((item) => { | 							this.form.productLineIds.forEach((item) => { | ||||||
|   | |||||||
| @@ -56,16 +56,6 @@ | |||||||
|           </el-select> |           </el-select> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|       </el-col> |       </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-col :span='6'> | ||||||
|         <el-form-item label="包装规格" prop="packSpec"> |         <el-form-item label="包装规格" prop="packSpec"> | ||||||
|           <el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable> |           <el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable> | ||||||
| @@ -75,7 +65,9 @@ | |||||||
|           </el-select> |           </el-select> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|       </el-col> |       </el-col> | ||||||
|       <el-col :span='12'> |     </el-row> | ||||||
|  |     <el-row :gutter="20"> | ||||||
|  |       <el-col :span='24'> | ||||||
|         <el-form-item label="备注" prop="remark"> |         <el-form-item label="备注" prop="remark"> | ||||||
|           <el-input v-model="form.remark"></el-input> |           <el-input v-model="form.remark"></el-input> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
| @@ -99,9 +91,7 @@ export default { | |||||||
|         planQuantity: '', |         planQuantity: '', | ||||||
|         planProductId: '', |         planProductId: '', | ||||||
|         specifications:undefined, |         specifications:undefined, | ||||||
|         price: '', |  | ||||||
|         customerId: '', |         customerId: '', | ||||||
|         priority: '', |  | ||||||
|         packSpec: '', |         packSpec: '', | ||||||
|         workers: '', |         workers: '', | ||||||
|         materialMethod: 1, |         materialMethod: 1, | ||||||
| @@ -114,7 +104,8 @@ export default { | |||||||
|         name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }], |         name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }], | ||||||
|         code: [{ required: true, message: "订单号不能为空", trigger: "blur" }], |         code: [{ required: true, message: "订单号不能为空", trigger: "blur" }], | ||||||
|         planQuantity: [{ 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: [], |       productList: [], | ||||||
|       customerList: [], |       customerList: [], | ||||||
| @@ -142,9 +133,7 @@ export default { | |||||||
|             this.form.code = res.data.code |             this.form.code = res.data.code | ||||||
|             this.form.planQuantity = res.data.planQuantity |             this.form.planQuantity = res.data.planQuantity | ||||||
|             this.form.planProductId = res.data.planProductId |             this.form.planProductId = res.data.planProductId | ||||||
|             this.form.price = res.data.price |  | ||||||
|             this.form.customerId = res.data.customerId |             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.planStartTime = res.data.planStartTime ? res.data.planStartTime : null | ||||||
|             this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : '' |             this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : '' | ||||||
|             this.form.workers = res.data.workers |             this.form.workers = res.data.workers | ||||||
| @@ -235,7 +224,6 @@ export default { | |||||||
|     formClear() { |     formClear() { | ||||||
|       this.$refs.orderAddForm.resetFields() |       this.$refs.orderAddForm.resetFields() | ||||||
|       this.form.materialMethod = 1 |       this.form.materialMethod = 1 | ||||||
|       this.form.price = 0.00 |  | ||||||
|       this.form.planQuantity = 0 |       this.form.planQuantity = 0 | ||||||
|       this.isEdit = false |       this.isEdit = false | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -73,11 +73,6 @@ const tableProps = [ | |||||||
| 		label: '产品规格', | 		label: '产品规格', | ||||||
| 		showOverflowtooltip: true, | 		showOverflowtooltip: true, | ||||||
| 	}, | 	}, | ||||||
| 	// { |  | ||||||
| 	//   prop: 'priority', |  | ||||||
| 	//   label: '优先级', |  | ||||||
| 	//   filter: publicFormatter('order_priority') |  | ||||||
| 	// }, |  | ||||||
| 	{ | 	{ | ||||||
| 		prop: 'planQuantity', | 		prop: 'planQuantity', | ||||||
| 		label: '计划加工量', | 		label: '计划加工量', | ||||||
| @@ -97,12 +92,6 @@ const tableProps = [ | |||||||
| 		showOverflowtooltip: true, | 		showOverflowtooltip: true, | ||||||
| 		// subcomponent: selectMember, | 		// subcomponent: selectMember, | ||||||
| 	}, | 	}, | ||||||
| 	{ |  | ||||||
| 		prop: 'price', |  | ||||||
| 		label: '单价', |  | ||||||
| 		width: 100, |  | ||||||
| 		// subcomponent: inputArea, |  | ||||||
| 	}, |  | ||||||
| 	{ | 	{ | ||||||
| 		prop: 'packSpec', | 		prop: 'packSpec', | ||||||
| 		label: '包装规格', | 		label: '包装规格', | ||||||
| @@ -130,10 +119,8 @@ export default { | |||||||
| 				code: '', | 				code: '', | ||||||
| 				planQuantity: '', | 				planQuantity: '', | ||||||
| 				planProductId: '', | 				planProductId: '', | ||||||
| 				price: '', |  | ||||||
| 				customerId: '', | 				customerId: '', | ||||||
| 				attr3: undefined, | 				attr3: undefined, | ||||||
| 				priority: '', |  | ||||||
| 				packSpec: '', | 				packSpec: '', | ||||||
| 				workers: '', | 				workers: '', | ||||||
| 				materialMethod: 1, | 				materialMethod: 1, | ||||||
| @@ -190,9 +177,7 @@ export default { | |||||||
| 			//       this.form.code = res.data.code | 			//       this.form.code = res.data.code | ||||||
| 			//       this.form.planQuantity = res.data.planQuantity | 			//       this.form.planQuantity = res.data.planQuantity | ||||||
| 			//       this.form.planProductId = res.data.planProductId | 			//       this.form.planProductId = res.data.planProductId | ||||||
| 			//       this.form.price = res.data.price |  | ||||||
| 			//       this.form.customerId = res.data.customerId | 			//       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.planStartTime = res.data.planStartTime ? res.data.planStartTime : null | ||||||
| 			//       this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : '' | 			//       this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : '' | ||||||
| 			//       this.form.workers = res.data.workers | 			//       this.form.workers = res.data.workers | ||||||
|   | |||||||
| @@ -62,14 +62,14 @@ | |||||||
| 				label="产品" | 				label="产品" | ||||||
| 				show-overflow-tooltip | 				show-overflow-tooltip | ||||||
| 				min-width="120" /> | 				min-width="120" /> | ||||||
| 			<el-table-column prop="deliveTime" label="交货时间" width="160"> | 			<el-table-column prop="deliveTime" label="交货日期" width="160"> | ||||||
| 				<template v-slot="scope"> | 				<template v-slot="scope"> | ||||||
| 					<span>{{ parseTime(scope.row.deliveTime) }}</span> | 					<span>{{ parseTime(scope.row.deliveTime) }}</span> | ||||||
| 				</template> | 				</template> | ||||||
| 			</el-table-column> | 			</el-table-column> | ||||||
| 			<el-table-column prop="workOrderNum" label="工单数量" width="140"> | 			<el-table-column prop="workOrderNum" label="工单数量" width="140"> | ||||||
| 				<template v-slot="scope"> | 				<template v-slot="scope"> | ||||||
| 					<el-button @click="handleRoute(scope.row)" type="text"> | 					<el-button @click="handleRoute(scope.row)" type="text" style='padding: 0px;'> | ||||||
| 						{{ scope.row.workOrderNum }} | 						{{ scope.row.workOrderNum }} | ||||||
| 					</el-button> | 					</el-button> | ||||||
| 				</template> | 				</template> | ||||||
| @@ -78,6 +78,7 @@ | |||||||
| 				<template v-slot="scope"> | 				<template v-slot="scope"> | ||||||
| 					<el-button | 					<el-button | ||||||
| 						type="text" | 						type="text" | ||||||
|  | 						style='padding: 0px;' | ||||||
| 						:disabled="!(scope.row.status != 5 && scope.row.workOrderNum === 0)" | 						:disabled="!(scope.row.status != 5 && scope.row.workOrderNum === 0)" | ||||||
| 						@click="handleClick({ data: scope.row, type: 'split' })" | 						@click="handleClick({ data: scope.row, type: 'split' })" | ||||||
| 						v-hasPermi="['base:order-manage:split']"> | 						v-hasPermi="['base:order-manage:split']"> | ||||||
| @@ -86,6 +87,7 @@ | |||||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||||
| 					<el-button | 					<el-button | ||||||
| 						type="text" | 						type="text" | ||||||
|  | 						style='padding: 0px;' | ||||||
| 						:disabled=" | 						:disabled=" | ||||||
| 							!( | 							!( | ||||||
| 								scope.row.status === 1 || | 								scope.row.status === 1 || | ||||||
| @@ -95,12 +97,22 @@ | |||||||
| 						" | 						" | ||||||
| 						@click="handleClick({ data: scope.row, type: 'bind' })" | 						@click="handleClick({ data: scope.row, type: 'bind' })" | ||||||
| 						v-hasPermi="['base:order-manage:bindWorkOrder']"> | 						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> | 					</el-button> | ||||||
|           <!-- addWorkOrder --> |           <!-- addWorkOrder --> | ||||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||||
| 					<el-button | 					<el-button | ||||||
| 						type="text" | 						type="text" | ||||||
|  | 						style='padding: 0px;' | ||||||
| 						:disabled="!(scope.row.status === 2 || scope.row.status === 3)" | 						:disabled="!(scope.row.status === 2 || scope.row.status === 3)" | ||||||
| 						@click="handleClick({ data: scope.row, type: 'complete' })" | 						@click="handleClick({ data: scope.row, type: 'complete' })" | ||||||
| 						v-hasPermi="['base:order-manage:bindWorkOrder']"> | 						v-hasPermi="['base:order-manage:bindWorkOrder']"> | ||||||
| @@ -109,6 +121,7 @@ | |||||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||||
| 					<el-button | 					<el-button | ||||||
| 						type="text" | 						type="text" | ||||||
|  | 						style='padding: 0px;' | ||||||
| 						@click="handleClick({ data: scope.row, type: 'detail' })" | 						@click="handleClick({ data: scope.row, type: 'detail' })" | ||||||
| 						v-hasPermi="['base:order-manage:detail']"> | 						v-hasPermi="['base:order-manage:detail']"> | ||||||
| 						<span class="iconfont icon-detail primary-color" /> | 						<span class="iconfont icon-detail primary-color" /> | ||||||
| @@ -116,6 +129,7 @@ | |||||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||||
| 					<el-button | 					<el-button | ||||||
| 						type="text" | 						type="text" | ||||||
|  | 						style='padding: 0px;' | ||||||
| 						:disabled=" | 						:disabled=" | ||||||
| 							!(scope.row.status === 1) | 							!(scope.row.status === 1) | ||||||
| 						" | 						" | ||||||
| @@ -132,18 +146,12 @@ | |||||||
| 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | 					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> | ||||||
| 					<el-button | 					<el-button | ||||||
| 						type="text" | 						type="text" | ||||||
|  | 						style='padding: 0px;' | ||||||
| 						:disabled="scope.row.status != 1" | 						:disabled="scope.row.status != 1" | ||||||
| 						@click="handleClick({ data: scope.row, type: 'void' })" | 						@click="handleClick({ data: scope.row, type: 'void' })" | ||||||
| 						v-hasPermi="['base:order-manage:delete']"> | 						v-hasPermi="['base:order-manage:delete']"> | ||||||
| 						作废 | 						作废 | ||||||
| 					</el-button> | 					</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> | 				</template> | ||||||
| 			</el-table-column> | 			</el-table-column> | ||||||
| 		</el-table> | 		</el-table> | ||||||
| @@ -546,3 +554,9 @@ export default { | |||||||
| 	background-color: unset !important; | 	background-color: unset !important; | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|  | <style> | ||||||
|  | .orderTable .el-table__cell { | ||||||
|  | 	padding: 0 !important; | ||||||
|  | 	height: 35px !important; | ||||||
|  | } | ||||||
|  | </style> | ||||||
| @@ -116,10 +116,6 @@ | |||||||
| 						<div class="blodTip">备注</div> | 						<div class="blodTip">备注</div> | ||||||
| 						<div class="lightTip">{{ orderMsg.remark }}</div> | 						<div class="lightTip">{{ orderMsg.remark }}</div> | ||||||
| 					</el-col> | 					</el-col> | ||||||
| 					<!-- <el-col :span="3"> |  | ||||||
| 						<div class="blodTip">负责人</div> |  | ||||||
| 						<div class="lightTip">{{ orderMsg.workers }}</div> |  | ||||||
| 					</el-col> --> |  | ||||||
| 					<!-- <el-col :span='3'> | 					<!-- <el-col :span='3'> | ||||||
|             <div class="blodTip">关联工艺</div> |             <div class="blodTip">关联工艺</div> | ||||||
|             <div class="lightTip">{{processFlowName}}</div> |             <div class="lightTip">{{processFlowName}}</div> | ||||||
| @@ -249,10 +245,6 @@ const tableProps1 = [ | |||||||
| 		filter: (val) => (val ? val.join(',') : ''), | 		filter: (val) => (val ? val.join(',') : ''), | ||||||
| 		showOverflowtooltip: true, | 		showOverflowtooltip: true, | ||||||
| 	}, | 	}, | ||||||
| 	{ |  | ||||||
| 		prop: 'workers', |  | ||||||
| 		label: '负责人', |  | ||||||
| 	}, |  | ||||||
| 	{ | 	{ | ||||||
| 		prop: 'remark', | 		prop: 'remark', | ||||||
| 		label: '备注', | 		label: '备注', | ||||||
|   | |||||||
| @@ -133,13 +133,6 @@ | |||||||
| 					</el-select> | 					</el-select> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</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> | ||||||
| 		<el-row :gutter="20"> | 		<el-row :gutter="20"> | ||||||
| 			<el-col :span="12"> | 			<el-col :span="12"> | ||||||
| @@ -288,7 +281,6 @@ export default { | |||||||
| 				priority: '', | 				priority: '', | ||||||
| 				productLineIds: [{ lineId: null, processId: null, num: null }], | 				productLineIds: [{ lineId: null, processId: null, num: null }], | ||||||
| 				type: '', | 				type: '', | ||||||
| 				workers: '', |  | ||||||
| 				status: 1, | 				status: 1, | ||||||
| 			}, | 			}, | ||||||
| 			rules: { | 			rules: { | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user