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.

4537 lines
156 KiB

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