You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3766 lines
127 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <el-form-item :label="'BU'">
  6. <el-select v-model="searchData.buNo" placeholder="请选择" clearable style="width: 90px">
  7. <el-option
  8. v-for = "i in buList"
  9. :key = "i.buNo"
  10. :label = "i.buDesc"
  11. :value = "i.buNo">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item :label="'物料编码'">
  16. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'物料名称'">
  19. <el-input v-model="searchData.partDesc" clearable style="width: 300px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'工艺类型'">
  22. <el-select v-model="searchData.routingType" clearable style="width: 120px">
  23. <el-option label="Manufacturing" value="Manufacturing"></el-option>
  24. <el-option label="Repair" value="Repair"></el-option>
  25. <el-option label="Prototype" value="Prototype"></el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item :label="'Routing版本号'">
  29. <el-input v-model="searchData.routingRevision" clearable style="width: 90px"></el-input>
  30. </el-form-item>
  31. <el-form-item :label="' '">
  32. <el-button v-if="!authSearch" @click="getDataList">查询</el-button>
  33. <el-button v-if="!authSave" type="primary" @click="addModal">新增</el-button>
  34. <el-button v-if="!authDelete" type="primary" @click="delModal">删除</el-button>
  35. <download-excel
  36. :fields="fields()"
  37. :data="exportData"
  38. type="xls"
  39. :name="exportName"
  40. :header="exportHeader"
  41. :footer="exportFooter"
  42. :fetch="createExportData"
  43. :before-generate="startDownload"
  44. :before-finish="finishDownload"
  45. worksheet="导出信息"
  46. class="el-button el-button--primary el-button--medium">
  47. {{ "导出" }}
  48. </download-excel>
  49. </el-form-item>
  50. </el-form>
  51. <!-- routing列表 -->
  52. <el-table
  53. :height="height"
  54. :data="dataList"
  55. border
  56. @selection-change="selectionRouting"
  57. style="width: 100%;">
  58. <el-table-column
  59. type="selection"
  60. header-align="center"
  61. align="center"
  62. width="50">
  63. </el-table-column>
  64. <el-table-column
  65. v-for="(item,index) in columnList" :key="index"
  66. :sortable="item.columnSortable"
  67. :prop="item.columnProp"
  68. :header-align="item.headerAlign"
  69. :show-overflow-tooltip="item.showOverflowTooltip"
  70. :align="item.align"
  71. :fixed="item.fixed === ''?false:item.fixed"
  72. :min-width="item.columnWidth"
  73. :label="item.columnLabel">
  74. <template slot-scope="scope">
  75. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  76. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. fixed="right"
  81. header-align="center"
  82. align="center"
  83. width="120"
  84. label="操作">
  85. <template slot-scope="scope">
  86. <el-link v-if="!authUpdate" style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link>
  87. <el-link style="cursor: pointer" @click="checkOutToBom(scope.row.partNo)">切换BOM</el-link>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <!-- 复选统计 -->
  92. <selectDiv ref="selectDiv"></selectDiv>
  93. <!-- 分页插件 -->
  94. <el-pagination
  95. @size-change="sizeChangeHandle"
  96. @current-change="currentChangeHandle"
  97. :current-page="pageIndex"
  98. :page-sizes="[20, 50, 100, 200, 500]"
  99. :page-size="pageSize"
  100. :total="totalPage"
  101. layout="total, sizes, prev, pager, next, jumper">
  102. </el-pagination>
  103. <!-- routing新增/编辑模态框 -->
  104. <el-dialog :close-on-click-modal="false" top="8vh" v-drag :before-close="closeModalX" :visible.sync="modalFlag" width="1110px">
  105. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 5px">
  106. <el-form-item label="BU" prop="bu">
  107. <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" @change="userBuChange" style="width: 150px">
  108. <el-option
  109. v-for = "i in userBuList"
  110. :key = "i.buNo"
  111. :label = "i.buDesc"
  112. :value = "i.buNo">
  113. </el-option>
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item prop="partNo">
  117. <span v-if="!modalDisableFlag" slot="label" @click="queryPartList"><a herf="#">物料编码</a></span>
  118. <span v-else slot="label">物料编码</span>
  119. <el-input v-model="modalData.partNo" :disabled="modalDisableFlag" @blur="partNoBlur" style="width: 150px"></el-input>
  120. </el-form-item>
  121. <el-form-item :label="'物料名称'" prop="partDesc">
  122. <el-input v-model="modalData.partDesc" disabled style="width: 340px"></el-input>
  123. </el-form-item>
  124. <el-form-item :label="'物料单位'">
  125. <el-input v-model="modalData.printUnit" disabled style="width: 100px"></el-input>
  126. </el-form-item>
  127. </el-form>
  128. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  129. <el-form-item label="生效日期" prop="phaseInDate">
  130. <el-date-picker
  131. style="width: 150px"
  132. v-model="modalData.phaseInDate"
  133. type="date"
  134. value-format="yyyy-MM-dd"
  135. format="yyyy-MM-dd"
  136. placeholder="请选择日期">
  137. </el-date-picker>
  138. </el-form-item>
  139. <el-form-item label="失效日期">
  140. <el-date-picker
  141. style="width: 150px"
  142. v-model="modalData.phaseOutDate"
  143. type="date"
  144. value-format="yyyy-MM-dd"
  145. format="yyyy-MM-dd"
  146. placeholder="请选择日期">
  147. </el-date-picker>
  148. </el-form-item>
  149. <el-form-item :label="'Routing版本号'" prop="routingRevision">
  150. <el-input-number :controls="false" :step="0" v-model="modalData.routingRevision" :disabled="modalDisableFlag" style="width: 130px"></el-input-number>
  151. </el-form-item>
  152. <el-form-item :label="'工艺类型'" prop="routingType">
  153. <el-select v-model="modalData.routingType" @change="routingTypeChange" :disabled="modalDisableFlag" style="width: 195px">
  154. <el-option label="Manufacturing" value="Manufacturing"></el-option>
  155. <el-option label="Repair" value="Repair"></el-option>
  156. <el-option label="Prototype" value="Prototype"></el-option>
  157. </el-select>
  158. </el-form-item>
  159. <el-form-item>
  160. <el-button v-if="modalData.flag === '1' && headerSaveFlag" :loading="saveHeaderLoading" type="primary" @click="saveRoutingHeader" style="margin-top: 23px;width: 100px">保存</el-button>
  161. <el-button v-else-if="modalData.flag === '2'" type="primary" @click="copyRoutingRevision" style="margin-top: 23px;width: 100px">Copy</el-button>
  162. </el-form-item>
  163. </el-form>
  164. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  165. <el-form-item label="备注">
  166. <el-input type="textarea" v-model="modalData.noteText" :rows="3" resize='none' show-word-limit style="width: 1082px;height: 20px"></el-input>
  167. </el-form-item>
  168. </el-form>
  169. <el-tabs v-model="detailTable" style="margin-top: 50px; width: 100%" type="border-card" class="detail-tab">
  170. <!-- Routing明细信息页签 -->
  171. <el-tab-pane label="Routings" name="routing_detail">
  172. <el-form label-position="top" style="margin-top: -10px">
  173. <el-form-item>
  174. <el-button type="primary" @click="saveRoutingDetail" style="margin-left: 7px">新增</el-button>
  175. <el-button type="primary" :loading="alternativeLoading" @click="deleteRoutingDetail">删除</el-button>
  176. <el-button type="primary" :loading="alternativeLoading" @click="updateRoutingDetail">编辑</el-button>
  177. <el-button v-if="modalData.flag === '2'" type="primary" :loading="alternativeLoading" @click="copyRoutingAlternative">Copy</el-button>
  178. <el-button v-if="detailData.status === 'Tentative' || detailData.status === 'Obsolete'" type="primary" :loading="alternativeLoading" @click="updateStatusToBuildable">Build</el-button>
  179. <el-button v-if="detailData.status === 'Buildable' && (modalData.effPhaseOutDate == null || modalData.effPhaseOutDate === '')" type="primary" :loading="alternativeLoading" @click="updateStatusToObsolete">Retire</el-button>
  180. <el-button type="primary" :loading="alternativeLoading" @click="createByStandardOperation">基于标准工序快速创建</el-button>
  181. </el-form-item>
  182. </el-form>
  183. <el-form :inline="true" label-position="top" :model="detailData" :rules="rules" style="margin-left: 7px">
  184. <el-form-item :label="'替代编码'">
  185. <el-select v-model="detailData.alternativeNo" @change="alternativeChange" style="width: 165px">
  186. <el-option
  187. v-for = "(i, index) in detailDataList"
  188. :key = "index"
  189. :label = "i.alternativeNo"
  190. :value = "i.alternativeNo">
  191. </el-option>
  192. </el-select>
  193. </el-form-item>
  194. <el-form-item :label="'替代名称'">
  195. <el-input v-model="detailData.alternativeDescription" readonly style="width: 300px"></el-input>
  196. </el-form-item>
  197. <el-form-item :label="'状态'">
  198. <el-input v-model="detailData.status" readonly style="width: 150px"></el-input>
  199. </el-form-item>
  200. </el-form>
  201. <el-form :inline="true" label-position="top" :model="detailData" style="margin-left: 7px">
  202. <el-form-item label="备注">
  203. <el-input type="textarea" v-model="detailData.detailNoteText" :rows="3" resize='none' show-word-limit readonly style="width: 1073px;height: 20px"></el-input>
  204. </el-form-item>
  205. </el-form>
  206. </el-tab-pane>
  207. </el-tabs>
  208. <el-tabs v-show="detailTable === 'routing_detail'" v-model="subDetailTable" style="width: 100%; min-height: 330px" type="border-card" class="sub_detail-tab">
  209. <!-- Routing子明细信息页签 -->
  210. <el-tab-pane label="Operations" name="routing_sub_detail">
  211. <el-form label-position="top" style="margin-top: 5px">
  212. <el-form-item>
  213. <el-button type="primary" :loading="alternativeLoading" @click="saveComponentModal" style="margin-left: 7px">新增</el-button>
  214. <el-button type="primary" :loading="alternativeLoading" @click="deleteComponentPart">删除</el-button>
  215. </el-form-item>
  216. </el-form>
  217. <el-table
  218. :data="subDetailList"
  219. height="256px"
  220. border
  221. ref="componentTable"
  222. @row-click="componentClickRow"
  223. :row-class-name="rowClassName"
  224. @selection-change="componentSelectionChange"
  225. style="width:100%">
  226. <el-table-column type="selection" align="center" width="50"></el-table-column>
  227. <el-table-column
  228. v-for="(item,index) in columnSubDetailList" :key="index"
  229. :sortable="item.columnSortable"
  230. :prop="item.columnProp"
  231. :header-align="item.headerAlign"
  232. :show-overflow-tooltip="item.showOverflowTooltip"
  233. :align="item.align"
  234. :fixed="item.fixed == ''?false:item.fixed"
  235. :min-width="item.columnWidth"
  236. :label="item.columnLabel">
  237. <template slot-scope="scope">
  238. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  239. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  240. </template>
  241. </el-table-column>
  242. <el-table-column
  243. fixed="right"
  244. header-align="center"
  245. align="center"
  246. width="100"
  247. label="操作">
  248. <template slot-scope="scope">
  249. <a type="text" size="small" @click="updateComponentModal(scope.row)">编辑</a>
  250. </template>
  251. </el-table-column>
  252. </el-table>
  253. </el-tab-pane>
  254. </el-tabs>
  255. <el-footer style="height:30px;margin-top:20px;text-align:center">
  256. <el-button :loading="saveAllLoading" type="primary" @click="saveData">保存</el-button>
  257. <el-button type="primary" @click="closeModal">关闭</el-button>
  258. </el-footer>
  259. </el-dialog>
  260. <!-- 明细新增模态框 -->
  261. <el-dialog title="替代" :close-on-click-modal="false" v-drag :visible.sync="saveDetailModalFlag" width="730px">
  262. <el-form :inline="true" label-position="top" :model="saveDetailData" :rules="detailRules" style="margin-left: 5px">
  263. <el-form-item :label="'替代编码'" prop="alternativeNo" :disabled="saveDetailModalDisable">
  264. <el-input v-model="saveDetailData.alternativeNo" style="width: 221px"></el-input>
  265. </el-form-item>
  266. <el-form-item :label="'替代名称'" prop="alternativeDescription">
  267. <el-input v-model="saveDetailData.alternativeDescription" style="width: 221px"></el-input>
  268. </el-form-item>
  269. <el-form-item :label="'状态'" prop="status">
  270. <el-input v-model="saveDetailData.status" disabled style="width: 221px"></el-input>
  271. </el-form-item>
  272. </el-form>
  273. <el-form :inline="true" label-position="top" :model="saveDetailData" style="margin-left: 5px">
  274. <el-form-item label="备注">
  275. <el-input type="textarea" v-model="saveDetailData.detailNoteText" :rows="3" resize='none' show-word-limit style="width: 690px;height: 20px"></el-input>
  276. </el-form-item>
  277. </el-form>
  278. <el-footer style="height:35px;margin-top:65px;text-align:center">
  279. <el-button :loading="saveDetailLoading" type="primary" @click="detailDataSave">保存</el-button>
  280. <el-button type="primary" @click="saveDetailModalFlag = false">关闭</el-button>
  281. </el-footer>
  282. </el-dialog>
  283. <!-- 物料模态框 -->
  284. <el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="900px">
  285. <div class="rq">
  286. <el-form :inline="true" label-position="top" :model="partData">
  287. <el-form-item :label="'物料编码'">
  288. <el-input v-model="partData.partNo" clearable style="width: 120px"></el-input>
  289. </el-form-item>
  290. <el-form-item :label="'物料名称'">
  291. <el-input v-model="partData.partDesc" clearable style="width: 120px"></el-input>
  292. </el-form-item>
  293. <el-form-item :label="' '">
  294. <el-button type="primary" @click="queryPartList">查询</el-button>
  295. </el-form-item>
  296. </el-form>
  297. <el-table
  298. :height="300"
  299. :data="partList"
  300. @row-dblclick="getRowData"
  301. border
  302. style="width: 100%;">
  303. <el-table-column
  304. v-for="(item,index) in partColumnList" :key="index"
  305. :sortable="item.columnSortable"
  306. :prop="item.columnProp"
  307. :header-align="item.headerAlign"
  308. :show-overflow-tooltip="item.showOverflowTooltip"
  309. :align="item.align"
  310. :fixed="item.fixed==''?false:item.fixed"
  311. :min-width="item.columnWidth"
  312. :label="item.columnLabel">
  313. <template slot-scope="scope">
  314. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  315. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  316. </template>
  317. </el-table-column>
  318. </el-table>
  319. <!-- 分页插件 -->
  320. <el-pagination
  321. @size-change="sizeChangeHandle2"
  322. @current-change="currentChangeHandle2"
  323. :current-page="pageIndex2"
  324. :page-sizes="[20, 50, 100, 200, 500]"
  325. :page-size="pageSize2"
  326. :total="totalPage2"
  327. layout="total, sizes, prev, pager, next, jumper">
  328. </el-pagination>
  329. </div>
  330. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  331. <el-button type="primary" @click="partModelFlag=false">关闭</el-button>
  332. </el-footer>
  333. </el-dialog>
  334. <!-- 子明细新增模态框 -->
  335. <el-dialog title="工序" :close-on-click-modal="false" v-drag :visible.sync="componentSaveModal" width="500px">
  336. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  337. <el-form-item :label="'工序编码'" prop="operationNo">
  338. <el-input-number :controls="false" :step="0" v-model="componentData.operationNo" style="width: 221px"></el-input-number>
  339. </el-form-item>
  340. <el-form-item :label="'工序名称'" prop="operationName">
  341. <el-input v-model="componentData.operationName" style="width: 221px"></el-input>
  342. </el-form-item>
  343. </el-form>
  344. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  345. <el-form-item prop="workCenterNo">
  346. <span style="cursor: pointer" slot="label" @click="getBaseList(516)"><a herf="#">加工中心编码</a></span>
  347. <el-input v-model="componentData.workCenterNo" @blur="workCenterBlur(516)" style="width: 103px"></el-input>
  348. </el-form-item>
  349. <el-form-item label=" ">
  350. <el-input v-model="componentData.workCenterType" disabled style="width: 103px"></el-input>
  351. </el-form-item>
  352. <el-form-item :label="'加工中心名称'">
  353. <el-input v-model="componentData.workCenterDesc" disabled style="width: 221px"></el-input>
  354. </el-form-item>
  355. </el-form>
  356. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  357. <el-form-item :label="'机器调机时间'" prop="machSetupTime">
  358. <el-input-number :controls="false" :step="0" v-model="componentData.machSetupTime" @change="changeMachSetupTime" style="width: 221px"></el-input-number>
  359. </el-form-item>
  360. <el-form-item :label="'人工调机时间'" prop="laborSetupTime">
  361. <el-input-number :controls="false" :step="0" v-model="componentData.laborSetupTime" style="width: 221px"></el-input-number>
  362. </el-form-item>
  363. </el-form>
  364. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  365. <el-form-item style="margin-left: 235px" prop="setupLaborClassNo">
  366. <span style="cursor: pointer" slot="label" @click="getBaseList(517, 2)"><a herf="#">调机过程中人员等级</a></span>
  367. <el-input v-model="componentData.setupLaborClassNo" @blur="setupLaborClassBlur(517)" style="width: 70px"></el-input>
  368. <el-input v-model="componentData.setupLaborClassDesc" disabled style="width: 148px"></el-input>
  369. </el-form-item>
  370. </el-form>
  371. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  372. <el-form-item :label="'调机过程中人数'" style="margin-left: 235px" prop="setupCrewSize">
  373. <el-input-number :controls="false" :step="0" :precision="2" v-model="componentData.setupCrewSize" style="width: 221px"></el-input-number>
  374. </el-form-item>
  375. </el-form>
  376. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  377. <el-form-item :label="'产出单位'" prop="runTimeCode">
  378. <el-select v-model="componentData.runTimeCode" style="width: 221px">
  379. <el-option label="单位/小时" value="Units/Hour"></el-option>
  380. <el-option label="小时/单位" value="Hours/Unit"></el-option>
  381. <el-option label="小时" value="Hours"></el-option>
  382. </el-select>
  383. </el-form-item>
  384. <el-form-item prop="laborClassNo">
  385. <span style="cursor: pointer" slot="label" @click="getBaseList(517, 1)"><a herf="#">人员等级</a></span>
  386. <el-input v-model="componentData.laborClassNo" @blur="laborClassBlur(517)" style="width: 70px"></el-input>
  387. <el-input v-model="componentData.laborClassDesc" disabled style="width: 148px"></el-input>
  388. </el-form-item>
  389. </el-form>
  390. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  391. <el-form-item :label="'机器处理时间'">
  392. <el-input-number :controls="false" :step="0" :precision="6" v-model="componentData.machCycleTime" @change="changeMachCycleTime" style="width: 221px"></el-input-number>
  393. </el-form-item>
  394. <el-form-item :label="'人工处理时间'">
  395. <el-input-number :controls="false" :step="0" :precision="6" v-model="componentData.laborCycleTime" @change="changeLaborCycleTime" style="width: 221px"></el-input-number>
  396. </el-form-item>
  397. </el-form>
  398. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  399. <el-form-item :label="'机器单位产出'" prop="machRunFactor">
  400. <el-input-number :controls="false" :step="0" :precision="4" v-model="componentData.machRunFactor" @change="changeMachRunFactor" style="width: 221px"></el-input-number>
  401. </el-form-item>
  402. <el-form-item :label="'人工单位产出'" prop="laborRunFactor">
  403. <el-input-number :controls="false" :step="0" :precision="4" v-model="componentData.laborRunFactor" style="width: 221px"></el-input-number>
  404. </el-form-item>
  405. </el-form>
  406. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  407. <el-form-item :label="'效率%'" prop="efficiencyFactor">
  408. <el-input-number :controls="false" :step="0" min="0" max="100" v-model="componentData.efficiencyFactor" style="width: 221px"></el-input-number>
  409. </el-form-item>
  410. <el-form-item :label="'生产过程中人数'" prop="crewSize">
  411. <el-input-number :controls="false" :step="0" :precision="2" v-model="componentData.crewSize" style="width: 221px"></el-input-number>
  412. </el-form-item>
  413. </el-form>
  414. <el-form :inline="true" label-position="top" :model="componentData" style="margin-left: 5px">
  415. <el-form-item :label="'外协采购料号'">
  416. <el-input v-model="componentData.outsideOpItem" style="width: 456px"></el-input>
  417. </el-form-item>
  418. </el-form>
  419. <el-form :inline="true" label-position="top" :model="componentData" style="margin-left: 5px">
  420. <el-form-item label="备注">
  421. <el-input type="textarea" v-model="componentData.noteText" :rows="3" resize='none' show-word-limit style="width: 456px;height: 20px"></el-input>
  422. </el-form-item>
  423. </el-form>
  424. <el-footer style="height:35px;margin-top:65px;text-align:center">
  425. <el-button v-if="componentData.flag === '1'" type="primary" @click="componentDataSave(true)">应用</el-button>
  426. <el-button type="primary" @click="componentDataSave(false)">保存</el-button>
  427. <el-button type="primary" @click="componentSaveModal = false">关闭</el-button>
  428. </el-footer>
  429. </el-dialog>
  430. <!-- copyRouting -->
  431. <el-dialog title="Copy Structure Revision" :close-on-click-modal="false" v-drag :visible.sync="copyRoutingModelFlag" width="450px">
  432. <fieldset style="width: 426px">
  433. <legend>Source Revision</legend>
  434. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  435. <el-form-item label="物料编码">
  436. <el-input v-model="modalData.partNo" readonly style="width: 120px"></el-input>
  437. </el-form-item>
  438. <el-form-item label="物料名称">
  439. <el-input v-model="modalData.partDesc" readonly style="width: 249px"></el-input>
  440. </el-form-item>
  441. </el-form>
  442. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  443. <el-form-item label="Site">
  444. <el-input v-model="modalData.site" readonly style="width: 85px"></el-input>
  445. </el-form-item>
  446. <el-form-item label="Routing版本号">
  447. <el-input v-model="modalData.routingRevision" readonly style="width: 85px"></el-input>
  448. </el-form-item>
  449. <el-form-item label="工艺类型">
  450. <el-input v-model="modalData.routingType" readonly style="width: 185px"></el-input>
  451. </el-form-item>
  452. </el-form>
  453. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  454. <el-form-item label="生效日期">
  455. <el-date-picker style="width: 185px" v-model="modalData.phaseInDate" readonly type="date" value-format="yyyy-MM-dd"></el-date-picker>
  456. </el-form-item>
  457. <el-form-item label="失效日期">
  458. <el-date-picker style="width: 185px" v-model="modalData.phaseOutDate" readonly type="date" value-format="yyyy-MM-dd"></el-date-picker>
  459. </el-form-item>
  460. </el-form>
  461. <el-table
  462. :data="detailDataList"
  463. height="100px"
  464. border
  465. style="width:100%">
  466. <el-table-column
  467. v-for="(item,index) in columnRoutingDetailList" :key="index"
  468. :sortable="item.columnSortable"
  469. :prop="item.columnProp"
  470. :header-align="item.headerAlign"
  471. :show-overflow-tooltip="item.showOverflowTooltip"
  472. :align="item.align"
  473. :fixed="item.fixed == ''?false:item.fixed"
  474. :min-width="item.columnWidth"
  475. :label="item.columnLabel">
  476. <template slot-scope="scope">
  477. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  478. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  479. </template>
  480. </el-table-column>
  481. </el-table>
  482. </fieldset>
  483. <fieldset style="width: 426px">
  484. <legend>Destination Revision</legend>
  485. <el-form :inline="true" label-position="top" :model="copyRoutingData" style="margin-left: 7px;margin-top: -5px;">
  486. <el-form-item>
  487. <span slot="label" @click="queryCopyPartModal"><a herf="#">物料编码</a></span>
  488. <el-input v-model="copyRoutingData.partNo" @change="copyRoutingTypeChange" @blur="copyPartBlur" style="width: 120px"></el-input>
  489. </el-form-item>
  490. <el-form-item :label="'物料名称'">
  491. <el-input v-model="copyRoutingData.partDesc" disabled style="width: 249px"></el-input>
  492. </el-form-item>
  493. </el-form>
  494. <el-form :inline="true" label-position="top" :model="copyRoutingData" style="margin-left: 7px;margin-top: -5px;">
  495. <el-form-item label="Site">
  496. <el-input v-model="copyRoutingData.site" disabled style="width: 85px"></el-input>
  497. </el-form-item>
  498. <el-form-item label="Routing版本号">
  499. <el-input v-model="copyRoutingData.routingRevision" disabled style="width: 85px"></el-input>
  500. </el-form-item>
  501. <el-form-item label="工艺类型">
  502. <el-select v-model="copyRoutingData.routingType" @change="copyRoutingTypeChange" style="width: 185px">
  503. <el-option label="Manufacturing" value="Manufacturing"></el-option>
  504. <el-option label="Repair" value="Repair"></el-option>
  505. <el-option label="Prototype" value="Prototype"></el-option>
  506. </el-select>
  507. </el-form-item>
  508. </el-form>
  509. <el-form :inline="true" label-position="top" :model="copyRoutingData" style="margin-left: 7px;margin-top: -5px;">
  510. <el-form-item label="生效日期">
  511. <el-date-picker style="width: 185px" v-model="copyRoutingData.phaseInDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
  512. </el-form-item>
  513. <el-form-item label="失效日期">
  514. <el-date-picker style="width: 185px" v-model="copyRoutingData.phaseOutDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
  515. </el-form-item>
  516. </el-form>
  517. </fieldset>
  518. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  519. <el-button type="primary" :loading="copyLoading" @click="copyRouting">保存</el-button>
  520. <el-button type="primary" @click="copyRoutingModelFlag = false">关闭</el-button>
  521. </el-footer>
  522. </el-dialog>
  523. <!-- copyAlternative -->
  524. <el-dialog title="Copy Structure Alternative" :close-on-click-modal="false" v-drag :visible.sync="copyAlternativeModelFlag" width="450px">
  525. <fieldset style="width: 426px">
  526. <legend>Source Revision</legend>
  527. <el-form :inline="true" label-position="top" :model="detailData" style="margin-left: 7px;margin-top: -5px;">
  528. <el-form-item label="物料编码">
  529. <el-input v-model="detailData.partNo" readonly style="width: 120px"></el-input>
  530. </el-form-item>
  531. <el-form-item label="物料名称">
  532. <el-input v-model="modalData.partDesc" readonly style="width: 249px"></el-input>
  533. </el-form-item>
  534. </el-form>
  535. <el-form :inline="true" label-position="top" :model="detailData" style="margin-left: 7px;margin-top: -5px;">
  536. <el-form-item label="Site">
  537. <el-input v-model="detailData.site" readonly style="width: 85px"></el-input>
  538. </el-form-item>
  539. <el-form-item label="Routing版本号">
  540. <el-input v-model="detailData.routingRevision" readonly style="width: 85px"></el-input>
  541. </el-form-item>
  542. <el-form-item label="工艺类型">
  543. <el-input v-model="detailData.routingType" readonly style="width: 185px"></el-input>
  544. </el-form-item>
  545. </el-form>
  546. <el-form :inline="true" label-position="top" :model="detailData" style="margin-left: 7px;margin-top: -5px;">
  547. <el-form-item label="替代编码">
  548. <el-input v-model="detailData.alternativeNo" readonly style="width: 185px"></el-input>
  549. </el-form-item>
  550. <el-form-item label="替代名称">
  551. <el-input v-model="detailData.alternativeDescription" readonly style="width: 185px"></el-input>
  552. </el-form-item>
  553. </el-form>
  554. </fieldset>
  555. <fieldset style="width: 426px">
  556. <legend>Destination Revision</legend>
  557. <el-form :inline="true" label-position="top" :model="copyAlternativeData" style="margin-left: 7px;margin-top: -5px;">
  558. <el-form-item>
  559. <span slot="label" @click="queryCopyPartModal"><a herf="#">物料编码</a></span>
  560. <el-input v-model="copyAlternativeData.partNo" @blur="copyPartBlur" style="width: 120px"></el-input>
  561. </el-form-item>
  562. <el-form-item :label="'物料名称'">
  563. <el-input v-model="copyAlternativeData.partDesc" disabled style="width: 249px"></el-input>
  564. </el-form-item>
  565. </el-form>
  566. <el-form :inline="true" label-position="top" :model="copyAlternativeData" style="margin-left: 7px;margin-top: -5px;">
  567. <el-form-item label="Site">
  568. <el-input v-model="copyAlternativeData.site" disabled style="width: 85px"></el-input>
  569. </el-form-item>
  570. <el-form-item label="Routing版本号">
  571. <el-input v-model="copyAlternativeData.routingRevision" style="width: 85px"></el-input>
  572. </el-form-item>
  573. <el-form-item label="工艺类型">
  574. <el-select v-model="copyAlternativeData.routingType" style="width: 185px">
  575. <el-option label="Manufacturing" value="Manufacturing"></el-option>
  576. <el-option label="Repair" value="Repair"></el-option>
  577. <el-option label="Prototype" value="Prototype"></el-option>
  578. </el-select>
  579. </el-form-item>
  580. </el-form>
  581. <el-form :inline="true" label-position="top" :model="copyAlternativeData" style="margin-left: 7px;margin-top: -5px;">
  582. <el-form-item label="替代编码">
  583. <el-input v-model="copyAlternativeData.alternativeNo" style="width: 185px"></el-input>
  584. </el-form-item>
  585. <el-form-item label="替代名称">
  586. <el-input v-model="copyAlternativeData.alternativeDescription" style="width: 185px"></el-input>
  587. </el-form-item>
  588. </el-form>
  589. </fieldset>
  590. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  591. <el-button type="primary" :loading="copyLoading" @click="copyAlternative">保存</el-button>
  592. <el-button type="primary" @click="copyAlternativeModelFlag = false">关闭</el-button>
  593. </el-footer>
  594. </el-dialog>
  595. <!-- copy物料模态框 -->
  596. <el-dialog title="物料清单" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="copyPartModelFlag" width="700px">
  597. <el-form :inline="true" label-position="top" :model="copyPartData">
  598. <el-form-item :label="'物料编码'">
  599. <el-input v-model="copyPartData.partNo" clearable style="width: 120px"></el-input>
  600. </el-form-item>
  601. <el-form-item :label="'物料名称'">
  602. <el-input v-model="copyPartData.partDesc" clearable style="width: 120px"></el-input>
  603. </el-form-item>
  604. <el-form-item :label="' '">
  605. <el-button type="primary" @click="queryCopyPartList">查询</el-button>
  606. </el-form-item>
  607. </el-form>
  608. <el-table
  609. :height="250"
  610. :data="copyPartList"
  611. @row-dblclick="getCopyRowData"
  612. border
  613. style="width: 100%;">
  614. <el-table-column
  615. v-for="(item,index) in componentPartColumnList" :key="index"
  616. :sortable="item.columnSortable"
  617. :prop="item.columnProp"
  618. :header-align="item.headerAlign"
  619. :show-overflow-tooltip="item.showOverflowTooltip"
  620. :align="item.align"
  621. :fixed="item.fixed==''?false:item.fixed"
  622. :min-width="item.columnWidth"
  623. :label="item.columnLabel">
  624. <template slot-scope="scope">
  625. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  626. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  627. </template>
  628. </el-table-column>
  629. </el-table>
  630. <!-- 分页插件 -->
  631. <el-pagination
  632. @size-change="sizeChangeHandle4"
  633. @current-change="currentChangeHandle4"
  634. :current-page="pageIndex4"
  635. :page-sizes="[20, 50, 100, 200, 500]"
  636. :page-size="pageSize4"
  637. :total="totalPage4"
  638. layout="total, sizes, prev, pager, next, jumper">
  639. </el-pagination>
  640. <el-footer style="height:35px;margin-top:10px;text-align:center">
  641. <el-button type="primary" @click="copyPartModelFlag = false">关闭</el-button>
  642. </el-footer>
  643. </el-dialog>
  644. <!-- 标准工序 -->
  645. <el-dialog title="标准工序" top="20vh" :close-on-click-modal="false" v-drag :visible.sync="standardOperationModal" width="1000px">
  646. <el-table
  647. :height="350"
  648. :data="standardOperationList"
  649. ref="standardOperationTable"
  650. @row-click="standardOperationClickRow"
  651. @selection-change="selectionStandardOperation"
  652. border
  653. style="width: 100%;">
  654. <el-table-column
  655. type="selection"
  656. header-align="center"
  657. align="center"
  658. width="50">
  659. </el-table-column>
  660. <el-table-column
  661. v-for="(item,index) in standardOperationColumnList" :key="index"
  662. :sortable="item.columnSortable"
  663. :prop="item.columnProp"
  664. :header-align="item.headerAlign"
  665. :show-overflow-tooltip="item.showOverflowTooltip"
  666. :align="item.align"
  667. :fixed="item.fixed==''?false:item.fixed"
  668. :min-width="item.columnWidth"
  669. :label="item.columnLabel">
  670. <template slot-scope="scope">
  671. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  672. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  673. </template>
  674. </el-table-column>
  675. </el-table>
  676. <el-footer style="height:35px;margin-top:10px;text-align:center">
  677. <el-button type="primary" @click="saveStandardOperation">保存</el-button>
  678. <el-button type="primary" @click="standardOperationModal = false">关闭</el-button>
  679. </el-footer>
  680. </el-dialog>
  681. <!-- chooseList模态框 -->
  682. <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
  683. </div>
  684. </template>
  685. <script>
  686. import {
  687. routingManagementSearch, // routing 列表查询
  688. routingManagementSave, // routing 新增
  689. routingManagementEdit, // routing 编辑
  690. routingManagementDelete, // routing 删除
  691. queryRoutingHeader, // 查询 routing 主信息
  692. saveRoutingHeader, // 新增 routing 主信息
  693. queryRoutingDetail, // 查 routing 明细
  694. routingDetailSave, // routing 明细新增
  695. routingDetailUpdate, // routing 明细编辑
  696. updateAlternativeStatus, // 修改明细状态
  697. routingDetailDelete, // routing 明细删除
  698. queryPartList, // 查询物料清单
  699. queryPartListRouting, // 查出可创建Routing的物料
  700. queryRoutingComponent, // 查询 routing 子明细
  701. saveRoutingComponent, // 新增 routing 子明细
  702. updateRoutingComponent, // 修改 routing 子明细
  703. deleteRoutingComponent, // 删除 routing 子明细
  704. getRottingRevision, // 获取物料的 routing 版本号
  705. copyRouting, // 复制routing
  706. copyAlternative, // 复制alternative
  707. queryMaxOperationNo, // 查询最大工序号
  708. getStandardOperations, // 根据物料的商品组1查维护的标准工序
  709. saveStandardOperation, // 新增工序
  710. } from '@/api/part/routingManagement.js'
  711. import {verifyData} from '@/api/part/partInformation.js'
  712. import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js"
  713. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  714. import ChooseList from '@/views/modules/common/Chooselist_eam'
  715. export default {
  716. // 组件
  717. components: {
  718. ChooseList
  719. },
  720. // 监听
  721. watch: {
  722. searchData: {
  723. deep: true,
  724. handler: function (newV, oldV) {
  725. this.searchData.partNo = this.searchData.partNo.toUpperCase()
  726. }
  727. },
  728. modalData: {
  729. deep: true,
  730. handler: function (newV, oldV) {
  731. this.modalData.partNo = this.modalData.partNo.toUpperCase()
  732. }
  733. },
  734. saveDetailData: {
  735. deep: true,
  736. handler: function (newV, oldV) {
  737. this.saveDetailData.alternativeNo = this.saveDetailData.alternativeNo.toUpperCase()
  738. }
  739. },
  740. copyAlternativeData: {
  741. deep: true,
  742. handler: function (newV, oldV) {
  743. this.copyAlternativeData.partNo = this.copyAlternativeData.partNo.toUpperCase()
  744. }
  745. },
  746. copyRoutingData: {
  747. deep: true,
  748. handler: function (newV, oldV) {
  749. this.copyRoutingData.partNo = this.copyRoutingData.partNo.toUpperCase()
  750. }
  751. },
  752. componentData: {
  753. deep: true,
  754. handler: function (newV, oldV) {
  755. this.componentData.workCenterNo = this.componentData.workCenterNo.toUpperCase()
  756. this.componentData.laborClassNo = this.componentData.laborClassNo.toUpperCase()
  757. this.componentData.setupLaborClassNo = this.componentData.setupLaborClassNo.toUpperCase()
  758. }
  759. },
  760. },
  761. // 对象
  762. data () {
  763. return {
  764. // 导出
  765. exportData: [],
  766. exportName: 'routing物料列表' + this.dayjs().format('YYYYMMDDHHmmss'),
  767. exportHeader: ['routing物料列表'],
  768. exportFooter: [],
  769. resultList: [],
  770. userBuList: [],
  771. buList: [],
  772. // ======== 行高 ========
  773. height: 200,
  774. // ======== 分页 ========
  775. pageIndex: 1,
  776. pageSize: 50,
  777. totalPage: 0,
  778. pageIndex2: 1,
  779. pageSize2: 20,
  780. totalPage2: 0,
  781. pageIndex4: 1,
  782. pageSize4: 20,
  783. totalPage4: 0,
  784. selectedDataNum: 0,
  785. // 条件查询
  786. searchData: {
  787. site: '',
  788. userName: this.$store.state.user.name,
  789. partNo: '',
  790. partDesc: '',
  791. routingType:'',
  792. routingRevision:'',
  793. page: 1,
  794. limit: 10
  795. },
  796. // loading
  797. saveHeaderLoading: false,
  798. saveDetailLoading: false,
  799. saveAllLoading: false,
  800. copyLoading: false,
  801. alternativeLoading: false,
  802. // 初始页签
  803. detailTable: 'routing_detail',
  804. subDetailTable: 'routing_sub_detail',
  805. // ======== 数据对象 ========
  806. modalData: {
  807. flag: '',
  808. title: '',
  809. bu: '',
  810. site: '',
  811. buNo: '',
  812. partNo: '',
  813. partDesc: '',
  814. routingRevision: '',
  815. routingType: '',
  816. noteText: '',
  817. phaseInDate: '',
  818. phaseOutDate: '',
  819. createDate: '',
  820. createBy: '',
  821. updateDate: '',
  822. updateBy: '',
  823. printUnit: '',
  824. printUnitName: '',
  825. },
  826. detailData: {
  827. site: '',
  828. buNo: '',
  829. partNo: '',
  830. routingRevision: '',
  831. routingType: '',
  832. alternativeNo: '',
  833. alternativeDescription: '',
  834. routTemplateId: '',
  835. planDate: '',
  836. fixedLeadTimeDay: '',
  837. fixedLeadTimeHour: '',
  838. variableLeadTimeDay: '',
  839. variableLeadTimeHour: '',
  840. forStdLotByDay: '',
  841. forLotByDay: '',
  842. minLotQty: '',
  843. detailNoteText: '',
  844. status: '',
  845. createDate: '',
  846. createBy: '',
  847. updateDate: '',
  848. updateBy: '',
  849. },
  850. componentData: {
  851. flag: '',
  852. site: '',
  853. buNo: '',
  854. partNo: '',
  855. routingRevision: '',
  856. routingType: '',
  857. alternativeNo: '',
  858. operationId: '',
  859. operationNo: '',
  860. operationName: '',
  861. efficiencyFactor: '',
  862. machRunFactor: '',
  863. machSetupTime: '',
  864. machCycleTime: '',
  865. laborCycleTime: '',
  866. runTimeCode: '',
  867. laborRunFactor: '',
  868. laborSetupTime: '',
  869. crewSize: '',
  870. setupCrewSize: '',
  871. outsideOpItem: '',
  872. machineNo: '',
  873. workCenterNo: '',
  874. workCenterDesc: '',
  875. workCenterType: '',
  876. laborClassNo: '',
  877. laborClassDesc: '',
  878. setupLaborClassNo: '',
  879. setupLaborClassDesc: '',
  880. overlap: '',
  881. noteText: '',
  882. createDate: '',
  883. createBy: '',
  884. updateDate: '',
  885. updateBy: '',
  886. },
  887. partData: {
  888. site: '',
  889. buNo: '',
  890. partNo: '',
  891. partDesc: '',
  892. page: 1,
  893. limit: 10
  894. },
  895. operationData: {
  896. site: this.$store.state.user.site,
  897. partNo: '',
  898. routingRevision: '',
  899. routingType: '',
  900. alternativeNo: '',
  901. operationNo: '',
  902. operationName: '',
  903. },
  904. saveDetailData: {
  905. flag: '',
  906. site: '',
  907. buNo: '',
  908. partNo: '',
  909. routingRevision: '',
  910. routingType: '',
  911. alternativeNo: '',
  912. alternativeDescription: '',
  913. routTemplateId: '',
  914. planDate: '',
  915. fixedLeadTimeDay: '',
  916. fixedLeadTimeHour: '',
  917. variableLeadTimeDay: '',
  918. variableLeadTimeHour: '',
  919. forStdLotByDay: '',
  920. forLotByDay: '',
  921. minLotQty: '',
  922. detailNoteText: '',
  923. status: '',
  924. createDate: '',
  925. createBy: '',
  926. updateDate: '',
  927. updateBy: ''
  928. },
  929. copyRoutingData: {
  930. site: '',
  931. buNo: '',
  932. partNo: '',
  933. partDesc: '',
  934. routingRevision: '',
  935. routingType: '',
  936. phaseInDate: '',
  937. phaseOutDate: '',
  938. previousVersion: {},
  939. createBy: ''
  940. },
  941. copyAlternativeData: {
  942. site: '',
  943. partNo: '',
  944. partDesc: '',
  945. routingRevision: '',
  946. routingType: '',
  947. alternativeNo: '',
  948. alternativeDescription: '',
  949. routTemplateId: '',
  950. planDate: '',
  951. fixedLeadTimeDay: '',
  952. fixedLeadTimeHour: '',
  953. variableLeadTimeDay: '',
  954. variableLeadTimeHour: '',
  955. forStdLotByDay: '',
  956. forLotByDay: '',
  957. minLotQty: '',
  958. detailNoteText: '',
  959. status: '',
  960. previousVersion: {},
  961. createBy: ''
  962. },
  963. copyPartData: {
  964. type: '',
  965. site: '',
  966. buNo: '',
  967. partNo: '',
  968. partDesc: '',
  969. page: 1,
  970. limit: 10
  971. },
  972. // ======== 数据列表 ========
  973. dataList: [],
  974. partList: [],
  975. operationList: [],
  976. componentPartSelections: [],
  977. subDetailList: [],
  978. detailDataList: [],
  979. checkedDetail: [],
  980. checkedTool: [],
  981. alternativeList: [],
  982. copyPartList: [],
  983. standardOperationList: [],
  984. standardOperationSelections: [],
  985. // ======== 列表表头 ========
  986. columnList: [
  987. {
  988. userId: this.$store.state.user.name,
  989. functionId: 601003,
  990. serialNumber: '601003Table1Bu',
  991. tableId: '601003Table1',
  992. tableName: 'Routing信息表',
  993. columnProp: 'buDesc',
  994. headerAlign: 'center',
  995. align: 'center',
  996. columnLabel: 'BU',
  997. columnHidden: false,
  998. columnImage: false,
  999. columnSortable: false,
  1000. sortLv: 0,
  1001. status: true,
  1002. fixed: '',
  1003. columnWidth: 100
  1004. },
  1005. {
  1006. userId: this.$store.state.user.name,
  1007. functionId: 601003,
  1008. serialNumber: '104003Table1PartNo',
  1009. tableId: '104003Table1',
  1010. tableName: 'Routing信息表',
  1011. columnProp: 'partNo',
  1012. headerAlign: 'center',
  1013. align: 'center',
  1014. columnLabel: '物料编码',
  1015. columnHidden: false,
  1016. columnImage: false,
  1017. columnSortable: false,
  1018. sortLv: 0,
  1019. status: true,
  1020. fixed: '',
  1021. columnWidth: 120
  1022. },
  1023. {
  1024. userId: this.$store.state.user.name,
  1025. functionId: 601003,
  1026. serialNumber: '104003Table1PartDesc',
  1027. tableId: '104003Table1',
  1028. tableName: 'Routing信息表',
  1029. columnProp: 'partDesc',
  1030. headerAlign: 'center',
  1031. align: 'left',
  1032. columnLabel: '物料名称',
  1033. columnHidden: false,
  1034. columnImage: false,
  1035. columnSortable: false,
  1036. sortLv: 0,
  1037. status: true,
  1038. fixed: '',
  1039. columnWidth: 300
  1040. },
  1041. {
  1042. userId: this.$store.state.user.name,
  1043. functionId: 601003,
  1044. serialNumber: '104003Table1RoutingType',
  1045. tableId: '104003Table1',
  1046. tableName: 'Routing信息表',
  1047. columnProp: 'routingType',
  1048. headerAlign: 'center',
  1049. align: 'center',
  1050. columnLabel: '工艺类型',
  1051. columnHidden: false,
  1052. columnImage: false,
  1053. columnSortable: false,
  1054. sortLv: 0,
  1055. status: true,
  1056. fixed: '',
  1057. columnWidth: 120
  1058. },
  1059. {
  1060. userId: this.$store.state.user.name,
  1061. functionId: 601003,
  1062. serialNumber: '104003Table1RoutingRevision',
  1063. tableId: '104003Table1',
  1064. tableName: 'Routing信息表',
  1065. columnProp: 'routingRevision',
  1066. headerAlign: 'center',
  1067. align: 'center',
  1068. columnLabel: 'Routing版本号',
  1069. columnHidden: false,
  1070. columnImage: false,
  1071. columnSortable: false,
  1072. sortLv: 0,
  1073. status: true,
  1074. fixed: '',
  1075. columnWidth: 120
  1076. },
  1077. {
  1078. userId: this.$store.state.user.name,
  1079. functionId: 601003,
  1080. serialNumber: '104003Table1CreateDate',
  1081. tableId: '104003Table1',
  1082. tableName: 'Routing信息表',
  1083. columnProp: 'createDate',
  1084. headerAlign: 'center',
  1085. align: 'center',
  1086. columnLabel: '创建时间',
  1087. columnHidden: false,
  1088. columnImage: false,
  1089. columnSortable: false,
  1090. sortLv: 0,
  1091. status: true,
  1092. fixed: '',
  1093. columnWidth: 160
  1094. },
  1095. {
  1096. userId: this.$store.state.user.name,
  1097. functionId: 601003,
  1098. serialNumber: '104003Table1CreateBy',
  1099. tableId: '104003Table1',
  1100. tableName: 'Routing信息表',
  1101. columnProp: 'createBy',
  1102. headerAlign: 'center',
  1103. align: 'center',
  1104. columnLabel: '创建人',
  1105. columnHidden: false,
  1106. columnImage: false,
  1107. columnSortable: false,
  1108. sortLv: 0,
  1109. status: true,
  1110. fixed: '',
  1111. columnWidth: 80
  1112. },
  1113. {
  1114. userId: this.$store.state.user.name,
  1115. functionId: 601003,
  1116. serialNumber: '104003Table1UpdateDate',
  1117. tableId: '104003Table1',
  1118. tableName: 'Routing信息表',
  1119. columnProp: 'updateDate',
  1120. headerAlign: 'center',
  1121. align: 'center',
  1122. columnLabel: '更新时间',
  1123. columnHidden: false,
  1124. columnImage: false,
  1125. columnSortable: false,
  1126. sortLv: 0,
  1127. status: true,
  1128. fixed: '',
  1129. columnWidth: 160
  1130. },
  1131. {
  1132. userId: this.$store.state.user.name,
  1133. functionId: 601003,
  1134. serialNumber: '104003Table1UpdateBy',
  1135. tableId: '104003Table1',
  1136. tableName: 'Routing信息表',
  1137. columnProp: 'updateBy',
  1138. headerAlign: 'center',
  1139. align: 'center',
  1140. columnLabel: '更新人',
  1141. columnHidden: false,
  1142. columnImage: false,
  1143. columnSortable: false,
  1144. sortLv: 0,
  1145. status: true,
  1146. fixed: '',
  1147. columnWidth: 80
  1148. }
  1149. ],
  1150. partColumnList: [
  1151. {
  1152. columnProp: 'partNo',
  1153. headerAlign: "center",
  1154. align: "center",
  1155. columnLabel: '物料编码',
  1156. columnHidden: false,
  1157. columnImage: false,
  1158. status: true,
  1159. fixed: '',
  1160. columnWidth: 120
  1161. },
  1162. {
  1163. columnProp: 'partDesc',
  1164. headerAlign: "center",
  1165. align: "left",
  1166. columnLabel: '物料名称',
  1167. columnHidden: false,
  1168. columnImage: false,
  1169. status: true,
  1170. fixed: '',
  1171. columnWidth: 300
  1172. },
  1173. {
  1174. columnProp: 'spec',
  1175. headerAlign: "center",
  1176. align: "left",
  1177. columnLabel: '规格型号',
  1178. columnHidden: false,
  1179. columnImage: false,
  1180. status: true,
  1181. fixed: '',
  1182. columnWidth: 300
  1183. },
  1184. {
  1185. columnProp: 'printUnitName',
  1186. headerAlign: "center",
  1187. align: "center",
  1188. columnLabel: '计量单位',
  1189. columnHidden: false,
  1190. columnImage: false,
  1191. status: true,
  1192. fixed: '',
  1193. columnWidth: 100
  1194. },
  1195. {
  1196. columnProp: 'partType2',
  1197. headerAlign: "center",
  1198. align: "center",
  1199. columnLabel: '零件类型',
  1200. columnHidden: false,
  1201. columnImage: false,
  1202. status: true,
  1203. fixed: '',
  1204. columnWidth: 100
  1205. }
  1206. ],
  1207. componentOperationColumnList: [
  1208. {
  1209. columnProp: 'operationNo',
  1210. headerAlign: "center",
  1211. align: "center",
  1212. columnLabel: '工序编码',
  1213. columnHidden: false,
  1214. columnImage: false,
  1215. columnSortable: false,
  1216. sortLv: 0,
  1217. status: true,
  1218. fixed: '',
  1219. },
  1220. {
  1221. columnProp: 'operationName',
  1222. headerAlign: "center",
  1223. align: "center",
  1224. columnLabel: '工序名称',
  1225. columnHidden: false,
  1226. columnImage: false,
  1227. columnSortable: false,
  1228. sortLv: 0,
  1229. status: true,
  1230. fixed: '',
  1231. }
  1232. ],
  1233. columnSubDetailList: [
  1234. {
  1235. userId: this.$store.state.user.name,
  1236. functionId: 601003,
  1237. serialNumber: '104003Table2OperationNo',
  1238. tableId: '104003Table2',
  1239. tableName: 'Routing工序表',
  1240. columnProp: 'operationNo',
  1241. headerAlign: 'center',
  1242. align: 'center',
  1243. columnLabel: '工序编码',
  1244. columnHidden: false,
  1245. columnImage: false,
  1246. columnSortable: false,
  1247. sortLv: 0,
  1248. status: true,
  1249. fixed: '',
  1250. columnWidth: 80
  1251. },
  1252. {
  1253. userId: this.$store.state.user.name,
  1254. functionId: 601003,
  1255. serialNumber: '104003Table2OperationName',
  1256. tableId: '104003Table2',
  1257. tableName: 'Routing工序表',
  1258. columnProp: 'operationName',
  1259. headerAlign: 'center',
  1260. align: 'left',
  1261. columnLabel: '工序名称',
  1262. columnHidden: false,
  1263. columnImage: false,
  1264. columnSortable: false,
  1265. sortLv: 0,
  1266. status: true,
  1267. fixed: '',
  1268. columnWidth: 100
  1269. },
  1270. {
  1271. userId: this.$store.state.user.name,
  1272. functionId: 601003,
  1273. serialNumber: '104003Table2RunTimeCodeDesc',
  1274. tableId: '104003Table2',
  1275. tableName: 'Routing工序表',
  1276. columnProp: 'runTimeCodeDesc',
  1277. headerAlign: 'center',
  1278. align: 'center',
  1279. columnLabel: '产出单位',
  1280. columnHidden: false,
  1281. columnImage: false,
  1282. columnSortable: false,
  1283. sortLv: 0,
  1284. status: true,
  1285. fixed: '',
  1286. columnWidth: 100
  1287. },
  1288. {
  1289. userId: this.$store.state.user.name,
  1290. functionId: 601003,
  1291. serialNumber: '104003Table2MachSetupTime',
  1292. tableId: '104003Table2',
  1293. tableName: 'Routing工序表',
  1294. columnProp: 'machSetupTime',
  1295. headerAlign: 'center',
  1296. align: 'right',
  1297. columnLabel: '机器调机时间',
  1298. columnHidden: false,
  1299. columnImage: false,
  1300. columnSortable: false,
  1301. sortLv: 0,
  1302. status: true,
  1303. fixed: '',
  1304. columnWidth: 100
  1305. },
  1306. {
  1307. userId: this.$store.state.user.name,
  1308. functionId: 601003,
  1309. serialNumber: '104003Table2SetupCrewSize',
  1310. tableId: '104003Table2',
  1311. tableName: 'Routing工序表',
  1312. columnProp: 'setupCrewSize',
  1313. headerAlign: 'center',
  1314. align: 'right',
  1315. columnLabel: '调机过程人数',
  1316. columnHidden: false,
  1317. columnImage: false,
  1318. columnSortable: false,
  1319. sortLv: 0,
  1320. status: true,
  1321. fixed: '',
  1322. columnWidth: 100
  1323. },
  1324. {
  1325. userId: this.$store.state.user.name,
  1326. functionId: 601003,
  1327. serialNumber: '104003Table2SetupLaborClassDesc',
  1328. tableId: '104003Table2',
  1329. tableName: 'Routing工序表',
  1330. columnProp: 'setupLaborClassDesc',
  1331. headerAlign: 'center',
  1332. align: 'center',
  1333. columnLabel: '调机时人员等级',
  1334. columnHidden: false,
  1335. columnImage: false,
  1336. columnSortable: false,
  1337. sortLv: 0,
  1338. status: true,
  1339. fixed: '',
  1340. columnWidth: 100
  1341. },
  1342. {
  1343. userId: this.$store.state.user.name,
  1344. functionId: 601003,
  1345. serialNumber: '104003Table2MachCycleTime',
  1346. tableId: '104003Table2',
  1347. tableName: 'Routing工序表',
  1348. columnProp: 'machCycleTime',
  1349. headerAlign: 'center',
  1350. align: 'right',
  1351. columnLabel: '机器处理时间',
  1352. columnHidden: false,
  1353. columnImage: false,
  1354. columnSortable: false,
  1355. sortLv: 0,
  1356. status: true,
  1357. fixed: '',
  1358. columnWidth: 100
  1359. },
  1360. {
  1361. userId: this.$store.state.user.name,
  1362. functionId: 601003,
  1363. serialNumber: '104003Table2MachRunFactor',
  1364. tableId: '104003Table2',
  1365. tableName: 'Routing工序表',
  1366. columnProp: 'machRunFactor',
  1367. headerAlign: 'center',
  1368. align: 'right',
  1369. columnLabel: '机器单位产出',
  1370. columnHidden: false,
  1371. columnImage: false,
  1372. columnSortable: false,
  1373. sortLv: 0,
  1374. status: true,
  1375. fixed: '',
  1376. columnWidth: 100
  1377. },
  1378. {
  1379. userId: this.$store.state.user.name,
  1380. functionId: 601003,
  1381. serialNumber: '104003Table2CrewSize',
  1382. tableId: '104003Table2',
  1383. tableName: 'Routing工序表',
  1384. columnProp: 'crewSize',
  1385. headerAlign: 'center',
  1386. align: 'right',
  1387. columnLabel: '生产过程人数',
  1388. columnHidden: false,
  1389. columnImage: false,
  1390. columnSortable: false,
  1391. sortLv: 0,
  1392. status: true,
  1393. fixed: '',
  1394. columnWidth: 100
  1395. },
  1396. {
  1397. userId: this.$store.state.user.name,
  1398. functionId: 601003,
  1399. serialNumber: '104003Table2LaborClassNo',
  1400. tableId: '104003Table2',
  1401. tableName: 'Routing工序表',
  1402. columnProp: 'laborClassDesc',
  1403. headerAlign: 'center',
  1404. align: 'center',
  1405. columnLabel: '人员等级',
  1406. columnHidden: false,
  1407. columnImage: false,
  1408. columnSortable: false,
  1409. sortLv: 0,
  1410. status: true,
  1411. fixed: '',
  1412. columnWidth: 100
  1413. },
  1414. {
  1415. userId: this.$store.state.user.name,
  1416. functionId: 601003,
  1417. serialNumber: '104003Table2LaborSetupTime',
  1418. tableId: '104003Table2',
  1419. tableName: 'Routing工序表',
  1420. columnProp: 'laborSetupTime',
  1421. headerAlign: 'center',
  1422. align: 'right',
  1423. columnLabel: '人工调机时间',
  1424. columnHidden: false,
  1425. columnImage: false,
  1426. columnSortable: false,
  1427. sortLv: 0,
  1428. status: true,
  1429. fixed: '',
  1430. columnWidth: 100
  1431. },
  1432. {
  1433. userId: this.$store.state.user.name,
  1434. functionId: 601003,
  1435. serialNumber: '104003Table2LaborCycleTime',
  1436. tableId: '104003Table2',
  1437. tableName: 'Routing工序表',
  1438. columnProp: 'laborCycleTime',
  1439. headerAlign: 'center',
  1440. align: 'right',
  1441. columnLabel: '人工处理时间',
  1442. columnHidden: false,
  1443. columnImage: false,
  1444. columnSortable: false,
  1445. sortLv: 0,
  1446. status: true,
  1447. fixed: '',
  1448. columnWidth: 100
  1449. },
  1450. {
  1451. userId: this.$store.state.user.name,
  1452. functionId: 601003,
  1453. serialNumber: '104003Table2LaborRunFactor',
  1454. tableId: '104003Table2',
  1455. tableName: 'Routing工序表',
  1456. columnProp: 'laborRunFactor',
  1457. headerAlign: 'center',
  1458. align: 'right',
  1459. columnLabel: '人工单位产出',
  1460. columnHidden: false,
  1461. columnImage: false,
  1462. columnSortable: false,
  1463. sortLv: 0,
  1464. status: true,
  1465. fixed: '',
  1466. columnWidth: 100
  1467. },
  1468. {
  1469. userId: this.$store.state.user.name,
  1470. functionId: 601003,
  1471. serialNumber: '104003Table2EfficiencyFactor',
  1472. tableId: '104003Table2',
  1473. tableName: 'Routing工序表',
  1474. columnProp: 'efficiencyFactor',
  1475. headerAlign: 'center',
  1476. align: 'right',
  1477. columnLabel: '效率%',
  1478. columnHidden: false,
  1479. columnImage: false,
  1480. columnSortable: false,
  1481. sortLv: 0,
  1482. status: true,
  1483. fixed: '',
  1484. columnWidth: 80
  1485. },
  1486. {
  1487. userId: this.$store.state.user.name,
  1488. functionId: 601003,
  1489. serialNumber: '104003Table2WorkCenterNo',
  1490. tableId: '104003Table2',
  1491. tableName: 'Routing工序表',
  1492. columnProp: 'workCenterNo',
  1493. headerAlign: 'center',
  1494. align: 'center',
  1495. columnLabel: '加工中心编码',
  1496. columnHidden: false,
  1497. columnImage: false,
  1498. columnSortable: false,
  1499. sortLv: 0,
  1500. status: true,
  1501. fixed: '',
  1502. columnWidth: 100
  1503. },
  1504. {
  1505. userId: this.$store.state.user.name,
  1506. functionId: 601003,
  1507. serialNumber: '104003Table2WorkCenterDesc',
  1508. tableId: '104003Table2',
  1509. tableName: 'Routing工序表',
  1510. columnProp: 'workCenterDesc',
  1511. headerAlign: 'center',
  1512. align: 'left',
  1513. columnLabel: '加工中心名称',
  1514. columnHidden: false,
  1515. columnImage: false,
  1516. columnSortable: false,
  1517. sortLv: 0,
  1518. status: true,
  1519. fixed: '',
  1520. columnWidth: 120
  1521. },
  1522. {
  1523. userId: this.$store.state.user.name,
  1524. functionId: 601003,
  1525. serialNumber: '601003Table2WorkCenterType',
  1526. tableId: '601003Table2',
  1527. tableName: 'Routing工序表',
  1528. columnProp: 'workCenterType',
  1529. headerAlign: 'center',
  1530. align: 'center',
  1531. columnLabel: '加工中心类型',
  1532. columnHidden: false,
  1533. columnImage: false,
  1534. columnSortable: false,
  1535. sortLv: 0,
  1536. status: true,
  1537. fixed: '',
  1538. columnWidth: 100
  1539. },
  1540. {
  1541. userId: this.$store.state.user.name,
  1542. functionId: 601003,
  1543. serialNumber: '104003Table2OutsideOpItem',
  1544. tableId: '104003Table2',
  1545. tableName: 'Routing工序表',
  1546. columnProp: 'outsideOpItem',
  1547. headerAlign: 'center',
  1548. align: 'center',
  1549. columnLabel: '外协采购料号',
  1550. columnHidden: false,
  1551. columnImage: false,
  1552. columnSortable: false,
  1553. sortLv: 0,
  1554. status: true,
  1555. fixed: '',
  1556. columnWidth: 100
  1557. },
  1558. {
  1559. userId: this.$store.state.user.name,
  1560. functionId: 601003,
  1561. serialNumber: '104003Table2NoteText',
  1562. tableId: '104003Table2',
  1563. tableName: 'Routing工序表',
  1564. columnProp: 'noteText',
  1565. headerAlign: 'center',
  1566. align: 'left',
  1567. columnLabel: '备注',
  1568. columnHidden: false,
  1569. columnImage: false,
  1570. columnSortable: false,
  1571. sortLv: 0,
  1572. status: true,
  1573. fixed: '',
  1574. columnWidth: 120
  1575. },
  1576. ],
  1577. columnRoutingDetailList: [
  1578. {
  1579. columnProp: 'alternativeNo',
  1580. headerAlign: "center",
  1581. align: "center",
  1582. columnLabel: '替代编码',
  1583. columnHidden: false,
  1584. columnImage: false,
  1585. columnSortable: false,
  1586. sortLv: 0,
  1587. status: true,
  1588. fixed: '',
  1589. },
  1590. {
  1591. columnProp: 'alternativeDescription',
  1592. headerAlign: "center",
  1593. align: "center",
  1594. columnLabel: '替代名称',
  1595. columnHidden: false,
  1596. columnImage: false,
  1597. columnSortable: false,
  1598. sortLv: 0,
  1599. status: true,
  1600. fixed: '',
  1601. },
  1602. {
  1603. columnProp: 'status',
  1604. headerAlign: "center",
  1605. align: "center",
  1606. columnLabel: '状态',
  1607. columnHidden: false,
  1608. columnImage: false,
  1609. columnSortable: false,
  1610. sortLv: 0,
  1611. status: true,
  1612. fixed: '',
  1613. },
  1614. ],
  1615. componentPartColumnList: [
  1616. {
  1617. columnProp: 'partNo',
  1618. headerAlign: "center",
  1619. align: "center",
  1620. columnLabel: '物料编码',
  1621. columnHidden: false,
  1622. columnImage: false,
  1623. status: true,
  1624. fixed: '',
  1625. columnWidth: 120
  1626. },
  1627. {
  1628. columnProp: 'partDesc',
  1629. headerAlign: "center",
  1630. align: "left",
  1631. columnLabel: '物料名称',
  1632. columnHidden: false,
  1633. columnImage: false,
  1634. status: true,
  1635. fixed: '',
  1636. columnWidth: 300
  1637. },
  1638. {
  1639. columnProp: 'spec',
  1640. headerAlign: "center",
  1641. align: "center",
  1642. columnLabel: '规格型号',
  1643. columnHidden: false,
  1644. columnImage: false,
  1645. status: true,
  1646. fixed: '',
  1647. columnWidth: 300
  1648. },
  1649. {
  1650. columnProp: 'printUnitName',
  1651. headerAlign: "center",
  1652. align: "center",
  1653. columnLabel: '计量单位',
  1654. columnHidden: false,
  1655. columnImage: false,
  1656. status: true,
  1657. fixed: '',
  1658. columnWidth: 100
  1659. },
  1660. {
  1661. columnProp: 'partType2',
  1662. headerAlign: "center",
  1663. align: "center",
  1664. columnLabel: '零件类型',
  1665. columnHidden: false,
  1666. columnImage: false,
  1667. status: true,
  1668. fixed: '',
  1669. columnWidth: 100
  1670. }
  1671. ],
  1672. standardOperationColumnList: [
  1673. {
  1674. columnProp: 'operationNo',
  1675. headerAlign: "center",
  1676. align: "center",
  1677. columnLabel: '工序编码',
  1678. columnHidden: false,
  1679. columnImage: false,
  1680. status: true,
  1681. fixed: '',
  1682. columnWidth: 80
  1683. },
  1684. {
  1685. columnProp: 'operationName',
  1686. headerAlign: "center",
  1687. align: "left",
  1688. columnLabel: '工序描述',
  1689. columnHidden: false,
  1690. columnImage: false,
  1691. status: true,
  1692. fixed: '',
  1693. columnWidth: 120
  1694. },
  1695. {
  1696. columnProp: 'setupCrewSize',
  1697. headerAlign: "center",
  1698. align: "right",
  1699. columnLabel: '调机过程中人数',
  1700. columnHidden: false,
  1701. columnImage: false,
  1702. status: true,
  1703. fixed: '',
  1704. columnWidth: 100
  1705. },
  1706. {
  1707. columnProp: 'setupLaborClassNo',
  1708. headerAlign: "center",
  1709. align: "center",
  1710. columnLabel: '调机时人员等级编码',
  1711. columnHidden: false,
  1712. columnImage: false,
  1713. status: true,
  1714. fixed: '',
  1715. columnWidth: 120
  1716. },
  1717. {
  1718. columnProp: 'setupLaborClassDesc',
  1719. headerAlign: "center",
  1720. align: "left",
  1721. columnLabel: '调机时人员等级描述',
  1722. columnHidden: false,
  1723. columnImage: false,
  1724. status: true,
  1725. fixed: '',
  1726. columnWidth: 120
  1727. },
  1728. {
  1729. columnProp: 'machCycleTime',
  1730. headerAlign: 'center',
  1731. align: 'right',
  1732. columnLabel: '机器处理时间',
  1733. columnHidden: false,
  1734. columnImage: false,
  1735. status: true,
  1736. fixed: '',
  1737. columnWidth: 100
  1738. },
  1739. {
  1740. columnProp: 'machRunFactor',
  1741. headerAlign: 'center',
  1742. align: 'right',
  1743. columnLabel: '机器单位产出',
  1744. columnHidden: false,
  1745. columnImage: false,
  1746. status: true,
  1747. fixed: '',
  1748. columnWidth: 100
  1749. },
  1750. {
  1751. columnProp: 'crewSize',
  1752. headerAlign: "center",
  1753. align: "right",
  1754. columnLabel: '生产过程中人数',
  1755. columnHidden: false,
  1756. columnImage: false,
  1757. status: true,
  1758. fixed: '',
  1759. columnWidth: 100
  1760. },
  1761. {
  1762. columnProp: 'laborClassNo',
  1763. headerAlign: "center",
  1764. align: "center",
  1765. columnLabel: '人员等级编码',
  1766. columnHidden: false,
  1767. columnImage: false,
  1768. status: true,
  1769. fixed: '',
  1770. columnWidth: 120
  1771. },
  1772. {
  1773. columnProp: 'laborClassDesc',
  1774. headerAlign: "center",
  1775. align: "left",
  1776. columnLabel: '人员等级描述',
  1777. columnHidden: false,
  1778. columnImage: false,
  1779. status: true,
  1780. fixed: '',
  1781. columnWidth: 120
  1782. },
  1783. {
  1784. columnProp: 'laborCycleTime',
  1785. headerAlign: 'center',
  1786. align: 'right',
  1787. columnLabel: '人工处理时间',
  1788. columnHidden: false,
  1789. columnImage: false,
  1790. status: true,
  1791. fixed: '',
  1792. columnWidth: 100
  1793. },
  1794. {
  1795. columnProp: 'laborRunFactor',
  1796. headerAlign: 'center',
  1797. align: 'right',
  1798. columnLabel: '人工单位产出',
  1799. columnHidden: false,
  1800. columnImage: false,
  1801. status: true,
  1802. fixed: '',
  1803. columnWidth: 100
  1804. },
  1805. {
  1806. columnProp: 'workCenterNo',
  1807. headerAlign: "center",
  1808. align: "center",
  1809. columnLabel: '加工中心编码',
  1810. columnHidden: false,
  1811. columnImage: false,
  1812. status: true,
  1813. fixed: '',
  1814. columnWidth: 100
  1815. },
  1816. {
  1817. columnProp: 'workCenterDesc',
  1818. headerAlign: "center",
  1819. align: "left",
  1820. columnLabel: '加工中心描述',
  1821. columnHidden: false,
  1822. columnImage: false,
  1823. status: true,
  1824. fixed: '',
  1825. columnWidth: 120
  1826. },
  1827. {
  1828. columnProp: 'conditionDesc',
  1829. headerAlign: 'center',
  1830. align: 'left',
  1831. columnLabel: '条件描述',
  1832. columnHidden: false,
  1833. columnImage: false,
  1834. status: true,
  1835. fixed: '',
  1836. columnWidth: 200
  1837. },
  1838. ],
  1839. // ======== 必填规则 ========
  1840. rules: {
  1841. partNo: [
  1842. {
  1843. required: true,
  1844. message: ' ',
  1845. trigger: ['blur','change']
  1846. }
  1847. ],
  1848. partDesc: [
  1849. {
  1850. required: true,
  1851. message: ' ',
  1852. trigger: ['blur','change']
  1853. }
  1854. ],
  1855. routingType: [
  1856. {
  1857. required: true,
  1858. message: ' ',
  1859. trigger: ['blur','change']
  1860. }
  1861. ],
  1862. phaseInDate: [
  1863. {
  1864. required: true,
  1865. message: ' ',
  1866. trigger: ['blur','change']
  1867. }
  1868. ],
  1869. routingRevision: [
  1870. {
  1871. required: true,
  1872. message: ' ',
  1873. trigger: ['blur','change']
  1874. }
  1875. ]
  1876. },
  1877. detailRules: {
  1878. alternativeNo: [
  1879. {
  1880. required: true,
  1881. message: ' ',
  1882. trigger: ['blur','change']
  1883. }
  1884. ],
  1885. alternativeDescription: [
  1886. {
  1887. required: true,
  1888. message: ' ',
  1889. trigger: ['blur','change']
  1890. }
  1891. ],
  1892. status: [
  1893. {
  1894. required: true,
  1895. message: ' ',
  1896. trigger: ['blur','change']
  1897. }
  1898. ]
  1899. },
  1900. componentRules: {
  1901. operationNo: [
  1902. {
  1903. required: true,
  1904. message: ' ',
  1905. trigger: ['blur','change']
  1906. }
  1907. ],
  1908. operationName: [
  1909. {
  1910. required: true,
  1911. message: ' ',
  1912. trigger: ['blur','change']
  1913. }
  1914. ],
  1915. workCenterNo: [
  1916. {
  1917. required: true,
  1918. message: ' ',
  1919. trigger: ['blur','change']
  1920. }
  1921. ],
  1922. machSetupTime: [
  1923. {
  1924. required: true,
  1925. message: ' ',
  1926. trigger: ['blur','change']
  1927. }
  1928. ],
  1929. laborSetupTime: [
  1930. {
  1931. required: true,
  1932. message: ' ',
  1933. trigger: ['blur','change']
  1934. }
  1935. ],
  1936. setupLaborClassNo: [
  1937. {
  1938. required: true,
  1939. message: ' ',
  1940. trigger: ['blur','change']
  1941. }
  1942. ],
  1943. setupCrewSize: [
  1944. {
  1945. required: true,
  1946. message: ' ',
  1947. trigger: ['blur','change']
  1948. }
  1949. ],
  1950. machRunFactor: [
  1951. {
  1952. required: true,
  1953. message: ' ',
  1954. trigger: ['blur','change']
  1955. }
  1956. ],
  1957. laborRunFactor: [
  1958. {
  1959. required: true,
  1960. message: ' ',
  1961. trigger: ['blur','change']
  1962. }
  1963. ],
  1964. runTimeCode: [
  1965. {
  1966. required: true,
  1967. message: ' ',
  1968. trigger: ['blur','change']
  1969. }
  1970. ],
  1971. laborClassNo: [
  1972. {
  1973. required: true,
  1974. message: ' ',
  1975. trigger: ['blur','change']
  1976. }
  1977. ],
  1978. efficiencyFactor: [
  1979. {
  1980. required: true,
  1981. message: ' ',
  1982. trigger: ['blur','change']
  1983. }
  1984. ],
  1985. crewSize: [
  1986. {
  1987. required: true,
  1988. message: ' ',
  1989. trigger: ['blur','change']
  1990. }
  1991. ]
  1992. },
  1993. // ======== 复选数据集 ========
  1994. routingSelections: [],
  1995. // ======== 模态框开关控制 ========
  1996. authSearch: false,
  1997. authSave: false,
  1998. authUpdate: false,
  1999. authDelete: false,
  2000. modalFlag: false,
  2001. modalDisableFlag: false,
  2002. partModelFlag: false,
  2003. saveDetailModalFlag: false,
  2004. saveDetailModalDisable: false,
  2005. componentSaveModal: false,
  2006. componentDisableFlag: false,
  2007. copyRoutingModelFlag: false,
  2008. copyAlternativeModelFlag: false,
  2009. headerSaveFlag: false,
  2010. menuId: this.$route.meta.menuId,
  2011. copyPartModelFlag: false,
  2012. standardOperationModal: false
  2013. }
  2014. },
  2015. mounted () {
  2016. this.$nextTick(() => {
  2017. this.height = window.innerHeight - 170
  2018. })
  2019. },
  2020. created () {
  2021. // 按钮控制
  2022. this.getButtonAuthData()
  2023. // 获取用户的 site 和 bu
  2024. this.getSiteAndBuByUserName()
  2025. // 获取用户的 site 和 bu
  2026. this.getSiteAndBuByUserName2()
  2027. // 动态列
  2028. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  2029. if (!this.authSearch) {
  2030. // 获取数据列表
  2031. this.getDataList()
  2032. }
  2033. },
  2034. activated () {
  2035. if (!this.authSearch) {
  2036. if (this.$route.params.type === 'quote'){
  2037. this.searchData.partNo = this.$route.params.partNo
  2038. this.searchData.routingType = this.$route.params.routingType
  2039. this.searchData.routingRevision = this.$route.params.routingRevision
  2040. }else if (this.$route.params.partNo) {
  2041. this.searchData.partNo = this.$route.params.partNo
  2042. }
  2043. this.getDataList()
  2044. } else {
  2045. this.$message.warning('无操作权限!')
  2046. }
  2047. },
  2048. methods: {
  2049. // bu改变事件
  2050. userBuChange () {
  2051. this.modalData.site = this.modalData.bu.split('_')[0]
  2052. this.modalData.buNo = this.modalData.bu.split('_')[1]
  2053. },
  2054. // 获取用户的bu
  2055. getSiteAndBuByUserName () {
  2056. let tempData = {
  2057. username: this.$store.state.user.name,
  2058. }
  2059. getSiteAndBuByUserName(tempData).then(({data}) => {
  2060. if (data.code === 0) {
  2061. this.userBuList = data.rows
  2062. }
  2063. })
  2064. },
  2065. // 获取用户的bu
  2066. getSiteAndBuByUserName2 () {
  2067. let tempData = {
  2068. username: this.$store.state.user.name,
  2069. }
  2070. getSiteAndBuByUserName2(tempData).then(({data}) => {
  2071. if (data.code === 0) {
  2072. this.buList = data.rows
  2073. }
  2074. })
  2075. },
  2076. // ======== 分页相关方法 ========
  2077. /**
  2078. * 每页数
  2079. * @param val
  2080. */
  2081. sizeChangeHandle (val) {
  2082. this.pageSize = val
  2083. this.pageIndex = 1
  2084. this.getDataList()
  2085. },
  2086. /**
  2087. * 当前页
  2088. * @param val
  2089. */
  2090. currentChangeHandle (val) {
  2091. this.pageIndex = val
  2092. this.getDataList()
  2093. },
  2094. /**
  2095. * 每页数
  2096. * @param val
  2097. */
  2098. sizeChangeHandle2 (val) {
  2099. this.pageSize2 = val
  2100. this.pageIndex2 = 1
  2101. this.queryPartList()
  2102. },
  2103. /**
  2104. * 当前页
  2105. * @param val
  2106. */
  2107. currentChangeHandle2 (val) {
  2108. this.pageIndex2 = val
  2109. this.queryPartList()
  2110. },
  2111. /**
  2112. * 每页数
  2113. * @param val
  2114. */
  2115. sizeChangeHandle4 (val) {
  2116. this.pageSize4 = val
  2117. this.pageIndex4 = 1
  2118. this.queryCopyPartModal()
  2119. },
  2120. /**
  2121. * 当前页
  2122. * @param val
  2123. */
  2124. currentChangeHandle4 (val) {
  2125. this.pageIndex4 = val
  2126. this.queryCopyPartModal()
  2127. },
  2128. /**
  2129. * copy物料列表
  2130. */
  2131. queryCopyPartModal () {
  2132. this.copyPartData.limit = this.pageSize4
  2133. this.copyPartData.page = this.pageIndex4
  2134. this.copyPartData.site = this.modalData.site
  2135. this.copyPartData.buNo = this.modalData.buNo
  2136. // 查询所有物料
  2137. queryPartList(this.copyPartData).then(({data}) => {
  2138. if (data && data.code === 0) {
  2139. this.copyPartList = data.page.list
  2140. this.pageIndex4 = data.page.currPage
  2141. this.pageSize4 = data.page.pageSize
  2142. this.totalPage4 = data.page.totalCount
  2143. this.copyPartModelFlag = true
  2144. } else {
  2145. this.$alert(data.msg, '错误', {
  2146. confirmButtonText: '确定'
  2147. })
  2148. }
  2149. })
  2150. },
  2151. /**
  2152. * copy物料查询列表
  2153. */
  2154. queryCopyPartList () {
  2155. this.copyPartData.limit = this.pageSize4
  2156. this.copyPartData.page = this.pageIndex4
  2157. // 查询所有物料
  2158. queryPartList(this.copyPartData).then(({data}) => {
  2159. if (data && data.code === 0) {
  2160. this.copyPartList = data.page.list
  2161. this.pageIndex4 = data.page.currPage
  2162. this.pageSize4 = data.page.pageSize
  2163. this.totalPage4 = data.page.totalCount
  2164. } else {
  2165. this.copyPartList = []
  2166. }
  2167. })
  2168. },
  2169. // copy物料编码失焦事件
  2170. copyPartBlur () {
  2171. if (this.copyPartData.type === '1') {
  2172. if (this.copyRoutingData.partNo != null && this.copyRoutingData.partNo !== '') {
  2173. this.copyPartData.limit = this.pageSize4
  2174. this.copyPartData.page = this.pageIndex4
  2175. this.copyPartData.partNo = this.copyRoutingData.partNo
  2176. queryPartList(this.copyPartData).then(({data}) => {
  2177. if (data && data.code === 0) {
  2178. if (data.page.list.length === 1) {
  2179. this.copyRoutingData.partDesc = data.page.list[0].partDesc
  2180. return
  2181. }
  2182. }
  2183. })
  2184. }
  2185. this.copyRoutingData.partDesc = ''
  2186. } else {
  2187. if (this.copyAlternativeData.partNo != null && this.copyAlternativeData.partNo !== '') {
  2188. this.copyPartData.limit = this.pageSize4
  2189. this.copyPartData.page = this.pageIndex4
  2190. this.copyPartData.partNo = this.copyAlternativeData.partNo
  2191. queryPartList(this.copyPartData).then(({data}) => {
  2192. if (data && data.code === 0) {
  2193. if (data.page.list.length === 1) {
  2194. this.copyAlternativeData.partDesc = data.page.list[0].partDesc
  2195. return
  2196. }
  2197. }
  2198. })
  2199. }
  2200. this.copyAlternativeData.partDesc = ''
  2201. }
  2202. },
  2203. // 双击选择copy物料
  2204. getCopyRowData (row) {
  2205. if (this.copyPartData.type === '1') {
  2206. this.copyRoutingData.partNo = row.partNo
  2207. this.copyRoutingData.partDesc = row.partDesc
  2208. this.copyRoutingTypeChange()
  2209. } else {
  2210. this.copyAlternativeData.partNo = row.partNo
  2211. this.copyAlternativeData.partDesc = row.partDesc
  2212. }
  2213. this.copyPartModelFlag = false
  2214. },
  2215. // copy BOM类型改变
  2216. copyRoutingTypeChange () {
  2217. // 获取物料的routing版本号
  2218. getRottingRevision(this.copyRoutingData).then(({data}) => {
  2219. if (data && data.code === 0) {
  2220. this.copyRoutingData.routingRevision = data.routingRevision
  2221. } else {
  2222. this.copyRoutingData.routingRevision = ''
  2223. }
  2224. })
  2225. },
  2226. // ======== 列表数据操作方法 ========
  2227. /**
  2228. * 获取数据列表
  2229. */
  2230. getDataList () {
  2231. this.searchData.limit = this.pageSize
  2232. this.searchData.page = this.pageIndex
  2233. routingManagementSearch(this.searchData).then(({data}) => {
  2234. if (data.code === 0) {
  2235. this.dataList = data.page.list
  2236. this.pageIndex = data.page.currPage
  2237. this.pageSize = data.page.pageSize
  2238. this.totalPage = data.page.totalCount
  2239. this.$refs.selectDiv.setLengthAll( this.dataList.length)
  2240. }
  2241. })
  2242. },
  2243. /**
  2244. * 复选列表信息
  2245. * @param val
  2246. */
  2247. selectionRouting (val) {
  2248. this.routingSelections = val
  2249. this.$refs.selectDiv.setLengthselected(this.routingSelections.length)
  2250. },
  2251. // ======== 新增/编辑模态框 ========
  2252. /**
  2253. * routing新增模态框
  2254. */
  2255. addModal () {
  2256. this.modalData = {
  2257. flag: '1',
  2258. title: 'Routing新增',
  2259. bu: this.userBuList[0].buNo,
  2260. site: this.userBuList[0].buNo.split('_')[0],
  2261. buNo: this.userBuList[0].buNo.split('_')[1],
  2262. partNo: '',
  2263. partDesc: '',
  2264. routingRevision: undefined,
  2265. routingType: 'Manufacturing',
  2266. noteText: '',
  2267. phaseInDate: new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''),
  2268. phaseOutDate: '',
  2269. createBy: this.$store.state.user.name,
  2270. printUnit: '',
  2271. printUnitName: '',
  2272. }
  2273. this.detailData = {
  2274. site: '',
  2275. buNo: '',
  2276. partNo: '',
  2277. routingRevision: '',
  2278. routingType: '',
  2279. alternativeNo: '',
  2280. alternativeDescription: '',
  2281. routTemplateId: '',
  2282. planDate: '',
  2283. fixedLeadTimeDay: '',
  2284. fixedLeadTimeHour: '',
  2285. variableLeadTimeDay: '',
  2286. variableLeadTimeHour: '',
  2287. forStdLotByDay: '',
  2288. forLotByDay: '',
  2289. minLotQty: '',
  2290. detailNoteText: '',
  2291. status: '',
  2292. createBy: this.$store.state.user.name,
  2293. }
  2294. this.detailTable = 'routing_detail'
  2295. this.detailDataList = []
  2296. this.subDetailList = []
  2297. this.headerSaveFlag = true
  2298. this.modalDisableFlag = false
  2299. this.modalFlag = true
  2300. },
  2301. /**
  2302. * routing编辑模态框
  2303. */
  2304. async updateModal (row) {
  2305. this.modalData = {
  2306. flag: '2',
  2307. bu: row.site + '_' + row.buNo,
  2308. site: row.site,
  2309. buNo: row.buNo,
  2310. partNo: row.partNo,
  2311. partDesc: row.partDesc,
  2312. routingRevision: row.routingRevision,
  2313. routingType: row.routingType,
  2314. noteText: row.noteText,
  2315. phaseInDate: row.phaseInDate,
  2316. phaseOutDate: row.phaseOutDate,
  2317. engRevision: row.engRevision,
  2318. typeFlag: row.typeFlag,
  2319. netWeight: row.netWeight,
  2320. updateBy: this.$store.state.user.name,
  2321. printUnit: row.printUnit,
  2322. printUnitName: row.printUnitName,
  2323. alternativeNo: row.alternativeNo,
  2324. }
  2325. // 查routing明细
  2326. queryRoutingDetail(this.modalData).then(({data}) => {
  2327. if (data && data.code === 0) {
  2328. this.detailDataList = data.rows.detailList
  2329. this.subDetailList = data.rows.componentList
  2330. this.detailData = data.rows.detailData
  2331. this.detailTable = 'routing_detail'
  2332. this.modalDisableFlag = true
  2333. this.modalFlag = true
  2334. } else {
  2335. this.$alert(data.msg, '错误', {
  2336. confirmButtonText: '确定'
  2337. })
  2338. }
  2339. })
  2340. },
  2341. /**
  2342. * 新增替代模态框
  2343. */
  2344. saveRoutingDetail () {
  2345. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  2346. this.$message.warning('请先选择Routing物料!')
  2347. return
  2348. }
  2349. if (this.modalData.routingRevision === '' || this.modalData.routingRevision == null) {
  2350. this.$message.warning('请先填写Routing版本号!')
  2351. return
  2352. }
  2353. if (this.modalData.routingType === '' || this.modalData.routingType == null) {
  2354. this.$message.warning('请先选择工艺类型!')
  2355. return
  2356. }
  2357. this.saveDetailData = {
  2358. flag: '1',
  2359. site: this.modalData.site,
  2360. buNo: this.modalData.buNo,
  2361. partNo: this.modalData.partNo,
  2362. routingRevision: this.modalData.routingRevision,
  2363. routingType: this.modalData.routingType,
  2364. alternativeNo: '',
  2365. alternativeDescription: '',
  2366. routTemplateId: '',
  2367. planDate: '',
  2368. fixedLeadTimeDay: '',
  2369. fixedLeadTimeHour: '',
  2370. variableLeadTimeDay: '',
  2371. variableLeadTimeHour: '',
  2372. forStdLotByDay: '',
  2373. forLotByDay: '',
  2374. minLotQty: '',
  2375. detailNoteText: '',
  2376. status: 'Tentative',
  2377. createDate: '',
  2378. createBy: this.$store.state.user.name,
  2379. }
  2380. // 查询routing主信息
  2381. queryRoutingHeader(this.modalData).then(({data}) => {
  2382. if (data && data.code === 0) {
  2383. if (data.rows.length > 0) {
  2384. this.saveDetailModalFlag = true
  2385. this.saveDetailModalDisable = false
  2386. } else {
  2387. this.$message.warning('请先保存Routing主记录!')
  2388. }
  2389. } else {
  2390. this.$alert(data.msg, '提示', {
  2391. confirmButtonText: '确定'
  2392. })
  2393. }
  2394. })
  2395. },
  2396. /**
  2397. * 替代编辑模态框
  2398. */
  2399. updateRoutingDetail () {
  2400. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  2401. this.$message.warning('请先选择Routing物料!')
  2402. return
  2403. }
  2404. if (this.modalData.routingRevision === '' || this.modalData.routingRevision == null) {
  2405. this.$message.warning('请先填写Routing版本号!')
  2406. return
  2407. }
  2408. if (this.modalData.routingType === '' || this.modalData.routingType == null) {
  2409. this.$message.warning('请先选择工艺类型!')
  2410. return
  2411. }
  2412. this.saveDetailData = {
  2413. flag: '2',
  2414. site: this.detailData.site,
  2415. buNo: this.detailData.buNo,
  2416. partNo: this.detailData.partNo,
  2417. routingRevision: this.detailData.routingRevision,
  2418. routingType: this.detailData.routingType,
  2419. alternativeNo: this.detailData.alternativeNo,
  2420. alternativeDescription: this.detailData.alternativeDescription,
  2421. routTemplateId: this.detailData.routTemplateId,
  2422. planDate: this.detailData.planDate,
  2423. fixedLeadTimeDay: this.detailData.fixedLeadTimeDay,
  2424. fixedLeadTimeHour: this.detailData.fixedLeadTimeHour,
  2425. variableLeadTimeDay: this.detailData.variableLeadTimeDay,
  2426. variableLeadTimeHour: this.detailData.variableLeadTimeHour,
  2427. forStdLotByDay: this.detailData.forStdLotByDay,
  2428. forLotByDay: this.detailData.forLotByDay,
  2429. minLotQty: this.detailData.minLotQty,
  2430. detailNoteText: this.detailData.detailNoteText,
  2431. status: this.detailData.status,
  2432. updateBy: this.$store.state.user.name,
  2433. }
  2434. // 查询routing主信息
  2435. queryRoutingHeader(this.modalData).then(({data}) => {
  2436. if (data && data.code === 0) {
  2437. if (data.rows.length > 0) {
  2438. this.saveDetailModalFlag = true
  2439. this.saveDetailModalDisable = true
  2440. } else {
  2441. this.$message.warning('请先保存Routing主记录!')
  2442. }
  2443. } else {
  2444. this.$alert(data.msg, '提示', {
  2445. confirmButtonText: '确定'
  2446. })
  2447. }
  2448. })
  2449. },
  2450. // 基于标准工序快速创建
  2451. createByStandardOperation () {
  2452. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  2453. this.$message.warning('请先选择替代!')
  2454. return
  2455. }
  2456. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  2457. // this.$message.warning('不可编辑的替代状态!')
  2458. // return
  2459. // }
  2460. this.standardOperationSelections = []
  2461. getStandardOperations(this.modalData).then(({data}) => {
  2462. if (data && data.code === 0) {
  2463. this.standardOperationList = data.rows
  2464. this.standardOperationModal = true
  2465. } else {
  2466. this.$alert(data.msg, '提示', {
  2467. confirmButtonText: '确定'
  2468. })
  2469. }
  2470. })
  2471. },
  2472. // 更新 Routing 的工序
  2473. saveStandardOperation () {
  2474. if (this.standardOperationSelections.length === 0) {
  2475. this.$message.warning('请选择标准工序!')
  2476. return
  2477. }
  2478. this.$confirm("是否确认更改替代下的工序?", "提示", {
  2479. confirmButtonText: "确定",
  2480. cancelButtonText: "取消",
  2481. type: "warning"
  2482. }).then(() => {
  2483. let tempData = {
  2484. site: this.detailData.site,
  2485. buNo: this.detailData.buNo,
  2486. partNo: this.detailData.partNo,
  2487. routingRevision: this.detailData.routingRevision,
  2488. routingType: this.detailData.routingType,
  2489. alternativeNo: this.detailData.alternativeNo,
  2490. informationList: this.standardOperationSelections
  2491. }
  2492. saveStandardOperation(tempData).then(({data}) => {
  2493. if (data && data.code === 0) {
  2494. this.subDetailList = data.rows
  2495. this.standardOperationModal = false
  2496. this.$message({
  2497. message: '操作成功',
  2498. type: 'success',
  2499. duration: 1500,
  2500. onClose: () => {}
  2501. })
  2502. } else {
  2503. this.$alert(data.msg, '提示', {
  2504. confirmButtonText: '确定'
  2505. })
  2506. }
  2507. })
  2508. })
  2509. },
  2510. /**
  2511. * 新增子明细模态框
  2512. */
  2513. saveComponentModal () {
  2514. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  2515. this.$message.warning('请先选择替代!')
  2516. return
  2517. }
  2518. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  2519. // this.$message.warning('不可编辑的替代状态!')
  2520. // return
  2521. // }
  2522. this.componentData = {
  2523. flag: '1',
  2524. site: this.modalData.site,
  2525. buNo: this.modalData.buNo,
  2526. partNo: this.modalData.partNo,
  2527. routingRevision: this.modalData.routingRevision,
  2528. routingType: this.modalData.routingType,
  2529. alternativeNo: this.detailData.alternativeNo,
  2530. operationId: '',
  2531. operationNo: '',
  2532. operationName: '',
  2533. efficiencyFactor: 100,
  2534. machRunFactor: '',
  2535. machSetupTime: '',
  2536. runTimeCode: 'Units/Hour',
  2537. laborRunFactor: '',
  2538. laborSetupTime: '',
  2539. crewSize: 1,
  2540. setupCrewSize: 1,
  2541. outsideOpItem: '',
  2542. machineNo: '',
  2543. workCenterNo: '',
  2544. workCenterDesc: '',
  2545. workCenterType: '',
  2546. laborClassNo: '',
  2547. laborClassDesc: '',
  2548. setupLaborClassNo: '',
  2549. setupLaborClassDesc: '',
  2550. noteText: '',
  2551. createBy: this.$store.state.user.name,
  2552. machCycleTime: '',
  2553. laborCycleTime: ''
  2554. }
  2555. this.queryMaxOperationNo()
  2556. this.componentDisableFlag = false
  2557. this.componentSaveModal = true
  2558. },
  2559. // 查询最大工序号
  2560. queryMaxOperationNo () {
  2561. queryMaxOperationNo(this.detailData).then(({data}) => {
  2562. if (data && data.code === 0) {
  2563. this.componentData.operationNo = data.operationNo
  2564. }
  2565. })
  2566. },
  2567. /**
  2568. * 编辑模态框
  2569. */
  2570. updateComponentModal (row) {
  2571. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  2572. // this.$message.warning('不可编辑的替代状态!')
  2573. // return
  2574. // }
  2575. this.componentData = {
  2576. flag: '2',
  2577. site: row.site,
  2578. buNo: row.buNo,
  2579. partNo: row.partNo,
  2580. routingRevision: row.routingRevision,
  2581. routingType: row.routingType,
  2582. alternativeNo: row.alternativeNo,
  2583. operationId: row.operationId,
  2584. operationNo: row.operationNo,
  2585. operationName: row.operationName,
  2586. efficiencyFactor: row.efficiencyFactor,
  2587. machRunFactor: row.machRunFactor,
  2588. machSetupTime: row.machSetupTime,
  2589. runTimeCode: row.runTimeCode,
  2590. laborRunFactor: row.laborRunFactor,
  2591. laborSetupTime: row.laborSetupTime,
  2592. crewSize: row.crewSize,
  2593. setupCrewSize: row.setupCrewSize,
  2594. outsideOpItem: row.outsideOpItem,
  2595. machineNo: row.machineNo,
  2596. workCenterNo: row.workCenterNo,
  2597. workCenterDesc: row.workCenterDesc,
  2598. workCenterType: row.workCenterType,
  2599. laborClassNo: row.laborClassNo,
  2600. laborClassDesc: row.laborClassDesc,
  2601. setupLaborClassNo: row.setupLaborClassNo,
  2602. setupLaborClassDesc: row.setupLaborClassDesc,
  2603. noteText: row.noteText,
  2604. updateBy: this.$store.state.user.name,
  2605. machCycleTime: row.machCycleTime,
  2606. laborCycleTime: row.laborCycleTime
  2607. }
  2608. this.componentDisableFlag = true
  2609. this.componentSaveModal = true
  2610. },
  2611. // ======== 新增/编辑/删除方法 ========
  2612. /**
  2613. * routing新增/编辑
  2614. */
  2615. saveData () {
  2616. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  2617. this.$message.warning('请选择物料编码!')
  2618. return
  2619. }
  2620. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  2621. this.$message.warning('请选择物料名称!')
  2622. return
  2623. }
  2624. if (this.modalData.routingType === '' || this.modalData.routingType == null) {
  2625. this.$message.warning('请选择制造类型!')
  2626. return
  2627. }
  2628. if (this.modalData.phaseInDate === '' || this.modalData.phaseInDate == null) {
  2629. this.$message.warning('请选择生效时间!')
  2630. return
  2631. }
  2632. if (this.modalData.routingRevision === '' || this.modalData.routingRevision == null) {
  2633. this.$message.warning('请填写Routing版本号!')
  2634. return
  2635. }
  2636. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  2637. this.$message.warning('请选择替代!')
  2638. return
  2639. }
  2640. if (this.detailData.status === '' || this.detailData.status == null) {
  2641. this.$message.warning('请选择替代状态!')
  2642. return
  2643. }
  2644. let tempData = {
  2645. site: this.$store.state.user.site,
  2646. partNo: this.modalData.partNo,
  2647. partDesc: this.modalData.partDesc,
  2648. routingRevision: this.modalData.routingRevision,
  2649. routingType: this.modalData.routingType,
  2650. noteText: this.modalData.noteText,
  2651. phaseInDate: this.modalData.phaseInDate,
  2652. phaseOutDate: this.modalData.phaseOutDate,
  2653. alternativeNo: this.detailData.alternativeNo,
  2654. alternativeDescription: this.detailData.alternativeDescription,
  2655. detailNoteText: this.detailData.detailNoteText,
  2656. status: this.detailData.status,
  2657. createBy: this.$store.state.user.name,
  2658. updateBy: this.$store.state.user.name,
  2659. informationList: this.subDetailList
  2660. }
  2661. if (this.modalData.flag === '1') {
  2662. this.saveAllLoading = true
  2663. routingManagementSave(tempData).then(({data}) => {
  2664. if (data && data.code === 0) {
  2665. this.getDataList()
  2666. this.modalFlag = false
  2667. this.$message({
  2668. message: '操作成功',
  2669. type: 'success',
  2670. duration: 1500,
  2671. onClose: () => {}
  2672. })
  2673. } else {
  2674. this.$alert(data.msg, '错误', {
  2675. confirmButtonText: '确定'
  2676. })
  2677. }
  2678. this.saveAllLoading = false
  2679. })
  2680. } else {
  2681. this.saveAllLoading = true
  2682. routingManagementEdit(tempData).then(({data}) => {
  2683. if (data && data.code === 0) {
  2684. this.getDataList()
  2685. this.modalFlag = false
  2686. this.$message({
  2687. message: '操作成功',
  2688. type: 'success',
  2689. duration: 1500,
  2690. onClose: () => {}
  2691. })
  2692. } else {
  2693. this.$alert(data.msg, '错误', {
  2694. confirmButtonText: '确定'
  2695. })
  2696. }
  2697. this.saveAllLoading = false
  2698. })
  2699. }
  2700. },
  2701. /**
  2702. * 新增编辑模态框关闭
  2703. */
  2704. closeModal () {
  2705. this.getDataList()
  2706. this.modalFlag = false
  2707. },
  2708. /**
  2709. * 新增编辑模态框关闭
  2710. */
  2711. closeModalX (done) {
  2712. this.getDataList()
  2713. done()
  2714. },
  2715. /**
  2716. * routing删除
  2717. */
  2718. delModal () {
  2719. if(this.routingSelections.length === 0){
  2720. this.$message.warning('请勾选要删除的Routing!')
  2721. return
  2722. }
  2723. this.$confirm(`是否删除这 `+ this.routingSelections.length +` 条Routing?`, '提示', {
  2724. confirmButtonText: '确定',
  2725. cancelButtonText: '取消',
  2726. type: 'warning'
  2727. }).then(() => {
  2728. let tempData = {
  2729. informationList: this.routingSelections
  2730. }
  2731. routingManagementDelete(tempData).then(({data}) => {
  2732. if (data && data.code === 0) {
  2733. this.getDataList()
  2734. this.routingSelections = []
  2735. this.$message({
  2736. message: '操作成功',
  2737. type: 'success',
  2738. duration: 1500,
  2739. onClose: () => {}
  2740. })
  2741. } else {
  2742. this.$alert(data.msg, '错误', {
  2743. confirmButtonText: '确定'
  2744. })
  2745. }
  2746. })
  2747. }).catch(() => {
  2748. })
  2749. },
  2750. /**
  2751. * 查询物料
  2752. */
  2753. queryPartList () {
  2754. this.partData.limit = this.pageSize2
  2755. this.partData.page = this.pageIndex2
  2756. this.partData.site = this.modalData.bu.split('_')[0]
  2757. this.partData.buNo = this.modalData.bu.split('_')[1]
  2758. queryPartListRouting(this.partData).then(({data}) => {
  2759. if (data && data.code === 0) {
  2760. this.partList = data.page.list
  2761. this.pageIndex2 = data.page.currPage
  2762. this.pageSize2 = data.page.pageSize
  2763. this.totalPage2 = data.page.totalCount
  2764. this.partModelFlag = true
  2765. } else {
  2766. this.$alert(data.msg, '错误', {
  2767. confirmButtonText: '确定'
  2768. })
  2769. }
  2770. })
  2771. },
  2772. // 物料编码失焦事件
  2773. partNoBlur () {
  2774. if (this.modalData.partNo != null && this.modalData.partNo !== '') {
  2775. this.partData.limit = this.pageSize2
  2776. this.partData.page = this.pageIndex2
  2777. this.partData.partNo = this.modalData.partNo
  2778. queryPartList(this.partData).then(({data}) => {
  2779. if (data && data.code === 0) {
  2780. if (data.page.list.length === 1) {
  2781. this.modalData.partDesc = data.page.list[0].partDesc
  2782. this.modalData.printUnit = data.page.list[0].printUnit
  2783. this.modalData.printUnitName = data.page.list[0].printUnitName
  2784. // 获取物料的routing版本号
  2785. getRottingRevision(this.modalData).then(({data}) => {
  2786. if (data && data.code === 0) {
  2787. this.modalData.routingRevision = data.routingRevision
  2788. } else {
  2789. this.modalData.routingRevision = ''
  2790. }
  2791. })
  2792. } else {
  2793. this.modalData.partDesc = ''
  2794. this.modalData.printUnit = ''
  2795. this.modalData.printUnitName = ''
  2796. this.modalData.routingRevision = ''
  2797. }
  2798. }
  2799. })
  2800. } else {
  2801. this.modalData.partDesc = ''
  2802. this.modalData.printUnit = ''
  2803. this.modalData.printUnitName = ''
  2804. this.modalData.routingRevision = ''
  2805. }
  2806. },
  2807. /**
  2808. * 双击选中物料
  2809. * @param row
  2810. */
  2811. getRowData (row) {
  2812. this.modalData.partNo = row.partNo
  2813. this.modalData.partDesc = row.partDesc
  2814. this.modalData.printUnit = row.printUnit
  2815. this.modalData.printUnitName = row.printUnitName
  2816. // 获取物料的routing版本号
  2817. getRottingRevision(this.modalData).then(({data}) => {
  2818. if (data && data.code === 0) {
  2819. this.modalData.routingRevision = data.routingRevision
  2820. } else {
  2821. this.modalData.routingRevision = ''
  2822. }
  2823. this.partModelFlag = false
  2824. })
  2825. },
  2826. /**
  2827. * 工艺类型改变
  2828. */
  2829. routingTypeChange () {
  2830. // 获取物料的routing版本号
  2831. getRottingRevision(this.modalData).then(({data}) => {
  2832. if (data && data.code === 0) {
  2833. this.modalData.routingRevision = data.routingRevision
  2834. } else {
  2835. this.modalData.routingRevision = ''
  2836. }
  2837. })
  2838. },
  2839. /**
  2840. * 表格的新增
  2841. * @param row
  2842. * @param rowIndex
  2843. */
  2844. rowClassName({ row, rowIndex }) {
  2845. row.xh = rowIndex + 1
  2846. },
  2847. /**
  2848. * 单选框选中数据
  2849. * @param selection
  2850. */
  2851. componentSelectionChange(selection) {
  2852. this.checkedDetail = selection
  2853. },
  2854. /**
  2855. * 删除子物料
  2856. */
  2857. deleteComponentPart () {
  2858. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  2859. // this.$message.warning('不可编辑的替代状态!')
  2860. // return
  2861. // }
  2862. if (this.checkedDetail.length === 0) {
  2863. this.$message.warning('请选择要删除子物料!')
  2864. return
  2865. } else {
  2866. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  2867. confirmButtonText: "确定",
  2868. cancelButtonText: "取消",
  2869. type: "warning"
  2870. }).then(() => {
  2871. let tempData = {
  2872. informationList: this.checkedDetail
  2873. }
  2874. deleteRoutingComponent(tempData).then(({data}) => {
  2875. if (data && data.code === 0) {
  2876. this.subDetailList = data.rows
  2877. this.$message({
  2878. message: '操作成功',
  2879. type: 'success',
  2880. duration: 1500,
  2881. onClose: () => {}
  2882. })
  2883. } else {
  2884. this.$alert(data.msg, '错误', {
  2885. confirmButtonText: '确定'
  2886. })
  2887. }
  2888. })
  2889. }).catch(() => {
  2890. })
  2891. }
  2892. },
  2893. /**
  2894. * 子物料
  2895. * @param row
  2896. */
  2897. componentClickRow (row) {
  2898. this.$refs.componentTable.toggleRowSelection(row)
  2899. },
  2900. /**
  2901. * 新增子明细方法
  2902. */
  2903. componentDataSave (isClose) {
  2904. if (this.componentData.partNo === '' || this.componentData.partNo == null) {
  2905. this.$message.warning('请选择主记录物料编码!')
  2906. return
  2907. }
  2908. if (this.componentData.routingType === '' || this.componentData.routingType == null) {
  2909. this.$message.warning('请选择主记录工艺类型!')
  2910. return
  2911. }
  2912. if (this.componentData.routingRevision === '' || this.componentData.routingRevision == null) {
  2913. this.$message.warning('请填写主记录Routing版本号!')
  2914. return
  2915. }
  2916. if (this.componentData.operationNo === '' || this.componentData.operationNo == null) {
  2917. this.$message.warning('请填写工序编码!')
  2918. return
  2919. }
  2920. if (this.componentData.operationName === '' || this.componentData.operationName == null) {
  2921. this.$message.warning('请填写工序名称!')
  2922. return
  2923. }
  2924. if (this.componentData.workCenterNo === '' || this.componentData.workCenterNo == null) {
  2925. this.$message.warning('请选择加工中心!')
  2926. return
  2927. }
  2928. if (this.componentData.machSetupTime === '' || this.componentData.machSetupTime == null) {
  2929. this.$message.warning('请填写机器调机时间!')
  2930. return
  2931. }
  2932. if (this.componentData.laborSetupTime === '' || this.componentData.laborSetupTime == null) {
  2933. this.$message.warning('请填写人工调机时间!')
  2934. return
  2935. }
  2936. if (this.componentData.setupLaborClassNo === '' || this.componentData.setupLaborClassNo == null) {
  2937. this.$message.warning('请选择调机过程中人员等级!')
  2938. return
  2939. }
  2940. if (this.componentData.setupCrewSize === '' || this.componentData.setupCrewSize == null) {
  2941. this.$message.warning('请填写调机过程中人数!')
  2942. return
  2943. }
  2944. if (this.componentData.machRunFactor === '' || this.componentData.machRunFactor == null) {
  2945. this.$message.warning('请填写机器单位产出!')
  2946. return
  2947. }
  2948. if (this.componentData.laborRunFactor === '' || this.componentData.laborRunFactor == null) {
  2949. this.$message.warning('请填写人工单位产出!')
  2950. return
  2951. }
  2952. if (this.componentData.runTimeCode === '' || this.componentData.runTimeCode == null) {
  2953. this.$message.warning('请选择产出单位!')
  2954. return
  2955. }
  2956. if (this.componentData.laborClassNo === '' || this.componentData.laborClassNo == null) {
  2957. this.$message.warning('请选择人员等级!')
  2958. return
  2959. }
  2960. if (this.componentData.efficiencyFactor === '' || this.componentData.efficiencyFactor == null) {
  2961. this.$message.warning('请填写效率!')
  2962. return
  2963. }
  2964. if (this.componentData.crewSize === '' || this.componentData.crewSize == null) {
  2965. this.$message.warning('请填写生产过程中人数!')
  2966. return
  2967. }
  2968. if (this.componentData.flag === '1') {
  2969. saveRoutingComponent(this.componentData).then(({data}) => {
  2970. if (data && data.code === 0) {
  2971. this.subDetailList = data.rows
  2972. if (isClose) {
  2973. this.saveComponentModal()
  2974. } else {
  2975. this.componentSaveModal = false
  2976. }
  2977. this.$message({
  2978. message: '操作成功',
  2979. type: 'success',
  2980. duration: 1500,
  2981. onClose: () => {}
  2982. })
  2983. } else {
  2984. this.$alert(data.msg, '错误', {
  2985. confirmButtonText: '确定'
  2986. })
  2987. }
  2988. })
  2989. } else if (this.componentData.flag === '2') {
  2990. updateRoutingComponent(this.componentData).then(({data}) => {
  2991. if (data && data.code === 0) {
  2992. this.subDetailList = data.rows
  2993. this.componentSaveModal = false
  2994. this.$message({
  2995. message: '操作成功',
  2996. type: 'success',
  2997. duration: 1500,
  2998. onClose: () => {}
  2999. })
  3000. } else {
  3001. this.$alert(data.msg, '错误', {
  3002. confirmButtonText: '确定'
  3003. })
  3004. }
  3005. })
  3006. }
  3007. },
  3008. /**
  3009. * 回车事件
  3010. */
  3011. focusNextInput (index, type) {
  3012. let aaa = ''
  3013. if (this.subDetailList.length - 1 === index) {
  3014. aaa = `${type}0`
  3015. } else {
  3016. aaa = `${type}${index + 1}`
  3017. }
  3018. this.$nextTick(() => {
  3019. this.$refs[aaa].focus()
  3020. })
  3021. },
  3022. /**
  3023. * 保存主表信息
  3024. */
  3025. saveRoutingHeader () {
  3026. if (this.modalData.bu === '' || this.modalData.bu == null) {
  3027. this.$message.warning('请选择BU!')
  3028. return
  3029. }
  3030. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  3031. this.$message.warning('请先选择Routing物料!')
  3032. return
  3033. }
  3034. if (this.modalData.routingRevision === '' || this.modalData.routingRevision == null) {
  3035. this.$message.warning('请先填写Routing版本号!')
  3036. return
  3037. }
  3038. if (this.modalData.routingType === '' || this.modalData.routingType == null) {
  3039. this.$message.warning('请先选择制造类型!')
  3040. return
  3041. }
  3042. if (this.modalData.phaseOutDate != null && this.modalData.phaseOutDate !== '' && (this.modalData.phaseInDate > this.modalData.phaseOutDate)) {
  3043. this.$message.warning('失效日期不能小于生效日期!')
  3044. return
  3045. }
  3046. this.saveHeaderLoading = true
  3047. // 新增主表信息
  3048. saveRoutingHeader(this.modalData).then(({data}) => {
  3049. if (data && data.code === 0) {
  3050. this.modalData = {
  3051. flag: '1',
  3052. title: 'routing新增',
  3053. bu: data.rows.modalData.site + '_' + data.rows.modalData.buNo,
  3054. site: data.rows.modalData.site,
  3055. buNo: data.rows.modalData.buNo,
  3056. partNo: data.rows.modalData.partNo,
  3057. partDesc: data.rows.modalData.partDesc,
  3058. routingRevision: data.rows.modalData.routingRevision,
  3059. routingType: data.rows.modalData.routingType,
  3060. noteText: data.rows.modalData.noteText,
  3061. phaseInDate: data.rows.modalData.phaseInDate,
  3062. phaseOutDate: data.rows.modalData.phaseOutDate,
  3063. engRevision: data.rows.modalData.engRevision,
  3064. typeFlag: data.rows.modalData.typeFlag,
  3065. netWeight: data.rows.modalData.netWeight,
  3066. }
  3067. this.detailDataList = data.rows.detailDataList
  3068. this.detailData = data.rows.detailData
  3069. this.subDetailList = []
  3070. this.headerSaveFlag = false
  3071. this.modalDisableFlag = true
  3072. this.$message({
  3073. message: '操作成功',
  3074. type: 'success',
  3075. duration: 1500,
  3076. onClose: () => {}
  3077. })
  3078. } else {
  3079. this.$alert(data.msg, '错误', {
  3080. confirmButtonText: '确定'
  3081. })
  3082. }
  3083. this.saveHeaderLoading = false
  3084. })
  3085. },
  3086. /**
  3087. * 复制Routing的模态框
  3088. */
  3089. copyRoutingRevision () {
  3090. this.copyRoutingData = {
  3091. site: this.modalData.site,
  3092. buNo: this.modalData.buNo,
  3093. partNo: this.modalData.partNo,
  3094. partDesc: this.modalData.partDesc,
  3095. routingRevision: this.modalData.routingRevision + 1,
  3096. routingType: this.modalData.routingType,
  3097. phaseInDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
  3098. phaseOutDate: '',
  3099. previousVersion: {},
  3100. createBy: this.$store.state.user.name,
  3101. }
  3102. this.copyPartData = {
  3103. type: '1',
  3104. site: this.modalData.site,
  3105. buNo: this.modalData.buNo,
  3106. partNo: '',
  3107. partDesc: '',
  3108. page: 1,
  3109. limit: 10
  3110. }
  3111. this.copyRoutingModelFlag = true
  3112. },
  3113. /**
  3114. * 复制Routing的方法
  3115. */
  3116. copyRouting () {
  3117. if (this.copyRoutingData.partNo === '' || this.copyRoutingData.partNo == null) {
  3118. this.$message.warning('请选择Routing物料!')
  3119. return
  3120. }
  3121. if (this.copyRoutingData.routingRevision === '' || this.copyRoutingData.routingRevision == null) {
  3122. this.$message.warning('请填写Routing版本号!')
  3123. return
  3124. }
  3125. if (this.copyRoutingData.routingType === '' || this.copyRoutingData.routingType == null) {
  3126. this.$message.warning('请选择工艺类型!')
  3127. return
  3128. }
  3129. this.copyRoutingData.previousVersion = this.modalData
  3130. this.copyLoading = true
  3131. // 新增主表信息
  3132. copyRouting(this.copyRoutingData).then(({data}) => {
  3133. if (data && data.code === 0) {
  3134. this.copyRoutingModelFlag = false
  3135. this.updateModal(data.rows)
  3136. this.$message({
  3137. message: '操作成功',
  3138. type: 'success',
  3139. duration: 1500,
  3140. onClose: () => {}
  3141. })
  3142. } else {
  3143. this.$alert(data.msg, '错误', {
  3144. confirmButtonText: '确定'
  3145. })
  3146. }
  3147. this.copyLoading = false
  3148. }).catch(()=>{
  3149. this.copyLoading = false
  3150. })
  3151. },
  3152. /**
  3153. * 复制alternative的模态框
  3154. */
  3155. copyRoutingAlternative () {
  3156. this.copyAlternativeData = {
  3157. site: this.detailData.site,
  3158. buNo: this.detailData.buNo,
  3159. partNo: this.detailData.partNo,
  3160. partDesc: this.modalData.partDesc,
  3161. routingRevision: this.detailData.routingRevision,
  3162. routingType: this.detailData.routingType,
  3163. alternativeNo: this.detailData.alternativeNo,
  3164. alternativeDescription: this.detailData.alternativeDescription,
  3165. routTemplateId: '',
  3166. planDate: '',
  3167. fixedLeadTimeDay: '',
  3168. fixedLeadTimeHour: '',
  3169. variableLeadTimeDay: '',
  3170. variableLeadTimeHour: '',
  3171. forStdLotByDay: '',
  3172. forLotByDay: '',
  3173. minLotQty: '',
  3174. detailNoteText: this.detailData.detailNoteText,
  3175. status: 'Tentative',
  3176. previousVersion: {},
  3177. createBy: this.$store.state.user.name
  3178. }
  3179. this.copyPartData = {
  3180. type: '2',
  3181. site: this.detailData.site,
  3182. buNo: this.detailData.buNo,
  3183. partNo: '',
  3184. partDesc: '',
  3185. page: 1,
  3186. limit: 10
  3187. }
  3188. this.copyAlternativeModelFlag = true
  3189. },
  3190. /**
  3191. * 复制alternative的方法
  3192. */
  3193. copyAlternative () {
  3194. if (this.copyAlternativeData.partNo === '' || this.copyAlternativeData.partNo == null) {
  3195. this.$message.warning('请选择Routing物料!')
  3196. return
  3197. }
  3198. if (this.copyAlternativeData.routingRevision === '' || this.copyAlternativeData.routingRevision == null) {
  3199. this.$message.warning('请填写Routing版本号!')
  3200. return
  3201. }
  3202. if (this.copyAlternativeData.routingType === '' || this.copyAlternativeData.routingType == null) {
  3203. this.$message.warning('请选择工艺类型!')
  3204. return
  3205. }
  3206. if (this.copyAlternativeData.alternativeNo === '' || this.copyAlternativeData.alternativeNo == null) {
  3207. this.$message.warning('请填写替代编码!')
  3208. return
  3209. }
  3210. if (this.copyAlternativeData.alternativeDescription === '' || this.copyAlternativeData.alternativeDescription == null) {
  3211. this.$message.warning('请填写替代名称!')
  3212. return
  3213. }
  3214. this.copyAlternativeData.previousVersion = this.detailData
  3215. this.copyLoading = true
  3216. copyAlternative(this.copyAlternativeData).then(({data}) => {
  3217. if (data && data.code === 0) {
  3218. this.copyAlternativeModelFlag = false
  3219. this.updateModal(data.rows)
  3220. this.$message({
  3221. message: '操作成功',
  3222. type: 'success',
  3223. duration: 1500,
  3224. onClose: () => {}
  3225. })
  3226. } else {
  3227. this.$alert(data.msg, '错误', {
  3228. confirmButtonText: '确定'
  3229. })
  3230. }
  3231. this.copyLoading = false
  3232. }).catch(()=>{
  3233. this.copyLoading = false
  3234. })
  3235. },
  3236. /**
  3237. * 新增替代方法
  3238. */
  3239. detailDataSave () {
  3240. if (this.saveDetailData.partNo === '' || this.saveDetailData.partNo == null) {
  3241. this.$message.warning('请先选择Routing物料!')
  3242. return
  3243. }
  3244. if (this.saveDetailData.routingRevision === '' || this.saveDetailData.routingRevision == null) {
  3245. this.$message.warning('请先填写Routing版本号!')
  3246. return
  3247. }
  3248. if (this.saveDetailData.routingType === '' || this.saveDetailData.routingType == null) {
  3249. this.$message.warning('请先选择工艺类型!')
  3250. return
  3251. }
  3252. if (this.saveDetailData.alternativeNo === '' || this.saveDetailData.alternativeNo == null) {
  3253. this.$message.warning('请填写替代编码!')
  3254. return
  3255. }
  3256. if (this.saveDetailData.alternativeDescription === '' || this.saveDetailData.alternativeDescription == null) {
  3257. this.$message.warning('请填写替代名称!')
  3258. return
  3259. }
  3260. if (this.saveDetailData.status === '' || this.saveDetailData.status == null) {
  3261. this.$message.warning('请选择替代状态!')
  3262. return
  3263. }
  3264. this.saveDetailLoading = true
  3265. if (this.saveDetailData.flag === '1') {
  3266. routingDetailSave(this.saveDetailData).then(({data}) => {
  3267. if (data && data.code === 0) {
  3268. this.detailDataList = data.rows
  3269. this.detailData = this.saveDetailData
  3270. this.subDetailList = []
  3271. this.saveDetailModalFlag = false
  3272. this.$message({
  3273. message: '操作成功',
  3274. type: 'success',
  3275. duration: 1500,
  3276. onClose: () => {}
  3277. })
  3278. } else {
  3279. this.$alert(data.msg, '错误', {
  3280. confirmButtonText: '确定'
  3281. })
  3282. }
  3283. this.saveDetailLoading = false
  3284. })
  3285. } else {
  3286. routingDetailUpdate(this.saveDetailData).then(({data}) => {
  3287. if (data && data.code === 0) {
  3288. this.detailDataList = data.rows.detailDataList
  3289. this.detailData = data.rows.detailData
  3290. this.subDetailList = data.rows.subDetailList
  3291. this.saveDetailModalFlag = false
  3292. this.$message({
  3293. message: '操作成功',
  3294. type: 'success',
  3295. duration: 1500,
  3296. onClose: () => {}
  3297. })
  3298. } else {
  3299. this.$alert(data.msg, '错误', {
  3300. confirmButtonText: '确定'
  3301. })
  3302. }
  3303. this.saveDetailLoading = false
  3304. })
  3305. }
  3306. },
  3307. /**
  3308. * 删除替代
  3309. */
  3310. deleteRoutingDetail () {
  3311. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  3312. this.$message.warning('请选择要删除的替代编码!')
  3313. return
  3314. }
  3315. if (this.detailData.alternativeNo === '*') {
  3316. this.$message.warning('当前为默认替代,不可以删除!')
  3317. return
  3318. }
  3319. this.$confirm(`是否删除这项替代?`, '提示', {
  3320. confirmButtonText: '确定',
  3321. cancelButtonText: '取消',
  3322. type: 'warning'
  3323. }).then(() => {
  3324. routingDetailDelete(this.detailData).then(({data}) => {
  3325. if (data && data.code === 0) {
  3326. this.detailData = data.rows.detailData
  3327. this.detailDataList = data.rows.detailDataList
  3328. this.subDetailList = data.rows.subDetailList
  3329. this.$message({
  3330. message: '操作成功',
  3331. type: 'success',
  3332. duration: 1500,
  3333. onClose: () => {}
  3334. })
  3335. } else {
  3336. this.$alert(data.msg, '错误', {
  3337. confirmButtonText: '确定'
  3338. })
  3339. }
  3340. })
  3341. })
  3342. },
  3343. /**
  3344. * 修改替代状态为 Buildable
  3345. */
  3346. updateStatusToBuildable () {
  3347. this.$confirm(`是否修改状态为Buildable?`, '提示', {
  3348. confirmButtonText: '确定',
  3349. cancelButtonText: '取消',
  3350. type: 'warning'
  3351. }).then(() => {
  3352. updateAlternativeStatus(this.detailData).then(({data}) => {
  3353. if (data && data.code === 0) {
  3354. this.detailDataList = data.rows.detailDataList
  3355. this.detailData = data.rows.detailData
  3356. this.subDetailList = data.rows.subDetailList
  3357. this.$message({
  3358. message: '操作成功',
  3359. type: 'success',
  3360. duration: 1500,
  3361. onClose: () => {}
  3362. })
  3363. } else {
  3364. this.$alert(data.msg, '错误', {confirmButtonText: '确定'})
  3365. // 刷新替代和子明细
  3366. this.alternativeChange()
  3367. }
  3368. })
  3369. })
  3370. },
  3371. /**
  3372. * 修改替代状态为 Obsolete
  3373. */
  3374. updateStatusToObsolete () {
  3375. this.$confirm(`是否修改状态为Obsolete?`, '提示', {
  3376. confirmButtonText: '确定',
  3377. cancelButtonText: '取消',
  3378. type: 'warning'
  3379. }).then(() => {
  3380. updateAlternativeStatus(this.detailData).then(({data}) => {
  3381. if (data && data.code === 0) {
  3382. this.detailDataList = data.rows.detailDataList
  3383. this.detailData = data.rows.detailData
  3384. this.subDetailList = data.rows.subDetailList
  3385. this.$message({
  3386. message: '操作成功',
  3387. type: 'success',
  3388. duration: 1500,
  3389. onClose: () => {}
  3390. })
  3391. } else {
  3392. this.$alert(data.msg, '错误', {confirmButtonText: '确定'})
  3393. // 刷新替代和子明细
  3394. this.alternativeChange()
  3395. }
  3396. })
  3397. })
  3398. },
  3399. /**
  3400. * 替代改变事件
  3401. */
  3402. alternativeChange () {
  3403. this.alternativeLoading = true
  3404. queryRoutingComponent(this.detailData).then(({data}) => {
  3405. if (data && data.code === 0) {
  3406. this.detailDataList = data.rows.detailDataList
  3407. this.detailData = data.rows.detailData
  3408. this.subDetailList = data.rows.subDetailList
  3409. } else {
  3410. this.$alert(data.msg, '错误', {
  3411. confirmButtonText: '确定'
  3412. })
  3413. }
  3414. this.alternativeLoading = false
  3415. }).catch(()=>{
  3416. this.alternativeLoading = false
  3417. })
  3418. },
  3419. // ======== chooseList相关方法 ========
  3420. /**
  3421. * 获取基础数据列表S
  3422. * @param val
  3423. * @param type
  3424. */
  3425. getBaseList (val, type) {
  3426. this.tagNo = val
  3427. this.tagNo1 = type
  3428. this.$nextTick(() => {
  3429. let strVal = ''
  3430. let conSql = ''
  3431. // if (this.modalData.bu === null || this.modalData.bu === '') {
  3432. // this.$message.warning("请选择BU!")
  3433. // return
  3434. // } else {
  3435. // conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
  3436. // }
  3437. if (val === 517) {
  3438. if (type === 1) {
  3439. strVal = this.componentData.laborClassNo
  3440. } else if (type === 2) {
  3441. strVal = this.componentData.setupLaborClassNo
  3442. }
  3443. }
  3444. if (val === 516) {
  3445. conSql = ''
  3446. strVal = this.componentData.workCenterNo
  3447. }
  3448. this.$refs.baseList.init(val, strVal, conSql)
  3449. })
  3450. },
  3451. /**
  3452. * 列表方法的回调
  3453. * @param val
  3454. */
  3455. getBaseData (val) {
  3456. if (this.tagNo === 517) {
  3457. if (this.tagNo1 === 1) {
  3458. this.componentData.laborClassNo = val.class_no
  3459. this.componentData.laborClassDesc = val.class_desc
  3460. } else if (this.tagNo1 === 2) {
  3461. this.componentData.setupLaborClassNo = val.class_no
  3462. this.componentData.setupLaborClassDesc = val.class_desc
  3463. }
  3464. }
  3465. if (this.tagNo === 516) {
  3466. this.componentData.workCenterNo = val.work_center_no
  3467. this.componentData.workCenterDesc = val.work_center_desc
  3468. this.componentData.workCenterType = val.work_center_type
  3469. }
  3470. },
  3471. // 机器调机时间改变
  3472. changeMachSetupTime () {
  3473. this.componentData.laborSetupTime = this.componentData.machSetupTime
  3474. },
  3475. // 机器单位产出改变
  3476. changeMachRunFactor () {
  3477. this.componentData.laborRunFactor = this.componentData.machRunFactor
  3478. },
  3479. // 机器处理时间改变
  3480. changeMachCycleTime () {
  3481. // 人工处理时间赋值
  3482. this.componentData.laborCycleTime = this.componentData.machCycleTime
  3483. // 计算机器单位产出
  3484. if (this.componentData.machCycleTime != 0) {
  3485. this.componentData.machRunFactor = 1/this.componentData.machCycleTime
  3486. } else {
  3487. this.componentData.machRunFactor = 0
  3488. }
  3489. // 人工单位产出赋值
  3490. this.componentData.laborRunFactor = this.componentData.machRunFactor
  3491. },
  3492. // 人工处理时间改变
  3493. changeLaborCycleTime () {
  3494. // 计算人工单位产出
  3495. if (this.componentData.laborCycleTime == 0) {
  3496. this.componentData.laborRunFactor = 0
  3497. } else {
  3498. this.componentData.laborRunFactor = 1/this.componentData.laborCycleTime
  3499. }
  3500. },
  3501. // 加工中心输入校验
  3502. workCenterBlur (tagNo) {
  3503. if (this.componentData.workCenterNo != null && this.componentData.workCenterNo !== '') {
  3504. let tempData = {
  3505. tagno: tagNo,
  3506. conditionSql: " and work_center_no = '" + this.componentData.workCenterNo + "'" + " and site = '" + this.modalData.site + "'"
  3507. }
  3508. verifyData(tempData).then(({data}) => {
  3509. if (data && data.code === 0) {
  3510. if (data.baseListData.length > 0) {
  3511. this.componentData.workCenterNo = data.baseListData[0].work_center_no
  3512. this.componentData.workCenterDesc = data.baseListData[0].work_center_desc
  3513. this.componentData.workCenterType = data.baseListData[0].work_center_type
  3514. return
  3515. }
  3516. }
  3517. })
  3518. }
  3519. this.componentData.workCenterDesc = ''
  3520. this.componentData.workCenterType = ''
  3521. },
  3522. // 人员等级
  3523. setupLaborClassBlur (tagNo) {
  3524. if (this.componentData.setupLaborClassNo != null && this.componentData.setupLaborClassNo !== '') {
  3525. let tempData = {
  3526. tagno: tagNo,
  3527. conditionSql: " and class_no = '" + this.componentData.setupLaborClassNo + "'" + " and site = '" + this.modalData.site + "'"
  3528. }
  3529. verifyData(tempData).then(({data}) => {
  3530. if (data && data.code === 0) {
  3531. if (data.baseListData.length > 0) {
  3532. this.componentData.setupLaborClassNo = data.baseListData[0].class_no
  3533. this.componentData.setupLaborClassDesc = data.baseListData[0].class_desc
  3534. return
  3535. }
  3536. }
  3537. })
  3538. }
  3539. this.componentData.setupLaborClassDesc = ''
  3540. },
  3541. // 人员等级
  3542. laborClassBlur (tagNo) {
  3543. if (this.componentData.laborClassNo != null && this.componentData.laborClassNo !== '') {
  3544. let tempData = {
  3545. tagno: tagNo,
  3546. conditionSql: " and class_no = '" + this.componentData.laborClassNo + "'" + " and site = '" + this.modalData.site + "'"
  3547. }
  3548. verifyData(tempData).then(({data}) => {
  3549. if (data && data.code === 0) {
  3550. if (data.baseListData.length > 0) {
  3551. this.componentData.laborClassNo = data.baseListData[0].class_no
  3552. this.componentData.laborClassDesc = data.baseListData[0].class_desc
  3553. return
  3554. }
  3555. }
  3556. })
  3557. }
  3558. this.componentData.laborClassDesc = ''
  3559. },
  3560. // 点击行选中复选框
  3561. standardOperationClickRow (row) {
  3562. this.$refs.standardOperationTable.toggleRowSelection(row)
  3563. },
  3564. // 复选信息
  3565. selectionStandardOperation (val) {
  3566. this.standardOperationSelections = val
  3567. },
  3568. // ======== 导出相关方法 ========
  3569. /**
  3570. * 导出excel
  3571. */
  3572. async createExportData () {
  3573. this.searchData.limit = -1
  3574. this.searchData.page = 1
  3575. await routingManagementSearch(this.searchData).then(({data}) => {
  3576. this.resultList = data.page.list
  3577. })
  3578. return this.resultList
  3579. },
  3580. startDownload () {},
  3581. finishDownload () {},
  3582. fields () {
  3583. let json = '{'
  3584. this.columnList.forEach((item, index) => {
  3585. if (index == this.columnList.length - 1) {
  3586. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  3587. } else {
  3588. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  3589. }
  3590. })
  3591. json += '}'
  3592. let s = eval('(' + json + ')')
  3593. return s
  3594. },
  3595. // 动态列开始 获取 用户保存的 格式列
  3596. async getTableUserColumn(tableId, columnId) {
  3597. let queryTableUser = {
  3598. userId: this.$store.state.user.name,
  3599. functionId: this.$route.meta.menuId,
  3600. tableId: tableId,
  3601. status: true,
  3602. languageCode: this.$i18n.locale
  3603. }
  3604. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  3605. if (data.rows.length > 0) {
  3606. switch (columnId) {
  3607. case 1:
  3608. this.columnList = data.rows
  3609. break;
  3610. }
  3611. } else {
  3612. this.getColumnList(tableId, columnId)
  3613. }
  3614. })
  3615. },
  3616. // 获取 tableDefault 列
  3617. async getColumnList (tableId, columnId) {
  3618. let queryTable= {
  3619. functionId: this.$route.meta.menuId,
  3620. tableId: tableId,
  3621. languageCode: this.$i18n.locale
  3622. }
  3623. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  3624. if (!data.rows.length === 0) {
  3625. switch (columnId) {
  3626. case 1:
  3627. this.columnList = data.rows
  3628. break;
  3629. }
  3630. }
  3631. })
  3632. },
  3633. //获取按钮的权限数据
  3634. getButtonAuthData () {
  3635. let searchFlag = this.isAuth(this.menuId+":search")
  3636. let saveFlag = this.isAuth(this.menuId+":save")
  3637. let updateFlag = this.isAuth(this.menuId+":update")
  3638. let deleteFlag = this.isAuth(this.menuId+":delete")
  3639. //处理页面的权限数据
  3640. this.authSearch = !searchFlag
  3641. this.authSave = !saveFlag
  3642. this.authUpdate = !updateFlag
  3643. this.authDelete = !deleteFlag
  3644. },
  3645. // 切换到Bom
  3646. checkOutToBom (partNo) {
  3647. if (this.$router.resolve('part-bomManagement').resolved.name === '404') {
  3648. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',})
  3649. } else {
  3650. this.$router.push({name:"part-bomManagement",params:{partNo: partNo}})
  3651. }
  3652. }
  3653. }
  3654. }
  3655. </script>
  3656. <style scoped lang="scss">
  3657. /deep/ .customer-tab .el-tabs__content {
  3658. padding: 0px !important;
  3659. }
  3660. /deep/ .detail-tab .el-tabs__content {
  3661. height: 165px;
  3662. padding: 15px 0px 0px 0px;
  3663. }
  3664. /deep/ .sub_detail-tab .el-tabs__content {
  3665. height: 280px;
  3666. padding: 0px;
  3667. }
  3668. .el-table /deep/ .cell{
  3669. height: auto;
  3670. line-height: 1.5;
  3671. }
  3672. </style>