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

4059 lines
136 KiB

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