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.

6229 lines
216 KiB

2 months ago
2 months ago
6 months ago
6 months ago
6 months ago
7 months ago
2 months ago
6 months ago
7 months ago
2 months ago
7 months ago
2 months ago
7 months ago
10 months ago
7 months ago
10 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
2 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
7 months ago
2 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
2 months ago
5 months ago
6 months ago
7 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
2 months ago
7 months ago
5 months ago
2 months ago
6 months ago
7 months ago
7 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
7 months ago
6 months ago
2 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
2 months ago
5 months ago
2 months ago
5 months ago
2 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
2 months ago
5 months ago
2 months ago
5 months ago
2 months ago
5 months ago
2 months ago
5 months ago
2 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
2 months ago
6 months ago
2 months ago
6 months ago
2 months ago
6 months ago
2 months ago
6 months ago
5 months ago
6 months ago
5 months ago
2 months ago
5 months ago
5 months ago
2 months ago
5 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
7 months ago
5 months ago
6 months ago
10 months ago
5 months ago
5 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
6 months ago
6 months ago
10 months ago
6 months ago
5 months ago
5 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
5 months ago
7 months ago
2 months ago
7 months ago
2 months ago
6 months ago
7 months ago
5 months ago
7 months ago
2 months ago
7 months ago
2 months ago
7 months ago
2 months ago
7 months ago
6 months ago
6 months ago
5 months ago
5 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
6 months ago
2 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
7 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
5 months ago
7 months ago
2 months ago
5 months ago
  1. <template>
  2. <div class="white-body-view">
  3. <el-form :inline="true" label-position="top" :model="searchData">
  4. <el-form-item label="BU">
  5. <el-input v-model="searchData.buNo" readonly style="width: 80px"></el-input>
  6. </el-form-item>
  7. <el-form-item label="产品编码">
  8. <el-input v-model="searchData.partNo" readonly style="width: 120px"></el-input>
  9. </el-form-item>
  10. <el-form-item label="产品描述">
  11. <el-input v-model="searchData.partDesc" readonly style="width: 300px"></el-input>
  12. </el-form-item>
  13. <el-form-item label=" ">
  14. <el-button type="primary" @click="queryPartListInfo">选择物料</el-button>
  15. </el-form-item>
  16. <el-form-item label=" ">
  17. <el-button type="primary" @click="updatePartModal">维护</el-button>
  18. </el-form-item>
  19. <el-form-item label=" ">
  20. <el-button type="primary" @click="handleBatchUpdatePart">物料属性批量维护</el-button>
  21. </el-form-item>
  22. </el-form>
  23. <el-table
  24. :height="60"
  25. :data="dataList"
  26. border
  27. v-loading="this.dataListLoading"
  28. style="width: 100%;">
  29. <el-table-column
  30. v-for="(item,index) in columnList" :key="index"
  31. :sortable="item.columnSortable"
  32. :prop="item.columnProp"
  33. :header-align="item.headerAlign"
  34. :show-overflow-tooltip="item.showOverflowTooltip"
  35. :align="item.align"
  36. :fixed="item.fixed === ''?false:item.fixed"
  37. :min-width="item.columnWidth"
  38. :label="item.columnLabel">
  39. <template slot-scope="scope">
  40. <div v-if="!item.columnHidden" @dblclick="startEditCell(scope.$index, item.columnProp, scope.row[item.columnProp])" style="min-height: 23px; cursor: pointer;" :title="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp ? '' : '双击编辑,回车保存'">
  41. <el-input
  42. v-if="editingCell.rowIndex === scope.$index && editingCell.columnProp === item.columnProp"
  43. v-model="editingCell.value"
  44. size="small"
  45. ref="editInput"
  46. :disabled="editingCell.isSaving"
  47. @keyup.enter.native="saveEditCell(scope.$index, item.columnProp, item.columnLabel)"
  48. @keyup.esc.native="cancelEditCell"
  49. style="width: 100%;">
  50. </el-input>
  51. <span v-else>{{ scope.row[item.columnProp] || '-' }}</span>
  52. </div>
  53. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <el-row :gutter="5">
  58. <!-- 树形结构 -->
  59. <el-col :span="7" :style="{height: this.height + 'px'}" style="display: block;overflow-y: scroll">
  60. <el-card style="width: 99%">
  61. <div slot="header" style="height: 20px;margin-top: -10px;text-align: center">
  62. <el-button size="mini" type="primary" round style="margin-left: -5px" @click="addTree">新增节点</el-button>
  63. <el-button size="mini" type="info" round @click="getNodeTree">刷新</el-button>
  64. <el-button size="mini" type="primary" round :loading="buildAllLoading" @click="batchBuild" style="margin-left: 10px">批量Build</el-button>
  65. <!-- <el-button size="mini" type="primary" round :loading="resetAllLoading" @click="resetNodePart">重置物料</el-button>-->
  66. </div>
  67. <div class="scroll-bar item">
  68. <el-tree
  69. id="my-tree"
  70. class="tree-view structure-tree scroll-bar"
  71. highlight-current
  72. check-strictly
  73. :data="treeData"
  74. :default-expand-all=true
  75. :props="defaultProps"
  76. :expand-on-click-node=false
  77. @node-click="handleNodeClick"
  78. :auto-expand-parent=false>
  79. <span slot-scope="{ node, data }" class="custom-tree-node">
  80. <span class="tooltip">
  81. <span class="add-f-s-14">{{ data.nodeName }}</span>
  82. </span>
  83. <div class="operation-view" style="display: inline-block; padding: 0px 5px; margin-left: 5px; color: #777777;">
  84. <!-- <i style="color:#1c92e0" class="small-operation-btn el-icon-plus" @click="addTreeItem(data)"/>-->
  85. <!-- <i style="color:#1c92e0" class="small-operation-btn el-icon-edit" @click="editTreeItem(data)"/>-->
  86. <!-- <i style="color:#1c92e0" class="small-operation-btn el-icon-delete" @click="deleteTreeItem(data)"/>-->
  87. <el-popover
  88. placement="right"
  89. width="80"
  90. trigger="click">
  91. <a style="cursor: pointer" @click="queryPartList2(data)">已有料号</a>
  92. <el-divider></el-divider>
  93. <a style="cursor: pointer" @click="addPartModal(data)">新增料号</a>
  94. <el-divider></el-divider>
  95. <a style="cursor: pointer" @click="editTreeItem(data)">修改节点</a>
  96. <el-divider></el-divider>
  97. <a style="cursor: pointer" @click="deleteTreeItem(data)">删除节点</a>
  98. <i style="color:#1c92e0" slot="reference" class="small-operation-btn el-icon-more"/>
  99. </el-popover>
  100. </div>
  101. </span>
  102. </el-tree>
  103. </div>
  104. </el-card>
  105. </el-col>
  106. <!-- 数据 -->
  107. <el-col :span="17" :style="{height: this.height + 'px'}" style="display: block;overflow-y: scroll">
  108. <!-- 页签 -->
  109. <el-tabs v-model="activeTable" :style="{height: this.height + 'px'}" style="width: 100%" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
  110. <!-- BOM页签 -->
  111. <el-tab-pane label="产品BOM管理" name="bom_info">
  112. <bom-create v-loading="bomLoading" ref="BomCreate" :batchUpdateFlag="batchUpdateFlag" @handleBatchUpdatePart="handleBatchUpdatePart" @refreshNode="refreshNode" @refreshBomLoading="refreshBomLoading" v-drag></bom-create>
  113. </el-tab-pane>
  114. <!-- Routing页签 -->
  115. <el-tab-pane label="工艺路线管理" name="routing_info">
  116. <routing-create v-loading="routingLoading" ref="RoutingCreate" :batchUpdateFlag="batchUpdateFlag" @refreshRoutingLoading="refreshRoutingLoading" v-drag></routing-create>
  117. </el-tab-pane>
  118. </el-tabs>
  119. </el-col>
  120. </el-row>
  121. <!-- 节点新增模态框 -->
  122. <el-dialog title="节点" :close-on-click-modal="false" v-drag :visible.sync="nodeModalFlag" width="360px">
  123. <el-form :inline="true" label-position="top" :model="nodeData" :rules="nodeRules" style="margin-left: 7px;margin-top: -5px;">
  124. <!-- <el-form-item label="节点编码" prop="nodeId" :rules="nodeRules.nodeId">-->
  125. <!-- <el-input v-model="nodeData.nodeId" :disabled="nodeModalDisableFlag" style="width: 140px"></el-input>-->
  126. <!-- </el-form-item>-->
  127. <el-form-item label="节点名称" prop="nodeName" :rules="nodeRules.nodeName">
  128. <el-input v-model="nodeData.nodeName" style="width: 320px"></el-input>
  129. </el-form-item>
  130. <el-form-item v-if="this.nodeData.flag === '1'" label="父节点" prop="pId" :rules="nodeRules.parentNodeName">
  131. <el-popover
  132. ref="nodeListPopover"
  133. placement="bottom-start"
  134. v-model="treeVisible"
  135. onclick="treeVisible=true"
  136. trigger="click">
  137. <el-tree
  138. id="my-tree"
  139. node-key="nodeId"
  140. class="tree-view structure-tree scroll-bar"
  141. highlight-current
  142. check-strictly
  143. @current-change="nodeListTreeCurrentChangeHandle"
  144. :data="treeData1"
  145. :default-expand-all=true
  146. :props="defaultProps"
  147. :expand-on-click-node=false
  148. :auto-expand-parent=false>
  149. </el-tree>
  150. </el-popover>
  151. <el-input style="width: 140px;" v-model="nodeData.parentNodeName" v-popover:nodeListPopover :readonly="true" class="node-list__input"></el-input>
  152. </el-form-item>
  153. <el-form-item label="子节点" v-if="this.nodeData.flag === '1'" :rules="nodeRules.id">
  154. <el-select v-model="nodeData.id" style="width: 100%;">
  155. <el-option :label="item.nodeName" :value="item.id" v-for="item in childrenNodeList" :key="item.id"></el-option>
  156. <el-option label="无" value="-1"></el-option>
  157. </el-select>
  158. </el-form-item>
  159. </el-form>
  160. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  161. <el-button type="primary" @click="saveNodeData()">保存</el-button>
  162. <el-button type="primary" @click="nodeModalFlag = false">关闭</el-button>
  163. </el-footer>
  164. </el-dialog>
  165. <!-- 物料模态框 -->
  166. <el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="900px">
  167. <div class="rq">
  168. <el-form :inline="true" label-position="top" :model="partData">
  169. <el-form-item :label="'物料编码'">
  170. <el-input v-model="partData.partNo" clearable style="width: 120px"></el-input>
  171. </el-form-item>
  172. <el-form-item :label="'物料名称'">
  173. <el-input v-model="partData.partDesc" clearable style="width: 120px"></el-input>
  174. </el-form-item>
  175. <el-form-item :label="' '">
  176. <el-button type="primary" @click="queryPartList">查询</el-button>
  177. </el-form-item>
  178. </el-form>
  179. <el-table
  180. :height="300"
  181. :data="partList"
  182. @row-dblclick="getRowData"
  183. border
  184. style="width: 100%;">
  185. <el-table-column
  186. v-for="(item,index) in partColumnList" :key="index"
  187. :sortable="item.columnSortable"
  188. :prop="item.columnProp"
  189. :header-align="item.headerAlign"
  190. :show-overflow-tooltip="item.showOverflowTooltip"
  191. :align="item.align"
  192. :fixed="item.fixed==''?false:item.fixed"
  193. :min-width="item.columnWidth"
  194. :label="item.columnLabel">
  195. <template slot-scope="scope">
  196. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  197. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  198. </template>
  199. </el-table-column>
  200. </el-table>
  201. <!-- 分页插件 -->
  202. <el-pagination
  203. @size-change="sizeChangeHandle2"
  204. @current-change="currentChangeHandle2"
  205. :current-page="pageIndex2"
  206. :page-sizes="[20, 50, 100, 200, 500]"
  207. :page-size="pageSize2"
  208. :total="totalPage2"
  209. layout="total, sizes, prev, pager, next, jumper">
  210. </el-pagination>
  211. </div>
  212. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  213. <el-button type="primary" @click="partModelFlag=false">关闭</el-button>
  214. </el-footer>
  215. </el-dialog>
  216. <!-- 物料属性批量维护模态框-->
  217. <el-dialog title="物料属性批量维护" :close-on-click-modal="false" v-drag
  218. :visible.sync="batchUpdateFlag"
  219. width="90vw"
  220. :before-close="handleBatchUpdateDialogClose">
  221. <div class="rq" slot-scope="scope">
  222. <div style="display: flex; align-items: center; justify-content: space-between;">
  223. <div style="display: flex; gap: 10px;">
  224. <el-button style="height: 20px" type="primary" @click="handleCopy">copy</el-button>
  225. <el-button style="height: 20px" type="primary" @click="handleEditInfo">{{ attributeFlag ? '编辑' : '保存' }}</el-button>
  226. </div>
  227. <el-form label-position="top" inline style="margin-right: -10px;margin-top: -20px">
  228. <el-form-item label="属性模板">
  229. <el-select v-model="searchData.codeNo" placeholder="请选择" @change="handleCodeNoChange" style="width: 235px">
  230. <el-option
  231. v-for="option in codeList"
  232. :key="option.fieldname1"
  233. :label="option.caption1"
  234. :value="option.fieldname1">
  235. </el-option>
  236. </el-select>
  237. </el-form-item>
  238. </el-form>
  239. </div>
  240. <el-table
  241. v-show="attributeFlag"
  242. @row-click="partClickRow"
  243. :row-style="rowStyle"
  244. :height="300"
  245. :header-cell-style="{padding: '2px 2px'}"
  246. :data="partList1"
  247. border
  248. style="width: 100%;">
  249. <el-table-column
  250. header-align="center"
  251. align="center"
  252. width="150"
  253. fixed="left"
  254. label="操作">
  255. <template slot-scope="scope">
  256. <div class="operation-view" style="display: inline-block; padding: 0px 5px; margin-left: 5px; color: #777777;">
  257. <el-popover
  258. placement="right"
  259. width="80"
  260. trigger="click">
  261. <a style="cursor: pointer" @click="queryPartList2(scope.row)">已有料号</a>
  262. <!-- <el-divider></el-divider>
  263. <a style="cursor: pointer" @click="addPartModal(scope.row)">新增料号</a>-->
  264. <i style="color:#1c92e0" slot="reference" class="small-operation-btn el-icon-more"/>
  265. </el-popover>
  266. </div>
  267. </template>
  268. </el-table-column>
  269. <el-table-column
  270. v-for="(item,index) in partColumnList1" :key="index"
  271. :sortable="item.columnSortable"
  272. :prop="item.columnProp"
  273. :header-align="item.headerAlign"
  274. :show-overflow-tooltip="item.showOverflowTooltip"
  275. :align="item.align"
  276. :fixed="item.fixed==''?false:item.fixed"
  277. :min-width="item.columnWidth"
  278. :label="item.columnLabel">
  279. <template slot-scope="scope">
  280. <span v-if="!item.columnHidden">
  281. <span v-if="item.columnProp==='partType2'">
  282. <span v-if="scope.row.partType2==='Manufactured'">
  283. 成品
  284. </span>
  285. <span v-if="scope.row.partType2==='Manufactured Recipe'">
  286. 半成品
  287. </span>
  288. <span v-if="scope.row.partType2==='Purchased (raw)'">
  289. 原材料
  290. </span>
  291. </span>
  292. <span v-if="item.columnProp!=='partType2'">
  293. {{scope.row[item.columnProp]}}
  294. </span>
  295. </span>
  296. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  297. </template>
  298. </el-table-column>
  299. </el-table>
  300. <el-table
  301. v-show="!attributeFlag"
  302. :height="300"
  303. @row-click="partClickRow"
  304. :row-style="rowStyle"
  305. :header-cell-style="{padding: '2px 2px'}"
  306. :data="partList1"
  307. border
  308. style="width: 100%;">
  309. <el-table-column
  310. header-align="center"
  311. align="center"
  312. width="150"
  313. fixed="left"
  314. label="操作">
  315. <template slot-scope="scope">
  316. <div class="operation-view" style="display: inline-block; padding: 0px 5px; margin-left: 5px; color: #777777;">
  317. <el-popover
  318. placement="right"
  319. width="80"
  320. trigger="click">
  321. <a style="cursor: pointer" @click="queryPartList2(scope.row)">已有料号</a>
  322. <i style="color:#1c92e0" slot="reference" class="small-operation-btn el-icon-more"/>
  323. </el-popover>
  324. </div>
  325. </template>
  326. </el-table-column>
  327. <el-table-column
  328. v-for="(item,index) in partColumnList2" :key="index"
  329. :sortable="item.columnSortable"
  330. :prop="item.columnProp"
  331. :header-align="item.headerAlign"
  332. :show-overflow-tooltip="item.showOverflowTooltip"
  333. :align="item.align"
  334. :fixed="item.fixed==''?false:item.fixed"
  335. :min-width="item.columnWidth"
  336. :label="item.columnLabel">
  337. <template slot-scope="scope">
  338. <span v-show="!item.columnHidden">
  339. <span v-if="item.columnProp==='partNo'||item.columnProp==='nodeName'">{{scope.row[item.columnProp]}}</span>
  340. <span v-if="item.columnProp==='buNo'">
  341. <el-select v-model="scope.row.buNo" v-show="!scope.row.partNo||scope.row.partNo===''" clearable @change="changeBuOfNode(scope.row)" placeholder="请选择">
  342. <el-option
  343. v-for = "i in userBuList"
  344. :key = "i.buNo.split('_')[1]"
  345. :label = "i.buNo.split('_')[1]"
  346. :value = "i.buNo.split('_')[1]">
  347. </el-option>
  348. </el-select>
  349. <span v-if="scope.row.partNo&&scope.row.partNo!==''">{{scope.row[item.columnProp]}}</span>
  350. </span>
  351. <span v-if="item.columnProp==='partDesc'">
  352. <el-input v-model="scope.row.partDesc" clearable></el-input>
  353. </span>
  354. <span v-if="item.columnProp==='tempNo'">
  355. <el-select :loading="buNoQueryLoading" v-model="scope.row.tempNo" clearable @change="chooseTemplate(scope.row)">
  356. <el-option
  357. v-for="option in scope.row.tempList"
  358. :key="option.templateNo"
  359. :label="option.templateName"
  360. :value="option.templateNo">
  361. </el-option>
  362. </el-select>
  363. </span>
  364. <span v-if="item.columnProp==='engChgLevel'">
  365. <el-select :loading="buNoQueryLoading" v-model="scope.row.engChgLevel" clearable>
  366. <el-option
  367. v-for="option in scope.row.engChgLevelList"
  368. :key="option"
  369. :label="option"
  370. :value="option">
  371. </el-option>
  372. </el-select>
  373. </span>
  374. <span v-if="item.columnProp==='routingRevision'">
  375. <el-select :loading="buNoQueryLoading" v-model="scope.row.routingRevision" clearable>
  376. <el-option
  377. v-for="option in scope.row.routingRevisionList"
  378. :key="option"
  379. :label="option"
  380. :value="option">
  381. </el-option>
  382. </el-select>
  383. </span>
  384. <span v-if="item.columnProp==='codeDesc'">
  385. <el-select v-model="scope.row.codeNo" placeholder="请选择" clearable style="width: 200px">
  386. <el-option :loading="buNoQueryLoading"
  387. v-for="option in scope.row.codeList"
  388. :key="option.fieldname1"
  389. :label="option.caption1"
  390. :value="option.fieldname1">
  391. </el-option>
  392. </el-select>
  393. </span>
  394. <span v-if="item.columnProp==='partType2'">
  395. <el-select v-model="scope.row.partType2" clearable>
  396. <el-option label="成品" value="Manufactured"></el-option>
  397. <el-option label="半成品" value="Manufactured Recipe"></el-option>
  398. <el-option label="原材料" value="Purchased (raw)"></el-option>
  399. </el-select>
  400. </span>
  401. <span v-if="item.columnProp==='umName'">
  402. <el-select
  403. v-model="scope.row.umId2" clearable>
  404. <el-option
  405. v-for="option in scope.row.umList"
  406. :key="option.fieldname1"
  407. :label="option.caption1"
  408. :value="option.fieldname1">
  409. </el-option>
  410. </el-select>
  411. </span>
  412. <span v-if="item.columnProp==='familyName'">
  413. <el-select :loading="buNoQueryLoading"
  414. v-model="scope.row.familyID" clearable>
  415. <el-option
  416. v-for="option in scope.row.partFamilyList"
  417. :key="option.fieldname1"
  418. :label="option.caption1"
  419. :value="option.fieldname1">
  420. </el-option>
  421. </el-select>
  422. </span>
  423. <span v-if="item.columnProp==='productGroupName1'">
  424. <el-select :loading="buNoQueryLoading"
  425. v-model="scope.row.productGroupId1" clearable>
  426. <el-option
  427. v-for="option in scope.row.partProductGroupList1"
  428. :key="option.fieldname1"
  429. :label="option.caption1"
  430. :value="option.fieldname1">
  431. </el-option>
  432. </el-select>
  433. </span>
  434. <span v-if="item.columnProp==='productGroupName2'">
  435. <el-select :loading="buNoQueryLoading"
  436. v-model="scope.row.productGroupId2" clearable>
  437. <el-option
  438. v-for="option in scope.row.partProductGroupList2"
  439. :key="option.fieldname1"
  440. :label="option.caption1"
  441. :value="option.fieldname1">
  442. </el-option>
  443. </el-select>
  444. </span>
  445. <span v-if="item.columnProp==='productGroupName3'">
  446. <el-select :loading="buNoQueryLoading"
  447. v-model="scope.row.productGroupId3" clearable>
  448. <el-option
  449. v-for="option in scope.row.partProductGroupList3"
  450. :key="option.fieldname1"
  451. :label="option.caption1"
  452. :value="option.fieldname1">
  453. </el-option>
  454. </el-select>
  455. </span>
  456. <span v-if="item.columnProp==='templateName'">
  457. <el-select :loading="buNoQueryLoading"
  458. v-model="scope.row.templateNo" clearable>
  459. <el-option
  460. v-for="option in scope.row.templateList"
  461. :key="option.fieldname1"
  462. :label="option.caption1"
  463. :value="option.fieldname1">
  464. </el-option>
  465. </el-select>
  466. </span>
  467. <span v-if="item.columnProp==='remark'">
  468. <el-input
  469. type="textarea"
  470. :autosize="{ minRows: 1}"
  471. v-model="scope.row.remark">
  472. </el-input>
  473. </span>
  474. </span>
  475. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  476. </template>
  477. </el-table-column>
  478. </el-table>
  479. <el-tabs v-model="inventoryPartTable" style="width: 100%;height: 400px;" :before-leave="tabLeave" @tab-click="tabClick" type="border-card">
  480. <el-tab-pane label="新增物料属性" style="margin-top: -10px" name="part_item">
  481. <el-form label-position="top" style="margin-left: 2px;">
  482. <el-button type="primary" @click="addOrDelItem1">新增</el-button>
  483. <el-button type="primary" :loading="loading" @click="clickSave1">{{ attributeFlag1?'编辑':'保存' }}</el-button>
  484. <el-button type="primary" @click="openPtmDialog">ProcessTimeMatrix</el-button>
  485. </el-form>
  486. <div class="rq " v-show="attributeFlag1">
  487. <el-table
  488. :data="partItemList1"
  489. height="340px"
  490. border
  491. :header-cell-style="{padding: '2px 2px'}"
  492. style="width: 100%;">
  493. <el-table-column
  494. v-for="(item,index) in columnItemList" :key="index"
  495. :sortable="item.columnSortable"
  496. :prop="item.columnProp"
  497. :header-align="item.headerAlign"
  498. :show-overflow-tooltip="item.showOverflowTooltip"
  499. :align="item.align"
  500. :fixed="item.fixed==''?false:item.fixed"
  501. :min-width="item.columnWidth"
  502. :label="item.columnLabel">
  503. <template slot-scope="scope">
  504. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  505. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  506. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  507. </div>
  508. <div v-else>
  509. <template v-if="item.columnProp==='textValue' && scope.row.valueTypeDb==='T'">
  510. {{ scope.row['textValue'] }}
  511. </template>
  512. <template v-else-if="item.columnProp==='textValue' && scope.row.valueTypeDb==='N'">
  513. {{ scope.row['numValue'] }}
  514. </template>
  515. </div>
  516. </template>
  517. </el-table-column>
  518. </el-table>
  519. </div>
  520. <div class="rq " v-show="!attributeFlag1">
  521. <el-table
  522. :data="partItemList1"
  523. height="340px"
  524. border
  525. :header-cell-style="{padding: '2px 2px'}"
  526. style="width: 100%">
  527. <el-table-column
  528. v-for="(item,index) in columnItemList" :key="index"
  529. :sortable="item.columnSortable"
  530. :prop="item.columnProp"
  531. :header-align="item.headerAlign"
  532. :show-overflow-tooltip="item.showOverflowTooltip"
  533. :align="item.align"
  534. :fixed="item.fixed===''?false:item.fixed"
  535. :min-width="item.columnWidth"
  536. :label="item.columnLabel">
  537. <template slot-scope="scope">
  538. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  539. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  540. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  541. </div>
  542. <div v-else>
  543. <div v-if="scope.row.valueChooseFlag !== 'Y'">
  544. <el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueTypeDb === 'N'" :controls="false"></el-input-number>
  545. <el-input v-model="scope.row.textValue" v-else></el-input>
  546. </div>
  547. <div v-else>
  548. <el-select style="width: 100%;" clearable v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue">
  549. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  550. </el-select>
  551. <el-select style="width: 100%;" clearable v-else v-model="scope.row.numValue">
  552. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  553. </el-select>
  554. </div>
  555. </div>
  556. </template>
  557. </el-table-column>
  558. </el-table>
  559. </div>
  560. </el-tab-pane>
  561. <el-tab-pane label="已有物料属性" style="margin-top: -10px" name="part_item1">
  562. <el-form label-position="top" style="margin-left: 2px;">
  563. <el-button type="primary" @click="addOrDelItem">新增</el-button>
  564. <el-button type="primary" :loading="loading" @click="clickSave">{{ attributeFlag1?'编辑':'保存' }}</el-button>
  565. </el-form>
  566. <div class="rq " v-show="attributeFlag1">
  567. <el-table
  568. :data="partItemList"
  569. height="340px"
  570. border
  571. :header-cell-style="{padding: '2px 2px'}"
  572. style="width: 100%;">
  573. <el-table-column
  574. v-for="(item,index) in columnItemList" :key="index"
  575. :sortable="item.columnSortable"
  576. :prop="item.columnProp"
  577. :header-align="item.headerAlign"
  578. :show-overflow-tooltip="item.showOverflowTooltip"
  579. :align="item.align"
  580. :fixed="item.fixed==''?false:item.fixed"
  581. :min-width="item.columnWidth"
  582. :label="item.columnLabel">
  583. <template slot-scope="scope">
  584. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  585. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  586. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  587. </div>
  588. <div v-else>
  589. <template v-if="item.columnProp==='textValue' && scope.row.valueTypeDb==='T'">
  590. {{ scope.row['textValue'] }}
  591. </template>
  592. <template v-else-if="item.columnProp==='textValue' && scope.row.valueTypeDb==='N'">
  593. {{ scope.row['numValue'] }}
  594. </template>
  595. </div>
  596. </template>
  597. </el-table-column>
  598. </el-table>
  599. </div>
  600. <div class="rq " v-show="!attributeFlag1">
  601. <el-table
  602. :data="partItemList"
  603. height="340px"
  604. border
  605. :header-cell-style="{padding: '2px 2px'}"
  606. style="width: 100%">
  607. <el-table-column
  608. v-for="(item,index) in columnItemList" :key="index"
  609. :sortable="item.columnSortable"
  610. :prop="item.columnProp"
  611. :header-align="item.headerAlign"
  612. :show-overflow-tooltip="item.showOverflowTooltip"
  613. :align="item.align"
  614. :fixed="item.fixed===''?false:item.fixed"
  615. :min-width="item.columnWidth"
  616. :label="item.columnLabel">
  617. <template slot-scope="scope">
  618. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  619. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  620. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  621. </div>
  622. <div v-else>
  623. <div v-if="scope.row.valueChooseFlag !== 'Y'">
  624. <el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueTypeDb === 'N'" :controls="false"></el-input-number>
  625. <el-input v-model="scope.row.textValue" v-else></el-input>
  626. </div>
  627. <div v-else>
  628. <el-select style="width: 100%;" v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue">
  629. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  630. </el-select>
  631. <el-select style="width: 100%;" v-else v-model="scope.row.numValue">
  632. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  633. </el-select>
  634. </div>
  635. </div>
  636. </template>
  637. </el-table-column>
  638. </el-table>
  639. </div>
  640. </el-tab-pane>
  641. <el-tab-pane label="版本信息" style="margin-top: -10px" name="revision_info">
  642. <el-row>
  643. <el-col :style="{width: 25 + 'vw',height: 340 + 'px'}" class="down-tree">
  644. <el-tabs v-model="activeTab1" style="width: 100%;height: 170px; margin-top: -5px" @tab-click="bomInfoTabClick">
  645. <el-tab-pane label="产品结构版本" name="default">
  646. <el-table
  647. :height="120"
  648. :data="bomComponentList"
  649. border
  650. :header-cell-style="{padding: '2px 2px'}"
  651. :row-style="bomRowStyle"
  652. @row-click="bomInfoRowClick"
  653. @row-dblclick="bomInfoRowDblClick"
  654. style="width: 100%">
  655. <el-table-column
  656. header-align="center"
  657. align="center"
  658. width="80"
  659. fixed="left"
  660. label="操作">
  661. <template slot-scope="scope">
  662. <div class="operation-view" style="display: inline-block; padding: 0px 5px; margin-left: 5px; color: #777777;">
  663. <a href="javascript:void(0)" @click="updateRevision(scope.row, 'bom')">
  664. 选择版本
  665. </a>
  666. </div>
  667. </template>
  668. </el-table-column>
  669. <el-table-column
  670. v-for="(item,index) in bomComponentListColumns" :key="index"
  671. :sortable="item.columnSortable"
  672. :prop="item.columnProp"
  673. :header-align="item.headerAlign"
  674. :show-overflow-tooltip="item.showOverflowTooltip"
  675. :align="item.align"
  676. :fixed="item.fixed==''?false:item.fixed"
  677. :min-width="item.columnWidth"
  678. :label="item.columnLabel">
  679. <template slot-scope="scope">
  680. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  681. </template>
  682. </el-table-column>
  683. </el-table>
  684. </el-tab-pane>
  685. </el-tabs>
  686. <el-tabs v-model="activeTab2" style="width: 100%;height: 165px;" @tab-click="routingInfoTabClick">
  687. <el-tab-pane label="工艺路线版本" name="default">
  688. <el-table
  689. :height="120"
  690. :data="routingComponentList"
  691. border
  692. :header-cell-style="{padding: '2px 2px'}"
  693. :row-style="routingRowStyle"
  694. @row-click="routingInfoRowClick"
  695. @row-dblclick="routingInfoRowDblClick"
  696. style="width: 100%">
  697. <el-table-column
  698. header-align="center"
  699. align="center"
  700. width="80"
  701. fixed="left"
  702. label="操作">
  703. <template slot-scope="scope">
  704. <div class="operation-view" style="display: inline-block; padding: 0px 5px; margin-left: 5px; color: #777777;">
  705. <a href="javascript:void(0)" @click="updateRevision(scope.row, 'bom')">
  706. 选择版本
  707. </a>
  708. </div>
  709. </template>
  710. </el-table-column>
  711. <el-table-column
  712. v-for="(item,index) in routingComponentListColumns" :key="index"
  713. :sortable="item.columnSortable"
  714. :prop="item.columnProp"
  715. :header-align="item.headerAlign"
  716. :show-overflow-tooltip="item.showOverflowTooltip"
  717. :align="item.align"
  718. :fixed="item.fixed==''?false:item.fixed"
  719. :min-width="item.columnWidth"
  720. :label="item.columnLabel">
  721. <template slot-scope="scope">
  722. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  723. </template>
  724. </el-table-column>
  725. </el-table>
  726. </el-tab-pane>
  727. </el-tabs>
  728. </el-col>
  729. <el-col :style="{width: 60 + 'vw',height: 340 + 'px'}">
  730. <el-table
  731. v-if="bomFlag"
  732. :height="340"
  733. :data="bomComponentPartList"
  734. border
  735. :header-cell-style="{padding: '2px 2px'}"
  736. style="width: 100%">
  737. <el-table-column
  738. v-for="(item,index) in bomComponentListColumnList" :key="index"
  739. :sortable="item.columnSortable"
  740. :prop="item.columnProp"
  741. :header-align="item.headerAlign"
  742. :show-overflow-tooltip="item.showOverflowTooltip"
  743. :align="item.align"
  744. :fixed="item.fixed==''?false:item.fixed"
  745. :min-width="item.columnWidth"
  746. :label="item.columnLabel">
  747. <template slot-scope="scope">
  748. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  749. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  750. </template>
  751. </el-table-column>
  752. </el-table>
  753. <el-table
  754. v-if="!bomFlag"
  755. :height="340"
  756. :data="routingComponentPartList"
  757. border
  758. :header-cell-style="{padding: '2px 2px'}"
  759. style="width: 100%">
  760. <el-table-column
  761. v-for="(item,index) in routingComponentListColumnList" :key="index"
  762. :sortable="item.columnSortable"
  763. :prop="item.columnProp"
  764. :header-align="item.headerAlign"
  765. :show-overflow-tooltip="item.showOverflowTooltip"
  766. :align="item.align"
  767. :fixed="item.fixed==''?false:item.fixed"
  768. :min-width="item.columnWidth"
  769. :label="item.columnLabel">
  770. <template slot-scope="scope">
  771. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  772. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  773. </template>
  774. </el-table-column>
  775. </el-table>
  776. </el-col>
  777. </el-row>
  778. </el-tab-pane>
  779. </el-tabs>
  780. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  781. <el-button type="primary" @click="handleBatchUpdateDialogClose">关闭</el-button>
  782. </el-footer>
  783. </div>
  784. </el-dialog>
  785. <el-dialog title="新增" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1000px">
  786. <div style="font-size: 12px">
  787. <el-form :inline="true" label-position="top" :model="itemData">
  788. <el-form-item :label="'属性编码'">
  789. <el-input v-model="itemData.propertiesItemNo" clearable style="width: 120px"></el-input>
  790. </el-form-item>
  791. <el-form-item :label="'属性名称'">
  792. <el-input v-model="itemData.itemDesc" clearable style="width: 150px"></el-input>
  793. </el-form-item>
  794. <el-form-item :label="' '">
  795. <el-button type="primary" @click="queryPartItem()">查询</el-button>
  796. </el-form-item>
  797. </el-form>
  798. </div>
  799. <el-container style="margin-top: 0px;">
  800. <el-main style="width: 350px;padding: 1px">
  801. <span style="font-size: 12px" >可选属性</span>
  802. <el-table
  803. height="400px"
  804. :data="itemList1"
  805. border
  806. ref="itemTable1"
  807. @row-click="itemClickRow1"
  808. @selection-change="selectionItem1"
  809. highlight-current-row
  810. style="width: 100%">
  811. <el-table-column
  812. type="selection"
  813. header-align="center"
  814. align="center"
  815. width="50">
  816. </el-table-column>
  817. <el-table-column
  818. prop="itNo"
  819. header-align="center"
  820. align="center"
  821. min-width="80"
  822. label="属性编码">
  823. </el-table-column>
  824. <el-table-column
  825. prop="itemDesc"
  826. header-align="center"
  827. align="center"
  828. min-width="200"
  829. label="属性名称">
  830. </el-table-column>
  831. </el-table>
  832. </el-main>
  833. <el-main style="width: 10px;padding: 1px">
  834. <div style="margin-top: 200px;margin-left: 18px">
  835. <el-button type="primary" :loading="addItemLoading" @click="addItem()">添加>></el-button>
  836. </div>
  837. <div style="margin-top: 15px;margin-left: 18px">
  838. <el-button type="primary" :loading="deleteItemLoading" @click="deleteItem()">删除<<</el-button>
  839. </div>
  840. </el-main>
  841. <el-main style="width: 350px;padding: 1px">
  842. <span style="font-size: 12px" >已有属性</span>
  843. <el-table
  844. height="400px"
  845. :data="itemList2"
  846. border
  847. ref="itemTable2"
  848. @row-click="itemClickRow2"
  849. @selection-change="selectionItem2"
  850. highlight-current-row
  851. style="width: 100%">
  852. <el-table-column
  853. type="selection"
  854. header-align="center"
  855. align="center"
  856. width="50">
  857. </el-table-column>
  858. <el-table-column
  859. prop="itNo"
  860. header-align="center"
  861. align="center"
  862. min-width="80"
  863. label="属性编码">
  864. </el-table-column>
  865. <el-table-column
  866. prop="itemDesc"
  867. header-align="center"
  868. align="center"
  869. min-width="200"
  870. label="属性名称">
  871. </el-table-column>
  872. </el-table>
  873. </el-main>
  874. </el-container>
  875. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  876. <el-button type="primary" @click="fastAddFlag = false">关闭</el-button>
  877. </el-footer>
  878. </el-dialog>
  879. <el-dialog title="新增" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag1" width="1000px">
  880. <div style="font-size: 12px">
  881. <el-form :inline="true" label-position="top" :model="itemData">
  882. <el-form-item :label="'属性编码'">
  883. <el-input v-model="itemData.propertiesItemNo" clearable style="width: 120px"></el-input>
  884. </el-form-item>
  885. <el-form-item :label="'属性名称'">
  886. <el-input v-model="itemData.itemDesc" clearable style="width: 150px"></el-input>
  887. </el-form-item>
  888. <el-form-item :label="' '">
  889. <el-button type="primary" @click="queryPartItem()">查询</el-button>
  890. </el-form-item>
  891. </el-form>
  892. </div>
  893. <el-container style="margin-top: 0px;">
  894. <el-main style="width: 350px;padding: 1px">
  895. <span style="font-size: 12px" >可选属性</span>
  896. <el-table
  897. height="400px"
  898. :data="itemList1"
  899. border
  900. ref="itemTable1"
  901. @row-click="itemClickRow1"
  902. @selection-change="selectionItem1"
  903. highlight-current-row
  904. style="width: 100%">
  905. <el-table-column
  906. type="selection"
  907. header-align="center"
  908. align="center"
  909. width="50">
  910. </el-table-column>
  911. <el-table-column
  912. prop="itNo"
  913. header-align="center"
  914. align="center"
  915. min-width="80"
  916. label="属性编码">
  917. </el-table-column>
  918. <el-table-column
  919. prop="itemDesc"
  920. header-align="center"
  921. align="center"
  922. min-width="200"
  923. label="属性名称">
  924. </el-table-column>
  925. </el-table>
  926. </el-main>
  927. <el-main style="width: 10px;padding: 1px">
  928. <div style="margin-top: 200px;margin-left: 18px">
  929. <el-button type="primary" :loading="addItemLoading" @click="addItem1()">添加>></el-button>
  930. </div>
  931. <div style="margin-top: 15px;margin-left: 18px">
  932. <el-button type="primary" :loading="deleteItemLoading" @click="deleteItem1()">删除<<</el-button>
  933. </div>
  934. </el-main>
  935. <el-main style="width: 350px;padding: 1px">
  936. <span style="font-size: 12px" >已有属性</span>
  937. <el-table
  938. height="400px"
  939. :data="itemList2"
  940. border
  941. ref="itemTable2"
  942. @row-click="itemClickRow2"
  943. @selection-change="selectionItem2"
  944. highlight-current-row
  945. style="width: 100%">
  946. <el-table-column
  947. type="selection"
  948. header-align="center"
  949. align="center"
  950. width="50">
  951. </el-table-column>
  952. <el-table-column
  953. prop="itNo"
  954. header-align="center"
  955. align="center"
  956. min-width="80"
  957. label="属性编码">
  958. </el-table-column>
  959. <el-table-column
  960. prop="itemDesc"
  961. header-align="center"
  962. align="center"
  963. min-width="200"
  964. label="属性名称">
  965. </el-table-column>
  966. </el-table>
  967. </el-main>
  968. </el-container>
  969. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  970. <el-button type="primary" @click="fastAddFlag1 = false">关闭</el-button>
  971. </el-footer>
  972. </el-dialog>
  973. <el-dialog :close-on-click-modal="false" v-drag :visible.sync="copyVisible" width="90vw">
  974. <div class="rq">
  975. <div style="display: flex; justify-content: space-between;">
  976. <fieldset style="width: 31vw">
  977. <legend v-if="partCurrentRow.partNo&&partCurrentRow.partNo!==''">目标物料</legend>
  978. <legend v-else>新物料</legend>
  979. <el-form :inline="true" label-position="top" :model="copyData" :rules="rules" ref="copyForm">
  980. <el-form-item :label="'BU'" prop="buNo">
  981. <el-select v-model="copyData.buNo" placeholder="请选择" @change="userBuList = userBuList.filter(item => item.buNo!=='')" style="width: 7.5vw">
  982. <el-option
  983. v-for = "i in userBuList"
  984. :key = "i.buNo.split('_')[1]"
  985. :label = "i.buNo.split('_')[1]"
  986. :value = "i.buNo.split('_')[1]">
  987. </el-option>
  988. </el-select>
  989. </el-form-item>
  990. <el-form-item :label="'物料编码'">
  991. <el-input v-model="copyData.partNo" disabled style="width: 8vw"></el-input>
  992. </el-form-item>
  993. <el-form-item :label="'物料描述'" prop="partDesc">
  994. <el-input v-model="copyData.partDesc" clearable style="width: 10vw"></el-input>
  995. </el-form-item>
  996. <el-form-item label="制造类型" v-if="copyData.bomFlag==='Y'" prop="bomType">
  997. <el-select v-model="copyData.bomType" style="width: 5vw">
  998. <el-option label="Manufacturing" value="Manufacturing"></el-option>
  999. <el-option label="Repair" value="Repair"></el-option>
  1000. <el-option label="Purchase" value="Purchase"></el-option>
  1001. <el-option label="Prototype" value="Prototype"></el-option>
  1002. </el-select>
  1003. </el-form-item>
  1004. <el-form-item label="工艺类型" v-if="copyData.routingFlag==='Y'" prop="routingType">
  1005. <el-select v-model="copyData.routingType" style="width: 5vw">
  1006. <el-option label="Manufacturing" value="Manufacturing"></el-option>
  1007. <el-option label="Repair" value="Repair"></el-option>
  1008. <el-option label="Prototype" value="Prototype"></el-option>
  1009. </el-select>
  1010. </el-form-item>
  1011. <el-form-item label="生效日期" v-if="copyData.routingFlag==='Y'||copyData.bomFlag==='Y'" prop="effPhaseInDate">
  1012. <el-date-picker style="width: 7vw" v-model="copyData.effPhaseInDate" clearable type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
  1013. </el-form-item>
  1014. <el-form-item label="失效日期" v-if="copyData.routingFlag==='Y'||copyData.bomFlag==='Y'">
  1015. <el-date-picker style="width: 7vw" v-model="copyData.effPhaseOutDate" clearable type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
  1016. </el-form-item>
  1017. </el-form>
  1018. </fieldset>
  1019. <fieldset style="width: 57vw">
  1020. <legend>被复制的物料</legend>
  1021. <el-form :inline="true" label-position="top" :model="copyData">
  1022. <el-form-item>
  1023. <span slot="label" @click="queryCopyPartModal"><a herf="#">物料编码</a></span>
  1024. <el-input v-model="copyData.previousVersion.partNo" disabled style="width: 10vw"></el-input>
  1025. </el-form-item>
  1026. <el-form-item label="物料描述">
  1027. <el-input v-model="copyData.previousVersion.partDesc" disabled style="width: 14vw"></el-input>
  1028. </el-form-item>
  1029. <el-form-item label="零件类型">
  1030. <el-input v-model="copyData.previousVersion.partType2Desc" disabled style="width: 5vw"></el-input>
  1031. </el-form-item>
  1032. <el-form-item label="计量单位">
  1033. <el-input v-model="copyData.previousVersion.umName" disabled style="width: 5vw"></el-input>
  1034. </el-form-item>
  1035. <el-form-item label="商品组1">
  1036. <el-input v-model="copyData.previousVersion.productGroupName1" disabled style="width: 12vw"></el-input>
  1037. </el-form-item>
  1038. <el-form-item label="商品组2">
  1039. <el-input v-model="copyData.previousVersion.productGroupName2" disabled style="width: 12vw"></el-input>
  1040. </el-form-item>
  1041. <el-form-item label="BOM版本号">
  1042. <el-input v-model="copyData.previousVersion.engChgLevel" disabled style="width: 5vw"></el-input>
  1043. </el-form-item>
  1044. <el-form-item label="Routing版本号">
  1045. <el-input v-model="copyData.previousVersion.routingRevision" disabled style="width: 5vw"></el-input>
  1046. </el-form-item>
  1047. <el-form-item :label="' '">
  1048. <el-checkbox v-model="copyData.bomFlag" true-label="Y" false-label="N" style="margin-left: 8vw">复制BOM</el-checkbox>
  1049. <el-checkbox v-model="copyData.routingFlag" true-label="Y" false-label="N">复制Routing</el-checkbox>
  1050. </el-form-item>
  1051. </el-form>
  1052. </fieldset>
  1053. </div>
  1054. <fieldset>
  1055. <legend>版本信息</legend>
  1056. <el-row>
  1057. <el-col :style="{width: 25 + 'vw',height: 340 + 'px'}" class="down-tree">
  1058. <el-tabs v-model="activeTab1" style="width: 100%;height: 170px; margin-top: -5px" @tab-click="bomInfoTabClick1">
  1059. <el-tab-pane label="产品结构版本" name="default">
  1060. <el-table
  1061. :height="120"
  1062. :data="bomComponentList1"
  1063. border
  1064. :header-cell-style="{padding: '2px 2px'}"
  1065. :row-style="bomRowStyle1"
  1066. @row-click="bomInfoRowClick1"
  1067. @row-dblclick="bomInfoRowDblClick1"
  1068. style="width: 100%">
  1069. <el-table-column
  1070. header-align="center"
  1071. align="center"
  1072. width="80"
  1073. fixed="left"
  1074. label="操作">
  1075. <template slot-scope="scope">
  1076. <div class="operation-view" style="display: inline-block; padding: 0px 5px; margin-left: 5px; color: #777777;">
  1077. <a href="javascript:void(0)" @click="bomInfoRowDblClick1(scope.row)">
  1078. 选择版本
  1079. </a>
  1080. </div>
  1081. </template>
  1082. </el-table-column>
  1083. <el-table-column
  1084. v-for="(item,index) in bomComponentListColumns" :key="index"
  1085. :sortable="item.columnSortable"
  1086. :prop="item.columnProp"
  1087. :header-align="item.headerAlign"
  1088. :show-overflow-tooltip="item.showOverflowTooltip"
  1089. :align="item.align"
  1090. :fixed="item.fixed==''?false:item.fixed"
  1091. :min-width="item.columnWidth"
  1092. :label="item.columnLabel">
  1093. <template slot-scope="scope">
  1094. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  1095. </template>
  1096. </el-table-column>
  1097. </el-table>
  1098. </el-tab-pane>
  1099. </el-tabs>
  1100. <el-tabs v-model="activeTab2" style="width: 100%;height: 165px;" @tab-click="routingInfoTabClick1">
  1101. <el-tab-pane label="工艺路线版本" name="default">
  1102. <el-table
  1103. :height="120"
  1104. :data="routingComponentList1"
  1105. border
  1106. :header-cell-style="{padding: '2px 2px'}"
  1107. :row-style="routingRowStyle1"
  1108. @row-click="routingInfoRowClick1"
  1109. @row-dblclick="routingInfoRowDblClick1"
  1110. style="width: 100%">
  1111. <el-table-column
  1112. header-align="center"
  1113. align="center"
  1114. width="80"
  1115. fixed="left"
  1116. label="操作">
  1117. <template slot-scope="scope">
  1118. <div class="operation-view" style="display: inline-block; padding: 0px 5px; margin-left: 5px; color: #777777;">
  1119. <a href="javascript:void(0)" @click="routingInfoRowDblClick1(scope.row)">
  1120. 选择版本
  1121. </a>
  1122. </div>
  1123. </template>
  1124. </el-table-column>
  1125. <el-table-column
  1126. v-for="(item,index) in routingComponentListColumns" :key="index"
  1127. :sortable="item.columnSortable"
  1128. :prop="item.columnProp"
  1129. :header-align="item.headerAlign"
  1130. :show-overflow-tooltip="item.showOverflowTooltip"
  1131. :align="item.align"
  1132. :fixed="item.fixed==''?false:item.fixed"
  1133. :min-width="item.columnWidth"
  1134. :label="item.columnLabel">
  1135. <template slot-scope="scope">
  1136. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  1137. </template>
  1138. </el-table-column>
  1139. </el-table>
  1140. </el-tab-pane>
  1141. </el-tabs>
  1142. </el-col>
  1143. <el-col :style="{width: 56 + 'vw',height: 340 + 'px'}">
  1144. <el-table
  1145. v-if="bomFlag1"
  1146. :height="340"
  1147. :data="bomComponentPartList1"
  1148. border
  1149. :header-cell-style="{padding: '2px 2px'}"
  1150. style="width: 100%">
  1151. <el-table-column
  1152. v-for="(item,index) in bomComponentListColumnList" :key="index"
  1153. :sortable="item.columnSortable"
  1154. :prop="item.columnProp"
  1155. :header-align="item.headerAlign"
  1156. :show-overflow-tooltip="item.showOverflowTooltip"
  1157. :align="item.align"
  1158. :fixed="item.fixed==''?false:item.fixed"
  1159. :min-width="item.columnWidth"
  1160. :label="item.columnLabel">
  1161. <template slot-scope="scope">
  1162. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  1163. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1164. </template>
  1165. </el-table-column>
  1166. </el-table>
  1167. <el-table
  1168. v-if="!bomFlag1"
  1169. :height="340"
  1170. :data="routingComponentPartList1"
  1171. border
  1172. :header-cell-style="{padding: '2px 2px'}"
  1173. style="width: 100%">
  1174. <el-table-column
  1175. v-for="(item,index) in routingComponentListColumnList" :key="index"
  1176. :sortable="item.columnSortable"
  1177. :prop="item.columnProp"
  1178. :header-align="item.headerAlign"
  1179. :show-overflow-tooltip="item.showOverflowTooltip"
  1180. :align="item.align"
  1181. :fixed="item.fixed==''?false:item.fixed"
  1182. :min-width="item.columnWidth"
  1183. :label="item.columnLabel">
  1184. <template slot-scope="scope">
  1185. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  1186. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1187. </template>
  1188. </el-table-column>
  1189. </el-table>
  1190. </el-col>
  1191. </el-row>
  1192. </fieldset>
  1193. </div>
  1194. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1195. <el-button type="primary" @click="copySave">保存</el-button>
  1196. <el-button type="primary" @click="copyVisible=false">关闭</el-button>
  1197. </el-footer>
  1198. </el-dialog>
  1199. <!-- copy物料模态框 -->
  1200. <el-dialog title="物料清单" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="copyPartModelFlag" width="700px">
  1201. <el-form :inline="true" label-position="top" :model="copyData.previousVersion">
  1202. <el-form-item :label="'物料编码'">
  1203. <el-input v-model="copyModalData.partNo" clearable style="width: 120px"></el-input>
  1204. </el-form-item>
  1205. <el-form-item :label="'物料名称'">
  1206. <el-input v-model="copyModalData.partDesc" clearable style="width: 120px"></el-input>
  1207. </el-form-item>
  1208. <el-form-item :label="' '">
  1209. <el-button type="primary" @click="queryCopyPartModal">查询</el-button>
  1210. </el-form-item>
  1211. </el-form>
  1212. <el-table
  1213. :height="250"
  1214. :data="copyPartList"
  1215. @row-dblclick="getCopyRowData"
  1216. border
  1217. style="width: 100%;">
  1218. <el-table-column
  1219. v-for="(item,index) in componentPartColumnList" :key="index"
  1220. :sortable="item.columnSortable"
  1221. :prop="item.columnProp"
  1222. :header-align="item.headerAlign"
  1223. :show-overflow-tooltip="item.showOverflowTooltip"
  1224. :align="item.align"
  1225. :fixed="item.fixed==''?false:item.fixed"
  1226. :min-width="item.columnWidth"
  1227. :label="item.columnLabel">
  1228. <template slot-scope="scope">
  1229. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  1230. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1231. </template>
  1232. </el-table-column>
  1233. </el-table>
  1234. <!-- 分页插件 -->
  1235. <el-pagination
  1236. @size-change="sizeChangeHandle4"
  1237. @current-change="currentChangeHandle4"
  1238. :current-page="pageIndex4"
  1239. :page-sizes="[20, 50, 100, 200, 500]"
  1240. :page-size="pageSize4"
  1241. :total="totalPage4"
  1242. layout="total, sizes, prev, pager, next, jumper">
  1243. </el-pagination>
  1244. <el-footer style="height:35px;margin-top:10px;text-align:center">
  1245. <el-button type="primary" @click="copyPartModelFlag = false">关闭</el-button>
  1246. </el-footer>
  1247. </el-dialog>
  1248. <el-dialog :title="'修改属性'" :close-on-click-modal="false" v-drag :visible.sync="itemUpdateFlag" width="1100px">
  1249. <el-table
  1250. :data="partItemList1"
  1251. border
  1252. :header-cell-style="{padding: '2px 2px'}"
  1253. style="width: 100%">
  1254. <el-table-column
  1255. v-for="(item,index) in columnItemList" :key="index"
  1256. :sortable="item.columnSortable"
  1257. :prop="item.columnProp"
  1258. :header-align="item.headerAlign"
  1259. :show-overflow-tooltip="item.showOverflowTooltip"
  1260. :align="item.align"
  1261. :fixed="item.fixed===''?false:item.fixed"
  1262. :min-width="item.columnWidth"
  1263. :label="item.columnLabel">
  1264. <template slot-scope="scope">
  1265. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  1266. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  1267. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1268. </div>
  1269. <div v-else>
  1270. <div v-if="scope.row.valueChooseFlag !== 'Y'">
  1271. <el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueTypeDb === 'N'" :controls="false"></el-input-number>
  1272. <el-input v-model="scope.row.textValue" v-else></el-input>
  1273. </div>
  1274. <div v-else>
  1275. <el-select style="width: 100%;" clearable v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue">
  1276. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  1277. </el-select>
  1278. <el-select style="width: 100%;" clearable v-else v-model="scope.row.numValue">
  1279. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  1280. </el-select>
  1281. </div>
  1282. </div>
  1283. </template>
  1284. </el-table-column>
  1285. </el-table>
  1286. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  1287. <el-button type="primary" @click="itemUpdateSave">保存</el-button>
  1288. <el-button type="primary" @click="itemUpdateFlag = false">关闭</el-button>
  1289. </el-footer>
  1290. </el-dialog>
  1291. <!-- PTM参数选择对话框 -->
  1292. <el-dialog
  1293. title="选择ProcessTimeMatrix参数"
  1294. :close-on-click-modal="false"
  1295. v-drag
  1296. :visible.sync="ptmDialogVisible"
  1297. width="95%"
  1298. top="3vh">
  1299. <div class="rq">
  1300. <el-form :inline="true" label-position="top" style="margin-bottom: 10px">
  1301. <el-form-item label="商品组1">
  1302. <el-select
  1303. v-model="ptmSelectedProductGroupId"
  1304. placeholder="请选择商品组1"
  1305. clearable
  1306. filterable
  1307. style="width: 300px"
  1308. @change="handleProductGroupChange">
  1309. <el-option
  1310. v-for="item in ptmProductGroupList"
  1311. :key="item.productGroupId"
  1312. :label="item.productGroupName"
  1313. :value="item.productGroupId">
  1314. </el-option>
  1315. </el-select>
  1316. </el-form-item>
  1317. <el-form-item label="Code筛选">
  1318. <el-input v-model="ptmSearchCode" placeholder="请输入条件描述" clearable style="width: 260px" @keyup.enter.native="filterPtmList"></el-input>
  1319. </el-form-item>
  1320. <el-form-item label=" ">
  1321. <el-button type="primary" @click="filterPtmList">筛选</el-button>
  1322. <el-button @click="resetPtmFilter">重置</el-button>
  1323. </el-form-item>
  1324. <el-form-item label=" " style="float: right">
  1325. <span style="color: #67C23A; font-size: 13px;">
  1326. 💡 提示双击某一行直接添加该ProcessTimeMatrix的参数
  1327. </span>
  1328. </el-form-item>
  1329. </el-form>
  1330. <el-table
  1331. ref="ptmTable"
  1332. :data="filteredPtmDataList"
  1333. :height="520"
  1334. border
  1335. @row-dblclick="handlePtmRowDoubleClick"
  1336. highlight-current-row
  1337. :header-cell-style="{padding: '2px 2px', fontSize: '12px'}"
  1338. :cell-style="{padding: '2px 2px', fontSize: '11px', cursor: 'pointer'}"
  1339. style="width: 100%;">
  1340. <el-table-column
  1341. type="index"
  1342. label="序号"
  1343. width="60"
  1344. align="center"
  1345. fixed="left">
  1346. </el-table-column>
  1347. <el-table-column
  1348. prop="conditionDesc"
  1349. label="Code"
  1350. width="300"
  1351. header-align="center"
  1352. align="left"
  1353. fixed="left">
  1354. </el-table-column>
  1355. <el-table-column
  1356. v-for="(col, index) in ptmColumnList"
  1357. :key="index"
  1358. :prop="col.prop"
  1359. :label="col.label"
  1360. :min-width="col.width || 100"
  1361. header-align="center"
  1362. :align="col.align || 'center'"
  1363. show-overflow-tooltip>
  1364. <template slot-scope="scope">
  1365. <span>{{ scope.row[col.prop] || '-' }}</span>
  1366. </template>
  1367. </el-table-column>
  1368. </el-table>
  1369. </div>
  1370. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1371. <el-button type="primary" @click="ptmDialogVisible=false">关闭</el-button>
  1372. </el-footer>
  1373. </el-dialog>
  1374. <!-- 新增物料 -->
  1375. <part-create :init-data="searchData" ref="PartCreate" @update-part-item="getPartItem" @refreshPageTables="getBomInfo" @refreshPageTables2="getInfoByBomTemplate" v-drag></part-create>
  1376. <!-- chooseList模态框 -->
  1377. <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
  1378. </div>
  1379. </template>
  1380. <script>
  1381. import {
  1382. getNodeTree,
  1383. nodeSave,
  1384. nodeDelete,
  1385. nodeEdit,
  1386. batchBuildInfo,
  1387. resetNodePartInfo
  1388. } from "@/api/part/quicklyCreateBom.js"
  1389. import {
  1390. queryPartListBom, // 查出可创建BOM的物料
  1391. } from "@/api/part/bomManagement.js"
  1392. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  1393. import ChooseList from '@/views/modules/common/Chooselist_eam'
  1394. import {Decimal} from "decimal.js";
  1395. import BomCreate from "./bom_create.vue";
  1396. import RoutingCreate from "./routing_create.vue";
  1397. import PartCreate from "./part_create.vue";
  1398. import {updateInquiryDetailStatusAndPart} from "../../../api/inquiry/inquiryDetail";
  1399. import {EventBus} from "../../../main";
  1400. import {searchProductGroupPtmCondition, batchSearchProductGroupPtmConditionsWithItems, productGroupInformationSearch} from "../../../api/part/partProductGroupInformation";
  1401. import {
  1402. addPartItem,
  1403. batchUpdateItem,
  1404. commitItemValue, deletePartItem,
  1405. getPartItem,
  1406. partInfoByMainPart,
  1407. queryPartItem,
  1408. getItemLists, batchSavePartInfo, addPartsItem, batchUpdateCodeNo, deletePartsItem, commitItemsValue, getCopyRowData, recalculateBomAndRouting
  1409. } from "../../../api/part/partInformation";
  1410. import {getChooselist1} from "../../../api/chooselist/chooselist";
  1411. import {
  1412. chooseEngChgLevel,
  1413. chooseTemplate, getBomAndRoutingRevision,
  1414. getBomInformationListByPartNo,
  1415. getRoutingInformationListByPartNo,
  1416. getTemplateList,
  1417. savePartInfo, setRevision,
  1418. updatePartNoOfNode
  1419. } from "../../../api/part/quicklyCreateBom";
  1420. import {getSiteAndBuByUserName} from "../../../api/qc/qc";
  1421. import Data from "lodash";
  1422. import {copyBom, queryBomDetail, queryPartList} from "../../../api/part/bomManagement";
  1423. import {copyRouting, queryRoutingDetail} from "../../../api/part/routingManagement";
  1424. export default {
  1425. components: {
  1426. PartCreate,
  1427. BomCreate,
  1428. RoutingCreate,
  1429. ChooseList
  1430. },
  1431. watch: {
  1432. nodeData: {
  1433. deep: true,
  1434. handler: function (newV, oldV) {
  1435. this.nodeData.nodeId = this.nodeData.nodeId.toUpperCase()
  1436. }
  1437. },
  1438. itemUpdateFlag: {
  1439. deep: true,
  1440. handler: function (newV, oldV) {
  1441. if (!newV) {
  1442. this.partItemList1 = []
  1443. }
  1444. }
  1445. },
  1446. 'partCurrentRow': {
  1447. deep: true,
  1448. handler: function (newV, oldV) {
  1449. if (this.inventoryPartTable==='part_item1'&&this.attributeFlag1){
  1450. this.getPartItem1()
  1451. } else if (this.inventoryPartTable==='revision_info'){
  1452. this.getRevisionInfo()
  1453. }
  1454. }
  1455. },
  1456. 'bomCurrentRow': {
  1457. deep: true,
  1458. handler: function (newV, oldV) {
  1459. if (newV) {
  1460. this.routingCurrentRow = null
  1461. }
  1462. }
  1463. },
  1464. 'routingCurrentRow': {
  1465. deep: true,
  1466. handler: function (newV, oldV) {
  1467. if (newV) {
  1468. this.bomCurrentRow = null
  1469. }
  1470. }
  1471. },
  1472. 'bomCurrentRow1': {
  1473. deep: true,
  1474. handler: function (newV, oldV) {
  1475. if (newV) {
  1476. this.routingCurrentRow1 = null
  1477. }
  1478. }
  1479. },
  1480. 'routingCurrentRow1': {
  1481. deep: true,
  1482. handler: function (newV, oldV) {
  1483. if (newV) {
  1484. this.bomCurrentRow1 = null
  1485. }
  1486. }
  1487. },
  1488. batchUpdateFlag: {
  1489. handler: function (newV, oldV) {
  1490. if (newV===false) {
  1491. this.attributeFlag = true
  1492. this.attributeFlag1 = true
  1493. this.inventoryPartTable = 'part_item'
  1494. this.getNodeTree()
  1495. this.getPartItem()
  1496. } else {
  1497. this.previousCodeNo = this.searchData.codeNo
  1498. }
  1499. }
  1500. },
  1501. 'nodeData.pId': {
  1502. deep: true,
  1503. handler: function (newV, oldV) {
  1504. this.childrenNodeList = [];
  1505. if (!newV || newV.trim().length === 0) {
  1506. return;
  1507. }
  1508. const findNodeById = (nodes, targetId) => {
  1509. for (let i = 0; i < nodes.length; i++) {
  1510. const node = nodes[i];
  1511. if (node.id === targetId) {
  1512. return node;
  1513. }
  1514. if (node.nodeList && node.nodeList.length > 0) {
  1515. const result = findNodeById(node.nodeList, targetId);
  1516. if (result) return result;
  1517. }
  1518. }
  1519. return null;
  1520. };
  1521. const foundNode = findNodeById(this.treeData1, newV);
  1522. if (foundNode && foundNode.nodeList) {
  1523. this.childrenNodeList = foundNode.nodeList.filter(node => node.nodeName!==null&&node.nodeName.trim()!=="");
  1524. } else {
  1525. this.childrenNodeList = [];
  1526. }
  1527. }
  1528. },
  1529. 'routingComponentPartList': {
  1530. deep: true,
  1531. handler: function (newV, oldV) {
  1532. newV.forEach(item => {
  1533. item.formula = this.getFormula(item.operationName)
  1534. })
  1535. }
  1536. },
  1537. 'routingComponentPartList1': {
  1538. deep: true,
  1539. handler: function (newV, oldV) {
  1540. newV.forEach(item => {
  1541. item.formula = this.getFormula(item.operationName)
  1542. })
  1543. }
  1544. },
  1545. 'copyVisible': {
  1546. deep: true,
  1547. handler: function (newV, oldV) {
  1548. if (!newV) {
  1549. this.copyData= {
  1550. flag: '',
  1551. site: this.$store.state.user.site,
  1552. partNo: '',
  1553. partDesc: '',
  1554. umId2: null,
  1555. productGroupId1: null,
  1556. productGroupId2: null,
  1557. productGroupId3: null,
  1558. codeNo: null,
  1559. familyID: null,
  1560. partType2: null,
  1561. routingType: 'Manufacturing',
  1562. bomType: 'Manufacturing',
  1563. effPhaseInDate: null,
  1564. effPhaseOutDate: null,
  1565. phaseOutDate: null,
  1566. phaseInDate: null,
  1567. previousVersion: {},
  1568. nodeFlag: false,
  1569. mainPart: '',
  1570. nodeId: '',
  1571. engChgLevel: null,
  1572. routingRevision: null,
  1573. active: '',
  1574. createBy: '',
  1575. routingFlag: 'Y',
  1576. bomFlag: 'Y',
  1577. page: 1,
  1578. limit: 10
  1579. }
  1580. this.bomComponentList1 = []
  1581. this.routingComponentList1 = []
  1582. this.bomComponentPartList1 = []
  1583. this.routingComponentPartList1 = []
  1584. this.handleBatchUpdatePart()
  1585. this.getRevisionInfo()
  1586. }
  1587. }
  1588. },
  1589. '$route.query.data': {
  1590. handler(newData, oldData) {
  1591. if (newData) {
  1592. this.searchData = newData;
  1593. this.searchData.partDesc = newData.testPartDesc;
  1594. this.searchData.codeNo = newData.partCodeNo;
  1595. this.searchData.rfqDetailId = newData.id;
  1596. this.dataList = [{}]
  1597. this.getNodeTree();
  1598. this.getPartItem();
  1599. }
  1600. },
  1601. immediate: true
  1602. }
  1603. },
  1604. data () {
  1605. return {
  1606. activeTable: 'bom_info',
  1607. activeTab1: 'default',
  1608. activeTab2: 'default',
  1609. inventoryPartTable: 'part_item',
  1610. partItemList: [],
  1611. partItemList1: [],
  1612. copyAttributeList: [],
  1613. treeData: [],
  1614. treeData1: [],
  1615. childrenNodeList: [],
  1616. userBuList: [],
  1617. partFamilyList: [],
  1618. partProductGroupList1: [],
  1619. partProductGroupList2: [],
  1620. partProductGroupList3: [],
  1621. templateList: [],
  1622. tempList: [],
  1623. defaultProps: {
  1624. children: "nodeList",
  1625. label: "nodeName",
  1626. },
  1627. menuId: this.$route.meta.menuId,
  1628. // 是否收藏
  1629. favorite: false,
  1630. exportData: [],
  1631. exportName: "节点" + this.dayjs().format('YYYYMMDDHHmmss'),
  1632. exportHeader: ["节点"],
  1633. exportFooter: [],
  1634. height: 200,
  1635. rightWidth: '',
  1636. pageIndex: 1,
  1637. pageSize: 20,
  1638. totalPage: 0,
  1639. pageIndex2: 1,
  1640. pageSize2: 20,
  1641. totalPage2: 0,
  1642. pageIndex3: 1,
  1643. pageSize3: 20,
  1644. totalPage3: 0,
  1645. pageIndex4: 1,
  1646. pageSize4: 20,
  1647. totalPage4: 0,
  1648. partList: [],
  1649. partList1: [],
  1650. codeList: [],
  1651. itemSelections1: [],
  1652. itemSelections2: [],
  1653. itemList1: [],
  1654. itemList2: [],
  1655. bomComponentPartList: [],
  1656. bomComponentPartList1: [],
  1657. routingComponentPartList: [],
  1658. routingComponentPartList1: [],
  1659. bomComponentList: [],
  1660. bomComponentList1: [],
  1661. routingComponentList: [],
  1662. routingComponentList1: [],
  1663. copyPartList: [],
  1664. previousCodeNo: '',
  1665. rules: {
  1666. buNo:[
  1667. {
  1668. required: true,
  1669. message: ' ',
  1670. trigger: ['blur', 'change']
  1671. }
  1672. ],
  1673. partDesc: [
  1674. {
  1675. required: true,
  1676. message: ' ',
  1677. trigger: ['blur', 'change']
  1678. }
  1679. ],
  1680. bomType: [
  1681. {
  1682. required: true,
  1683. message: ' ',
  1684. trigger: ['blur', 'change']
  1685. }
  1686. ],
  1687. routingType: [
  1688. {
  1689. required: true,
  1690. message: ' ',
  1691. trigger: ['blur', 'change']
  1692. }
  1693. ],
  1694. effPhaseInDate: [
  1695. {
  1696. required: true,
  1697. message: ' ',
  1698. trigger: ['blur', 'change']
  1699. }
  1700. ],
  1701. },
  1702. searchData: {
  1703. site: this.$store.state.user.site,
  1704. buNo: '',
  1705. partNo: '',
  1706. partDesc: '',
  1707. codeNo: '',
  1708. rfqDetailId: null
  1709. },
  1710. partNoGenerated: false, // 标记产品编码是否已通过"维护"生成
  1711. savedPartData: null, // 保存已生成的产品数据,防止被路由参数覆盖
  1712. itemData: {
  1713. site: this.$store.state.user.site,
  1714. partNo: '',
  1715. propertiesItemNo: '',
  1716. codeNo: '',
  1717. itemDesc: '',
  1718. textValue: '',
  1719. numValue: '',
  1720. recordType: ''
  1721. },
  1722. nodeData: {
  1723. flag: '',
  1724. site: this.$store.state.user.site,
  1725. nodeId: '',
  1726. nodeName: '',
  1727. id: '',
  1728. pId: '',
  1729. parentNodeName: '',
  1730. createBy: this.$store.state.user.name,
  1731. updateBy: this.$store.state.user.name,
  1732. mainPart: '',
  1733. rfqDetailId: null
  1734. },
  1735. partData: {
  1736. flag: '',
  1737. site: '',
  1738. partNo: '',
  1739. partDesc: '',
  1740. nodeFlag: false,
  1741. mainPart: '',
  1742. nodeId: '',
  1743. engChgLevel: null,
  1744. page: 1,
  1745. limit: 10
  1746. },
  1747. copyData: {
  1748. flag: '',
  1749. site: this.$store.state.user.site,
  1750. partNo: '',
  1751. partDesc: '',
  1752. umId2: null,
  1753. productGroupId1: null,
  1754. productGroupId2: null,
  1755. productGroupId3: null,
  1756. codeNo: null,
  1757. familyID: null,
  1758. partType2: null,
  1759. routingType: 'Manufacturing',
  1760. bomType: 'Manufacturing',
  1761. effPhaseInDate: null,
  1762. effPhaseOutDate: null,
  1763. phaseOutDate: null,
  1764. phaseInDate: null,
  1765. previousVersion: {},
  1766. nodeFlag: false,
  1767. mainPart: '',
  1768. nodeId: '',
  1769. engChgLevel: null,
  1770. routingRevision: null,
  1771. active: '',
  1772. createBy: '',
  1773. routingFlag: 'Y',
  1774. bomFlag: 'Y',
  1775. page: 1,
  1776. limit: 10
  1777. },
  1778. copyModalData: {
  1779. site: '',
  1780. partNo: '',
  1781. partDesc: '',
  1782. page: 1,
  1783. limit: 10
  1784. },
  1785. nodeRules:{
  1786. nodeId:[
  1787. {
  1788. required: true,
  1789. message: ' ',
  1790. trigger: ['blur','change']
  1791. }
  1792. ],
  1793. nodeName:[
  1794. {
  1795. required: true,
  1796. message: ' ',
  1797. trigger: ['blur','change']
  1798. }
  1799. ],
  1800. parentNodeName:[
  1801. {
  1802. required: true,
  1803. message: ' ',
  1804. trigger: ['blur','change']
  1805. }
  1806. ],
  1807. id:[
  1808. {
  1809. required: true,
  1810. message: ' ',
  1811. trigger: ['blur','change']
  1812. }
  1813. ]
  1814. },
  1815. dataList: [{}],
  1816. editingCell: {
  1817. rowIndex: -1,
  1818. columnProp: null,
  1819. value: '',
  1820. isSaving: false
  1821. },
  1822. currentNode: {},
  1823. partCurrentRow: {},
  1824. bomCurrentRow: {},
  1825. bomCurrentRow1: {},
  1826. routingCurrentRow: {},
  1827. routingCurrentRow1: {},
  1828. partCurrentRowIndex: -1,
  1829. columnList: [
  1830. {
  1831. userId: this.$store.state.user.name,
  1832. columnProp: 'family1',
  1833. headerAlign: 'left',
  1834. align: 'left',
  1835. columnLabel: 'Family1',
  1836. columnHidden: false,
  1837. columnImage: false,
  1838. columnSortable: false,
  1839. sortLv: 0,
  1840. status: true,
  1841. fixed: '',
  1842. columnWidth: 50
  1843. },
  1844. {
  1845. userId: this.$store.state.user.name,
  1846. columnProp: 'family2',
  1847. headerAlign: 'left',
  1848. align: 'left',
  1849. columnLabel: 'Family2',
  1850. columnHidden: false,
  1851. columnImage: false,
  1852. columnSortable: false,
  1853. sortLv: 0,
  1854. status: true,
  1855. fixed: '',
  1856. columnWidth: 50
  1857. },
  1858. {
  1859. userId: this.$store.state.user.name,
  1860. columnProp: 'bondingPitch',
  1861. headerAlign: 'left',
  1862. align: 'left',
  1863. columnLabel: 'Bonding Pitch',
  1864. columnHidden: false,
  1865. columnImage: false,
  1866. columnSortable: false,
  1867. sortLv: 0,
  1868. status: true,
  1869. fixed: '',
  1870. columnWidth: 80
  1871. },
  1872. {
  1873. userId: this.$store.state.user.name,
  1874. columnProp: 'bondingLanes',
  1875. headerAlign: 'left',
  1876. align: 'left',
  1877. columnLabel: '绑定列数',
  1878. columnHidden: false,
  1879. columnImage: false,
  1880. columnSortable: false,
  1881. sortLv: 0,
  1882. status: true,
  1883. fixed: '',
  1884. columnWidth: 50
  1885. },
  1886. {
  1887. userId: this.$store.state.user.name,
  1888. columnProp: 'printingLanes',
  1889. headerAlign: 'left',
  1890. align: 'left',
  1891. columnLabel: 'Printing lanes',
  1892. columnHidden: false,
  1893. columnImage: false,
  1894. columnSortable: false,
  1895. sortLv: 0,
  1896. status: true,
  1897. fixed: '',
  1898. columnWidth: 80
  1899. },
  1900. {
  1901. userId: this.$store.state.user.name,
  1902. columnProp: 'uph-tal',
  1903. headerAlign: 'left',
  1904. align: 'left',
  1905. columnLabel: 'UPH-TAL',
  1906. columnHidden: false,
  1907. columnImage: false,
  1908. columnSortable: false,
  1909. sortLv: 0,
  1910. status: true,
  1911. fixed: '',
  1912. columnWidth: 80
  1913. },
  1914. {
  1915. userId: this.$store.state.user.name,
  1916. columnProp: 'uph-paris',
  1917. headerAlign: 'left',
  1918. align: 'left',
  1919. columnLabel: 'UPH-Paris',
  1920. columnHidden: false,
  1921. columnImage: false,
  1922. columnSortable: false,
  1923. sortLv: 0,
  1924. status: true,
  1925. fixed: '',
  1926. columnWidth: 80
  1927. },
  1928. {
  1929. userId: this.$store.state.user.name,
  1930. columnProp: 'cl60k-up',
  1931. headerAlign: 'left',
  1932. align: 'left',
  1933. columnLabel: 'CL60k-UP',
  1934. columnHidden: false,
  1935. columnImage: false,
  1936. columnSortable: false,
  1937. sortLv: 0,
  1938. status: true,
  1939. fixed: '',
  1940. columnWidth: 80
  1941. },
  1942. {
  1943. userId: this.$store.state.user.name,
  1944. columnProp: 'cl60k-pitch',
  1945. headerAlign: 'left',
  1946. align: 'left',
  1947. columnLabel: 'CL60k-Pitch',
  1948. columnHidden: false,
  1949. columnImage: false,
  1950. columnSortable: false,
  1951. sortLv: 0,
  1952. status: true,
  1953. fixed: '',
  1954. columnWidth: 80
  1955. },
  1956. {
  1957. userId: this.$store.state.user.name,
  1958. columnProp: 'cl60k-cd',
  1959. headerAlign: 'left',
  1960. align: 'left',
  1961. columnLabel: 'CL60k-CD',
  1962. columnHidden: false,
  1963. columnImage: false,
  1964. columnSortable: false,
  1965. sortLv: 0,
  1966. status: true,
  1967. fixed: '',
  1968. columnWidth: 80
  1969. },
  1970. {
  1971. userId: this.$store.state.user.name,
  1972. columnProp: 'compositeLanes',
  1973. headerAlign: 'left',
  1974. align: 'left',
  1975. columnLabel: '复合列数',
  1976. columnHidden: false,
  1977. columnImage: false,
  1978. columnSortable: false,
  1979. sortLv: 0,
  1980. status: true,
  1981. fixed: '',
  1982. columnWidth: 50
  1983. },
  1984. {
  1985. userId: this.$store.state.user.name,
  1986. columnProp: 'labelingLanes',
  1987. headerAlign: 'left',
  1988. align: 'left',
  1989. columnLabel: '贴标列数',
  1990. columnHidden: false,
  1991. columnImage: false,
  1992. columnSortable: false,
  1993. sortLv: 0,
  1994. status: true,
  1995. fixed: '',
  1996. columnWidth: 50
  1997. },
  1998. {
  1999. userId: this.$store.state.user.name,
  2000. columnProp: 'inspectionLanes',
  2001. headerAlign: 'left',
  2002. align: 'left',
  2003. columnLabel: '检测列数',
  2004. columnHidden: false,
  2005. columnImage: false,
  2006. columnSortable: false,
  2007. sortLv: 0,
  2008. status: true,
  2009. fixed: '',
  2010. columnWidth: 50
  2011. },
  2012. {
  2013. userId: this.$store.state.user.name,
  2014. columnProp: 'finalInspection-uph',
  2015. headerAlign: 'left',
  2016. align: 'left',
  2017. columnLabel: '后道检品-UPH',
  2018. columnHidden: false,
  2019. columnImage: false,
  2020. columnSortable: false,
  2021. sortLv: 0,
  2022. status: true,
  2023. fixed: '',
  2024. columnWidth: 80
  2025. },
  2026. {
  2027. userId: this.$store.state.user.name,
  2028. columnProp: 'coding-uph',
  2029. headerAlign: 'left',
  2030. align: 'left',
  2031. columnLabel: '编码-UPH',
  2032. columnHidden: false,
  2033. columnImage: false,
  2034. columnSortable: false,
  2035. sortLv: 0,
  2036. status: true,
  2037. fixed: '',
  2038. columnWidth: 80
  2039. },
  2040. {
  2041. userId: this.$store.state.user.name,
  2042. columnProp: 'codingPrinting-uph',
  2043. headerAlign: 'left',
  2044. align: 'left',
  2045. columnLabel: '编码打印-UPH',
  2046. columnHidden: false,
  2047. columnImage: false,
  2048. columnSortable: false,
  2049. sortLv: 0,
  2050. status: true,
  2051. fixed: '',
  2052. columnWidth: 80
  2053. },
  2054. ],
  2055. partColumnList1: [
  2056. {
  2057. columnProp: 'buNo',
  2058. headerAlign: "center",
  2059. align: "center",
  2060. columnLabel: 'BU',
  2061. columnHidden: false,
  2062. columnImage: false,
  2063. columnSortable: false,
  2064. sortLv: 0,
  2065. status: true,
  2066. fixed: '',
  2067. columnWidth: 100
  2068. },
  2069. {
  2070. columnProp: 'partNo',
  2071. headerAlign: "center",
  2072. align: "center",
  2073. columnLabel: '料号',
  2074. columnHidden: false,
  2075. columnImage: false,
  2076. status: true,
  2077. fixed: '',
  2078. columnWidth: 120
  2079. },
  2080. {
  2081. columnProp: 'partDesc',
  2082. headerAlign: "center",
  2083. align: "left",
  2084. columnLabel: '物料描述',
  2085. columnHidden: false,
  2086. columnImage: false,
  2087. status: true,
  2088. fixed: '',
  2089. columnWidth: 320
  2090. },
  2091. {
  2092. columnProp: 'codeDesc',
  2093. headerAlign: "center",
  2094. align: "center",
  2095. columnLabel: '属性模板',
  2096. columnHidden: false,
  2097. columnImage: false,
  2098. status: true,
  2099. fixed: '',
  2100. columnWidth: 220
  2101. },
  2102. {
  2103. columnProp: 'nodeName',
  2104. headerAlign: "center",
  2105. align: "center",
  2106. columnLabel: '节点',
  2107. columnHidden: false,
  2108. columnImage: false,
  2109. status: true,
  2110. fixed: '',
  2111. columnWidth: 100
  2112. },
  2113. {
  2114. columnProp: 'partType2',
  2115. headerAlign: "center",
  2116. align: "center",
  2117. columnLabel: '零件类型',
  2118. columnHidden: false,
  2119. columnImage: false,
  2120. status: true,
  2121. fixed: '',
  2122. columnWidth: 130
  2123. },
  2124. {
  2125. columnProp: 'umName',
  2126. headerAlign: "center",
  2127. align: "center",
  2128. columnLabel: '计量单位',
  2129. columnHidden: false,
  2130. columnImage: false,
  2131. status: true,
  2132. fixed: '',
  2133. columnWidth: 100
  2134. },
  2135. {
  2136. columnProp: 'familyName',
  2137. headerAlign: "center",
  2138. align: "center",
  2139. columnLabel: '物料分类',
  2140. columnHidden: false,
  2141. columnImage: false,
  2142. status: true,
  2143. fixed: '',
  2144. columnWidth: 100
  2145. },
  2146. {
  2147. columnProp: 'productGroupName1',
  2148. headerAlign: "center",
  2149. align: "center",
  2150. columnLabel: '商品组1',
  2151. columnHidden: false,
  2152. columnImage: false,
  2153. status: true,
  2154. fixed: '',
  2155. columnWidth: 250
  2156. },
  2157. {
  2158. columnProp: 'productGroupName2',
  2159. headerAlign: "center",
  2160. align: "center",
  2161. columnLabel: '商品组2',
  2162. columnHidden: false,
  2163. columnImage: false,
  2164. status: true,
  2165. fixed: '',
  2166. columnWidth: 250
  2167. },
  2168. {
  2169. columnProp: 'productGroupName3',
  2170. headerAlign: "center",
  2171. align: "center",
  2172. columnLabel: '商品组3',
  2173. columnHidden: false,
  2174. columnImage: false,
  2175. status: true,
  2176. fixed: '',
  2177. columnWidth: 250
  2178. },
  2179. // {
  2180. // columnProp: 'nodeName',
  2181. // headerAlign: "center",
  2182. // align: "center",
  2183. // columnLabel: '属性模板',
  2184. // columnHidden: false,
  2185. // columnImage: false,
  2186. // status: true,
  2187. // fixed: '',
  2188. // columnWidth: 100
  2189. // },
  2190. {
  2191. columnProp: 'templateName',
  2192. headerAlign: "center",
  2193. align: "center",
  2194. columnLabel: 'BOM模板',
  2195. columnHidden: false,
  2196. columnImage: false,
  2197. status: true,
  2198. fixed: '',
  2199. columnWidth: 100
  2200. },
  2201. {
  2202. columnProp: 'engChgLevel',
  2203. headerAlign: "center",
  2204. align: "center",
  2205. columnLabel: 'BOM版本号',
  2206. columnHidden: false,
  2207. columnImage: false,
  2208. status: true,
  2209. fixed: '',
  2210. columnWidth: 100
  2211. },
  2212. {
  2213. columnProp: 'routingRevision',
  2214. headerAlign: "center",
  2215. align: "center",
  2216. columnLabel: 'Routing版本号',
  2217. columnHidden: false,
  2218. columnImage: false,
  2219. status: true,
  2220. fixed: '',
  2221. columnWidth: 100
  2222. },
  2223. {
  2224. columnProp: 'remark',
  2225. headerAlign: "center",
  2226. align: "center",
  2227. columnLabel: '备注',
  2228. columnHidden: false,
  2229. columnImage: false,
  2230. status: true,
  2231. fixed: '',
  2232. columnWidth: 200
  2233. },
  2234. ],
  2235. partColumnList2: [
  2236. {
  2237. columnProp: 'buNo',
  2238. headerAlign: "center",
  2239. align: "center",
  2240. columnLabel: 'BU',
  2241. columnHidden: false,
  2242. columnImage: false,
  2243. columnSortable: false,
  2244. sortLv: 0,
  2245. status: true,
  2246. fixed: '',
  2247. columnWidth: 100
  2248. },
  2249. {
  2250. columnProp: 'partNo',
  2251. headerAlign: "center",
  2252. align: "center",
  2253. columnLabel: '料号',
  2254. columnHidden: false,
  2255. columnImage: false,
  2256. status: true,
  2257. fixed: '',
  2258. columnWidth: 120
  2259. },
  2260. {
  2261. columnProp: 'partDesc',
  2262. headerAlign: "center",
  2263. align: "left",
  2264. columnLabel: '物料描述',
  2265. columnHidden: false,
  2266. columnImage: false,
  2267. status: true,
  2268. fixed: '',
  2269. columnWidth: 320
  2270. },
  2271. {
  2272. columnProp: 'codeDesc',
  2273. headerAlign: "center",
  2274. align: "center",
  2275. columnLabel: '属性模板',
  2276. columnHidden: false,
  2277. columnImage: false,
  2278. status: true,
  2279. fixed: '',
  2280. columnWidth: 220
  2281. },
  2282. {
  2283. columnProp: 'nodeName',
  2284. headerAlign: "center",
  2285. align: "center",
  2286. columnLabel: '节点',
  2287. columnHidden: false,
  2288. columnImage: false,
  2289. status: true,
  2290. fixed: '',
  2291. columnWidth: 100
  2292. },
  2293. {
  2294. columnProp: 'tempNo',
  2295. headerAlign: "center",
  2296. align: "center",
  2297. columnLabel: '模板',
  2298. columnHidden: false,
  2299. columnImage: false,
  2300. status: true,
  2301. fixed: '',
  2302. columnWidth: 100
  2303. },
  2304. {
  2305. columnProp: 'partType2',
  2306. headerAlign: "center",
  2307. align: "center",
  2308. columnLabel: '零件类型',
  2309. columnHidden: false,
  2310. columnImage: false,
  2311. status: true,
  2312. fixed: '',
  2313. columnWidth: 100
  2314. },
  2315. {
  2316. columnProp: 'umName',
  2317. headerAlign: "center",
  2318. align: "center",
  2319. columnLabel: '计量单位',
  2320. columnHidden: false,
  2321. columnImage: false,
  2322. status: true,
  2323. fixed: '',
  2324. columnWidth: 100
  2325. },
  2326. {
  2327. columnProp: 'familyName',
  2328. headerAlign: "center",
  2329. align: "center",
  2330. columnLabel: '物料分类',
  2331. columnHidden: false,
  2332. columnImage: false,
  2333. status: true,
  2334. fixed: '',
  2335. columnWidth: 100
  2336. },
  2337. {
  2338. columnProp: 'productGroupName1',
  2339. headerAlign: "center",
  2340. align: "center",
  2341. columnLabel: '商品组1',
  2342. columnHidden: false,
  2343. columnImage: false,
  2344. status: true,
  2345. fixed: '',
  2346. columnWidth: 250
  2347. },
  2348. {
  2349. columnProp: 'productGroupName2',
  2350. headerAlign: "center",
  2351. align: "center",
  2352. columnLabel: '商品组2',
  2353. columnHidden: false,
  2354. columnImage: false,
  2355. status: true,
  2356. fixed: '',
  2357. columnWidth: 250
  2358. },
  2359. {
  2360. columnProp: 'productGroupName3',
  2361. headerAlign: "center",
  2362. align: "center",
  2363. columnLabel: '商品组3',
  2364. columnHidden: false,
  2365. columnImage: false,
  2366. status: true,
  2367. fixed: '',
  2368. columnWidth: 250
  2369. },
  2370. // {
  2371. // columnProp: 'nodeName',
  2372. // headerAlign: "center",
  2373. // align: "center",
  2374. // columnLabel: '属性模板',
  2375. // columnHidden: false,
  2376. // columnImage: false,
  2377. // status: true,
  2378. // fixed: '',
  2379. // columnWidth: 100
  2380. // },
  2381. {
  2382. columnProp: 'templateName',
  2383. headerAlign: "center",
  2384. align: "center",
  2385. columnLabel: 'BOM模板',
  2386. columnHidden: false,
  2387. columnImage: false,
  2388. status: true,
  2389. fixed: '',
  2390. columnWidth: 100
  2391. },
  2392. {
  2393. columnProp: 'engChgLevel',
  2394. headerAlign: "center",
  2395. align: "center",
  2396. columnLabel: 'BOM版本号',
  2397. columnHidden: false,
  2398. columnImage: false,
  2399. status: true,
  2400. fixed: '',
  2401. columnWidth: 100
  2402. },
  2403. {
  2404. columnProp: 'routingRevision',
  2405. headerAlign: "center",
  2406. align: "center",
  2407. columnLabel: 'Routing版本号',
  2408. columnHidden: false,
  2409. columnImage: false,
  2410. status: true,
  2411. fixed: '',
  2412. columnWidth: 100
  2413. },
  2414. {
  2415. columnProp: 'remark',
  2416. headerAlign: "center",
  2417. align: "center",
  2418. columnLabel: '备注',
  2419. columnHidden: false,
  2420. columnImage: false,
  2421. status: true,
  2422. fixed: '',
  2423. columnWidth: 200
  2424. },
  2425. ],
  2426. partColumnList: [
  2427. {
  2428. columnProp: 'buNo',
  2429. headerAlign: "center",
  2430. align: "center",
  2431. columnLabel: 'BU',
  2432. columnHidden: false,
  2433. columnImage: false,
  2434. columnSortable: false,
  2435. sortLv: 0,
  2436. status: true,
  2437. fixed: '',
  2438. columnWidth: 100
  2439. },
  2440. {
  2441. columnProp: 'partNo',
  2442. headerAlign: "center",
  2443. align: "center",
  2444. columnLabel: '物料编码',
  2445. columnHidden: false,
  2446. columnImage: false,
  2447. columnSortable: false,
  2448. sortLv: 0,
  2449. status: true,
  2450. fixed: '',
  2451. columnWidth: 120
  2452. },
  2453. {
  2454. columnProp: 'partDesc',
  2455. headerAlign: "center",
  2456. align: "center",
  2457. columnLabel: '物料名称',
  2458. columnHidden: false,
  2459. columnImage: false,
  2460. status: true,
  2461. fixed: '',
  2462. columnWidth: 300
  2463. },
  2464. {
  2465. columnProp: 'spec',
  2466. headerAlign: "center",
  2467. align: "center",
  2468. columnLabel: '规格型号',
  2469. columnHidden: false,
  2470. columnImage: false,
  2471. status: true,
  2472. fixed: '',
  2473. columnWidth: 300
  2474. },
  2475. {
  2476. columnProp: 'printUnitName',
  2477. headerAlign: "center",
  2478. align: "center",
  2479. columnLabel: '计量单位',
  2480. columnHidden: false,
  2481. columnImage: false,
  2482. status: true,
  2483. fixed: '',
  2484. columnWidth: 100
  2485. },
  2486. {
  2487. columnProp: 'partType2',
  2488. headerAlign: "center",
  2489. align: "center",
  2490. columnLabel: '零件类型',
  2491. columnHidden: false,
  2492. columnImage: false,
  2493. status: true,
  2494. fixed: '',
  2495. columnWidth: 100
  2496. },
  2497. {
  2498. columnProp: 'yieldRate',
  2499. headerAlign: "center",
  2500. align: "right",
  2501. columnLabel: '良品率',
  2502. columnHidden: false,
  2503. columnImage: false,
  2504. status: true,
  2505. fixed: '',
  2506. columnWidth: 100
  2507. },
  2508. ],
  2509. columnItemList:[
  2510. {
  2511. userId: this.$store.state.user.name,
  2512. functionId: 601001,
  2513. serialNumber: '601001Table2PropertiesItemID',
  2514. tableId: "601001Table2",
  2515. tableName: "物料属性表",
  2516. columnProp: 'propertiesItemNo',
  2517. headerAlign: "center",
  2518. align: "center",
  2519. columnLabel: '属性编码',
  2520. columnHidden: false,
  2521. columnImage: false,
  2522. status: true,
  2523. fixed: '',
  2524. columnWidth: 200,
  2525. },
  2526. {
  2527. userId: this.$store.state.user.name,
  2528. functionId: 601001,
  2529. serialNumber: '601001Table2PropertiesItemDesc',
  2530. tableId: "601001Table2",
  2531. tableName: "物料属性表",
  2532. columnProp: 'itemDesc',
  2533. headerAlign: "center",
  2534. align: "center",
  2535. columnLabel: '属性名称',
  2536. columnHidden: false,
  2537. columnImage: false,
  2538. status: true,
  2539. fixed: '',
  2540. columnWidth: 200,
  2541. },
  2542. {
  2543. userId: this.$store.state.user.name,
  2544. functionId: 601001,
  2545. serialNumber: '601001Table2ValueType',
  2546. tableId: "601001Table2",
  2547. tableName: "物料属性表",
  2548. columnProp: 'valueType',
  2549. headerAlign: "center",
  2550. align: "center",
  2551. columnLabel: '属性类型',
  2552. columnHidden: false,
  2553. columnImage: false,
  2554. status: true,
  2555. fixed: '',
  2556. columnWidth: 240,
  2557. },
  2558. {
  2559. userId: this.$store.state.user.name,
  2560. functionId: 601001,
  2561. serialNumber: '601001Table2ValueChooseFlag',
  2562. tableId: "601001Table2",
  2563. tableName: "物料属性表",
  2564. columnProp: 'textValue',
  2565. headerAlign: "center",
  2566. align: "center",
  2567. columnLabel: '属性值',
  2568. columnHidden: false,
  2569. columnImage: false,
  2570. status: true,
  2571. fixed: '',
  2572. columnWidth: 200,
  2573. },
  2574. ],
  2575. bomComponentListColumnList: [
  2576. {
  2577. userId: this.$store.state.user.name,
  2578. functionId: 601002,
  2579. serialNumber: '601002Table2LineSequence',
  2580. tableId: '601002Table2',
  2581. tableName: 'BOM子物料表',
  2582. columnProp: 'lineSequence',
  2583. headerAlign: 'center',
  2584. align: 'center',
  2585. columnLabel: '序号',
  2586. columnHidden: false,
  2587. columnImage: false,
  2588. columnSortable: false,
  2589. sortLv: 0,
  2590. status: true,
  2591. fixed: '',
  2592. columnWidth: 50
  2593. },
  2594. {
  2595. userId: this.$store.state.user.name,
  2596. functionId: 601002,
  2597. serialNumber: '601002Table2ComponentPart',
  2598. tableId: '601002Table2',
  2599. tableName: 'BOM子物料表',
  2600. columnProp: 'componentPart',
  2601. headerAlign: 'center',
  2602. align: 'left',
  2603. columnLabel: '物料编码',
  2604. columnHidden: false,
  2605. columnImage: false,
  2606. columnSortable: false,
  2607. sortLv: 0,
  2608. status: true,
  2609. fixed: '',
  2610. columnWidth: 120
  2611. },
  2612. {
  2613. userId: this.$store.state.user.name,
  2614. functionId: 601002,
  2615. serialNumber: '601002Table2ComponentPartDesc',
  2616. tableId: '601002Table2',
  2617. tableName: 'BOM子物料表',
  2618. columnProp: 'componentPartDesc',
  2619. headerAlign: 'center',
  2620. align: 'left',
  2621. columnLabel: '物料名称',
  2622. columnHidden: false,
  2623. columnImage: false,
  2624. columnSortable: false,
  2625. sortLv: 0,
  2626. status: true,
  2627. fixed: '',
  2628. columnWidth: 300
  2629. },
  2630. {
  2631. userId: this.$store.state.user.name,
  2632. functionId: 601002,
  2633. serialNumber: '601002Table2ComponentPartDesc',
  2634. tableId: '601002Table2',
  2635. tableName: 'BOM子物料表',
  2636. columnProp: 'formula',
  2637. headerAlign: 'center',
  2638. align: 'left',
  2639. columnLabel: '计算公式',
  2640. columnHidden: false,
  2641. columnImage: false,
  2642. columnSortable: false,
  2643. sortLv: 0,
  2644. status: true,
  2645. fixed: '',
  2646. columnWidth: 300
  2647. },
  2648. {
  2649. userId: this.$store.state.user.name,
  2650. functionId: 601002,
  2651. serialNumber: '601002Table2PrintUnit',
  2652. tableId: '601002Table2',
  2653. tableName: 'BOM子物料表',
  2654. columnProp: 'printUnitName',
  2655. headerAlign: 'center',
  2656. align: 'center',
  2657. columnLabel: '物料单位',
  2658. columnHidden: false,
  2659. columnImage: false,
  2660. columnSortable: false,
  2661. sortLv: 0,
  2662. status: true,
  2663. fixed: '',
  2664. columnWidth: 100
  2665. },
  2666. {
  2667. userId: this.$store.state.user.name,
  2668. functionId: 601002,
  2669. serialNumber: '601002Table2PrintUnit',
  2670. tableId: '601002Table2',
  2671. tableName: 'BOM子物料表',
  2672. columnProp: 'qtyPerAssembly',
  2673. headerAlign: 'center',
  2674. align: 'center',
  2675. columnLabel: '单位用量',
  2676. columnHidden: false,
  2677. columnImage: false,
  2678. columnSortable: false,
  2679. sortLv: 0,
  2680. status: true,
  2681. fixed: '',
  2682. columnWidth: 100
  2683. },
  2684. {
  2685. userId: this.$store.state.user.name,
  2686. functionId: 601002,
  2687. serialNumber: '601002Table2PrintUnit',
  2688. tableId: '601002Table2',
  2689. tableName: 'BOM子物料表',
  2690. columnProp: 'shrinkageFactor',
  2691. headerAlign: 'center',
  2692. align: 'center',
  2693. columnLabel: '损耗率',
  2694. columnHidden: false,
  2695. columnImage: false,
  2696. columnSortable: false,
  2697. sortLv: 0,
  2698. status: true,
  2699. fixed: '',
  2700. columnWidth: 60
  2701. },
  2702. {
  2703. userId: this.$store.state.user.name,
  2704. functionId: 601002,
  2705. serialNumber: '601002Table2OperationNo',
  2706. tableId: '601002Table2',
  2707. tableName: 'BOM子物料表',
  2708. columnProp: 'operationNo',
  2709. headerAlign: 'center',
  2710. align: 'center',
  2711. columnLabel: '工序编码',
  2712. columnHidden: false,
  2713. columnImage: false,
  2714. columnSortable: false,
  2715. sortLv: 0,
  2716. status: true,
  2717. fixed: '',
  2718. columnWidth: 80
  2719. },
  2720. {
  2721. userId: this.$store.state.user.name,
  2722. functionId: 601002,
  2723. serialNumber: '601002Table2OperationName',
  2724. tableId: '601002Table2',
  2725. tableName: 'BOM子物料表',
  2726. columnProp: 'operationName',
  2727. headerAlign: 'center',
  2728. align: 'left',
  2729. columnLabel: '工序名称',
  2730. columnHidden: false,
  2731. columnImage: false,
  2732. columnSortable: false,
  2733. sortLv: 0,
  2734. status: true,
  2735. fixed: '',
  2736. columnWidth: 120
  2737. },
  2738. {
  2739. userId: this.$store.state.user.name,
  2740. functionId: 601002,
  2741. serialNumber: '601002Table2NoteText',
  2742. tableId: '601002Table2',
  2743. tableName: 'BOM子物料表',
  2744. columnProp: 'noteText',
  2745. headerAlign: 'center',
  2746. align: 'center',
  2747. columnLabel: '备注',
  2748. columnHidden: false,
  2749. columnImage: false,
  2750. columnSortable: false,
  2751. sortLv: 0,
  2752. status: true,
  2753. fixed: '',
  2754. columnWidth: 150
  2755. },
  2756. ],
  2757. bomComponentListColumns: [
  2758. {
  2759. userId: this.$store.state.user.name,
  2760. columnProp: 'engChgLevel',
  2761. headerAlign: 'center',
  2762. align: 'center',
  2763. columnLabel: 'BOM版本号',
  2764. columnHidden: false,
  2765. columnImage: false,
  2766. columnSortable: false,
  2767. sortLv: 0,
  2768. status: true,
  2769. fixed: '',
  2770. columnWidth: 80
  2771. },
  2772. {
  2773. userId: this.$store.state.user.name,
  2774. columnProp: 'noteText',
  2775. headerAlign: 'center',
  2776. align: 'left',
  2777. columnLabel: '备注',
  2778. columnHidden: false,
  2779. columnImage: false,
  2780. columnSortable: false,
  2781. sortLv: 0,
  2782. status: true,
  2783. fixed: '',
  2784. columnWidth: 200
  2785. },
  2786. ],
  2787. routingComponentListColumns: [
  2788. {
  2789. userId: this.$store.state.user.name,
  2790. columnProp: 'routingRevision',
  2791. headerAlign: 'center',
  2792. align: 'center',
  2793. columnLabel: 'Routing版本号',
  2794. columnHidden: false,
  2795. columnImage: false,
  2796. columnSortable: false,
  2797. sortLv: 0,
  2798. status: true,
  2799. fixed: '',
  2800. columnWidth: 100
  2801. },
  2802. {
  2803. userId: this.$store.state.user.name,
  2804. columnProp: 'noteText',
  2805. headerAlign: 'center',
  2806. align: 'left',
  2807. columnLabel: '备注',
  2808. columnHidden: false,
  2809. columnImage: false,
  2810. columnSortable: false,
  2811. sortLv: 0,
  2812. status: true,
  2813. fixed: '',
  2814. columnWidth: 200
  2815. },
  2816. ],
  2817. routingComponentListColumnList: [
  2818. {
  2819. userId: this.$store.state.user.name,
  2820. functionId: 601003,
  2821. serialNumber: '104003Table2OperationNo',
  2822. tableId: '104003Table2',
  2823. tableName: 'Routing工序表',
  2824. columnProp: 'operationNo',
  2825. headerAlign: 'center',
  2826. align: 'center',
  2827. columnLabel: '工序编码',
  2828. columnHidden: false,
  2829. columnImage: false,
  2830. columnSortable: false,
  2831. sortLv: 0,
  2832. status: true,
  2833. fixed: '',
  2834. columnWidth: 80
  2835. },
  2836. {
  2837. userId: this.$store.state.user.name,
  2838. functionId: 601003,
  2839. serialNumber: '104003Table2OperationName',
  2840. tableId: '104003Table2',
  2841. tableName: 'Routing工序表',
  2842. columnProp: 'operationName',
  2843. headerAlign: 'center',
  2844. align: 'center',
  2845. columnLabel: '工序名称',
  2846. columnHidden: false,
  2847. columnImage: false,
  2848. columnSortable: false,
  2849. sortLv: 0,
  2850. status: true,
  2851. fixed: '',
  2852. columnWidth: 120
  2853. },
  2854. {
  2855. userId: this.$store.state.user.name,
  2856. functionId: 601003,
  2857. serialNumber: '104003Table2MachCycleTime',
  2858. tableId: '104003Table2',
  2859. tableName: 'Routing工序表',
  2860. columnProp: 'machCycleTime',
  2861. headerAlign: 'center',
  2862. align: 'right',
  2863. columnLabel: '机器处理时间',
  2864. columnHidden: false,
  2865. columnImage: false,
  2866. columnSortable: false,
  2867. sortLv: 0,
  2868. status: true,
  2869. fixed: '',
  2870. columnWidth: 100
  2871. },
  2872. {
  2873. userId: this.$store.state.user.name,
  2874. functionId: 601003,
  2875. serialNumber: '104003Table2OperationName',
  2876. tableId: '104003Table2',
  2877. tableName: 'Routing工序表',
  2878. columnProp: 'formula',
  2879. headerAlign: 'center',
  2880. align: 'left',
  2881. columnLabel: '计算公式',
  2882. columnHidden: false,
  2883. columnImage: false,
  2884. columnSortable: false,
  2885. sortLv: 0,
  2886. status: true,
  2887. fixed: '',
  2888. columnWidth: 260
  2889. },
  2890. {
  2891. userId: this.$store.state.user.name,
  2892. functionId: 601003,
  2893. serialNumber: '104003Table2OperationName',
  2894. tableId: '104003Table2',
  2895. tableName: 'Routing工序表',
  2896. columnProp: 'crewSize',
  2897. headerAlign: 'center',
  2898. align: 'center',
  2899. columnLabel: '人数',
  2900. columnHidden: false,
  2901. columnImage: false,
  2902. columnSortable: false,
  2903. sortLv: 0,
  2904. status: true,
  2905. fixed: '',
  2906. columnWidth: 100
  2907. },
  2908. {
  2909. userId: this.$store.state.user.name,
  2910. functionId: 601003,
  2911. serialNumber: '104003Table2OperationName',
  2912. tableId: '104003Table2',
  2913. tableName: 'Routing工序表',
  2914. columnProp: 'refSpeed',
  2915. headerAlign: 'center',
  2916. align: 'center',
  2917. columnLabel: '速度',
  2918. columnHidden: false,
  2919. columnImage: false,
  2920. columnSortable: false,
  2921. sortLv: 0,
  2922. status: true,
  2923. fixed: '',
  2924. columnWidth: 100
  2925. },
  2926. {
  2927. userId: this.$store.state.user.name,
  2928. functionId: 601003,
  2929. serialNumber: '104003Table2OperationName',
  2930. tableId: '104003Table2',
  2931. tableName: 'Routing工序表',
  2932. columnProp: 'refTime',
  2933. headerAlign: 'center',
  2934. align: 'center',
  2935. columnLabel: '时间',
  2936. columnHidden: false,
  2937. columnImage: false,
  2938. columnSortable: false,
  2939. sortLv: 0,
  2940. status: true,
  2941. fixed: '',
  2942. columnWidth: 100
  2943. },
  2944. {
  2945. userId: this.$store.state.user.name,
  2946. functionId: 601003,
  2947. serialNumber: '104003Table2OperationName',
  2948. tableId: '104003Table2',
  2949. tableName: 'Routing工序表',
  2950. columnProp: 'refEfficiency',
  2951. headerAlign: 'center',
  2952. align: 'center',
  2953. columnLabel: '效率',
  2954. columnHidden: false,
  2955. columnImage: false,
  2956. columnSortable: false,
  2957. sortLv: 0,
  2958. status: true,
  2959. fixed: '',
  2960. columnWidth: 100
  2961. },
  2962. {
  2963. userId: this.$store.state.user.name,
  2964. functionId: 601003,
  2965. serialNumber: '104003Table2SetupCrewSize',
  2966. tableId: '104003Table2',
  2967. tableName: 'Routing工序表',
  2968. columnProp: 'setupCrewSize',
  2969. headerAlign: 'center',
  2970. align: 'right',
  2971. columnLabel: '调机过程人数',
  2972. columnHidden: false,
  2973. columnImage: false,
  2974. columnSortable: false,
  2975. sortLv: 0,
  2976. status: true,
  2977. fixed: '',
  2978. columnWidth: 100
  2979. },
  2980. {
  2981. userId: this.$store.state.user.name,
  2982. functionId: 601003,
  2983. serialNumber: '104003Table2MachRunFactor',
  2984. tableId: '104003Table2',
  2985. tableName: 'Routing工序表',
  2986. columnProp: 'machRunFactor',
  2987. headerAlign: 'center',
  2988. align: 'right',
  2989. columnLabel: '机器单位产出',
  2990. columnHidden: false,
  2991. columnImage: false,
  2992. columnSortable: false,
  2993. sortLv: 0,
  2994. status: true,
  2995. fixed: '',
  2996. columnWidth: 100
  2997. },
  2998. {
  2999. userId: this.$store.state.user.name,
  3000. functionId: 601003,
  3001. serialNumber: '104003Table2CrewSize',
  3002. tableId: '104003Table2',
  3003. tableName: 'Routing工序表',
  3004. columnProp: 'crewSize',
  3005. headerAlign: 'center',
  3006. align: 'right',
  3007. columnLabel: '生产过程人数',
  3008. columnHidden: false,
  3009. columnImage: false,
  3010. columnSortable: false,
  3011. sortLv: 0,
  3012. status: true,
  3013. fixed: '',
  3014. columnWidth: 100
  3015. },
  3016. {
  3017. userId: this.$store.state.user.name,
  3018. functionId: 601003,
  3019. serialNumber: '104003Table2LaborClassNo',
  3020. tableId: '104003Table2',
  3021. tableName: 'Routing工序表',
  3022. columnProp: 'laborClassDesc',
  3023. headerAlign: 'center',
  3024. align: 'center',
  3025. columnLabel: '人员等级',
  3026. columnHidden: false,
  3027. columnImage: false,
  3028. columnSortable: false,
  3029. sortLv: 0,
  3030. status: true,
  3031. fixed: '',
  3032. columnWidth: 120
  3033. },
  3034. {
  3035. userId: this.$store.state.user.name,
  3036. functionId: 601003,
  3037. serialNumber: '104003Table2LaborCycleTime',
  3038. tableId: '104003Table2',
  3039. tableName: 'Routing工序表',
  3040. columnProp: 'laborCycleTime',
  3041. headerAlign: 'center',
  3042. align: 'right',
  3043. columnLabel: '人工处理时间',
  3044. columnHidden: false,
  3045. columnImage: false,
  3046. columnSortable: false,
  3047. sortLv: 0,
  3048. status: true,
  3049. fixed: '',
  3050. columnWidth: 100
  3051. },
  3052. {
  3053. userId: this.$store.state.user.name,
  3054. functionId: 601003,
  3055. serialNumber: '104003Table2LaborRunFactor',
  3056. tableId: '104003Table2',
  3057. tableName: 'Routing工序表',
  3058. columnProp: 'laborRunFactor',
  3059. headerAlign: 'center',
  3060. align: 'right',
  3061. columnLabel: '人工单位产出',
  3062. columnHidden: false,
  3063. columnImage: false,
  3064. columnSortable: false,
  3065. sortLv: 0,
  3066. status: true,
  3067. fixed: '',
  3068. columnWidth: 100
  3069. },
  3070. {
  3071. userId: this.$store.state.user.name,
  3072. functionId: 601003,
  3073. serialNumber: '104003Table2EfficiencyFactor',
  3074. tableId: '104003Table2',
  3075. tableName: 'Routing工序表',
  3076. columnProp: 'efficiencyFactor',
  3077. headerAlign: 'center',
  3078. align: 'right',
  3079. columnLabel: '效率%',
  3080. columnHidden: false,
  3081. columnImage: false,
  3082. columnSortable: false,
  3083. sortLv: 0,
  3084. status: true,
  3085. fixed: '',
  3086. columnWidth: 80
  3087. },
  3088. {
  3089. userId: this.$store.state.user.name,
  3090. functionId: 601003,
  3091. serialNumber: '104003Table2WorkCenterNo',
  3092. tableId: '104003Table2',
  3093. tableName: 'Routing工序表',
  3094. columnProp: 'workCenterNo',
  3095. headerAlign: 'center',
  3096. align: 'center',
  3097. columnLabel: '加工中心编码',
  3098. columnHidden: false,
  3099. columnImage: false,
  3100. columnSortable: false,
  3101. sortLv: 0,
  3102. status: true,
  3103. fixed: '',
  3104. columnWidth: 100
  3105. },
  3106. {
  3107. userId: this.$store.state.user.name,
  3108. functionId: 601003,
  3109. serialNumber: '104003Table2NoteText',
  3110. tableId: '104003Table2',
  3111. tableName: 'Routing工序表',
  3112. columnProp: 'noteText',
  3113. headerAlign: 'center',
  3114. align: 'center',
  3115. columnLabel: '备注',
  3116. columnHidden: false,
  3117. columnImage: false,
  3118. columnSortable: false,
  3119. sortLv: 0,
  3120. status: true,
  3121. fixed: '',
  3122. columnWidth: 120
  3123. },
  3124. ],
  3125. componentPartColumnList: [
  3126. {
  3127. columnProp: 'partNo',
  3128. headerAlign: "center",
  3129. align: "center",
  3130. columnLabel: '物料编码',
  3131. columnHidden: false,
  3132. columnImage: false,
  3133. status: true,
  3134. fixed: '',
  3135. columnWidth: 120
  3136. },
  3137. {
  3138. columnProp: 'partDesc',
  3139. headerAlign: "center",
  3140. align: "center",
  3141. columnLabel: '物料名称',
  3142. columnHidden: false,
  3143. columnImage: false,
  3144. status: true,
  3145. fixed: '',
  3146. columnWidth: 300
  3147. },
  3148. {
  3149. columnProp: 'spec',
  3150. headerAlign: "center",
  3151. align: "center",
  3152. columnLabel: '规格型号',
  3153. columnHidden: false,
  3154. columnImage: false,
  3155. status: true,
  3156. fixed: '',
  3157. columnWidth: 300
  3158. },
  3159. {
  3160. columnProp: 'printUnitName',
  3161. headerAlign: "center",
  3162. align: "center",
  3163. columnLabel: '计量单位',
  3164. columnHidden: false,
  3165. columnImage: false,
  3166. status: true,
  3167. fixed: '',
  3168. columnWidth: 100
  3169. },
  3170. {
  3171. columnProp: 'partType2',
  3172. headerAlign: "center",
  3173. align: "center",
  3174. columnLabel: '零件类型',
  3175. columnHidden: false,
  3176. columnImage: false,
  3177. status: true,
  3178. fixed: '',
  3179. columnWidth: 100
  3180. }
  3181. ],
  3182. // 控制
  3183. nodeModalFlag: false,
  3184. nodeModalDisableFlag: false,
  3185. partModelFlag: false,
  3186. buildAllLoading: false,
  3187. resetAllLoading: false,
  3188. bomLoading: false,
  3189. routingLoading: false,
  3190. treeVisible: false,
  3191. addNodeFlag: true,
  3192. batchUpdateFlag: false,
  3193. attributeFlag: true,
  3194. attributeFlag1: true,
  3195. attributeFlag2: true,
  3196. fastAddFlag: false,
  3197. fastAddFlag1: false,
  3198. loading: false,
  3199. dataListLoading: false,
  3200. addItemLoading: false,
  3201. deleteItemLoading: false,
  3202. buNoQueryLoading: false,
  3203. alternativeLoading: false,
  3204. processTimeMatrixLoading: false,
  3205. bomFlag: true,
  3206. bomFlag1: true,
  3207. copyVisible: false,
  3208. copyPartModelFlag: false,
  3209. itemUpdateFlag: false,
  3210. ptmDialogVisible: false, // PTM参数选择对话框显示控制
  3211. ptmDataList: [], // PTM完整数据列表(53行,每行包含Code和12个参数列)
  3212. filteredPtmDataList: [], // PTM筛选后的数据列表
  3213. ptmColumnList: [], // PTM参数动态列配置(12个参数列)
  3214. ptmSearchCode: '', // PTM Code筛选条件
  3215. ptmItemList: [], // PTM参数列表(去重后的item列表)
  3216. selectedPtmItems: [], // 用户勾选的PTM参数
  3217. ptmProductGroupList: [], // 当前BU下所有商品组1列表
  3218. ptmSelectedProductGroupId: '', // 当前选中的商品组1ID
  3219. ptmCurrentBuNo: '' // 当前BU编号
  3220. }
  3221. },
  3222. created () {
  3223. // 按钮控制
  3224. this.getButtonAuthData()
  3225. // 校验用户是否收藏
  3226. this.favoriteIsOk()
  3227. // 获取树形结构
  3228. // this.searchData = {
  3229. // site: '2',
  3230. // buNo: '03-RFID',
  3231. // partNo: '*',
  3232. // partDesc: '***'
  3233. // }
  3234. },
  3235. mounted () {
  3236. this.$nextTick(() => {
  3237. this.height = window.innerHeight - 151
  3238. })
  3239. },
  3240. activated() {
  3241. if (this.$route.query.data) {
  3242. console.log('activated 触发 - partNoGenerated 标记:', this.partNoGenerated)
  3243. console.log('activated 触发 - 当前 partNo:', this.searchData.partNo)
  3244. console.log('activated 触发 - 路由参数 partNo:', this.$route.query.data.partNo)
  3245. console.log('activated 触发 - savedPartData:', this.savedPartData)
  3246. // 如果产品编码已通过"维护"生成,从保存的副本恢复数据
  3247. if (this.partNoGenerated && this.savedPartData) {
  3248. console.log('产品编码已生成,从 savedPartData 恢复数据:', this.savedPartData.partNo)
  3249. // 从保存的副本恢复数据
  3250. this.searchData.site = this.savedPartData.site
  3251. this.searchData.buNo = this.savedPartData.buNo
  3252. this.searchData.partNo = this.savedPartData.partNo
  3253. this.searchData.partDesc = this.savedPartData.partDesc
  3254. this.searchData.testPartId = this.savedPartData.testPartId
  3255. this.searchData.codeNo = this.savedPartData.codeNo || this.$route.query.data.partCodeNo
  3256. this.searchData.rfqDetailId = this.savedPartData.rfqDetailId || this.$route.query.data.id
  3257. console.log('恢复后的 searchData.partNo:', this.searchData.partNo)
  3258. // 刷新相关数据
  3259. this.getNodeTree();
  3260. this.getPartItem();
  3261. return
  3262. }
  3263. // 产品编码未生成时,正常从路由参数加载数据
  3264. console.log('从路由参数加载初始数据')
  3265. this.searchData = this.$route.query.data
  3266. this.searchData.partDesc = this.$route.query.data.testPartDesc
  3267. this.searchData.codeNo = this.$route.query.data.partCodeNo
  3268. this.searchData.rfqDetailId = this.$route.query.data.id
  3269. this.getNodeTree();
  3270. this.getPartItem();
  3271. }
  3272. },
  3273. methods: {
  3274. // 每页数
  3275. sizeChangeHandle2 (val) {
  3276. this.pageSize2 = val
  3277. this.pageIndex2 = 1
  3278. this.queryPartList()
  3279. },
  3280. // 当前页
  3281. currentChangeHandle2 (val) {
  3282. this.pageIndex2 = val
  3283. this.queryPartList()
  3284. },
  3285. // 查询下拉树结构
  3286. getNodeTree () {
  3287. let tempData = {
  3288. site: this.searchData.site,
  3289. mainPart: this.searchData.partNo,
  3290. rfqDetailId: this.searchData.rfqDetailId,
  3291. pId: '0'
  3292. }
  3293. getNodeTree(tempData).then(({data}) => {
  3294. if (data && data.code === 0) {
  3295. this.$set(this, 'treeData', data.rows)
  3296. }
  3297. if (this.batchUpdateFlag){
  3298. this.handleBatchUpdatePart()
  3299. }
  3300. })
  3301. },
  3302. // 新增节点
  3303. addTree () {
  3304. this.nodeData = {
  3305. flag: '1',
  3306. site: this.$store.state.user.site,
  3307. nodeId: 'NODE' + Data.now(),
  3308. nodeName: '',
  3309. pId: '0',
  3310. createBy: this.$store.state.user.name,
  3311. updateBy: this.$store.state.user.name,
  3312. mainPart: this.searchData.partNo,
  3313. rfqDetailId: this.searchData.rfqDetailId,
  3314. }
  3315. this.treeData1 = [
  3316. {
  3317. id: '0',
  3318. nodeName: '首节点',
  3319. nodeList: []
  3320. }
  3321. ]
  3322. if (Array.isArray(this.treeData) && this.treeData.length > 0) {
  3323. this.treeData1[0].nodeList = [...this.treeData]
  3324. }
  3325. this.nodeModalDisableFlag = false
  3326. this.nodeModalFlag = true
  3327. },
  3328. // 修改节点
  3329. editTreeItem (data) {
  3330. this.nodeData = {
  3331. flag: '2',
  3332. site: data.site,
  3333. nodeId: data.nodeId,
  3334. nodeName: data.nodeName,
  3335. mainPart: this.searchData.partNo,
  3336. createBy: this.$store.state.user.name,
  3337. updateBy: this.$store.state.user.name,
  3338. }
  3339. this.nodeModalDisableFlag = true
  3340. this.nodeModalFlag = true
  3341. },
  3342. // 删除节点
  3343. deleteTreeItem (data) {
  3344. this.$confirm('将删除该节点及其子节点数据!', '提示', {
  3345. confirmButtonText: '确定',
  3346. cancelButtonText: '取消',
  3347. type: 'warning'
  3348. }).then(() => {
  3349. nodeDelete(data).then(({data}) => {
  3350. if (data && data.code === 0) {
  3351. this.getNodeTree()
  3352. this.$message({
  3353. message: '操作成功',
  3354. type: 'success',
  3355. duration: 1500,
  3356. onClose: () => {}
  3357. })
  3358. } else {
  3359. this.$alert(data.msg, '错误', {
  3360. confirmButtonText: '确定'
  3361. })
  3362. }
  3363. })
  3364. })
  3365. },
  3366. // 分类新增/编辑方法
  3367. saveNodeData () {
  3368. if (this.nodeData.nodeId === '' || this.nodeData.nodeId == null) {
  3369. this.$message.warning('请输入节点编码!')
  3370. return
  3371. }
  3372. if (this.nodeData.nodeName === '' || this.nodeData.nodeName == null) {
  3373. this.$message.warning('请输入节点名称!')
  3374. return
  3375. }
  3376. if(this.nodeData.flag === '1') {
  3377. nodeSave(this.nodeData).then(({data}) => {
  3378. if (data && data.code === 0) {
  3379. this.getNodeTree()
  3380. this.nodeModalFlag = false
  3381. this.$message({
  3382. message: '操作成功',
  3383. type: 'success',
  3384. duration: 1500,
  3385. onClose: () => {}
  3386. })
  3387. } else {
  3388. this.$alert(data.msg, '错误', {
  3389. confirmButtonText: '确定'
  3390. })
  3391. }
  3392. })
  3393. } else {
  3394. nodeEdit(this.nodeData).then(({data}) => {
  3395. if (data && data.code === 0) {
  3396. this.getNodeTree()
  3397. this.nodeModalFlag = false
  3398. this.$message({
  3399. message: '操作成功',
  3400. type: 'success',
  3401. duration: 1500,
  3402. onClose: () => {}
  3403. })
  3404. } else {
  3405. this.$alert(data.msg, '错误', {
  3406. confirmButtonText: '确定'
  3407. })
  3408. }
  3409. })
  3410. }
  3411. },
  3412. // 批量build
  3413. batchBuild () {
  3414. let tempData = {
  3415. site: this.searchData.site,
  3416. mainPart: this.searchData.partNo
  3417. }
  3418. this.$confirm('将所有节点的BOM和Routing状态改为Build!', '提示', {
  3419. confirmButtonText: '确定',
  3420. cancelButtonText: '取消',
  3421. type: 'warning'
  3422. }).then(() => {
  3423. this.buildAllLoading = true
  3424. batchBuildInfo(tempData).then(({data}) => {
  3425. if (data && data.code === 0) {
  3426. this.refreshCurrentTabTable()
  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. this.buildAllLoading = false
  3439. })
  3440. })
  3441. },
  3442. // 重置节点物料
  3443. resetNodePart() {
  3444. let tempData = {
  3445. site: this.$store.state.user.site
  3446. }
  3447. this.$confirm('将重置所有节点的关联物料!', '提示', {
  3448. confirmButtonText: '确定',
  3449. cancelButtonText: '取消',
  3450. type: 'warning'
  3451. }).then(() => {
  3452. this.resetAllLoading = true
  3453. resetNodePartInfo(tempData).then(({data}) => {
  3454. if (data && data.code === 0) {
  3455. this.currentNode = {}
  3456. this.getNodeTree()
  3457. this.refreshCurrentTabTable()
  3458. this.$message({
  3459. message: '操作成功',
  3460. type: 'success',
  3461. duration: 1500,
  3462. onClose: () => {}
  3463. })
  3464. } else {
  3465. this.$alert(data.msg, '错误', {
  3466. confirmButtonText: '确定'
  3467. })
  3468. }
  3469. this.resetAllLoading = false
  3470. })
  3471. })
  3472. },
  3473. /**
  3474. * 刷新页签的table数据
  3475. */
  3476. refreshCurrentTabTable () {
  3477. if (this.activeTable === 'bom_info') {
  3478. if (this.currentNode.partNo != null && this.currentNode.partNo.length > 0) {
  3479. this.getBomInfo2(this.currentNode)
  3480. } else {
  3481. this.$nextTick(() => {
  3482. this.$refs.BomCreate.init2()
  3483. })
  3484. }
  3485. } else if (this.activeTable === 'routing_info') {
  3486. if (this.currentNode.partNo != null && this.currentNode.partNo.length > 0) {
  3487. this.getRoutingInfo(this.currentNode)
  3488. } else {
  3489. this.$nextTick(() => {
  3490. this.$refs.RoutingCreate.init2()
  3491. })
  3492. }
  3493. }
  3494. },
  3495. queryPartList2(data) {
  3496. this.partData = {
  3497. flag: '2',
  3498. site: '',
  3499. partNo: '',
  3500. partDesc: '',
  3501. nodeFlag: true,
  3502. page: 1,
  3503. limit: 10,
  3504. mainPart: this.searchData.partNo,
  3505. nodeId: this.treeData[0].nodeId,
  3506. engChgLevel: this.treeData[0].engChgLevel
  3507. }
  3508. this.currentNode = data
  3509. this.queryPartList()
  3510. },
  3511. queryPartListInfo () {
  3512. this.partData = {
  3513. flag: '1',
  3514. site: '',
  3515. partNo: '',
  3516. partDesc: '',
  3517. page: 1,
  3518. limit: 10
  3519. }
  3520. this.queryPartList3()
  3521. },
  3522. queryPartList3 () {
  3523. this.partData.limit = this.pageSize2
  3524. this.partData.page = this.pageIndex2
  3525. queryPartListBom(this.partData).then(({data}) => {
  3526. if (data && data.code === 0) {
  3527. this.partList = data.page.list
  3528. this.pageIndex2 = data.page.currPage
  3529. this.pageSize2 = data.page.pageSize
  3530. this.totalPage2 = data.page.totalCount
  3531. this.partModelFlag = true
  3532. } else {
  3533. this.partList = []
  3534. }
  3535. })
  3536. },
  3537. // 查询物料
  3538. queryPartList () {
  3539. this.partData.limit = this.pageSize2
  3540. this.partData.page = this.pageIndex2
  3541. this.partData.site = this.nodeData.site
  3542. queryPartListBom(this.partData).then(({data}) => {
  3543. if (data && data.code === 0) {
  3544. this.partList = data.page.list
  3545. this.pageIndex2 = data.page.currPage
  3546. this.pageSize2 = data.page.pageSize
  3547. this.totalPage2 = data.page.totalCount
  3548. this.partModelFlag = true
  3549. } else {
  3550. this.partList = []
  3551. }
  3552. })
  3553. },
  3554. // 双击选中物料
  3555. getRowData (row) {
  3556. if (this.partData.flag === '1') {
  3557. this.getInfoByBomTemplate(row)
  3558. } else {
  3559. this.toPartModule(row)
  3560. }
  3561. },
  3562. // 获取物料的Bom模板详情
  3563. async getInfoByBomTemplate (row) {
  3564. console.log('getInfoByBomTemplate 接收到的 row:', row)
  3565. this.searchData.site = row.site
  3566. this.searchData.buNo = row.buNo
  3567. this.searchData.partNo = row.partNo
  3568. this.searchData.partDesc = row.partDesc
  3569. this.searchData.testPartId = row.id
  3570. // 标记产品编码已生成(从 * 变成实际编码)并保存数据副本
  3571. if (row.partNo && row.partNo !== '*') {
  3572. this.partNoGenerated = true
  3573. // 保存完整的产品数据副本,用于页签切换时恢复
  3574. this.savedPartData = {
  3575. site: row.site,
  3576. buNo: row.buNo,
  3577. partNo: row.partNo,
  3578. partDesc: row.partDesc,
  3579. testPartId: row.id,
  3580. rfqDetailId: this.searchData.rfqDetailId
  3581. }
  3582. console.log('设置 partNoGenerated = true,保存的数据:', this.savedPartData)
  3583. }
  3584. console.log('更新后的 searchData.partNo:', this.searchData.partNo)
  3585. await this.getNodeTree()
  3586. let tempData = {
  3587. site: this.$store.state.user.site,
  3588. buNo: this.searchData.buNo,
  3589. partNo: this.searchData.partNo,
  3590. codeNo: this.searchData.codeNo
  3591. }
  3592. await partInfoByMainPart(tempData).then(({data}) => {
  3593. if (data && data.code === 0){
  3594. this.$set(this, 'partList1', data.rows)
  3595. this.searchData.codeNo = this.partList1[0].codeNo
  3596. // 同步更新保存的数据
  3597. if (this.savedPartData) {
  3598. this.savedPartData.codeNo = this.partList1[0].codeNo
  3599. }
  3600. }
  3601. })
  3602. this.getPartItem();
  3603. this.partModelFlag = false
  3604. },
  3605. // 到物料编辑组件
  3606. toPartModule (row) {
  3607. let tempData = {
  3608. site: row.site,
  3609. buNo: row.buNo,
  3610. mainPart: this.searchData.partNo,
  3611. partNo: row.partNo,
  3612. bomType: 'Manufacturing',
  3613. partDesc: row.partDesc,
  3614. printUnit: row.printUnit,
  3615. printUnitName: row.printUnitName,
  3616. shrinkageFactor: new Decimal(100).sub(new Decimal(row.yieldRate)).toNumber(),
  3617. nodeId: this.currentNode.nodeId,
  3618. offFlag: '1'
  3619. }
  3620. //打开组件 去做新增业务
  3621. this.$nextTick(() => {
  3622. this.$refs.BomCreate.init(tempData)
  3623. })
  3624. this.partModelFlag = false
  3625. },
  3626. // 新增物料
  3627. addPartModal (data) {
  3628. this.currentNode = data
  3629. //打开组件 去做新增业务
  3630. this.$nextTick(() => {
  3631. this.$refs.PartCreate.init()
  3632. })
  3633. },
  3634. // 维护
  3635. updatePartModal () {
  3636. if (this.searchData.partNo === '' || this.searchData.partNo == null) {
  3637. this.$message.warning('请选择产品!')
  3638. return
  3639. }
  3640. let templateData = {
  3641. site: this.searchData.site,
  3642. buNo: this.searchData.buNo,
  3643. partNo: this.searchData.partNo,
  3644. partDesc: this.searchData.partDesc
  3645. }
  3646. //打开组件 去做编辑业务
  3647. this.$nextTick(() => {
  3648. this.$refs.PartCreate.updateModal(templateData)
  3649. })
  3650. },
  3651. // 根据物料获取BOM信息
  3652. getBomInfo (row) {
  3653. let tempData = {
  3654. site: row.site,
  3655. buNo: row.buNo,
  3656. mainPart: this.searchData.partNo,
  3657. partNo: row.partNo,
  3658. partDesc: row.partDesc,
  3659. printUnit: row.umId2,
  3660. printUnitName: row.umName,
  3661. bomType: 'Manufacturing',
  3662. nodeId: this.currentNode.nodeId,
  3663. offFlag: '1'
  3664. }
  3665. //打开组件 去做新增业务
  3666. this.$nextTick(() => {
  3667. this.$refs.BomCreate.init(tempData)
  3668. })
  3669. },
  3670. // 根据物料获取Routing信息
  3671. getRoutingInfo (row) {
  3672. this.routingLoading = true
  3673. let tempData = {
  3674. site: row.site,
  3675. buNo: row.buNo,
  3676. partNo: row.partNo,
  3677. partDesc: row.partDesc,
  3678. printUnit: row.printUnit,
  3679. printUnitName: row.printUnitName,
  3680. routingType: 'Manufacturing',
  3681. }
  3682. //打开组件 去做新增业务
  3683. this.$nextTick(() => {
  3684. this.$refs.RoutingCreate.init(tempData)
  3685. })
  3686. },
  3687. // 树节点单机事件
  3688. handleNodeClick (e, node) {
  3689. this.currentNode = e
  3690. if (e.partNo != null && e.partNo.length > 0) {
  3691. if (this.activeTable === 'routing_info') {
  3692. this.getRoutingInfo(e)
  3693. } else {
  3694. this.getBomInfo2(e)
  3695. }
  3696. } else {
  3697. if (this.activeTable === 'routing_info') {
  3698. this.$nextTick(() => {
  3699. this.$refs.RoutingCreate.init2()
  3700. })
  3701. } else {
  3702. this.$nextTick(() => {
  3703. this.$refs.BomCreate.init2()
  3704. })
  3705. }
  3706. }
  3707. },
  3708. // 根据物料获取BOM信息
  3709. getBomInfo2 (row) {
  3710. this.bomLoading = true
  3711. let tempData = {
  3712. site: row.site,
  3713. buNo: row.buNo,
  3714. mainPart: this.searchData.partNo,
  3715. partNo: row.partNo,
  3716. partDesc: row.partDesc,
  3717. printUnit: row.printUnit,
  3718. printUnitName: row.printUnitName,
  3719. processUnit: row.processUnit,
  3720. bomType: 'Manufacturing',
  3721. nodeId: this.currentNode.nodeId,
  3722. offFlag: '2'
  3723. }
  3724. //打开组件 去做新增业务
  3725. this.$nextTick(() => {
  3726. this.$refs.BomCreate.init(tempData)
  3727. })
  3728. },
  3729. // 刷新BOM的loading
  3730. refreshBomLoading () {
  3731. this.bomLoading = false
  3732. },
  3733. // 刷新Routing的loading
  3734. refreshRoutingLoading () {
  3735. this.routingLoading = false
  3736. },
  3737. // 刷新节点列表
  3738. refreshNode (partNo) {
  3739. this.getNodeTree()
  3740. this.currentNode.partNo = partNo
  3741. },
  3742. // 获取基础数据列表S
  3743. getBaseList (val, type) {
  3744. this.tagNo = val
  3745. this.$nextTick(() => {
  3746. let strVal = ''
  3747. if (val === 215) {
  3748. strVal = this.componentData.issueToLoc
  3749. }
  3750. this.$refs.baseList.init(val, strVal)
  3751. })
  3752. },
  3753. // 列表方法的回调
  3754. getBaseData (val) {
  3755. if (this.tagNo === 215) {
  3756. this.componentData.issueToLoc = val.location_id
  3757. this.componentData.issueToLocName = val.location_name
  3758. }
  3759. },
  3760. // 回车事件
  3761. focusNextInput (index, type) {
  3762. let aaa = ''
  3763. if (this.subDetailList.length - 1 === index) {
  3764. aaa = `${type}0`
  3765. } else {
  3766. aaa = `${type}${index + 1}`
  3767. }
  3768. this.$nextTick(() => {
  3769. this.$refs[aaa].focus()
  3770. })
  3771. },
  3772. // 校验用户是否收藏
  3773. favoriteIsOk () {
  3774. let userFavorite = {
  3775. userId: this.$store.state.user.id,
  3776. languageCode: this.$i18n.locale
  3777. }
  3778. userFavoriteList(userFavorite).then(({data}) => {
  3779. for (let i = 0; i < data.list.length; i++) {
  3780. if (this.$route.meta.menuId === data.list[i].menuId) {
  3781. this.favorite = true
  3782. }
  3783. }
  3784. })
  3785. },
  3786. updateInquiryDetailStatus () {
  3787. let inData = {
  3788. id: this.searchData.id,
  3789. testPartId: this.searchData.testPartId,
  3790. testPartDesc: this.searchData.partDesc,
  3791. partBomStatus: this.searchData.partBomStatus,
  3792. updateBy: this.$store.state.user.name,
  3793. }
  3794. this.$confirm('是否确认完成?', '提示', {
  3795. confirmButtonText: '确定',
  3796. cancelButtonText: '取消',
  3797. type: 'warning'
  3798. }).then(() => {
  3799. updateInquiryDetailStatusAndPart(inData).then(({data}) => {
  3800. if (data && data.code === 0) {
  3801. this.$message({
  3802. message: '操作成功',
  3803. type: 'success'
  3804. })
  3805. EventBus.$emit('refreshInquiryOneDetail1')
  3806. EventBus.$emit('refreshInquiryOneDetail2')
  3807. } else {
  3808. this.$alert(data.msg, '错误', {
  3809. confirmButtonText: '确定'
  3810. })
  3811. }
  3812. })
  3813. })
  3814. },
  3815. // 收藏 OR 取消收藏
  3816. favoriteFunction() {
  3817. let userFavorite = {
  3818. userId: this.$store.state.user.id,
  3819. functionId: this.$route.meta.menuId,
  3820. }
  3821. if (this.favorite) {
  3822. removeUserFavorite(userFavorite).then(({data}) => {
  3823. this.$message.success(data.msg)
  3824. this.favorite = false
  3825. })
  3826. } else {
  3827. // 收藏
  3828. saveUserFavorite(userFavorite).then(({data}) => {
  3829. this.$message.success(data.msg)
  3830. this.favorite = true
  3831. })
  3832. }
  3833. },
  3834. //获取按钮的权限数据
  3835. getButtonAuthData () {
  3836. let searchFlag = this.isAuth(this.menuId+":search")
  3837. let saveFlag = this.isAuth(this.menuId+":save")
  3838. let updateFlag = this.isAuth(this.menuId+":update")
  3839. let deleteFlag = this.isAuth(this.menuId+":delete")
  3840. //处理页面的权限数据
  3841. this.authSearch = !searchFlag
  3842. this.authSave = !saveFlag
  3843. this.authUpdate = !updateFlag
  3844. this.authDelete = !deleteFlag
  3845. },
  3846. nodeListTreeCurrentChangeHandle (data, node) {
  3847. this.nodeData.pId = data.id
  3848. this.nodeData.parentNodeName = data.nodeName
  3849. this.treeVisible = false
  3850. },
  3851. getPartItem() {
  3852. let tempData = {
  3853. site: this.$store.state.user.site,
  3854. buNo: this.searchData.buNo,
  3855. partNo: this.searchData.partNo,
  3856. codeNo: this.searchData.codeNo,
  3857. recordType: 'IP'
  3858. }
  3859. this.dataListLoading = true
  3860. getPartItem(tempData).then(({data}) => {
  3861. this.dataList = [{}]
  3862. if (data && data.code === 0 && data.rows.length > 0) {
  3863. for (let i = 0; i < data.rows.length; i++) {
  3864. const itemDesc = data.rows[i].itemDesc;
  3865. const value = data.rows[i].numValue ? data.rows[i].numValue : data.rows[i].textValue;
  3866. switch (itemDesc) {
  3867. case 'Family1':
  3868. this.$set(this.dataList[0], 'family1', value);
  3869. break;
  3870. case 'Family2':
  3871. this.$set(this.dataList[0], 'family2', value);
  3872. break;
  3873. case 'Bonding Pitch':
  3874. this.$set(this.dataList[0], 'bondingPitch', value);
  3875. break;
  3876. case '绑定列数':
  3877. this.$set(this.dataList[0], 'bondingLanes', value);
  3878. break;
  3879. case 'Printing lanes':
  3880. this.$set(this.dataList[0], 'printingLanes', value);
  3881. break;
  3882. case 'UPH-TAL':
  3883. this.$set(this.dataList[0], 'uph-tal', value);
  3884. break;
  3885. case 'UPH-Paris':
  3886. this.$set(this.dataList[0], 'uph-paris', value);
  3887. break;
  3888. case 'CL60k-UP':
  3889. this.$set(this.dataList[0], 'cl60k-up', value);
  3890. break;
  3891. case 'CL60k-Pitch':
  3892. this.$set(this.dataList[0], 'cl60k-pitch', value);
  3893. break;
  3894. case 'CL60k-CD':
  3895. this.$set(this.dataList[0], 'cl60k-cd', value);
  3896. break;
  3897. case '复合列数':
  3898. this.$set(this.dataList[0], 'compositeLanes', value);
  3899. break;
  3900. case '贴标列数':
  3901. this.$set(this.dataList[0], 'labelingLanes', value);
  3902. break;
  3903. case '检测列数':
  3904. this.$set(this.dataList[0], 'inspectionLanes', value);
  3905. break;
  3906. case '后道检品-UPH':
  3907. this.$set(this.dataList[0], 'finalInspection-uph', value);
  3908. break;
  3909. case '编码-UPH':
  3910. this.$set(this.dataList[0], 'coding-uph', value);
  3911. break;
  3912. case '编码打印-UPH':
  3913. this.$set(this.dataList[0], 'codingPrinting-uph', value);
  3914. break;
  3915. }
  3916. }
  3917. this.$forceUpdate()
  3918. } else {
  3919. this.dataList = [{}]
  3920. }
  3921. this.dataListLoading = false
  3922. })
  3923. },
  3924. getPartItem1 () {
  3925. let tempData = {
  3926. site: this.partCurrentRow.site,
  3927. buNo: this.partCurrentRow.buNo,
  3928. partNo: this.partCurrentRow.partNo,
  3929. codeNo: this.partCurrentRow.codeNo,
  3930. recordType: 'IP'
  3931. }
  3932. getPartItem(tempData).then(({data}) => {
  3933. if (data && data.code === 0) {
  3934. this.partItemList = data.rows
  3935. } else {
  3936. this.partItemList = []
  3937. }
  3938. })
  3939. },
  3940. getPartItem2 () {
  3941. let tempData = {
  3942. site: this.partList1[0].site,
  3943. buNo: this.partList1[0].buNo,
  3944. partNo: this.partList1[0].partNo,
  3945. codeNo: this.partList1[0].codeNo,
  3946. recordType: 'IP'
  3947. }
  3948. getPartItem(tempData).then(({data}) => {
  3949. if (data && data.code === 0) {
  3950. this.partItemList1 = data.rows
  3951. } else {
  3952. this.partItemList1 = []
  3953. }
  3954. })
  3955. },
  3956. getRevisionInfo(){
  3957. if (this.partCurrentRow.partNo!==null&&this.partCurrentRow.partNo.length>0){
  3958. let tempData = {
  3959. site: this.partCurrentRow.site,
  3960. buNo: this.partCurrentRow.buNo,
  3961. mainPart: this.searchData.partNo,
  3962. partNo: this.partCurrentRow.partNo,
  3963. partDesc: this.partCurrentRow.partDesc,
  3964. printUnit: this.partCurrentRow.umId2,
  3965. printUnitName: this.partCurrentRow.umName,
  3966. bomType: 'Manufacturing',
  3967. routingType: 'Manufacturing',
  3968. nodeId: this.partCurrentRow.nodeId,
  3969. offFlag: '2'
  3970. }
  3971. this.$nextTick(() => {
  3972. getBomInformationListByPartNo(tempData).then(({data}) => {
  3973. if (data && data.code === 0) {
  3974. this.bomComponentList = []
  3975. this.bomComponentPartList = []
  3976. if (data.rows.length > 0) {
  3977. data.rows = data.rows.filter(item => item.partNo!==null&&item.partNo.length>0)
  3978. if (data.rows.length > 0) {
  3979. for (let i = 0; i < data.rows.length; i++) {
  3980. this.$set(data.rows[i], 'index', i)
  3981. this.$set(this.bomComponentList, i, data.rows[i])
  3982. this.queryBomDetail(data.rows[i])
  3983. }
  3984. }
  3985. }
  3986. } else {
  3987. this.$alert(data.msg, '提示', {
  3988. confirmButtonText: '确定'
  3989. })
  3990. }
  3991. })
  3992. getRoutingInformationListByPartNo(tempData).then(({data}) => {
  3993. if (data && data.code === 0) {
  3994. this.routingComponentList = []
  3995. this.routingComponentPartList = []
  3996. if (data.rows.length > 0) {
  3997. data.rows = data.rows.filter(item => item.partNo!==null&&item.partNo.length>0)
  3998. if (data.rows.length > 0) {
  3999. for (let i = 0; i < data.rows.length; i++) {
  4000. this.$set(data.rows[i], 'index', i)
  4001. this.$set(this.routingComponentList, i, data.rows[i])
  4002. this.queryRoutingDetail(data.rows[i])
  4003. }
  4004. }
  4005. }
  4006. } else {
  4007. this.$alert(data.msg, '提示', {
  4008. confirmButtonText: '确定'
  4009. })
  4010. }
  4011. })
  4012. })
  4013. }
  4014. },
  4015. getRevisionInfo1(row){
  4016. let tempData = {
  4017. site: row.site,
  4018. buNo: row.buNo,
  4019. mainPart: this.searchData.partNo,
  4020. partNo: row.partNo,
  4021. partDesc: row.partDesc,
  4022. printUnit: row.umId2,
  4023. printUnitName: row.umName,
  4024. bomType: 'Manufacturing',
  4025. routingType: 'Manufacturing',
  4026. offFlag: '2'
  4027. }
  4028. this.$nextTick(() => {
  4029. getBomInformationListByPartNo(tempData).then(({data}) => {
  4030. if (data && data.code === 0) {
  4031. this.bomComponentList1 = []
  4032. this.bomComponentPartList1 = []
  4033. if (data.rows.length > 0) {
  4034. data.rows = data.rows.filter(item => item.partNo!==null&&item.partNo.length>0)
  4035. if (data.rows.length > 0) {
  4036. for (let i = 0; i < data.rows.length; i++) {
  4037. this.$set(data.rows[i], 'index', i)
  4038. this.$set(this.bomComponentList1, i, data.rows[i])
  4039. this.queryBomDetail1(data.rows[i])
  4040. }
  4041. }
  4042. }
  4043. } else {
  4044. this.$alert(data.msg, '提示', {
  4045. confirmButtonText: '确定'
  4046. })
  4047. }
  4048. })
  4049. getRoutingInformationListByPartNo(tempData).then(({data}) => {
  4050. if (data && data.code === 0) {
  4051. this.routingComponentList1 = []
  4052. this.routingComponentPartList1 = []
  4053. if (data.rows.length > 0) {
  4054. data.rows = data.rows.filter(item => item.partNo!==null&&item.partNo.length>0)
  4055. if (data.rows.length > 0) {
  4056. for (let i = 0; i < data.rows.length; i++) {
  4057. this.$set(data.rows[i], 'index', i)
  4058. this.$set(this.routingComponentList1, i, data.rows[i])
  4059. this.queryRoutingDetail1(data.rows[i])
  4060. }
  4061. }
  4062. }
  4063. } else {
  4064. this.$alert(data.msg, '提示', {
  4065. confirmButtonText: '确定'
  4066. })
  4067. }
  4068. })
  4069. })
  4070. },
  4071. handleBatchUpdatePart(){
  4072. if(this.treeData.length===0){
  4073. this.$message.warning('请先维护主物料的BOM模板!')
  4074. return
  4075. }
  4076. let tempData = {
  4077. site: this.$store.state.user.site,
  4078. buNo: this.searchData.buNo,
  4079. partNo: this.searchData.partNo,
  4080. codeNo: this.searchData.codeNo
  4081. }
  4082. partInfoByMainPart(tempData).then(({data}) => {
  4083. if (data && data.code === 0){
  4084. this.$set(this, 'partList1', data.rows)
  4085. this.searchData.codeNo = this.partList1[0].codeNo
  4086. this.partCurrentRow = JSON.parse(JSON.stringify(this.partList1[0]))
  4087. let tempList = []
  4088. tempList.push(
  4089. ["Select code_no as fieldname1, code_desc as caption1 from plm_properties_model_header where function_type = 'IP' and active = 'Y' and (code_no like '%%' OR code_desc like '%%' ) and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+this.searchData.buNo+"'"]
  4090. )
  4091. getChooselist1(tempList).then(({data}) => {
  4092. this.$set(this, 'codeList', data.list[0][0])
  4093. })
  4094. let tempData1 = {
  4095. username: this.$store.state.user.name,
  4096. }
  4097. getSiteAndBuByUserName(tempData1).then(({data}) => {
  4098. if (data&&data.code === 0) {
  4099. this.userBuList = data.rows.sort((a, b) => {
  4100. return a.buNo.split('_')[1].localeCompare(b.buNo.split('_')[1]);
  4101. });
  4102. }
  4103. })
  4104. this.getTemplateList()
  4105. this.getPartItem2()
  4106. this.getBomAndRoutingRevision()
  4107. this.batchUpdateFlag = true
  4108. }else {
  4109. this.$alert(data.msg, '错误', {
  4110. confirmButtonText: '确定'
  4111. })
  4112. }
  4113. })
  4114. },
  4115. addOrDelItem () {
  4116. if (!this.attributeFlag1) {
  4117. this.$message.warning('请保存更改!')
  4118. return
  4119. }
  4120. this.itemSelections1 = null
  4121. this.itemSelections2 = null
  4122. this.itemData.propertiesItemNo = ''
  4123. this.itemData.itemDesc = ''
  4124. let tempData = {
  4125. site: this.partCurrentRow.site,
  4126. buNo: this.partCurrentRow.buNo,
  4127. partNo: this.partCurrentRow.partNo,
  4128. codeNo: this.partCurrentRow.codeNo||this.searchData.codeNo,
  4129. recordType: 'IP'
  4130. }
  4131. getItemLists(tempData).then(({data}) => {
  4132. this.itemList1 = data.row1
  4133. this.itemList2 = data.row2
  4134. })
  4135. this.fastAddFlag = true
  4136. },
  4137. addOrDelItem1 () {
  4138. if (!this.attributeFlag1) {
  4139. this.$message.warning('请保存更改!')
  4140. return
  4141. }
  4142. this.itemSelections1 = null
  4143. this.itemSelections2 = null
  4144. this.itemData.propertiesItemNo = ''
  4145. this.itemData.itemDesc = ''
  4146. let tempData = {
  4147. site: this.partList1[0].site,
  4148. buNo: this.partList1[0].buNo,
  4149. partNo: this.partList1[0].partNo,
  4150. codeNo: this.partList1[0].codeNo,
  4151. recordType: 'IP'
  4152. }
  4153. getItemLists(tempData).then(({data}) => {
  4154. this.itemList1 = data.row1
  4155. this.itemList2 = data.row2
  4156. })
  4157. this.fastAddFlag1 = true
  4158. },
  4159. clickSave1 () {
  4160. if (!this.attributeFlag1) { // 保存
  4161. this.updateItemValue1()
  4162. this.attributeFlag1 = true
  4163. } else { // 编辑
  4164. this.copyAttributeList = JSON.parse(JSON.stringify(this.partItemList1))
  4165. this.attributeFlag1 = false
  4166. }
  4167. },
  4168. clickSave () {
  4169. if (!this.attributeFlag1) { // 保存
  4170. this.updateItemValue()
  4171. this.attributeFlag1 = true
  4172. } else { // 编辑
  4173. this.copyAttributeList = JSON.parse(JSON.stringify(this.partItemList))
  4174. this.attributeFlag1 = false
  4175. }
  4176. },
  4177. // 列表表格选择替换
  4178. tabClick (tab, event) {
  4179. this.refreshCurrentTabTable1()
  4180. },
  4181. tabLeave (activeName, oldActiveName) {
  4182. if (!this.attributeFlag1) {
  4183. this.$message.warning('请先保存当前编辑的内容!')
  4184. return false
  4185. }
  4186. return true
  4187. },
  4188. // 刷新页签的table数据
  4189. refreshCurrentTabTable1 () {
  4190. if (this.inventoryPartTable === 'part_item') {
  4191. this.getPartItem2()
  4192. } else if (this.inventoryPartTable === 'part_item1') {
  4193. this.getPartItem1()
  4194. } else if (this.inventoryPartTable === 'revision_info') {
  4195. this.getRevisionInfo()
  4196. }
  4197. },
  4198. // 查询物料属性
  4199. queryPartItem () {
  4200. this.itemData.codeNo = this.modalData.codeNo
  4201. this.itemData.partNo = this.modalData.partNo
  4202. queryPartItem(this.itemData).then(({data}) => {
  4203. if (data && data.code === 0) {
  4204. this.itemList1 = data.rows
  4205. } else {
  4206. this.itemList1 = []
  4207. }
  4208. })
  4209. },
  4210. // 可选属性
  4211. itemClickRow1 (row) {
  4212. this.$refs.itemTable1.toggleRowSelection(row)
  4213. },
  4214. // 复选属性
  4215. selectionItem1 (val) {
  4216. this.itemSelections1 = val
  4217. },
  4218. // 已有属性
  4219. itemClickRow2 (row) {
  4220. this.$refs.itemTable2.toggleRowSelection(row)
  4221. },
  4222. // 复选属性
  4223. selectionItem2 (val) {
  4224. this.itemSelections2 = val
  4225. },
  4226. updateItemValue1 () {
  4227. this.loading = true
  4228. let list = []
  4229. for (let i = 0; i <this.partList1.length; i++) {
  4230. if (this.partList1[i].partNo&&this.partList1.partNo!==''&&this.partList1[i].buNo && this.partList1[i].buNo === this.searchData.buNo){
  4231. let items = JSON.parse(JSON.stringify(this.partItemList1))
  4232. for (let j = 0; j < this.partItemList1.length; j++) {
  4233. items[j].site = this.partList1[i].site
  4234. items[j].buNo = this.partList1[i].buNo
  4235. items[j].partNo = this.partList1[i].partNo
  4236. items[j].codeNo = this.partList1[i].codeNo
  4237. items[j].recordType = 'IP'
  4238. }
  4239. list.push({
  4240. site: this.partList1[i].site,
  4241. buNo: this.partList1[i].buNo,
  4242. partNo: this.partList1[i].partNo,
  4243. codeNo: this.partList1[i].codeNo,
  4244. recordType: 'IP',
  4245. itemList: items
  4246. })
  4247. }
  4248. }
  4249. commitItemsValue(list).then(({data}) => {
  4250. if (data && data.code === 0) {
  4251. this.getPartItem2()
  4252. this.loading = false
  4253. this.attributeFlag1 = true
  4254. this.$message({
  4255. message: '操作成功',
  4256. type: 'success',
  4257. duration: 1500,
  4258. onClose: () => {}
  4259. })
  4260. } else {
  4261. this.$alert(data.msg, '错误', {
  4262. confirmButtonText: '确定'
  4263. })
  4264. this.attributeFlag1 = true
  4265. this.loading = false
  4266. }
  4267. }).catch((error) => {
  4268. this.attributeFlag1 = true
  4269. this.$set(this, 'loading', false)
  4270. this.$message.error(error)
  4271. })
  4272. },
  4273. updateItemValue () {
  4274. this.loading = true
  4275. let tempData = {
  4276. itemList: JSON.parse(JSON.stringify(this.partItemList))
  4277. }
  4278. commitItemValue(tempData).then(({data}) => {
  4279. if (data && data.code === 0) {
  4280. this.getPartItem1()
  4281. this.loading = false
  4282. this.attributeFlag1 = true
  4283. this.$message({
  4284. message: '操作成功',
  4285. type: 'success',
  4286. duration: 1500,
  4287. onClose: () => {}
  4288. })
  4289. } else {
  4290. this.$alert(data.msg, '错误', {
  4291. confirmButtonText: '确定'
  4292. })
  4293. }
  4294. }).catch((error) => {
  4295. this.$set(this, 'loading', false)
  4296. this.$message.error(error)
  4297. })
  4298. },
  4299. // 物料项目新增
  4300. addItem () {
  4301. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  4302. this.$message.warning('请选择可选属性!')
  4303. return
  4304. }
  4305. let inData = {
  4306. site: this.partCurrentRow.site,
  4307. buNo: this.partCurrentRow.buNo,
  4308. partNo: this.partCurrentRow.partNo,
  4309. codeNo: this.partCurrentRow.codeNo,
  4310. codeDesc: this.partCurrentRow.codeDesc,
  4311. recordType: 'IP',
  4312. itemList: this.itemSelections1
  4313. }
  4314. addPartItem(inData).then(({data}) => {
  4315. if (data && data.code === 0) {
  4316. getItemLists(inData).then(({data}) => {
  4317. this.itemList1 = data.row1
  4318. this.itemList2 = data.row2
  4319. })
  4320. this.getPartItem1()
  4321. this.itemSelections1 = []
  4322. } else {
  4323. this.$alert(data.msg, '错误', {
  4324. confirmButtonText: '确定'
  4325. })
  4326. }
  4327. })
  4328. },
  4329. addItem1 () {
  4330. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  4331. this.$message.warning('请选择可选属性!')
  4332. return
  4333. }
  4334. let partList = this.partList1.filter(item => item.partNo&&item.partNo!==''&&item.buNo && item.buNo === this.searchData.buNo)
  4335. this.addItemLoading = true
  4336. let inDataList = []
  4337. for (let i = 0; i < partList.length; i++){
  4338. if (!partList[i].codeNo||partList[i].codeNo===''){
  4339. continue
  4340. }
  4341. inDataList.push({
  4342. site: partList[i].site,
  4343. buNo: partList[i].buNo,
  4344. partNo: partList[i].partNo,
  4345. codeNo: partList[i].codeNo,
  4346. codeDesc: partList[i].codeDesc,
  4347. recordType: 'IP',
  4348. itemList: this.itemSelections1
  4349. })
  4350. }
  4351. addPartsItem(inDataList).then(({data}) => {
  4352. if (data && data.code === 0) {
  4353. getItemLists(inDataList[0]).then(({data}) => {
  4354. this.itemList1 = data.row1
  4355. this.itemList2 = data.row2
  4356. this.addItemLoading = false
  4357. this.getPartItem2()
  4358. })
  4359. this.itemSelections1 = []
  4360. } else {
  4361. this.addItemLoading = false
  4362. this.$alert(data.msg, '错误', {
  4363. confirmButtonText: '确定'
  4364. })
  4365. }
  4366. }).catch((error) => {
  4367. this.addItemLoading = false
  4368. this.$message.error(error)
  4369. })
  4370. },
  4371. // 物料项目删除
  4372. deleteItem () {
  4373. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  4374. this.$alert("请选择已有属性!", '提示', {
  4375. confirmButtonText: '确定'
  4376. })
  4377. return false
  4378. }
  4379. let inData = {
  4380. site: this.partCurrentRow.site,
  4381. buNo: this.partCurrentRow.buNo,
  4382. partNo: this.partCurrentRow.partNo,
  4383. codeNo: this.partCurrentRow.codeNo,
  4384. codeDesc: this.partCurrentRow.codeDesc,
  4385. recordType: 'IP',
  4386. itemList: this.itemSelections2
  4387. }
  4388. deletePartItem(inData).then(({data}) => {
  4389. if (data && data.code === 0) {
  4390. getItemLists(inData).then(({data}) => {
  4391. this.itemList1 = data.row1
  4392. this.itemList2 = data.row2
  4393. })
  4394. this.getPartItem1()
  4395. this.itemSelections2 = []
  4396. } else {
  4397. this.$alert(data.msg, '错误', {
  4398. confirmButtonText: '确定'
  4399. })
  4400. }
  4401. })
  4402. },
  4403. // 物料项目删除
  4404. deleteItem1 () {
  4405. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  4406. this.$alert("请选择已有属性!", '提示', {
  4407. confirmButtonText: '确定'
  4408. })
  4409. return false
  4410. }
  4411. let partList = this.partList1.filter(item => item.partNo&&item.partNo!==''&&item.buNo && item.buNo === this.searchData.buNo)
  4412. let inDataList = []
  4413. for (let i = 0; i < partList.length; i++){
  4414. let items = JSON.parse(JSON.stringify(this.itemSelections2))
  4415. for (let j = 0; j < this.itemSelections2.length; j++) {
  4416. items[j].site = partList[i].site
  4417. items[j].buNo = partList[i].buNo
  4418. items[j].partNo = partList[i].partNo
  4419. items[j].codeNo = partList[i].codeNo
  4420. items[j].recordType = 'IP'
  4421. }
  4422. inDataList.push({
  4423. itemList: items
  4424. })
  4425. }
  4426. deletePartsItem(inDataList).then(({data}) => {
  4427. if (data && data.code === 0) {
  4428. this.$set(this.partList1[0], 'recordType', 'IP')
  4429. getItemLists(this.partList1[0]).then(({data}) => {
  4430. this.itemList1 = data.row1
  4431. this.itemList2 = data.row2
  4432. })
  4433. this.getPartItem2()
  4434. this.itemSelections2 = []
  4435. } else {
  4436. this.$alert(data.msg, '错误', {
  4437. confirmButtonText: '确定'
  4438. })
  4439. }
  4440. })
  4441. },
  4442. rowStyle({row}){
  4443. if(this.partCurrentRow&&row.nodeName===this.partCurrentRow.nodeName)
  4444. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  4445. },
  4446. bomRowStyle({row}){
  4447. if(this.bomCurrentRow&&row.engChgLevel===this.bomCurrentRow.engChgLevel)
  4448. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  4449. },
  4450. bomRowStyle1({row}){
  4451. if(this.bomCurrentRow1&&row.engChgLevel===this.bomCurrentRow1.engChgLevel)
  4452. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  4453. },
  4454. routingRowStyle({row}){
  4455. if(this.routingCurrentRow&&row.routingRevision===this.routingCurrentRow.routingRevision)
  4456. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  4457. },
  4458. routingRowStyle1({row}){
  4459. if(this.routingCurrentRow1&&row.routingRevision===this.routingCurrentRow1.routingRevision)
  4460. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  4461. },
  4462. partClickRow(row) {
  4463. this.partCurrentRow = JSON.parse(JSON.stringify(row))
  4464. this.partCurrentRowIndex = this.partList1.indexOf(row)
  4465. },
  4466. async handleEditInfo(){
  4467. if (this.attributeFlag===true){
  4468. this.getPropertiesList()
  4469. this.attributeFlag = false
  4470. } else {
  4471. for (let i = 0; i < this.partList1.length; i++) {
  4472. if (!this.partList1[i].partNo||this.partList1[i].partNo===''){
  4473. console.log('处理行数据',i+1)
  4474. // 没有物料编号就新增料号
  4475. // 没有填写物料描述就认为用户暂时不在这个节点新建料号
  4476. if (this.partList1[i].partDesc === '' || this.partList1[i].partDesc == null) {
  4477. console.log('没有物料描述的行数据',i+1)
  4478. continue
  4479. }
  4480. if (this.partList1[i].buNo === '' || this.partList1[i].buNo == null) {
  4481. console.log('没有BU的行数据',i+1)
  4482. this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的BU!')
  4483. return
  4484. }
  4485. if (this.partList1[i].partType2 === '' || this.partList1[i].partType2 == null) {
  4486. console.log('没有零件类型的行数据',i+1)
  4487. this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的零件类型!')
  4488. return
  4489. }
  4490. if (this.partList1[i].umId2 === '' || this.partList1[i].umId2 == null) {
  4491. console.log('没有计量单位的行数据',i+1)
  4492. this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的计量单位!')
  4493. return
  4494. }
  4495. if (this.partList1[i].partType2 === 'Purchased (raw)' && (this.partList1[i].familyID === '' || this.partList1[i].familyID == null)) {
  4496. console.log('没有物料分类的行数据',i+1)
  4497. this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的物料分类!')
  4498. return
  4499. }
  4500. if (this.partList1[i].partType2 !== 'Purchased (raw)' && (this.partList1[i].productGroupId1 === '' || this.partList1[i].productGroupId1 == null)) {
  4501. console.log('没有商品组1的行数据',i+1)
  4502. this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的商品组1!')
  4503. return
  4504. }
  4505. if (this.partList1[i].partType2 !== 'Purchased (raw)' && (this.partList1[i].productGroupId2 === '' || this.partList1[i].productGroupId2 == null)) {
  4506. console.log('没有商品组2的行数据',i+1)
  4507. this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的商品组2!')
  4508. return
  4509. }
  4510. if (this.partList1[i].codeNo === '' || this.partList1[i].codeNo == null) {
  4511. console.log('没有属性模板的行数据',i+1)
  4512. this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的属性模板!')
  4513. return
  4514. }
  4515. let flag = true
  4516. this.partList1[i].partNo = '*'
  4517. this.partList1[i].active = 'Y'
  4518. this.partList1[i].createBy = this.$store.state.user.name
  4519. this.partList1[i].mainPart = this.searchData.partNo
  4520. console.log('其他数据赋值完成',i+1)
  4521. // 创建物料
  4522. await savePartInfo(this.partList1[i]).then((data) => {
  4523. if (data.data && data.data.code === 0) {
  4524. console.log('创建物料成功',i+1)
  4525. this.partList1[i].partNo = data.data.rows.partNo
  4526. updatePartNoOfNode(this.partList1[i]).then((data) => {
  4527. if (data.data && data.data.code === 0) {
  4528. }else {
  4529. this.$message.error(data.msg)
  4530. }
  4531. })
  4532. } else {
  4533. this.$message.error(data.msg)
  4534. flag = false
  4535. }
  4536. })
  4537. if (!flag) {
  4538. return
  4539. }
  4540. }
  4541. }
  4542. this.partList1.forEach(item => this.$set(item, 'mainPart', this.searchData.partNo))
  4543. // 修改物料的属性
  4544. batchSavePartInfo(this.partList1.filter(item => item.partNo&&item.partNo!=='')).then(({data}) => {
  4545. if (data && data.code === 0){
  4546. this.handleBatchUpdatePart()
  4547. this.$message({
  4548. message: '操作成功',
  4549. type: 'success',
  4550. duration: 1500,
  4551. onClose: () => {}
  4552. })
  4553. this.attributeFlag = true
  4554. } else {
  4555. this.$alert(data.msg, '错误', {
  4556. confirmButtonText: '确定'
  4557. })
  4558. }
  4559. })
  4560. }
  4561. },
  4562. handleBatchUpdateDialogClose(){
  4563. if (!this.attributeFlag||!this.attributeFlag1){
  4564. this.$confirm(`编辑尚未保存,是否关闭?`, '提示', {
  4565. confirmButtonText: '确定',
  4566. cancelButtonText: '取消',
  4567. type: 'warning'
  4568. }).then(() => {
  4569. this.batchUpdateFlag = false
  4570. })
  4571. } else {
  4572. this.batchUpdateFlag = false
  4573. }
  4574. },
  4575. getPropertiesList(){
  4576. const propLists = []
  4577. for (let i = 0; i <= this.partList1.length; i++) {
  4578. if (i === this.partList1.length){
  4579. propLists[i] = [
  4580. "Select UMID fieldname1, UMName caption1 from UM where site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"'",
  4581. "Select template_no fieldname1, template_name caption1 from plm_bom_template where site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"'",
  4582. ]
  4583. } else {
  4584. propLists[i] = [
  4585. "select family_id fieldname1, family_name caption1 from part_family where active = 'Y' and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+this.partList1[i].buNo+"'",
  4586. "select product_group_id fieldname1,product_group_name caption1 from part_product_group where active = 'Y' and type = '1' and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+this.partList1[i].buNo+"'",
  4587. "select product_group_id fieldname1,product_group_name caption1 from part_product_group where active = 'Y' and type = '2' and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+this.partList1[i].buNo+"'",
  4588. "select product_group_id fieldname1,product_group_name caption1 from part_product_group where active = 'Y' and type = '3' and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+this.partList1[i].buNo+"'",
  4589. "Select code_no as fieldname1, code_desc as caption1 from plm_properties_model_header where function_type = 'IP' and active = 'Y' and (code_no like '%%' OR code_desc like '%%' ) and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+this.partList1[i].buNo+"'"
  4590. ]
  4591. }
  4592. }
  4593. getChooselist1(propLists).then((data) => {
  4594. if (data.data && data.data.code === 0){
  4595. // 对 umList 进行排序,将"米"和"千张"放在最前面
  4596. let umList = data.data.list[this.partList1.length][0] || []
  4597. if (Array.isArray(umList) && umList.length > 0) {
  4598. try {
  4599. const priorityList = []
  4600. const otherList = []
  4601. umList.forEach(item => {
  4602. if (!item) return
  4603. const umid = String(item.fieldname1 || item.UMID || '')
  4604. const umName = String(item.caption1 || item.UMName || '')
  4605. const isQianZhang = umid === '1002' || umName.includes('千张')
  4606. const isMi = umName === '米' || (umName.includes('米') && umName.length <= 2 && !umName.includes('千'))
  4607. if (isMi || isQianZhang) {
  4608. priorityList.push({ item, isMi, isQianZhang })
  4609. } else {
  4610. otherList.push(item)
  4611. }
  4612. })
  4613. // 米优先,然后千张
  4614. priorityList.sort((a, b) => {
  4615. if (a.isMi && !b.isMi) return -1
  4616. if (!a.isMi && b.isMi) return 1
  4617. return 0
  4618. })
  4619. if (priorityList.length > 0) {
  4620. umList = [...priorityList.map(p => p.item), ...otherList]
  4621. }
  4622. } catch (error) {
  4623. console.warn('计量单位排序失败,使用原始顺序:', error)
  4624. }
  4625. }
  4626. for (let i = 0; i < this.partList1.length; i++) {
  4627. this.$set(this.partList1[i], 'umList', umList);
  4628. this.$set(this.partList1[i], 'partFamilyList', data.data.list[i][0]);
  4629. this.$set(this.partList1[i], 'partProductGroupList1', data.data.list[i][1]);
  4630. this.$set(this.partList1[i], 'partProductGroupList2', data.data.list[i][2]);
  4631. this.$set(this.partList1[i], 'partProductGroupList3', data.data.list[i][3]);
  4632. this.$set(this.partList1[i], 'codeList', data.data.list[i][4]);
  4633. this.$set(this.partList1[i], 'templateList', data.data.list[this.partList1.length][1]);
  4634. }
  4635. }
  4636. })
  4637. },
  4638. handleCodeNoChange(value) {
  4639. const previousValue = this.previousCodeNo;
  4640. let partList = []
  4641. for (let i = 0; i < this.partList1.length; i++) {
  4642. if (this.partList1[i].partNo&&this.partList1[i].partNo!==''&&this.partList1[i].buNo&&this.partList1[i].buNo === this.searchData.buNo){
  4643. let temp = {
  4644. site: this.$store.state.user.site,
  4645. partNo: this.partList1[i].partNo,
  4646. codeNo: value
  4647. }
  4648. partList.push(temp)
  4649. }
  4650. }
  4651. batchUpdateCodeNo(partList).then(({data}) => {
  4652. if (data&&data.code === 0){
  4653. this.handleBatchUpdatePart()
  4654. this.handleEditInfo()
  4655. this.$message({
  4656. message: '操作成功',
  4657. type: 'success',
  4658. duration: 1500,
  4659. onClose: () => {}
  4660. })
  4661. } else {
  4662. this.$set(this.searchData, 'codeNo', previousValue)
  4663. this.$message({
  4664. message: data.msg,
  4665. type: 'error',
  4666. duration: 1500,
  4667. onClose: () => {}
  4668. })
  4669. }
  4670. })
  4671. },
  4672. async changeBuOfNode(row) {
  4673. this.buNoQueryLoading = true
  4674. row.familyId = ''
  4675. row.productGroupId1 = ''
  4676. row.productGroupId2 = ''
  4677. row.productGroupId3 = ''
  4678. row.codeNo = ''
  4679. row.bu = this.$store.state.user.site + '_' + row.buNo
  4680. const propLists = [
  4681. [
  4682. "select family_id fieldname1, family_name caption1 from part_family where active = 'Y' and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+row.buNo+"'",
  4683. "select product_group_id fieldname1,product_group_name caption1 from part_product_group where active = 'Y' and type = '1' and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+row.buNo+"'",
  4684. "select product_group_id fieldname1,product_group_name caption1 from part_product_group where active = 'Y' and type = '2' and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+row.buNo+"'",
  4685. "select product_group_id fieldname1,product_group_name caption1 from part_product_group where active = 'Y' and type = '3' and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+row.buNo+"'",
  4686. "Select code_no as fieldname1, code_desc as caption1 from plm_properties_model_header where function_type = 'IP' and active = 'Y' and (code_no like '%%' OR code_desc like '%%' ) and site in (select site from eam_access_site where username = '"+this.$store.state.user.name+"') and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = '"+this.$store.state.user.name+"') and site = '"+this.$store.state.user.site+"' and bu_no = '"+row.buNo+"'"
  4687. ]
  4688. ]
  4689. await getChooselist1(propLists).then((data) => {
  4690. if (data.data && data.data.code === 0){
  4691. this.$set(row, 'partFamilyList', data.data.list[0][0])
  4692. this.$set(row, 'partProductGroupList1', data.data.list[0][1])
  4693. this.$set(row, 'partProductGroupList2', data.data.list[0][2])
  4694. this.$set(row, 'partProductGroupList3', data.data.list[0][3])
  4695. this.$set(row, 'codeList', data.data.list[0][4])
  4696. }
  4697. })
  4698. await getTemplateList(row).then(({data}) => {
  4699. if (data && data.code === 0) {
  4700. this.$set(row, 'tempList', data.rows)
  4701. }
  4702. })
  4703. this.buNoQueryLoading = false
  4704. },
  4705. chooseTemplate(row){
  4706. chooseTemplate(row).then(({data}) => {
  4707. if (data&&data.code===0) {
  4708. Object.keys(data.data).forEach(key => {
  4709. if (key !== 'templateNo') {
  4710. row[key] = data.data[key];
  4711. }
  4712. });
  4713. row.umId2 = data.data.umId
  4714. row.familyID = data.data.familyId
  4715. if (row.partType2&&row.partType2==='Manufactured'){
  4716. row.templateNo = data.data.bomTemplateNo
  4717. row.templateName = data.data.bomTemplateName
  4718. }
  4719. }
  4720. })
  4721. },
  4722. getTemplateList() {
  4723. for (let i = 0; i < this.partList1.length; i++) {
  4724. getTemplateList(this.partList1[i]).then(({data}) => {
  4725. if (data && data.code === 0) {
  4726. this.partList1[i].tempList = data.rows
  4727. }
  4728. })
  4729. }
  4730. },
  4731. queryBomDetail(row) {
  4732. let tempData = {
  4733. flag: '2',
  4734. site: row.site,
  4735. buNo: row.buNo,
  4736. partNo: row.partNo,
  4737. partDesc: row.partDesc,
  4738. engChgLevel: row.engChgLevel,
  4739. bomType: row.bomType,
  4740. noteText: row.noteText,
  4741. effPhaseInDate: row.effPhaseInDate,
  4742. effPhaseOutDate: row.effPhaseOutDate,
  4743. engRevision: row.engRevision,
  4744. typeFlag: row.typeFlag,
  4745. netWeight: row.netWeight,
  4746. updateBy: this.$store.state.user.name,
  4747. printUnit: row.printUnit,
  4748. printUnitName: row.printUnitName,
  4749. alternativeNo: row.alternativeNo,
  4750. yieldRate: row.yieldRate,
  4751. shrinkageFactor: new Decimal(100).sub(new Decimal(row.yieldRate)).toNumber(),
  4752. processUnit: row.processUnit,
  4753. processUnitName: row.processUnitName
  4754. }
  4755. queryBomDetail(tempData).then(({data}) => {
  4756. if (data && data.code === 0) {
  4757. this.bomComponentPartList = data.rows.componentList
  4758. this.bomComponentList[row.index] = { ...this.bomComponentList[row.index], ...data.rows.detailData}
  4759. this.bomCurrentRow = JSON.parse(JSON.stringify(this.bomComponentList[0]))
  4760. } else {
  4761. this.$alert(data.msg, '错误', {
  4762. confirmButtonText: '确定'
  4763. })
  4764. }
  4765. })
  4766. },
  4767. queryBomDetail1(row) {
  4768. let tempData = {
  4769. flag: '2',
  4770. site: row.site,
  4771. buNo: row.buNo,
  4772. partNo: row.partNo,
  4773. partDesc: row.partDesc,
  4774. engChgLevel: row.engChgLevel,
  4775. bomType: row.bomType,
  4776. noteText: row.noteText,
  4777. effPhaseInDate: row.effPhaseInDate,
  4778. effPhaseOutDate: row.effPhaseOutDate,
  4779. engRevision: row.engRevision,
  4780. typeFlag: row.typeFlag,
  4781. netWeight: row.netWeight,
  4782. updateBy: this.$store.state.user.name,
  4783. printUnit: row.printUnit,
  4784. printUnitName: row.printUnitName,
  4785. alternativeNo: row.alternativeNo,
  4786. yieldRate: row.yieldRate,
  4787. shrinkageFactor: new Decimal(100).sub(new Decimal(row.yieldRate)).toNumber(),
  4788. processUnit: row.processUnit,
  4789. processUnitName: row.processUnitName
  4790. }
  4791. queryBomDetail(tempData).then(({data}) => {
  4792. if (data && data.code === 0) {
  4793. this.bomComponentPartList1 = data.rows.componentList
  4794. this.bomComponentList1[row.index] = { ...this.bomComponentList1[row.index], ...data.rows.detailData}
  4795. this.bomCurrentRow1 = JSON.parse(JSON.stringify(this.bomComponentList1[0]))
  4796. } else {
  4797. this.$alert(data.msg, '错误', {
  4798. confirmButtonText: '确定'
  4799. })
  4800. }
  4801. })
  4802. },
  4803. queryRoutingDetail (row) {
  4804. let tempData = {
  4805. flag: '2',
  4806. site: row.site,
  4807. buNo: row.buNo,
  4808. partNo: row.partNo,
  4809. partDesc: row.partDesc,
  4810. routingRevision: row.routingRevision,
  4811. routingType: row.routingType,
  4812. noteText: row.noteText,
  4813. phaseInDate: row.phaseInDate,
  4814. phaseOutDate: row.phaseOutDate,
  4815. engRevision: row.engRevision,
  4816. typeFlag: row.typeFlag,
  4817. netWeight: row.netWeight,
  4818. updateBy: this.$store.state.user.name,
  4819. printUnit: row.printUnit,
  4820. printUnitName: row.printUnitName,
  4821. alternativeNo: row.alternativeNo,
  4822. }
  4823. // 查routing明细
  4824. queryRoutingDetail(tempData).then(({data}) => {
  4825. if (data && data.code === 0) {
  4826. this.routingComponentPartList = data.rows.componentList
  4827. this.routingComponentList[row.index] = { ...this.routingComponentList[row.index], ...data.rows.detailData}
  4828. } else {
  4829. this.$alert(data.msg, '错误', {
  4830. confirmButtonText: '确定'
  4831. })
  4832. }
  4833. })
  4834. },
  4835. queryRoutingDetail1 (row) {
  4836. let tempData = {
  4837. flag: '2',
  4838. site: row.site,
  4839. buNo: row.buNo,
  4840. partNo: row.partNo,
  4841. partDesc: row.partDesc,
  4842. routingRevision: row.routingRevision,
  4843. routingType: row.routingType,
  4844. noteText: row.noteText,
  4845. phaseInDate: row.phaseInDate,
  4846. phaseOutDate: row.phaseOutDate,
  4847. engRevision: row.engRevision,
  4848. typeFlag: row.typeFlag,
  4849. netWeight: row.netWeight,
  4850. updateBy: this.$store.state.user.name,
  4851. printUnit: row.printUnit,
  4852. printUnitName: row.printUnitName,
  4853. alternativeNo: row.alternativeNo,
  4854. }
  4855. // 查routing明细
  4856. queryRoutingDetail(tempData).then(({data}) => {
  4857. if (data && data.code === 0) {
  4858. this.routingComponentPartList1 = data.rows.componentList
  4859. this.routingComponentList1[row.index] = { ...this.routingComponentList1[row.index], ...data.rows.detailData}
  4860. } else {
  4861. this.$alert(data.msg, '错误', {
  4862. confirmButtonText: '确定'
  4863. })
  4864. }
  4865. })
  4866. },
  4867. bomRowClick() {
  4868. let tempData = {
  4869. flag: '2',
  4870. site: this.bomCurrentRow.site,
  4871. buNo: this.bomCurrentRow.buNo,
  4872. partNo: this.bomCurrentRow.partNo,
  4873. partDesc: this.bomCurrentRow.partDesc,
  4874. engChgLevel: this.bomCurrentRow.engChgLevel,
  4875. bomType: this.bomCurrentRow.bomType,
  4876. noteText: this.bomCurrentRow.noteText,
  4877. effPhaseInDate: this.bomCurrentRow.effPhaseInDate,
  4878. effPhaseOutDate: this.bomCurrentRow.effPhaseOutDate,
  4879. engRevision: this.bomCurrentRow.engRevision,
  4880. typeFlag: this.bomCurrentRow.typeFlag,
  4881. netWeight: this.bomCurrentRow.netWeight,
  4882. updateBy: this.$store.state.user.name,
  4883. printUnit: this.bomCurrentRow.printUnit,
  4884. printUnitName: this.bomCurrentRow.printUnitName,
  4885. alternativeNo: this.bomCurrentRow.alternativeNo,
  4886. yieldRate: this.bomCurrentRow.yieldRate,
  4887. shrinkageFactor: new Decimal(100).sub(new Decimal(this.bomCurrentRow.yieldRate)).toNumber(),
  4888. processUnit: this.bomCurrentRow.processUnit,
  4889. processUnitName: this.bomCurrentRow.processUnitName
  4890. }
  4891. queryBomDetail(tempData).then(({data}) => {
  4892. if (data && data.code === 0) {
  4893. this.bomComponentPartList = data.rows.componentList
  4894. this.bomFlag = true
  4895. } else {
  4896. this.$alert(data.msg, '错误', {
  4897. confirmButtonText: '确定'
  4898. })
  4899. }
  4900. })
  4901. },
  4902. bomRowClick1() {
  4903. let tempData = {
  4904. flag: '2',
  4905. site: this.bomCurrentRow1.site,
  4906. buNo: this.bomCurrentRow1.buNo,
  4907. partNo: this.bomCurrentRow1.partNo,
  4908. partDesc: this.bomCurrentRow1.partDesc,
  4909. engChgLevel: this.bomCurrentRow1.engChgLevel,
  4910. bomType: this.bomCurrentRow1.bomType,
  4911. noteText: this.bomCurrentRow1.noteText,
  4912. effPhaseInDate: this.bomCurrentRow1.effPhaseInDate,
  4913. effPhaseOutDate: this.bomCurrentRow1.effPhaseOutDate,
  4914. engRevision: this.bomCurrentRow1.engRevision,
  4915. typeFlag: this.bomCurrentRow1.typeFlag,
  4916. netWeight: this.bomCurrentRow1.netWeight,
  4917. updateBy: this.$store.state.user.name,
  4918. printUnit: this.bomCurrentRow1.printUnit,
  4919. printUnitName: this.bomCurrentRow1.printUnitName,
  4920. alternativeNo: this.bomCurrentRow1.alternativeNo,
  4921. yieldRate: this.bomCurrentRow1.yieldRate,
  4922. shrinkageFactor: new Decimal(100).sub(new Decimal(this.bomCurrentRow1.yieldRate)).toNumber(),
  4923. processUnit: this.bomCurrentRow1.processUnit,
  4924. processUnitName: this.bomCurrentRow1.processUnitName
  4925. }
  4926. queryBomDetail(tempData).then(({data}) => {
  4927. if (data && data.code === 0) {
  4928. this.bomComponentPartList1 = data.rows.componentList
  4929. this.bomFlag1 = true
  4930. } else {
  4931. this.$alert(data.msg, '错误', {
  4932. confirmButtonText: '确定'
  4933. })
  4934. }
  4935. })
  4936. },
  4937. bomInfoRowClick(row) {
  4938. this.bomCurrentRow = JSON.parse(JSON.stringify(row))
  4939. this.bomRowClick()
  4940. },
  4941. bomInfoRowClick1(row) {
  4942. this.bomCurrentRow1 = JSON.parse(JSON.stringify(row))
  4943. this.bomRowClick1()
  4944. },
  4945. bomInfoTabClick() {
  4946. if (this.bomComponentList.length>0){
  4947. if (!this.bomCurrentRow) {
  4948. this.bomCurrentRow = this.bomComponentList[0]
  4949. }
  4950. this.bomRowClick()
  4951. }
  4952. },
  4953. bomInfoTabClick1() {
  4954. if (this.bomComponentList1.length>0){
  4955. if (!this.bomCurrentRow1) {
  4956. this.bomCurrentRow1 = this.bomComponentList1[0]
  4957. }
  4958. this.bomRowClick1()
  4959. }
  4960. },
  4961. bomInfoRowDblClick(row){
  4962. let tempData = {
  4963. site: this.$store.state.user.site,
  4964. partNo: row.partNo,
  4965. mainPart: this.searchData.partNo,
  4966. engChgLevel: row.engChgLevel,
  4967. routingRevision: this.partCurrentRow.routingRevision
  4968. }
  4969. setRevision(tempData).then(({data}) => {
  4970. if (data && data.code === 0) {
  4971. this.handleBatchUpdatePart()
  4972. this.$message({
  4973. message: '操作成功',
  4974. type: 'success',
  4975. duration: 1500,
  4976. onClose: () => {}
  4977. })
  4978. }
  4979. })
  4980. },
  4981. bomInfoRowDblClick1(row){
  4982. this.$set(this.copyData.previousVersion, 'engChgLevel', row.engChgLevel)
  4983. this.$set(this.copyData.previousVersion, 'bomType', row.bomType)
  4984. },
  4985. routingInfoRowDblClick(row){
  4986. let tempData = {
  4987. site: this.$store.state.user.site,
  4988. partNo: row.partNo,
  4989. mainPart: this.searchData.partNo,
  4990. engChgLevel: this.partCurrentRow.engChgLevel,
  4991. routingRevision: row.routingRevision
  4992. }
  4993. setRevision(tempData).then(({data}) => {
  4994. if (data && data.code === 0) {
  4995. this.handleBatchUpdatePart()
  4996. this.$message({
  4997. message: '操作成功',
  4998. type: 'success',
  4999. duration: 1500,
  5000. onClose: () => {}
  5001. })
  5002. }
  5003. })
  5004. },
  5005. routingInfoRowDblClick1(row){
  5006. this.copyData.previousVersion.routingRevision = row.routingRevision
  5007. this.copyData.previousVersion.routingType = row.routingType
  5008. },
  5009. routingInfoRowClick(row) {
  5010. this.routingCurrentRow = JSON.parse(JSON.stringify(row))
  5011. this.routingRowClick()
  5012. },
  5013. routingInfoRowClick1(row) {
  5014. this.routingCurrentRow1 = JSON.parse(JSON.stringify(row))
  5015. this.routingRowClick1()
  5016. },
  5017. routingInfoTabClick() {
  5018. if (this.routingComponentList.length>0) {
  5019. if (!this.routingCurrentRow) {
  5020. this.routingCurrentRow = this.routingComponentList[0]
  5021. }
  5022. this.routingRowClick()
  5023. }
  5024. },
  5025. routingInfoTabClick1() {
  5026. if (this.routingComponentList1.length>0) {
  5027. if (!this.routingCurrentRow1) {
  5028. this.routingCurrentRow1 = this.routingComponentList1[0]
  5029. }
  5030. this.routingRowClick1()
  5031. }
  5032. },
  5033. routingRowClick() {
  5034. let tempData = {
  5035. flag: '2',
  5036. site: this.routingCurrentRow.site,
  5037. buNo: this.routingCurrentRow.buNo,
  5038. partNo: this.routingCurrentRow.partNo,
  5039. partDesc: this.routingCurrentRow.partDesc,
  5040. routingRevision: this.routingCurrentRow.routingRevision,
  5041. routingType: this.routingCurrentRow.routingType,
  5042. noteText: this.routingCurrentRow.noteText,
  5043. phaseInDate: this.routingCurrentRow.phaseInDate,
  5044. phaseOutDate: this.routingCurrentRow.phaseOutDate,
  5045. engRevision: this.routingCurrentRow.engRevision,
  5046. typeFlag: this.routingCurrentRow.typeFlag,
  5047. netWeight: this.routingCurrentRow.netWeight,
  5048. updateBy: this.$store.state.user.name,
  5049. printUnit: this.routingCurrentRow.printUnit,
  5050. printUnitName: this.routingCurrentRow.printUnitName,
  5051. alternativeNo: this.routingCurrentRow.alternativeNo,
  5052. }
  5053. // 查routing明细
  5054. queryRoutingDetail(tempData).then(({data}) => {
  5055. if (data && data.code === 0) {
  5056. this.routingComponentPartList = data.rows.componentList
  5057. this.bomFlag = false
  5058. } else {
  5059. this.$alert(data.msg, '错误', {
  5060. confirmButtonText: '确定'
  5061. })
  5062. }
  5063. })
  5064. },
  5065. routingRowClick1() {
  5066. let tempData = {
  5067. flag: '2',
  5068. site: this.routingCurrentRow1.site,
  5069. buNo: this.routingCurrentRow1.buNo,
  5070. partNo: this.routingCurrentRow1.partNo,
  5071. partDesc: this.routingCurrentRow1.partDesc,
  5072. routingRevision: this.routingCurrentRow1.routingRevision,
  5073. routingType: this.routingCurrentRow1.routingType,
  5074. noteText: this.routingCurrentRow1.noteText,
  5075. phaseInDate: this.routingCurrentRow1.phaseInDate,
  5076. phaseOutDate: this.routingCurrentRow1.phaseOutDate,
  5077. engRevision: this.routingCurrentRow1.engRevision,
  5078. typeFlag: this.routingCurrentRow1.typeFlag,
  5079. netWeight: this.routingCurrentRow1.netWeight,
  5080. updateBy: this.$store.state.user.name,
  5081. printUnit: this.routingCurrentRow1.printUnit,
  5082. printUnitName: this.routingCurrentRow1.printUnitName,
  5083. alternativeNo: this.routingCurrentRow1.alternativeNo,
  5084. }
  5085. // 查routing明细
  5086. queryRoutingDetail(tempData).then(({data}) => {
  5087. if (data && data.code === 0) {
  5088. this.routingComponentPartList1 = data.rows.componentList
  5089. this.bomFlag1 = false
  5090. } else {
  5091. this.$alert(data.msg, '错误', {
  5092. confirmButtonText: '确定'
  5093. })
  5094. }
  5095. })
  5096. },
  5097. getFormula(value) {
  5098. switch (value) {
  5099. case '一复': case '熟化': case 'RFID前道检品':
  5100. return '人数/(速度x时间x效率)'
  5101. case '印刷': case 'RFID-蚀刻': case 'RFID-分切':
  5102. return '人数/(速度x时间x效率)/Printing lanes'
  5103. case '绑定': case 'RFID编码': case 'RFID编码打印':
  5104. return '人数/(UPH(每小时产量)*效率)*1KCT'
  5105. case 'RFID多条检测':
  5106. return '人数/(速度x时间xCDx效率)*1KCT'
  5107. case 'RFID复合模切检测':
  5108. return '人数/(速度x时间x效率x(CDx复合列数))*1KCT'
  5109. case 'RFID后道检品':
  5110. return '人数/UPH(每小时产量)*100%*1KCT'
  5111. case 'RFID自动贴标':
  5112. return '人数/(速度x时间x效率x(CDx贴标列数))*1KCT'
  5113. case 'Voyantic在线检测':
  5114. return '人数/(速度x时间x效率x(CDx检测列数))*1KCT'
  5115. case 'RFID包装':
  5116. return '人数/(日产量/8小时/17人均摊)*1KCT'
  5117. default:
  5118. return ''
  5119. }
  5120. },
  5121. getBomAndRoutingRevision(){
  5122. let list = []
  5123. for (let i = 0; i < this.partList1.length; i++) {
  5124. list.push({
  5125. site: this.partList1[i].site,
  5126. buNo: this.partList1[i].buNo,
  5127. partNo: this.partList1[i].partNo,
  5128. partDesc: this.partList1[i].partDesc,
  5129. printUnit: this.partList1[i].umId2,
  5130. printUnitName: this.partList1[i].umName,
  5131. bomType: 'Manufacturing',
  5132. routingType: 'Manufacturing',
  5133. nodeId: this.partList1[i].nodeId,
  5134. offFlag: '2'
  5135. })
  5136. }
  5137. getBomAndRoutingRevision(list).then(({data}) => {
  5138. if (data && data.code === 0) {
  5139. for (let i = 0; i <this.partList1.length; i++) {
  5140. this.$set(this.partList1[i], 'engChgLevelList', data.rows.engChgLevelList[this.partList1[i].nodeId])
  5141. this.$set(this.partList1[i], 'routingRevisionList', data.rows.routingRevisionList[this.partList1[i].nodeId])
  5142. }
  5143. }
  5144. })
  5145. },
  5146. updateRevision(row, type) {
  5147. if(type === 'bom') {
  5148. let tempData = {
  5149. site: this.$store.state.user.site,
  5150. partNo: row.partNo,
  5151. mainPart: this.searchData.partNo,
  5152. engChgLevel: row.engChgLevel,
  5153. routingRevision: this.partCurrentRow.routingRevision
  5154. }
  5155. setRevision(tempData).then(({data}) => {
  5156. if (data && data.code === 0) {
  5157. this.handleBatchUpdatePart()
  5158. this.$message({
  5159. message: '操作成功',
  5160. type: 'success',
  5161. duration: 1500,
  5162. onClose: () => {}
  5163. })
  5164. }
  5165. })
  5166. } else if(type === 'routing') {
  5167. let tempData = {
  5168. site: this.$store.state.user.site,
  5169. partNo: row.partNo,
  5170. mainPart: this.searchData.partNo,
  5171. engChgLevel: this.partCurrentRow.engChgLevel,
  5172. routingRevision: row.routingRevision
  5173. }
  5174. setRevision(tempData).then(({data}) => {
  5175. if (data && data.code === 0) {
  5176. this.handleBatchUpdatePart()
  5177. this.$message({
  5178. message: '操作成功',
  5179. type: 'success',
  5180. duration: 1500,
  5181. onClose: () => {}
  5182. })
  5183. }
  5184. })
  5185. }
  5186. },
  5187. handleCopy() {
  5188. this.copyData.partNo = this.partCurrentRow.partNo
  5189. this.copyData.partDesc = this.partCurrentRow.partDesc
  5190. this.copyData.buNo = this.partCurrentRow.buNo
  5191. this.copyData.bomType = 'Manufacturing'
  5192. this.copyData.routingType = 'Manufacturing'
  5193. this.copyData.effPhaseInDate = new Date()
  5194. this.copyVisible = true
  5195. },
  5196. queryCopyPartModal () {
  5197. this.copyModalData.limit = this.pageSize4
  5198. this.copyModalData.page = this.pageIndex4
  5199. this.copyModalData.site = this.searchData.site
  5200. this.copyModalData.buNo = this.searchData.buNo
  5201. // 查询所有物料
  5202. queryPartList(this.copyModalData).then(({data}) => {
  5203. if (data && data.code === 0) {
  5204. this.copyPartList = data.page.list
  5205. this.pageIndex4 = data.page.currPage
  5206. this.pageSize4 = data.page.pageSize
  5207. this.totalPage4 = data.page.totalCount
  5208. this.copyPartModelFlag = true
  5209. } else {
  5210. this.$alert(data.msg, '错误', {
  5211. confirmButtonText: '确定'
  5212. })
  5213. }
  5214. })
  5215. },
  5216. // 每页数
  5217. sizeChangeHandle4 (val) {
  5218. this.pageSize4 = val
  5219. this.pageIndex4 = 1
  5220. this.queryCopyPartModal()
  5221. },
  5222. // 当前页
  5223. currentChangeHandle4 (val) {
  5224. this.pageIndex4 = val
  5225. this.queryCopyPartModal()
  5226. },
  5227. getCopyRowData(row) {
  5228. getCopyRowData(row).then(({data}) => {
  5229. if (data && data.code === 0) {
  5230. this.copyData.previousVersion = data.rows
  5231. this.getRevisionInfo1(data.rows)
  5232. this.copyPartModelFlag = false
  5233. }
  5234. })
  5235. },
  5236. async copySave() {
  5237. if (!this.copyData.previousVersion.partNo) {
  5238. this.$message.warning('请先选择要复制的料号!')
  5239. return
  5240. }
  5241. if (this.copyData.bomFlag&&this.copyData.bomFlag==='Y'&&!this.copyData.previousVersion.engChgLevel) {
  5242. this.$message.warning('请选择要复制的BOM版本!')
  5243. return
  5244. }
  5245. if (this.copyData.routingFlag&&this.copyData.routingFlag==='Y'&&!this.copyData.previousVersion.routingRevision) {
  5246. this.$message.warning('请选择要复制的routing版本!')
  5247. return
  5248. }
  5249. let flag = true
  5250. if (!this.copyData.partNo||this.copyData.partNo==='') {
  5251. // 没有料号就先新建
  5252. if (this.copyData.previousVersion.buNo !== this.copyData.buNo) {
  5253. this.$message.warning('所选的被复制的物料的BU和新物料的不一致!')
  5254. return
  5255. }
  5256. this.copyData.partNo = '*'
  5257. this.copyData.active = 'Y'
  5258. this.copyData.createBy = this.$store.state.user.name
  5259. this.copyData.mainPart = this.searchData.partNo
  5260. this.copyData.bu = this.$store.state.user.site + '_' + this.copyData.buNo
  5261. this.copyData.partType2 = this.copyData.previousVersion.partType2
  5262. this.copyData.umId2 = this.copyData.previousVersion.umId2
  5263. this.copyData.productGroupId1 = this.copyData.previousVersion.productGroupId1
  5264. this.copyData.productGroupId2 = this.copyData.previousVersion.productGroupId2
  5265. this.copyData.productGroupId3 = this.copyData.previousVersion.productGroupId3
  5266. this.copyData.familyID = this.copyData.previousVersion.familyID
  5267. this.copyData.codeNo = this.copyData.previousVersion.codeNo
  5268. await savePartInfo(this.copyData).then(async ({data}) => {
  5269. if (data && data.code === 0) {
  5270. this.$set(this.partList1[this.partCurrentRowIndex], 'partNo', data.rows.partNo)
  5271. this.partList1[this.partCurrentRowIndex].mainPart = this.searchData.partNo
  5272. // 等待 updatePartNoOfNode 完成
  5273. const {data: updateNodeData} = await updatePartNoOfNode(this.partList1[this.partCurrentRowIndex]);
  5274. if (updateNodeData && updateNodeData.code === 0) {
  5275. this.copyData.partNo = this.partList1[this.partCurrentRowIndex].partNo;
  5276. } else {
  5277. this.$message.error(data.msg);
  5278. flag = false;
  5279. }
  5280. } else {
  5281. this.$message.error(data.msg)
  5282. flag = false
  5283. }
  5284. })
  5285. }
  5286. if (this.copyData.bomFlag&&this.copyData.bomFlag==='Y') {
  5287. await copyBom(this.copyData).then(({data}) => {
  5288. if (data && data.code === 0) {
  5289. this.$message({
  5290. message: '操作成功',
  5291. type: 'success',
  5292. duration: 1500,
  5293. onClose: () => {}
  5294. })
  5295. } else {
  5296. this.$alert(data.msg, '错误', {
  5297. confirmButtonText: '确定'
  5298. })
  5299. flag = false
  5300. }
  5301. }).catch(()=>{
  5302. flag = false
  5303. })
  5304. }
  5305. if (this.copyData.routingFlag&&this.copyData.routingFlag==='Y') {
  5306. this.copyData.phaseInDate = this.copyData.effPhaseInDate
  5307. this.copyData.phaseOutDate = this.copyData.effPhaseOutDate
  5308. await copyRouting(this.copyData).then(({data}) => {
  5309. if (data && data.code === 0) {
  5310. this.$message({
  5311. message: '操作成功',
  5312. type: 'success',
  5313. duration: 1500,
  5314. onClose: () => {}
  5315. })
  5316. } else {
  5317. this.$alert(data.msg, '错误', {
  5318. confirmButtonText: '确定'
  5319. })
  5320. flag = false
  5321. }
  5322. }).catch(()=>{
  5323. flag = false
  5324. })
  5325. }
  5326. if (flag) {
  5327. this.copyVisible = false
  5328. }
  5329. },
  5330. // 双击单元格开始编辑
  5331. startEditCell(rowIndex, columnProp, value) {
  5332. this.editingCell.rowIndex = rowIndex
  5333. this.editingCell.columnProp = columnProp
  5334. this.editingCell.value = value || ''
  5335. // 下一帧聚焦输入框
  5336. this.$nextTick(() => {
  5337. if (this.$refs.editInput && this.$refs.editInput[0]) {
  5338. this.$refs.editInput[0].focus()
  5339. }
  5340. })
  5341. },
  5342. // 保存单元格编辑
  5343. async saveEditCell(rowIndex, columnProp, columnLabel) {
  5344. // 防止重复保存
  5345. if (this.editingCell.isSaving) {
  5346. return
  5347. }
  5348. const newValue = this.editingCell.value
  5349. const oldValue = this.dataList[rowIndex][columnProp]
  5350. // 值未改变,直接取消编辑
  5351. if (newValue === oldValue) {
  5352. this.cancelEditCell()
  5353. return
  5354. }
  5355. this.editingCell.isSaving = true
  5356. // 显示loading
  5357. const loading = this.$loading({
  5358. lock: true,
  5359. text: '保存中...',
  5360. spinner: 'el-icon-loading',
  5361. background: 'rgba(0, 0, 0, 0.5)'
  5362. })
  5363. try {
  5364. // 更新本地显示
  5365. this.$set(this.dataList[rowIndex], columnProp, newValue)
  5366. // 先获取当前属性的完整信息
  5367. let itemTemplate = null
  5368. await getPartItem({
  5369. site: this.$store.state.user.site,
  5370. buNo: this.searchData.buNo,
  5371. partNo: this.searchData.partNo,
  5372. codeNo: this.searchData.codeNo,
  5373. recordType: 'IP'
  5374. }).then(({data}) => {
  5375. if (data && data.code === 0 && data.rows) {
  5376. itemTemplate = data.rows.find(item => item.itemDesc === columnLabel)
  5377. }
  5378. })
  5379. if (!itemTemplate) {
  5380. loading.close()
  5381. this.$message.error('未找到属性配置')
  5382. this.$set(this.dataList[rowIndex], columnProp, oldValue)
  5383. this.editingCell.isSaving = false
  5384. this.cancelEditCell()
  5385. return
  5386. }
  5387. // 根据属性类型更新对应的值
  5388. if (itemTemplate.valueTypeDb === 'N') {
  5389. // 数值类型
  5390. const parsedValue = parseFloat(newValue)
  5391. if (newValue !== '' && isNaN(parsedValue)) {
  5392. loading.close()
  5393. this.$message.error('请输入有效的数值')
  5394. this.$set(this.dataList[rowIndex], columnProp, oldValue)
  5395. this.editingCell.isSaving = false
  5396. this.cancelEditCell()
  5397. return
  5398. }
  5399. itemTemplate.numValue = newValue === '' ? null : parsedValue
  5400. itemTemplate.textValue = ''
  5401. } else {
  5402. // 文本类型
  5403. itemTemplate.textValue = newValue || ''
  5404. itemTemplate.numValue = null
  5405. }
  5406. // 准备保存到后端
  5407. let tempData = {
  5408. site: this.$store.state.user.site,
  5409. buNo: this.searchData.buNo,
  5410. partNo: this.searchData.partNo,
  5411. codeNo: this.searchData.codeNo
  5412. }
  5413. // 获取所有物料
  5414. await partInfoByMainPart(tempData).then(({data}) => {
  5415. if (data && data.code === 0) {
  5416. this.$set(this, 'partList1', data.rows)
  5417. }
  5418. })
  5419. // 构建保存数据
  5420. let list = []
  5421. let partList = this.partList1.filter(item => item.buNo === this.searchData.buNo)
  5422. for (let i = 0; i < partList.length; i++) {
  5423. if (partList[i].partNo && partList[i].partNo !== '' && partList[i].buNo) {
  5424. // 克隆item对象并更新部分字段
  5425. let itemCopy = JSON.parse(JSON.stringify(itemTemplate))
  5426. itemCopy.site = partList[i].site
  5427. itemCopy.buNo = partList[i].buNo
  5428. itemCopy.partNo = partList[i].partNo
  5429. itemCopy.codeNo = partList[i].codeNo
  5430. itemCopy.recordType = 'IP'
  5431. list.push({
  5432. site: partList[i].site,
  5433. buNo: partList[i].buNo,
  5434. partNo: partList[i].partNo,
  5435. codeNo: partList[i].codeNo,
  5436. recordType: 'IP',
  5437. itemList: [itemCopy]
  5438. })
  5439. }
  5440. }
  5441. // 调用保存接口
  5442. commitItemsValue(list).then(({data}) => {
  5443. if (data && data.code === 0) {
  5444. this.$message.success('保存成功')
  5445. this.editingCell.isSaving = false
  5446. this.cancelEditCell()
  5447. // 关闭"保存中"的loading,创建"重新计算中"的loading
  5448. loading.close()
  5449. const recalcLoading = this.$loading({
  5450. lock: true,
  5451. text: '重新计算中,请稍后...',
  5452. spinner: 'el-icon-loading',
  5453. background: 'rgba(0, 0, 0, 0.5)'
  5454. })
  5455. // 重新计算BOM单位用量和Routing机器处理时间
  5456. const recalcData = {
  5457. site: this.searchData.site,
  5458. buNo: this.searchData.buNo,
  5459. partNo: this.searchData.partNo,
  5460. codeNo: this.searchData.codeNo
  5461. }
  5462. recalculateBomAndRouting(recalcData).then(({data}) => {
  5463. recalcLoading.close()
  5464. if (data && data.code === 0) {
  5465. this.$message.success('重新计算完成')
  5466. // 刷新当前节点的BOM和Routing数据
  5467. if (this.currentNode && this.currentNode.partNo) {
  5468. if (this.activeTable === 'routing_info') {
  5469. // 如果当前显示Routing,刷新Routing数据
  5470. this.getRoutingInfo(this.currentNode)
  5471. } else {
  5472. // 如果当前显示BOM,刷新BOM数据
  5473. this.getBomInfo2(this.currentNode)
  5474. }
  5475. }
  5476. } else {
  5477. this.$message.warning('重新计算失败,但属性已保存')
  5478. }
  5479. }).catch(error => {
  5480. recalcLoading.close()
  5481. this.$message.warning('重新计算失败,但属性已保存')
  5482. })
  5483. } else {
  5484. loading.close()
  5485. this.$message.error(data.msg || '保存失败')
  5486. this.$set(this.dataList[rowIndex], columnProp, oldValue)
  5487. this.editingCell.isSaving = false
  5488. this.cancelEditCell()
  5489. }
  5490. }).catch(error => {
  5491. loading.close()
  5492. this.$message.error('保存异常')
  5493. this.$set(this.dataList[rowIndex], columnProp, oldValue)
  5494. this.editingCell.isSaving = false
  5495. this.cancelEditCell()
  5496. })
  5497. } catch (error) {
  5498. loading.close()
  5499. this.$message.error('操作失败')
  5500. this.$set(this.dataList[rowIndex], columnProp, oldValue)
  5501. this.editingCell.isSaving = false
  5502. this.cancelEditCell()
  5503. }
  5504. },
  5505. // 取消单元格编辑
  5506. cancelEditCell() {
  5507. this.editingCell.rowIndex = -1
  5508. this.editingCell.columnProp = null
  5509. this.editingCell.value = ''
  5510. this.editingCell.isSaving = false
  5511. },
  5512. async itemUpdateSave() {
  5513. let tempData = {
  5514. site: this.$store.state.user.site,
  5515. buNo: this.searchData.buNo,
  5516. partNo: this.searchData.partNo,
  5517. codeNo: this.searchData.codeNo
  5518. }
  5519. await partInfoByMainPart(tempData).then(({data}) => {
  5520. if (data && data.code === 0){
  5521. this.$set(this, 'partList1', data.rows)
  5522. }else {
  5523. this.$alert(data.msg, '错误', {
  5524. confirmButtonText: '确定'
  5525. })
  5526. }
  5527. })
  5528. let list = []
  5529. let partList = this.partList1.filter(item => item.buNo === this.searchData.buNo)
  5530. for (let i = 0; i <this.partList1.length; i++) {
  5531. if (this.partList1[i].partNo&&this.partList1[i].partNo!==''&&this.partList1[i].buNo){
  5532. let items = JSON.parse(JSON.stringify(this.partItemList1))
  5533. items[0].site = this.searchData.site
  5534. items[0].buNo = partList[i].buNo
  5535. items[0].partNo = partList[i].partNo
  5536. items[0].codeNo = partList[i].codeNo
  5537. items[0].recordType = 'IP'
  5538. list.push({
  5539. site: this.partList1[i].site,
  5540. buNo: this.partList1[i].buNo,
  5541. partNo: this.partList1[i].partNo,
  5542. codeNo: this.partList1[i].codeNo,
  5543. recordType: 'IP',
  5544. itemList: items
  5545. })
  5546. }
  5547. }
  5548. commitItemsValue(list).then(({data}) => {
  5549. if (data && data.code === 0) {
  5550. this.getPartItem()
  5551. // this.autoCompute()
  5552. this.$message({
  5553. message: '操作成功',
  5554. type: 'success',
  5555. duration: 1500,
  5556. onClose: () => {}
  5557. })
  5558. this.itemUpdateFlag = false
  5559. } else {
  5560. this.$alert(data.msg, '错误', {
  5561. confirmButtonText: '确定'
  5562. })
  5563. }
  5564. }).catch((error) => {
  5565. this.$message.error(error)
  5566. })
  5567. },
  5568. /**
  5569. * 打开ProcessTimeMatrix选择对话框
  5570. * 默认查询且只查询商品组编码为 G1701G1702G1703G1704 的数据
  5571. */
  5572. openPtmDialog() {
  5573. if (!this.attributeFlag1) {
  5574. this.$message.warning('请先保存当前编辑的内容!')
  5575. return
  5576. }
  5577. // 检查是否有选中的物料
  5578. if (!this.partList1 || this.partList1.length === 0) {
  5579. this.$message.warning('请先选择物料!')
  5580. return
  5581. }
  5582. // 获取第一个物料的信息
  5583. const firstPart = this.partList1[0]
  5584. // 保存当前BU编号
  5585. this.ptmCurrentBuNo = firstPart.buNo
  5586. // 显示加载提示
  5587. const loadingInstance = this.$loading({
  5588. lock: true,
  5589. text: '正在加载商品组数据...',
  5590. spinner: 'el-icon-loading',
  5591. background: 'rgba(0, 0, 0, 0.3)'
  5592. })
  5593. // 查询该BU下所有商品组1
  5594. const productGroupQuery = {
  5595. userName: this.$store.state.user.name,
  5596. type:'1',
  5597. limit :100,
  5598. page :1
  5599. }
  5600. productGroupInformationSearch(productGroupQuery).then(({data}) => {
  5601. if (data && data.code === 0) {
  5602. const allProductGroups = data.page.list || []
  5603. // 筛选出商品组编码为 G1701、G1702、G1703、G1704 的商品组
  5604. const targetProductGroupIds = ['G1701', 'G1702', 'G1703', 'G1704']
  5605. this.ptmProductGroupList = allProductGroups.filter(item =>
  5606. targetProductGroupIds.includes(item.productGroupId)
  5607. )
  5608. if (this.ptmProductGroupList.length === 0) {
  5609. loadingInstance.close()
  5610. this.$message.warning('未找到商品组编码为 G1701、G1702、G1703、G1704 的商品组!')
  5611. return
  5612. }
  5613. // 默认选中第一个筛选出的商品组
  5614. this.ptmSelectedProductGroupId = this.ptmProductGroupList[0].productGroupId
  5615. // 加载默认选中商品组的PTM数据
  5616. this.loadPtmDataByProductGroup(this.ptmSelectedProductGroupId, loadingInstance)
  5617. } else {
  5618. loadingInstance.close()
  5619. this.$alert(data.msg || '查询商品组失败', '错误', {
  5620. confirmButtonText: '确定'
  5621. })
  5622. }
  5623. }).catch(error => {
  5624. loadingInstance.close()
  5625. this.$message.error('查询商品组异常')
  5626. console.error(error)
  5627. })
  5628. },
  5629. /**
  5630. * 根据商品组ID加载PTM数据
  5631. * @param productGroupId 商品组ID
  5632. * @param loadingInstance loading实例可选
  5633. */
  5634. loadPtmDataByProductGroup(productGroupId, loadingInstance) {
  5635. if (!productGroupId) {
  5636. if (loadingInstance) loadingInstance.close()
  5637. this.$message.warning('请选择商品组1!')
  5638. return
  5639. }
  5640. // 如果没有传入loading实例,创建一个新的
  5641. if (!loadingInstance) {
  5642. loadingInstance = this.$loading({
  5643. lock: true,
  5644. text: '正在加载ProcessTimeMatrix数据...',
  5645. spinner: 'el-icon-loading',
  5646. background: 'rgba(0, 0, 0, 0.3)'
  5647. })
  5648. } else {
  5649. // 更新loading文本
  5650. loadingInstance.text = '正在加载ProcessTimeMatrix数据...'
  5651. }
  5652. // 查询该商品组下所有PTM条件及其参数(一次查询)
  5653. const queryData = {
  5654. site: this.$store.state.user.site,
  5655. buNo: this.ptmCurrentBuNo,
  5656. productGroupId: productGroupId
  5657. }
  5658. batchSearchProductGroupPtmConditionsWithItems(queryData).then(({data}) => {
  5659. loadingInstance.close()
  5660. if (data && data.code === 0) {
  5661. const ptmConditions = data.conditions || []
  5662. const allItems = data.items || []
  5663. if (ptmConditions.length === 0) {
  5664. this.$message.info('该商品组下未配置PTM参数')
  5665. // 清空数据
  5666. this.ptmDataList = []
  5667. this.filteredPtmDataList = []
  5668. this.ptmColumnList = []
  5669. // 打开对话框(显示空表格)
  5670. this.ptmDialogVisible = true
  5671. return
  5672. }
  5673. if (allItems.length === 0) {
  5674. this.$message.info('该商品组的PTM配置中没有参数')
  5675. // 清空数据
  5676. this.ptmDataList = []
  5677. this.filteredPtmDataList = []
  5678. this.ptmColumnList = []
  5679. // 打开对话框(显示空表格)
  5680. this.ptmDialogVisible = true
  5681. return
  5682. }
  5683. // 处理数据:将items按conditionId分组
  5684. this.processPtmData(ptmConditions, allItems)
  5685. } else {
  5686. this.$alert(data.msg || '查询PTM条件失败', '错误', {
  5687. confirmButtonText: '确定'
  5688. })
  5689. }
  5690. }).catch(error => {
  5691. loadingInstance.close()
  5692. this.$message.error('查询PTM条件异常')
  5693. console.error(error)
  5694. })
  5695. },
  5696. /**
  5697. * 处理商品组切换事件
  5698. * @param productGroupId 新选中的商品组ID
  5699. */
  5700. handleProductGroupChange(productGroupId) {
  5701. if (!productGroupId) {
  5702. // 清空数据
  5703. this.ptmDataList = []
  5704. this.filteredPtmDataList = []
  5705. this.ptmColumnList = []
  5706. return
  5707. }
  5708. // 重新加载PTM数据
  5709. this.loadPtmDataByProductGroup(productGroupId)
  5710. },
  5711. /**
  5712. * 处理PTM数据横向展示
  5713. * 将后端返回的数据处理成表格展示格式
  5714. * @param ptmConditions PTM条件列表
  5715. * @param allItems 所有参数列表
  5716. */
  5717. processPtmData(ptmConditions, allItems) {
  5718. const flatDataList = []
  5719. const columnSet = new Set()
  5720. const columnMap = new Map()
  5721. // 将items按conditionId分组
  5722. const itemsByCondition = {}
  5723. allItems.forEach(item => {
  5724. if (!itemsByCondition[item.conditionId]) {
  5725. itemsByCondition[item.conditionId] = []
  5726. }
  5727. itemsByCondition[item.conditionId].push(item)
  5728. // 收集唯一的列信息
  5729. if (!columnSet.has(item.itemNo)) {
  5730. columnSet.add(item.itemNo)
  5731. columnMap.set(item.itemNo, {
  5732. itemNo: item.itemNo,
  5733. itemDesc: item.itemDesc,
  5734. valueType: item.valueTypeDb,
  5735. valueChooseFlag: item.valueChooseFlag
  5736. })
  5737. }
  5738. })
  5739. // 构建表格数据
  5740. ptmConditions.forEach(condition => {
  5741. const items = itemsByCondition[condition.conditionId] || []
  5742. if (items.length === 0) {
  5743. return
  5744. }
  5745. // 构建一行数据:包含conditionDesc和所有参数的值
  5746. const rowData = {
  5747. conditionId: condition.conditionId,
  5748. conditionDesc: condition.conditionDesc,
  5749. seqNo: condition.seqNo,
  5750. site: condition.site,
  5751. buNo: condition.buNo,
  5752. productGroupId: condition.productGroupId,
  5753. items: items // 保存原始items数据,用于后续添加操作
  5754. }
  5755. // 将每个参数转换为列数据
  5756. items.forEach(item => {
  5757. const propName = `param_${item.itemNo}`
  5758. const displayValue = item.valueTypeDb === 'T' ? item.textValue : item.numValue
  5759. rowData[propName] = displayValue || '-'
  5760. })
  5761. flatDataList.push(rowData)
  5762. })
  5763. // 构建动态列配置
  5764. const columns = []
  5765. columnMap.forEach((colInfo, itemNo) => {
  5766. columns.push({
  5767. prop: `param_${itemNo}`,
  5768. label: colInfo.itemDesc || itemNo,
  5769. itemNo: itemNo,
  5770. valueType: colInfo.valueType,
  5771. width: 110,
  5772. align: colInfo.valueType === 'N' ? 'right' : 'left'
  5773. })
  5774. })
  5775. // 按itemNo排序列
  5776. columns.sort((a, b) => a.itemNo.localeCompare(b.itemNo))
  5777. // 设置数据并打开对话框
  5778. this.ptmDataList = flatDataList
  5779. this.filteredPtmDataList = flatDataList
  5780. this.ptmColumnList = columns
  5781. this.ptmSearchCode = ''
  5782. this.ptmDialogVisible = true
  5783. this.$message.success(`已加载 ${flatDataList.length} 个 ProcessTimeMatrix(共 ${columns.length} 个参数列)`)
  5784. },
  5785. /**
  5786. * 处理双击PTM行事件
  5787. * @param row 双击的行数据
  5788. */
  5789. handlePtmRowDoubleClick(row) {
  5790. if (!row || !row.items || row.items.length === 0) {
  5791. this.$message.warning('该ProcessTimeMatrix没有参数!')
  5792. return
  5793. }
  5794. // 显示loading
  5795. const loadingInstance = this.$loading({
  5796. lock: true,
  5797. text: '正在添加参数...',
  5798. spinner: 'el-icon-loading',
  5799. background: 'rgba(0, 0, 0, 0.3)'
  5800. })
  5801. // 直接添加该行的参数
  5802. this.addPtmItemsFromRow(row, loadingInstance)
  5803. },
  5804. /**
  5805. * 筛选PTM列表按Code条件描述
  5806. */
  5807. filterPtmList() {
  5808. if (!this.ptmSearchCode || this.ptmSearchCode.trim() === '') {
  5809. this.filteredPtmDataList = this.ptmDataList
  5810. return
  5811. }
  5812. const searchText = this.ptmSearchCode.trim().toLowerCase()
  5813. this.filteredPtmDataList = this.ptmDataList.filter(row => {
  5814. return row.conditionDesc && row.conditionDesc.toLowerCase().includes(searchText)
  5815. })
  5816. if (this.filteredPtmDataList.length === 0) {
  5817. this.$message.info('没有找到匹配的ProcessTimeMatrix')
  5818. } else {
  5819. this.$message.success(`找到 ${this.filteredPtmDataList.length} 条匹配的ProcessTimeMatrix`)
  5820. }
  5821. },
  5822. /**
  5823. * 重置PTM筛选
  5824. */
  5825. resetPtmFilter() {
  5826. this.ptmSearchCode = ''
  5827. this.filteredPtmDataList = this.ptmDataList
  5828. this.$message.info('已重置筛选条件')
  5829. },
  5830. /**
  5831. * 添加选中的PTM行的参数到物料属性列表
  5832. * @param row 双击的行数据
  5833. * @param loadingInstance loading实例
  5834. */
  5835. addPtmItemsFromRow(row, loadingInstance) {
  5836. // 从行中提取参数,并转换为后端期望的格式
  5837. const allItems = []
  5838. if (row.items && row.items.length > 0) {
  5839. row.items.forEach(item => {
  5840. // 转换为后端期望的格式
  5841. const itemData = {
  5842. itNo: item.itemNo, // 属性编码(后端接口字段名为itNo)
  5843. valueTypeDb: item.valueTypeDb,
  5844. itemDesc: item.itemDesc
  5845. }
  5846. // 根据类型设置值
  5847. if (item.valueTypeDb === 'T') {
  5848. itemData.textValue = item.textValue || null
  5849. itemData.numValue = null
  5850. } else if (item.valueTypeDb === 'N') {
  5851. itemData.textValue = null
  5852. // 确保numValue是数值类型
  5853. itemData.numValue = item.numValue !== null && item.numValue !== undefined && item.numValue !== ''
  5854. ? (typeof item.numValue === 'number' ? item.numValue : parseFloat(item.numValue))
  5855. : null
  5856. }
  5857. allItems.push(itemData)
  5858. })
  5859. }
  5860. if (allItems.length === 0) {
  5861. loadingInstance.close()
  5862. this.$message.warning('选中的ProcessTimeMatrix中没有参数!')
  5863. return
  5864. }
  5865. // 使用与addItem1相同的逻辑
  5866. const partList = this.partList1.filter(item =>
  5867. item.partNo && item.partNo !== '' && item.buNo && item.buNo === this.searchData.buNo
  5868. )
  5869. if (partList.length === 0) {
  5870. loadingInstance.close()
  5871. this.$message.warning('没有符合条件的物料!')
  5872. return
  5873. }
  5874. const inDataList = []
  5875. for (let i = 0; i < partList.length; i++) {
  5876. if (!partList[i].codeNo || partList[i].codeNo === '') {
  5877. continue
  5878. }
  5879. inDataList.push({
  5880. site: partList[i].site,
  5881. buNo: partList[i].buNo,
  5882. partNo: partList[i].partNo,
  5883. codeNo: partList[i].codeNo,
  5884. codeDesc: partList[i].codeDesc,
  5885. recordType: 'IP',
  5886. itemList: allItems
  5887. })
  5888. }
  5889. if (inDataList.length === 0) {
  5890. loadingInstance.close()
  5891. this.$message.warning('请确保物料已配置属性模板(codeNo)!')
  5892. return
  5893. }
  5894. // 调用批量添加接口(与addItem1相同的逻辑)
  5895. addPartsItem(inDataList).then(({data}) => {
  5896. if (data && data.code === 0) {
  5897. // 更新可选属性列表和已有属性列表
  5898. getItemLists(inDataList[0]).then(({data}) => {
  5899. this.itemList1 = data.row1
  5900. this.itemList2 = data.row2
  5901. loadingInstance.close()
  5902. // 刷新物料属性列表
  5903. this.getPartItem2()
  5904. this.$message.success(`成功添加 ${allItems.length} 个参数(ProcessTimeMatrix: ${row.conditionDesc}`)
  5905. // 关闭对话框
  5906. this.ptmDialogVisible = false
  5907. // 清空数据
  5908. this.ptmDataList = []
  5909. this.filteredPtmDataList = []
  5910. this.ptmColumnList = []
  5911. }).catch(error => {
  5912. loadingInstance.close()
  5913. this.getPartItem2()
  5914. this.$message.success(`成功添加 ${allItems.length} 个参数(ProcessTimeMatrix: ${row.conditionDesc}`)
  5915. this.ptmDialogVisible = false
  5916. this.ptmDataList = []
  5917. this.filteredPtmDataList = []
  5918. this.ptmColumnList = []
  5919. })
  5920. } else {
  5921. loadingInstance.close()
  5922. this.$alert(data.msg || '添加属性失败', '错误', {
  5923. confirmButtonText: '确定'
  5924. })
  5925. }
  5926. }).catch(error => {
  5927. loadingInstance.close()
  5928. this.$message.error('添加属性异常: ' + error.message)
  5929. console.error(error)
  5930. })
  5931. },
  5932. },
  5933. }
  5934. </script>
  5935. <style lang="scss" scoped>
  5936. .ndoe-list__input {
  5937. > .el-input__inner {
  5938. cursor: pointer;
  5939. }
  5940. }
  5941. .white-body-view {
  5942. width: 100%;
  5943. min-width: 320px;
  5944. }
  5945. // 单元格编辑样式
  5946. ::v-deep .el-table__body-wrapper {
  5947. .el-table__row {
  5948. .cell {
  5949. div[style*="cursor: pointer"] {
  5950. &:hover {
  5951. background-color: #f5f7fa;
  5952. border-radius: 2px;
  5953. transition: background-color 0.2s;
  5954. }
  5955. }
  5956. }
  5957. }
  5958. }
  5959. .structure-tree {
  5960. .el-scrollbar .el-scrollbar__wrap {
  5961. overflow-x: hidden;
  5962. }
  5963. #my-tree .el-tree > .el-tree-node {
  5964. min-width: 100%;
  5965. display: inline-block;
  5966. }
  5967. .el-tree-node__content {
  5968. margin-bottom: 10px;
  5969. }
  5970. .tooltip {
  5971. margin-right: 5px;
  5972. font-size: 13px;
  5973. border-radius: 4px;
  5974. box-sizing: border-box;
  5975. white-space: nowrap;
  5976. padding: 4px;
  5977. }
  5978. .operation-view {
  5979. display: inline-block;
  5980. padding: 0px 5px;
  5981. margin-left: 5px;
  5982. color: #777777;
  5983. }
  5984. .small-operation-btn {
  5985. margin: 0px 3px;
  5986. }
  5987. }
  5988. .el-icon-plus:hover {
  5989. color: #1c92e0;
  5990. }
  5991. .el-icon-edit:hover {
  5992. color: #1c92e0;
  5993. }
  5994. .el-icon-delete:hover {
  5995. color: #1c92e0;
  5996. }
  5997. ::v-deep .el-tree {
  5998. color: #333333;
  5999. }
  6000. .el-table /deep/ .cell{
  6001. height: auto;
  6002. line-height: 1.5;
  6003. }
  6004. /deep/ .customer-tab .el-tabs__item {
  6005. height: 35px;
  6006. line-height: 38px;
  6007. font-size: 13px;
  6008. }
  6009. .down-tree{
  6010. //height: 470px;
  6011. display: block;
  6012. overflow-y: scroll;
  6013. }
  6014. </style>