plm前端
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.

4114 lines
142 KiB

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