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.

4403 lines
147 KiB

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