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.

4512 lines
150 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
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
  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: 80px"></el-input>
  143. </el-form-item>
  144. <el-form-item :label="'工程版本号'">
  145. <el-input v-model="modalData.engRevision" readonly style="width: 90px"></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: 120px">保存</el-button>
  152. <el-button v-else-if="modalData.flag === '2'" type="primary" @click="copyBomRevision" style="margin-top: 23px;width: 120px">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: 120px"></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: 225px"></el-input>
  364. </el-form-item>
  365. <el-form-item :label="'状态'" prop="status" :rules="detailRules.status">
  366. <el-input v-model="saveDetailData.status" disabled style="width: 120px"></el-input>
  367. </el-form-item>
  368. </el-form>
  369. <!-- <el-form :inline="true" label-position="top" :model="saveDetailData" :rules="detailRules" style="margin-left: 5px">-->
  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="940px">
  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="940px">
  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" @input="validateInput" style="width: 112px"></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" @input="validateInput" style="width: 112px"></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" disabled 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="940px">
  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: 200
  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: "left",
  1443. columnLabel: '零件类型',
  1444. columnHidden: false,
  1445. columnImage: false,
  1446. status: true,
  1447. fixed: '',
  1448. columnWidth: 140
  1449. },
  1450. {
  1451. columnProp: 'partStatusDesc',
  1452. headerAlign: "center",
  1453. align: "left",
  1454. columnLabel: '零件状态',
  1455. columnHidden: false,
  1456. columnImage: false,
  1457. status: true,
  1458. fixed: '',
  1459. columnWidth: 120
  1460. }
  1461. ],
  1462. componentPartColumnList: [
  1463. {
  1464. columnProp: 'partNo',
  1465. headerAlign: "center",
  1466. align: "center",
  1467. columnLabel: '物料编码',
  1468. columnHidden: false,
  1469. columnImage: false,
  1470. status: true,
  1471. fixed: '',
  1472. columnWidth: 120
  1473. },
  1474. {
  1475. columnProp: 'partDesc',
  1476. headerAlign: "center",
  1477. align: "left",
  1478. columnLabel: '物料名称',
  1479. columnHidden: false,
  1480. columnImage: false,
  1481. status: true,
  1482. fixed: '',
  1483. columnWidth: 200
  1484. },
  1485. {
  1486. columnProp: 'familyName',
  1487. headerAlign: "center",
  1488. align: "center",
  1489. columnLabel: '物料分类',
  1490. columnHidden: false,
  1491. columnImage: false,
  1492. status: true,
  1493. fixed: '',
  1494. columnWidth: 100
  1495. },
  1496. {
  1497. columnProp: 'printUnit',
  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: 'spec',
  1509. headerAlign: "center",
  1510. align: "left",
  1511. columnLabel: '规格型号',
  1512. columnHidden: false,
  1513. columnImage: false,
  1514. status: true,
  1515. fixed: '',
  1516. columnWidth: 100
  1517. },
  1518. {
  1519. columnProp: 'partType',
  1520. headerAlign: "center",
  1521. align: "center",
  1522. columnLabel: '零件类型',
  1523. columnHidden: false,
  1524. columnImage: false,
  1525. status: true,
  1526. fixed: '',
  1527. columnWidth: 130
  1528. },
  1529. {
  1530. columnProp: 'partStatusDesc',
  1531. headerAlign: "center",
  1532. align: "left",
  1533. columnLabel: '零件状态',
  1534. columnHidden: false,
  1535. columnImage: false,
  1536. status: true,
  1537. fixed: '',
  1538. columnWidth: 120
  1539. }
  1540. ],
  1541. columnSubDetailList: [
  1542. {
  1543. userId: this.$store.state.user.name,
  1544. functionId: 104002,
  1545. serialNumber: '104002Table2LineSequence',
  1546. tableId: '104002Table2',
  1547. tableName: 'BOM子物料表',
  1548. columnProp: 'lineSequence',
  1549. headerAlign: 'center',
  1550. align: 'center',
  1551. columnLabel: '序号',
  1552. columnHidden: false,
  1553. columnImage: false,
  1554. columnSortable: false,
  1555. sortLv: 0,
  1556. status: true,
  1557. fixed: '',
  1558. columnWidth: 60
  1559. },
  1560. {
  1561. userId: this.$store.state.user.name,
  1562. functionId: 104002,
  1563. serialNumber: '104002Table2ComponentPart',
  1564. tableId: '104002Table2',
  1565. tableName: 'BOM子物料表',
  1566. columnProp: 'componentPart',
  1567. headerAlign: 'center',
  1568. align: 'center',
  1569. columnLabel: '物料编码',
  1570. columnHidden: false,
  1571. columnImage: false,
  1572. columnSortable: false,
  1573. sortLv: 0,
  1574. status: true,
  1575. fixed: '',
  1576. columnWidth: 120
  1577. },
  1578. {
  1579. userId: this.$store.state.user.name,
  1580. functionId: 104002,
  1581. serialNumber: '104002Table2ComponentPartDesc',
  1582. tableId: '104002Table2',
  1583. tableName: 'BOM子物料表',
  1584. columnProp: 'componentPartDesc',
  1585. headerAlign: 'center',
  1586. align: 'left',
  1587. columnLabel: '物料名称',
  1588. columnHidden: false,
  1589. columnImage: false,
  1590. columnSortable: false,
  1591. sortLv: 0,
  1592. status: true,
  1593. fixed: '',
  1594. columnWidth: 120
  1595. },
  1596. {
  1597. userId: this.$store.state.user.name,
  1598. functionId: 104002,
  1599. serialNumber: '104002Table2PartStatus',
  1600. tableId: '104002Table2',
  1601. tableName: 'BOM子物料表',
  1602. columnProp: 'partStatus',
  1603. headerAlign: 'center',
  1604. align: 'left',
  1605. columnLabel: '零件状态编码',
  1606. columnHidden: false,
  1607. columnImage: false,
  1608. columnSortable: false,
  1609. sortLv: 0,
  1610. status: true,
  1611. fixed: '',
  1612. columnWidth: 100
  1613. },
  1614. {
  1615. userId: this.$store.state.user.name,
  1616. functionId: 104002,
  1617. serialNumber: '104002Table2PartStatusDesc',
  1618. tableId: '104002Table2',
  1619. tableName: 'BOM子物料表',
  1620. columnProp: 'partStatusDesc',
  1621. headerAlign: 'center',
  1622. align: 'left',
  1623. columnLabel: '零件状态名称',
  1624. columnHidden: false,
  1625. columnImage: false,
  1626. columnSortable: false,
  1627. sortLv: 0,
  1628. status: true,
  1629. fixed: '',
  1630. columnWidth: 100
  1631. },
  1632. {
  1633. userId: this.$store.state.user.name,
  1634. functionId: 104002,
  1635. serialNumber: '104002Table2QtyPerAssembly',
  1636. tableId: '104002Table2',
  1637. tableName: 'BOM子物料表',
  1638. columnProp: 'qtyPerAssembly',
  1639. headerAlign: 'center',
  1640. align: 'right',
  1641. columnLabel: '单位用量',
  1642. columnHidden: false,
  1643. columnImage: false,
  1644. columnSortable: false,
  1645. sortLv: 0,
  1646. status: true,
  1647. fixed: '',
  1648. columnWidth: 110
  1649. },
  1650. {
  1651. userId: this.$store.state.user.name,
  1652. functionId: 104002,
  1653. serialNumber: '104002Table2ComponentScrap',
  1654. tableId: '104002Table2',
  1655. tableName: 'BOM子物料表',
  1656. columnProp: 'componentScrap',
  1657. headerAlign: 'center',
  1658. align: 'right',
  1659. columnLabel: '调机量',
  1660. columnHidden: false,
  1661. columnImage: false,
  1662. columnSortable: false,
  1663. sortLv: 0,
  1664. status: true,
  1665. fixed: '',
  1666. columnWidth: 110
  1667. },
  1668. {
  1669. userId: this.$store.state.user.name,
  1670. functionId: 104002,
  1671. serialNumber: '104002Table2ShrinkageFactor',
  1672. tableId: '104002Table2',
  1673. tableName: 'BOM子物料表',
  1674. columnProp: 'shrinkageFactor',
  1675. headerAlign: 'center',
  1676. align: 'right',
  1677. columnLabel: '损耗率',
  1678. columnHidden: false,
  1679. columnImage: false,
  1680. columnSortable: false,
  1681. sortLv: 0,
  1682. status: true,
  1683. fixed: '',
  1684. columnWidth: 80
  1685. },
  1686. {
  1687. userId: this.$store.state.user.name,
  1688. functionId: 104002,
  1689. serialNumber: '104002Table2ConsumptionItem',
  1690. tableId: '104002Table2',
  1691. tableName: 'BOM子物料表',
  1692. columnProp: 'consumptionItem',
  1693. headerAlign: 'center',
  1694. align: 'left',
  1695. columnLabel: '消耗项目',
  1696. columnHidden: false,
  1697. columnImage: false,
  1698. columnSortable: false,
  1699. sortLv: 0,
  1700. status: true,
  1701. fixed: '',
  1702. columnWidth: 80
  1703. },
  1704. {
  1705. userId: this.$store.state.user.name,
  1706. functionId: 104002,
  1707. serialNumber: '104002Table2PrintUnit',
  1708. tableId: '104002Table2',
  1709. tableName: 'BOM子物料表',
  1710. columnProp: 'printUnit',
  1711. headerAlign: 'center',
  1712. align: 'center',
  1713. columnLabel: '单位',
  1714. columnHidden: false,
  1715. columnImage: false,
  1716. columnSortable: false,
  1717. sortLv: 0,
  1718. status: true,
  1719. fixed: '',
  1720. columnWidth: 60
  1721. },
  1722. {
  1723. userId: this.$store.state.user.name,
  1724. functionId: 104002,
  1725. serialNumber: '104002Table2IssueType',
  1726. tableId: '104002Table2',
  1727. tableName: 'BOM子物料表',
  1728. columnProp: 'issueType',
  1729. headerAlign: 'center',
  1730. align: 'center',
  1731. columnLabel: '生产属性',
  1732. columnHidden: false,
  1733. columnImage: false,
  1734. columnSortable: false,
  1735. sortLv: 0,
  1736. status: true,
  1737. fixed: '',
  1738. columnWidth: 140
  1739. },
  1740. {
  1741. userId: this.$store.state.user.name,
  1742. functionId: 104002,
  1743. serialNumber: '104002Table2OperationNo',
  1744. tableId: '104002Table2',
  1745. tableName: 'BOM子物料表',
  1746. columnProp: 'operationNo',
  1747. headerAlign: 'center',
  1748. align: 'center',
  1749. columnLabel: '工序',
  1750. columnHidden: false,
  1751. columnImage: false,
  1752. columnSortable: false,
  1753. sortLv: 0,
  1754. status: true,
  1755. fixed: '',
  1756. columnWidth: 80
  1757. },
  1758. {
  1759. userId: this.$store.state.user.name,
  1760. functionId: 104002,
  1761. serialNumber: '104002Table2IssueToLoc',
  1762. tableId: '104002Table2',
  1763. tableName: 'BOM子物料表',
  1764. columnProp: 'issueToLocName',
  1765. headerAlign: 'center',
  1766. align: 'center',
  1767. columnLabel: '发料库位',
  1768. columnHidden: false,
  1769. columnImage: false,
  1770. columnSortable: false,
  1771. sortLv: 0,
  1772. status: true,
  1773. fixed: '',
  1774. columnWidth: 80
  1775. },
  1776. {
  1777. userId: this.$store.state.user.name,
  1778. functionId: 104002,
  1779. serialNumber: '104002Table2NoteText',
  1780. tableId: '104002Table2',
  1781. tableName: 'BOM子物料表',
  1782. columnProp: 'noteText',
  1783. headerAlign: 'center',
  1784. align: 'left',
  1785. columnLabel: '备注',
  1786. columnHidden: false,
  1787. columnImage: false,
  1788. columnSortable: false,
  1789. sortLv: 0,
  1790. status: true,
  1791. fixed: '',
  1792. columnWidth: 150
  1793. },
  1794. ],
  1795. columnSubDetailList2: [
  1796. {
  1797. userId: this.$store.state.user.name,
  1798. functionId: 104002,
  1799. serialNumber: '104002Table3LineSequence',
  1800. tableId: '104002Table3',
  1801. tableName: 'BOM副产品表',
  1802. columnProp: 'lineSequence',
  1803. headerAlign: 'center',
  1804. align: 'center',
  1805. columnLabel: '序号',
  1806. columnHidden: false,
  1807. columnImage: false,
  1808. columnSortable: false,
  1809. sortLv: 0,
  1810. status: true,
  1811. fixed: '',
  1812. columnWidth: 60
  1813. },
  1814. {
  1815. userId: this.$store.state.user.name,
  1816. functionId: 104002,
  1817. serialNumber: '104002Table3ComponentPart',
  1818. tableId: '104002Table3',
  1819. tableName: 'BOM副产品表',
  1820. columnProp: 'componentPart',
  1821. headerAlign: 'center',
  1822. align: 'center',
  1823. columnLabel: '物料编码',
  1824. columnHidden: false,
  1825. columnImage: false,
  1826. columnSortable: false,
  1827. sortLv: 0,
  1828. status: true,
  1829. fixed: '',
  1830. columnWidth: 120
  1831. },
  1832. {
  1833. userId: this.$store.state.user.name,
  1834. functionId: 104002,
  1835. serialNumber: '104002Table3ComponentPartDesc',
  1836. tableId: '104002Table3',
  1837. tableName: 'BOM副产品表',
  1838. columnProp: 'componentPartDesc',
  1839. headerAlign: 'center',
  1840. align: 'left',
  1841. columnLabel: '物料名称',
  1842. columnHidden: false,
  1843. columnImage: false,
  1844. columnSortable: false,
  1845. sortLv: 0,
  1846. status: true,
  1847. fixed: '',
  1848. columnWidth: 120
  1849. },
  1850. {
  1851. userId: this.$store.state.user.name,
  1852. functionId: 104002,
  1853. serialNumber: '104002Table3PartStatus',
  1854. tableId: '104002Table3',
  1855. tableName: 'BOM副产品表',
  1856. columnProp: 'partStatus',
  1857. headerAlign: 'center',
  1858. align: 'left',
  1859. columnLabel: '零件状态编码',
  1860. columnHidden: false,
  1861. columnImage: false,
  1862. columnSortable: false,
  1863. sortLv: 0,
  1864. status: true,
  1865. fixed: '',
  1866. columnWidth: 100
  1867. },
  1868. {
  1869. userId: this.$store.state.user.name,
  1870. functionId: 104002,
  1871. serialNumber: '104002Table3PartStatusDesc',
  1872. tableId: '104002Table3',
  1873. tableName: 'BOM副产品表',
  1874. columnProp: 'partStatusDesc',
  1875. headerAlign: 'center',
  1876. align: 'left',
  1877. columnLabel: '零件状态名称',
  1878. columnHidden: false,
  1879. columnImage: false,
  1880. columnSortable: false,
  1881. sortLv: 0,
  1882. status: true,
  1883. fixed: '',
  1884. columnWidth: 100
  1885. },
  1886. {
  1887. userId: this.$store.state.user.name,
  1888. functionId: 104002,
  1889. serialNumber: '104002Table3QtyPerAssembly',
  1890. tableId: '104002Table3',
  1891. tableName: 'BOM副产品表',
  1892. columnProp: 'qtyPerAssembly',
  1893. headerAlign: 'center',
  1894. align: 'right',
  1895. columnLabel: '单位用量',
  1896. columnHidden: false,
  1897. columnImage: false,
  1898. columnSortable: false,
  1899. sortLv: 0,
  1900. status: true,
  1901. fixed: '',
  1902. columnWidth: 110
  1903. },
  1904. {
  1905. userId: this.$store.state.user.name,
  1906. functionId: 104002,
  1907. serialNumber: '104002Table3ComponentScrap',
  1908. tableId: '104002Table3',
  1909. tableName: 'BOM副产品表',
  1910. columnProp: 'componentScrap',
  1911. headerAlign: 'center',
  1912. align: 'right',
  1913. columnLabel: '调机量',
  1914. columnHidden: false,
  1915. columnImage: false,
  1916. columnSortable: false,
  1917. sortLv: 0,
  1918. status: true,
  1919. fixed: '',
  1920. columnWidth: 110
  1921. },
  1922. {
  1923. userId: this.$store.state.user.name,
  1924. functionId: 104002,
  1925. serialNumber: '104002Table3ShrinkageFactor',
  1926. tableId: '104002Table3',
  1927. tableName: 'BOM副产品表',
  1928. columnProp: 'shrinkageFactor',
  1929. headerAlign: 'center',
  1930. align: 'right',
  1931. columnLabel: '损耗率',
  1932. columnHidden: false,
  1933. columnImage: false,
  1934. columnSortable: false,
  1935. sortLv: 0,
  1936. status: true,
  1937. fixed: '',
  1938. columnWidth: 80
  1939. },
  1940. {
  1941. userId: this.$store.state.user.name,
  1942. functionId: 104002,
  1943. serialNumber: '104002Table3PrintUnit',
  1944. tableId: '104002Table3',
  1945. tableName: 'BOM副产品表',
  1946. columnProp: 'printUnit',
  1947. headerAlign: 'center',
  1948. align: 'center',
  1949. columnLabel: '单位',
  1950. columnHidden: false,
  1951. columnImage: false,
  1952. columnSortable: false,
  1953. sortLv: 0,
  1954. status: true,
  1955. fixed: '',
  1956. columnWidth: 60
  1957. },
  1958. {
  1959. userId: this.$store.state.user.name,
  1960. functionId: 104002,
  1961. serialNumber: '104002Table3IssueType',
  1962. tableId: '104002Table3',
  1963. tableName: 'BOM副产品表',
  1964. columnProp: 'issueType',
  1965. headerAlign: 'center',
  1966. align: 'center',
  1967. columnLabel: '生产属性',
  1968. columnHidden: false,
  1969. columnImage: false,
  1970. columnSortable: false,
  1971. sortLv: 0,
  1972. status: true,
  1973. fixed: '',
  1974. columnWidth: 140
  1975. },
  1976. {
  1977. userId: this.$store.state.user.name,
  1978. functionId: 104002,
  1979. serialNumber: '104002Table3OperationDesc',
  1980. tableId: '104002Table3',
  1981. tableName: 'BOM副产品表',
  1982. columnProp: 'operationId',
  1983. headerAlign: 'center',
  1984. align: 'center',
  1985. columnLabel: '工序',
  1986. columnHidden: false,
  1987. columnImage: false,
  1988. columnSortable: false,
  1989. sortLv: 0,
  1990. status: true,
  1991. fixed: '',
  1992. columnWidth: 80
  1993. },
  1994. {
  1995. userId: this.$store.state.user.name,
  1996. functionId: 104002,
  1997. serialNumber: '104002Table3IssueToLoc',
  1998. tableId: '104002Table3',
  1999. tableName: 'BOM副产品表',
  2000. columnProp: 'issueToLocName',
  2001. headerAlign: 'center',
  2002. align: 'center',
  2003. columnLabel: '发料库位',
  2004. columnHidden: false,
  2005. columnImage: false,
  2006. columnSortable: false,
  2007. sortLv: 0,
  2008. status: true,
  2009. fixed: '',
  2010. columnWidth: 80
  2011. },
  2012. {
  2013. userId: this.$store.state.user.name,
  2014. functionId: 104002,
  2015. serialNumber: '104002Table3NoteText',
  2016. tableId: '104002Table3',
  2017. tableName: 'BOM副产品表',
  2018. columnProp: 'noteText',
  2019. headerAlign: 'center',
  2020. align: 'left',
  2021. columnLabel: '备注',
  2022. columnHidden: false,
  2023. columnImage: false,
  2024. columnSortable: false,
  2025. sortLv: 0,
  2026. status: true,
  2027. fixed: '',
  2028. columnWidth: 150
  2029. },
  2030. ],
  2031. operationDetailList: [
  2032. {
  2033. columnProp: 'routingRevision',
  2034. headerAlign: "center",
  2035. align: "center",
  2036. columnLabel: 'Routing版本号',
  2037. columnHidden: false,
  2038. columnImage: false,
  2039. status: true,
  2040. fixed: '',
  2041. columnWidth: 100
  2042. },
  2043. {
  2044. columnProp: 'routingType',
  2045. headerAlign: "center",
  2046. align: "center",
  2047. columnLabel: '工艺类型',
  2048. columnHidden: false,
  2049. columnImage: false,
  2050. status: true,
  2051. fixed: '',
  2052. columnWidth: 100
  2053. },
  2054. {
  2055. columnProp: 'alternativeNo',
  2056. headerAlign: "center",
  2057. align: "center",
  2058. columnLabel: '替代编码',
  2059. columnHidden: false,
  2060. columnImage: false,
  2061. status: true,
  2062. fixed: '',
  2063. columnWidth: 80
  2064. },
  2065. {
  2066. columnProp: 'alternativeDescription',
  2067. headerAlign: "center",
  2068. align: "left",
  2069. columnLabel: '替代名称',
  2070. columnHidden: false,
  2071. columnImage: false,
  2072. status: true,
  2073. fixed: '',
  2074. columnWidth: 100
  2075. },
  2076. {
  2077. columnProp: 'status',
  2078. headerAlign: "center",
  2079. align: "center",
  2080. columnLabel: '替代状态',
  2081. columnHidden: false,
  2082. columnImage: false,
  2083. status: true,
  2084. fixed: '',
  2085. columnWidth: 80
  2086. },
  2087. {
  2088. columnProp: 'operationNo',
  2089. headerAlign: "center",
  2090. align: "center",
  2091. columnLabel: '工序编码',
  2092. columnHidden: false,
  2093. columnImage: false,
  2094. status: true,
  2095. fixed: '',
  2096. columnWidth: 80
  2097. },
  2098. {
  2099. columnProp: 'operationName',
  2100. headerAlign: "center",
  2101. align: "left",
  2102. columnLabel: '工序名称',
  2103. columnHidden: false,
  2104. columnImage: false,
  2105. status: true,
  2106. fixed: '',
  2107. columnWidth: 100
  2108. }
  2109. ],
  2110. columnBomDetailList: [
  2111. {
  2112. columnProp: 'alternativeNo',
  2113. headerAlign: "center",
  2114. align: "center",
  2115. columnLabel: '替代编码',
  2116. columnHidden: false,
  2117. columnImage: false,
  2118. status: true,
  2119. fixed: '',
  2120. columnWidth: 100
  2121. },
  2122. {
  2123. columnProp: 'alternativeDescription',
  2124. headerAlign: "center",
  2125. align: "left",
  2126. columnLabel: '替代名称',
  2127. columnHidden: false,
  2128. columnImage: false,
  2129. status: true,
  2130. fixed: '',
  2131. columnWidth: 200
  2132. },
  2133. {
  2134. columnProp: 'status',
  2135. headerAlign: "center",
  2136. align: "center",
  2137. columnLabel: '状态',
  2138. columnHidden: false,
  2139. columnImage: false,
  2140. status: true,
  2141. fixed: '',
  2142. columnWidth: 100
  2143. },
  2144. ],
  2145. columnManufStructCostDistribList: [
  2146. {
  2147. columnProp: 'byProdLineItemNo',
  2148. headerAlign: "center",
  2149. align: "center",
  2150. columnLabel: '副产品行项目号',
  2151. columnHidden: false,
  2152. columnImage: false,
  2153. status: true,
  2154. fixed: '',
  2155. columnWidth: 60
  2156. },
  2157. {
  2158. columnProp: 'byProdPartNo',
  2159. headerAlign: "center",
  2160. align: "center",
  2161. columnLabel: '副产品物料编码',
  2162. columnHidden: false,
  2163. columnImage: false,
  2164. status: true,
  2165. fixed: '',
  2166. columnWidth: 120
  2167. },
  2168. {
  2169. columnProp: 'byProdPartDesc',
  2170. headerAlign: "center",
  2171. align: "left",
  2172. columnLabel: '副产品物料名称',
  2173. columnHidden: false,
  2174. columnImage: false,
  2175. status: true,
  2176. fixed: '',
  2177. columnWidth: 150
  2178. },
  2179. {
  2180. columnProp: 'componentLineItemNo',
  2181. headerAlign: "center",
  2182. align: "center",
  2183. columnLabel: '子物料项目号',
  2184. columnHidden: false,
  2185. columnImage: false,
  2186. status: true,
  2187. fixed: '',
  2188. columnWidth: 60
  2189. },
  2190. {
  2191. columnProp: 'componentPartNo',
  2192. headerAlign: "center",
  2193. align: "center",
  2194. columnLabel: '子物料编码',
  2195. columnHidden: false,
  2196. columnImage: false,
  2197. status: true,
  2198. fixed: '',
  2199. columnWidth: 120
  2200. },
  2201. {
  2202. columnProp: 'componentPartDesc',
  2203. headerAlign: "center",
  2204. align: "left",
  2205. columnLabel: '子物料名称',
  2206. columnHidden: false,
  2207. columnImage: false,
  2208. status: true,
  2209. fixed: '',
  2210. columnWidth: 150
  2211. },
  2212. {
  2213. columnProp: 'itemCostDistribution',
  2214. headerAlign: "center",
  2215. align: "center",
  2216. columnLabel: '项目成本分配因素',
  2217. columnHidden: false,
  2218. columnImage: false,
  2219. status: true,
  2220. fixed: '',
  2221. columnWidth: 60
  2222. },
  2223. ],
  2224. columnMultiLevelStructureList: [
  2225. {
  2226. columnProp: 'partNo',
  2227. headerAlign: "center",
  2228. align: "center",
  2229. columnLabel: '物料编码',
  2230. columnHidden: false,
  2231. columnImage: false,
  2232. status: true,
  2233. fixed: '',
  2234. columnWidth: 100
  2235. },
  2236. {
  2237. columnProp: 'partDesc',
  2238. headerAlign: "center",
  2239. align: "left",
  2240. columnLabel: '物料名称',
  2241. columnHidden: false,
  2242. columnImage: false,
  2243. status: true,
  2244. fixed: '',
  2245. columnWidth: 150
  2246. },
  2247. {
  2248. columnProp: 'engChgLevel',
  2249. headerAlign: "center",
  2250. align: "center",
  2251. columnLabel: 'BOM版本号',
  2252. columnHidden: false,
  2253. columnImage: false,
  2254. status: true,
  2255. fixed: '',
  2256. columnWidth: 80
  2257. },
  2258. {
  2259. columnProp: 'bomType',
  2260. headerAlign: "center",
  2261. align: "center",
  2262. columnLabel: '制造类型',
  2263. columnHidden: false,
  2264. columnImage: false,
  2265. status: true,
  2266. fixed: '',
  2267. columnWidth: 100
  2268. },
  2269. {
  2270. columnProp: 'alternativeNo',
  2271. headerAlign: "center",
  2272. align: "center",
  2273. columnLabel: '替代编码',
  2274. columnHidden: false,
  2275. columnImage: false,
  2276. status: true,
  2277. fixed: '',
  2278. columnWidth: 100
  2279. },
  2280. {
  2281. columnProp: 'alternativeDescription',
  2282. headerAlign: "center",
  2283. align: "left",
  2284. columnLabel: '替代名称',
  2285. columnHidden: false,
  2286. columnImage: false,
  2287. status: true,
  2288. fixed: '',
  2289. columnWidth: 150
  2290. },
  2291. {
  2292. columnProp: 'componentPart',
  2293. headerAlign: "center",
  2294. align: "center",
  2295. columnLabel: '子物料编码',
  2296. columnHidden: false,
  2297. columnImage: false,
  2298. status: true,
  2299. fixed: '',
  2300. columnWidth: 100
  2301. },
  2302. {
  2303. columnProp: 'componentPartDesc',
  2304. headerAlign: "center",
  2305. align: "left",
  2306. columnLabel: '子物料名称',
  2307. columnHidden: false,
  2308. columnImage: false,
  2309. status: true,
  2310. fixed: '',
  2311. columnWidth: 150
  2312. },
  2313. {
  2314. columnProp: 'qtyPerAssembly',
  2315. headerAlign: "center",
  2316. align: "right",
  2317. columnLabel: '单位用量',
  2318. columnHidden: false,
  2319. columnImage: false,
  2320. status: true,
  2321. fixed: '',
  2322. columnWidth: 110
  2323. },
  2324. {
  2325. columnProp: 'printUnit',
  2326. headerAlign: "center",
  2327. align: "left",
  2328. columnLabel: '计量单位',
  2329. columnHidden: false,
  2330. columnImage: false,
  2331. status: true,
  2332. fixed: '',
  2333. columnWidth: 80
  2334. },
  2335. {
  2336. columnProp: 'productGroupName4',
  2337. headerAlign: "center",
  2338. align: "left",
  2339. columnLabel: '计划人',
  2340. columnHidden: false,
  2341. columnImage: false,
  2342. status: true,
  2343. fixed: '',
  2344. columnWidth: 100
  2345. },
  2346. {
  2347. columnProp: 'minOrderQty',
  2348. headerAlign: "center",
  2349. align: "right",
  2350. columnLabel: '最小批量',
  2351. columnHidden: false,
  2352. columnImage: false,
  2353. status: true,
  2354. fixed: '',
  2355. columnWidth: 60
  2356. },
  2357. {
  2358. columnProp: 'mulOrderQty',
  2359. headerAlign: "center",
  2360. align: "right",
  2361. columnLabel: '多种批量大小',
  2362. columnHidden: false,
  2363. columnImage: false,
  2364. status: true,
  2365. fixed: '',
  2366. columnWidth: 60
  2367. },
  2368. {
  2369. columnProp: 'planningMethod',
  2370. headerAlign: "center",
  2371. align: "left",
  2372. columnLabel: '计划方法',
  2373. columnHidden: false,
  2374. columnImage: false,
  2375. status: true,
  2376. fixed: '',
  2377. columnWidth: 100
  2378. },
  2379. {
  2380. columnProp: 'cumLeadTime',
  2381. headerAlign: "center",
  2382. align: "right",
  2383. columnLabel: '父级累计提前期',
  2384. columnHidden: false,
  2385. columnImage: false,
  2386. status: true,
  2387. fixed: '',
  2388. columnWidth: 100
  2389. },
  2390. {
  2391. columnProp: 'unprotectedLeadTime',
  2392. headerAlign: "center",
  2393. align: "right",
  2394. columnLabel: '父级未受保护提前期',
  2395. columnHidden: false,
  2396. columnImage: false,
  2397. status: true,
  2398. fixed: '',
  2399. columnWidth: 100
  2400. },
  2401. {
  2402. columnProp: 'componentCumLeadTime',
  2403. headerAlign: "center",
  2404. align: "right",
  2405. columnLabel: '子物料累计提前期',
  2406. columnHidden: false,
  2407. columnImage: false,
  2408. status: true,
  2409. fixed: '',
  2410. columnWidth: 100
  2411. },
  2412. {
  2413. columnProp: 'componentUnprotectedLeadTime',
  2414. headerAlign: "center",
  2415. align: "right",
  2416. columnLabel: '子物料未受保护提前期',
  2417. columnHidden: false,
  2418. columnImage: false,
  2419. status: true,
  2420. fixed: '',
  2421. columnWidth: 100
  2422. },
  2423. ],
  2424. // ======== 必填规则 ========
  2425. rules: {
  2426. partNo: [
  2427. {
  2428. required: true,
  2429. message: ' ',
  2430. trigger: ['blur','change']
  2431. }
  2432. ],
  2433. partDesc: [
  2434. {
  2435. required: true,
  2436. message: ' ',
  2437. trigger: ['blur','change']
  2438. }
  2439. ],
  2440. bomType: [
  2441. {
  2442. required: true,
  2443. message: ' ',
  2444. trigger: ['blur','change']
  2445. }
  2446. ],
  2447. effPhaseInDate: [
  2448. {
  2449. required: true,
  2450. message: ' ',
  2451. trigger: ['blur','change']
  2452. }
  2453. ],
  2454. engChgLevel: [
  2455. {
  2456. required: true,
  2457. message: ' ',
  2458. trigger: ['blur','change']
  2459. }
  2460. ]
  2461. },
  2462. detailRules: {
  2463. alternativeNo: [
  2464. {
  2465. required: true,
  2466. message: ' ',
  2467. trigger: ['blur','change']
  2468. }
  2469. ],
  2470. alternativeDescription: [
  2471. {
  2472. required: true,
  2473. message: ' ',
  2474. trigger: ['blur','change']
  2475. }
  2476. ],
  2477. minLotQty: [
  2478. {
  2479. required: true,
  2480. message: ' ',
  2481. trigger: ['blur','change']
  2482. }
  2483. ],
  2484. status: [
  2485. {
  2486. required: true,
  2487. message: ' ',
  2488. trigger: ['blur','change']
  2489. }
  2490. ]
  2491. },
  2492. componentRules: {
  2493. componentPart: [
  2494. {
  2495. required: true,
  2496. message: ' ',
  2497. trigger: ['blur','change']
  2498. }
  2499. ],
  2500. lineSequence: [
  2501. {
  2502. required: true,
  2503. message: ' ',
  2504. trigger: ['blur','change']
  2505. }
  2506. ],
  2507. qtyPerAssembly: [
  2508. {
  2509. required: true,
  2510. message: ' ',
  2511. trigger: ['blur','change']
  2512. }
  2513. ],
  2514. componentScrap: [
  2515. {
  2516. required: true,
  2517. message: ' ',
  2518. trigger: ['blur','change']
  2519. }
  2520. ],
  2521. shrinkageFactor: [
  2522. {
  2523. required: true,
  2524. message: ' ',
  2525. trigger: ['blur','change']
  2526. }
  2527. ],
  2528. issueType: [
  2529. {
  2530. required: true,
  2531. message: ' ',
  2532. trigger: ['blur','change']
  2533. }
  2534. ],
  2535. consumptionItem: [
  2536. {
  2537. required: true,
  2538. message: ' ',
  2539. trigger: ['blur','change']
  2540. }
  2541. ]
  2542. },
  2543. // ======== 复选数据集 ========
  2544. bomSelections: [],
  2545. // ======== 模态框开关控制 ========
  2546. modalFlag: false,
  2547. modalDisableFlag: false,
  2548. partModelFlag: false,
  2549. componentPartModelFlag: false,
  2550. copyPartModelFlag: false,
  2551. saveDetailModalFlag :false,
  2552. saveDetailModalDisable: false,
  2553. componentSaveModal: false,
  2554. componentDisableFlag: false,
  2555. operationModelFlag: false,
  2556. copyBomModelFlag: false,
  2557. copyAlternativeModelFlag: false,
  2558. headerSaveFlag: false,
  2559. manufStructCostDistribModal: false
  2560. }
  2561. },
  2562. mounted () {
  2563. this.$nextTick(() => {
  2564. this.height = window.innerHeight - 180
  2565. })
  2566. },
  2567. created () {
  2568. },
  2569. activated() {
  2570. if (this.$route.params && this.$route.params.type && this.$route.params.type === 'quote'){
  2571. this.handleQueryBomByQuote();
  2572. }else if (this.$route.params.partNo) {
  2573. this.searchData.partNo = this.$route.params.partNo
  2574. this.getDataList()
  2575. }else if (this.initPage === false){
  2576. this.getDataList()
  2577. }
  2578. this.initPage = true
  2579. },
  2580. // js
  2581. methods: {
  2582. validateInput (value) {
  2583. // 使用正则表达式检查是否为科学计数法
  2584. if (/e/i.test(value.toString())) {
  2585. // 如果是科学计数法,则恢复到之前的值
  2586. this.$nextTick(() => {
  2587. this.componentData.componentScrap = ''
  2588. })
  2589. }
  2590. },
  2591. // === 报价查询 ===
  2592. handleQueryBomByQuote(){
  2593. let params = {
  2594. site:this.$route.params.site,
  2595. partNo:this.$route.params.partNo,
  2596. bomType:this.$route.params.bomType,
  2597. engChgLevel:this.$route.params.engChgLevel,
  2598. page:this.pageIndex,
  2599. limit:this.pageSize
  2600. }
  2601. this.queryLoading = true
  2602. bomManagementSearch(params).then(({data})=>{
  2603. if (data && data.code === 0) {
  2604. this.dataList = data.page.list
  2605. this.pageIndex = data.page.currPage
  2606. this.pageSize = data.page.pageSize
  2607. this.totalPage = data.page.totalCount
  2608. this.$refs.selectDiv.setLengthAll( this.dataList.length)
  2609. }
  2610. this.queryLoading = false
  2611. })
  2612. },
  2613. // ======== 分页相关方法 ========
  2614. /**
  2615. * 每页数
  2616. * @param val
  2617. */
  2618. sizeChangeHandle (val) {
  2619. this.pageSize = val
  2620. this.pageIndex = 1
  2621. this.getDataList()
  2622. },
  2623. /**
  2624. * 当前页
  2625. * @param val
  2626. */
  2627. currentChangeHandle (val) {
  2628. this.pageIndex = val
  2629. this.getDataList()
  2630. },
  2631. /**
  2632. * 每页数
  2633. * @param val
  2634. */
  2635. sizeChangeHandle2 (val) {
  2636. this.pageSize2 = val
  2637. this.pageIndex2 = 1
  2638. this.queryPartList()
  2639. },
  2640. /**
  2641. * 当前页
  2642. * @param val
  2643. */
  2644. currentChangeHandle2 (val) {
  2645. this.pageIndex2 = val
  2646. this.queryPartList()
  2647. },
  2648. /**
  2649. * 每页数
  2650. * @param val
  2651. */
  2652. sizeChangeHandle3 (val) {
  2653. this.pageSize3 = val
  2654. this.pageIndex3 = 1
  2655. this.queryComponentPartList()
  2656. },
  2657. /**
  2658. * 当前页
  2659. * @param val
  2660. */
  2661. currentChangeHandle3 (val) {
  2662. this.pageIndex3 = val
  2663. this.queryComponentPartList()
  2664. },
  2665. /**
  2666. * 每页数
  2667. * @param val
  2668. */
  2669. sizeChangeHandle4 (val) {
  2670. this.pageSize4 = val
  2671. this.pageIndex4 = 1
  2672. this.queryCopyPartModal()
  2673. },
  2674. /**
  2675. * 当前页
  2676. * @param val
  2677. */
  2678. currentChangeHandle4 (val) {
  2679. this.pageIndex4 = val
  2680. this.queryCopyPartModal()
  2681. },
  2682. // ======== 页签切换相关方法 ========
  2683. /**
  2684. * 明细页签选择替换
  2685. * @param tab
  2686. * @param event
  2687. */
  2688. tabDetailClick (tab, event) {
  2689. // 刷新列表数据
  2690. this.refreshDetailTable()
  2691. },
  2692. /**
  2693. * 子明细页签选择替换
  2694. * @param tab
  2695. * @param event
  2696. */
  2697. tabSubDetailClick (tab, event) {
  2698. // 刷新列表数据
  2699. this.refreshSubDetailTable()
  2700. },
  2701. /**
  2702. * 刷新明细页签的table数据
  2703. */
  2704. refreshDetailTable () {
  2705. if (this.detailTable === 'bom_detail') {
  2706. }
  2707. },
  2708. /**
  2709. * 刷新子明细页签的table数据
  2710. */
  2711. refreshSubDetailTable () {
  2712. if (this.subDetailTable === 'bom_sub_detail') {
  2713. this.queryBomComponentTable()
  2714. } else if (this.subDetailTable === 'by_products') {
  2715. this.queryBomByProductTable()
  2716. } else if (this.subDetailTable === 'manuf_struct_cost_distribtion') {
  2717. this.queryManufStructCostDistribtionTable()
  2718. } else if (this.subDetailTable === 'multi_level_structure') {
  2719. this.queryMultiLevelStructureTable()
  2720. }
  2721. },
  2722. // 刷新方法
  2723. queryBomComponentTable () {
  2724. queryBomComponentTable(this.detailData).then(({data}) => {
  2725. if (data.code === 0) {
  2726. this.subDetailList = data.rows
  2727. }
  2728. })
  2729. },
  2730. // 刷新方法
  2731. queryBomByProductTable () {
  2732. queryBomByProductTable(this.detailData).then(({data}) => {
  2733. if (data.code === 0) {
  2734. this.byProductList = data.rows
  2735. }
  2736. })
  2737. },
  2738. // 刷新方法
  2739. queryManufStructCostDistribtionTable () {
  2740. queryManufStructCostDistribtionTable(this.detailData).then(({data}) => {
  2741. if (data.code === 0) {
  2742. this.manufStructCostDistribList = data.rows
  2743. }
  2744. })
  2745. },
  2746. // 刷新方法
  2747. queryMultiLevelStructureTable () {
  2748. queryMultiLevelStructureTable(this.detailData).then(({data}) => {
  2749. if (data.code === 0) {
  2750. this.multiLevelStructureList = data.rows
  2751. }
  2752. })
  2753. },
  2754. // ======== 列表数据操作方法 ========
  2755. /**
  2756. * 未知
  2757. * @returns {boolean}
  2758. */
  2759. selectFlag () {
  2760. return true
  2761. },
  2762. /**
  2763. * 获取数据列表
  2764. */
  2765. getDataList () {
  2766. //如果是跳转过来的 要判断
  2767. if (localStorage.getItem('bomData') != undefined) {
  2768. let data = JSON.parse(localStorage.getItem('bomData'))
  2769. this.searchData.partNo = data.partNo
  2770. this.searchData.bomType = data.bomType
  2771. this.searchData.engChgLevel = data.engChgLevel
  2772. }
  2773. this.searchData.limit = this.pageSize
  2774. this.searchData.page = this.pageIndex
  2775. this.queryLoading = true
  2776. bomManagementSearch(this.searchData).then(({data}) => {
  2777. if (data.code === 0) {
  2778. this.dataList = data.page.list
  2779. this.pageIndex = data.page.currPage
  2780. this.pageSize = data.page.pageSize
  2781. this.totalPage = data.page.totalCount
  2782. this.$refs.selectDiv.setLengthAll( this.dataList.length)
  2783. if (localStorage.getItem('bomData') != undefined) {
  2784. this.updateModal(this.dataList[0])
  2785. }
  2786. }
  2787. this.queryLoading = false
  2788. if (localStorage.getItem('bomData') != undefined) {
  2789. this.$nextTick(function () {
  2790. localStorage.removeItem('bomData')
  2791. })
  2792. }
  2793. })
  2794. },
  2795. /**
  2796. * 复选列表信息
  2797. * @param val
  2798. */
  2799. selectionBom (val) {
  2800. this.bomSelections = val
  2801. this.$refs.selectDiv.setLengthselected(this.bomSelections.length)
  2802. },
  2803. // ======== 新增/编辑模态框 ========
  2804. /**
  2805. * bom新增模态框
  2806. */
  2807. addModal () {
  2808. this.modalData = {
  2809. flag: '1',
  2810. title: 'bom新增',
  2811. site: this.$store.state.user.site,
  2812. partNo: '',
  2813. partDesc: '',
  2814. engChgLevel: '',
  2815. bomType: 'Manufacturing',
  2816. noteText: '',
  2817. effPhaseInDate: new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''),
  2818. effPhaseOutDate: '',
  2819. engRevision: '',
  2820. typeFlag: 'B',
  2821. netWeight: 0,
  2822. createBy: this.$store.state.user.name,
  2823. printUnit: '',
  2824. printUnitName: '',
  2825. officialFlag: 'N'
  2826. }
  2827. this.detailData = {
  2828. site: this.$store.state.user.site,
  2829. partNo: '',
  2830. engChgLevel: '',
  2831. bomType: '',
  2832. alternativeNo: '',
  2833. alternativeDescription: '',
  2834. minLotQty: '',
  2835. defaultFlag: '',
  2836. detailNoteText: '',
  2837. status: '',
  2838. createDate: '',
  2839. createBy: this.$store.state.user.name,
  2840. updateDate: '',
  2841. updateBy: this.$store.state.user.name,
  2842. officialFlag: 'N'
  2843. }
  2844. this.detailDataList = []
  2845. this.subDetailList = []
  2846. this.byProductList = []
  2847. this.manufStructCostDistribList = []
  2848. this.headerSaveFlag = true
  2849. this.modalDisableFlag = false
  2850. this.modalFlag = true
  2851. },
  2852. /**
  2853. * bom编辑模态框
  2854. */
  2855. async updateModal (row) {
  2856. this.modalData = {
  2857. flag: '2',
  2858. site: row.site,
  2859. partNo: row.partNo,
  2860. partDesc: row.partDesc,
  2861. engChgLevel: row.engChgLevel,
  2862. bomType: row.bomType,
  2863. noteText: row.noteText,
  2864. effPhaseInDate: row.effPhaseInDate,
  2865. effPhaseOutDate: row.effPhaseOutDate,
  2866. engRevision: row.engRevision,
  2867. typeFlag: row.typeFlag,
  2868. netWeight: row.netWeight,
  2869. updateBy: this.$store.state.user.name,
  2870. printUnit: row.printUnit,
  2871. printUnitName: row.printUnitName,
  2872. officialFlag: row.officialFlag,
  2873. alternativeNo: row.alternativeNo,
  2874. ifsPartNo: row.ifsPartNo
  2875. }
  2876. this.subDetailTable = 'bom_sub_detail'
  2877. // 查bom明细
  2878. queryBomDetail(this.modalData).then(({data}) => {
  2879. if (data && data.code === 0) {
  2880. this.detailDataList = data.rows.detailList
  2881. this.subDetailList = data.rows.componentList
  2882. this.detailData = data.rows.detailData
  2883. this.modalDisableFlag = true
  2884. this.modalFlag = true
  2885. } else {
  2886. this.$alert(data.msg, '错误', {
  2887. confirmButtonText: '确定'
  2888. })
  2889. }
  2890. })
  2891. },
  2892. /**
  2893. * 替代新增模态框
  2894. */
  2895. saveBomDetail () {
  2896. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  2897. this.$message.warning('请先选择Bom物料!')
  2898. return
  2899. }
  2900. if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) {
  2901. this.$message.warning('请先填写Bom版本号!')
  2902. return
  2903. }
  2904. if (this.modalData.bomType === '' || this.modalData.bomType == null) {
  2905. this.$message.warning('请先选择制造类型!')
  2906. return
  2907. }
  2908. this.saveDetailData = {
  2909. flag: '1',
  2910. site: this.$store.state.user.site,
  2911. partNo: this.modalData.partNo,
  2912. engChgLevel: this.modalData.engChgLevel,
  2913. bomType: this.modalData.bomType,
  2914. alternativeNo: '',
  2915. alternativeDescription: '',
  2916. minLotQty: 0,
  2917. defaultFlag: '',
  2918. detailNoteText: '',
  2919. status: 'Tentative',
  2920. createDate: '',
  2921. createBy: this.$store.state.user.name,
  2922. officialFlag: 'N'
  2923. }
  2924. // 查询bom主信息
  2925. queryBomHeader(this.modalData).then(({data}) => {
  2926. if (data && data.code === 0) {
  2927. if (data.rows.length > 0) {
  2928. this.saveDetailModalFlag = true
  2929. this.saveDetailModalDisable = false
  2930. } else {
  2931. this.$message.warning('请先保存BOM主记录!')
  2932. }
  2933. } else {
  2934. this.$alert(data.msg, '提示', {
  2935. confirmButtonText: '确定'
  2936. })
  2937. }
  2938. })
  2939. },
  2940. /**
  2941. * 替代编辑模态框
  2942. */
  2943. updateBomDetail () {
  2944. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  2945. this.$message.warning('请先选择Bom物料!')
  2946. return
  2947. }
  2948. if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) {
  2949. this.$message.warning('请先填写Bom版本号!')
  2950. return
  2951. }
  2952. if (this.modalData.bomType === '' || this.modalData.bomType == null) {
  2953. this.$message.warning('请先选择制造类型!')
  2954. return
  2955. }
  2956. this.saveDetailData = {
  2957. flag: '2',
  2958. site: this.detailData.site,
  2959. partNo: this.detailData.partNo,
  2960. engChgLevel: this.detailData.engChgLevel,
  2961. bomType: this.detailData.bomType,
  2962. alternativeNo: this.detailData.alternativeNo,
  2963. alternativeDescription: this.detailData.alternativeDescription,
  2964. minLotQty: this.detailData.minLotQty,
  2965. defaultFlag: '',
  2966. detailNoteText: this.detailData.detailNoteText,
  2967. status: this.detailData.status,
  2968. updateBy: this.$store.state.user.name,
  2969. officialFlag: this.detailData.officialFlag
  2970. }
  2971. // 查询bom主信息
  2972. queryBomHeader(this.modalData).then(({data}) => {
  2973. if (data && data.code === 0) {
  2974. if (data.rows.length > 0) {
  2975. this.saveDetailModalFlag = true
  2976. this.saveDetailModalDisable = true
  2977. } else {
  2978. this.$message.warning('请先保存BOM主记录!')
  2979. }
  2980. } else {
  2981. this.$alert(data.msg, '提示', {
  2982. confirmButtonText: '确定'
  2983. })
  2984. }
  2985. })
  2986. },
  2987. /**
  2988. * 子明细新增模态框
  2989. */
  2990. saveComponentModal () {
  2991. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  2992. this.$message.warning('请先选择替代!')
  2993. return
  2994. }
  2995. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  2996. // this.$message.warning('不可编辑的替代状态!')
  2997. // return
  2998. // }
  2999. this.componentData = {
  3000. flag: '1',
  3001. site: this.$store.state.user.site,
  3002. partNo: this.modalData.partNo,
  3003. engChgLevel: this.modalData.engChgLevel,
  3004. bomType: this.modalData.bomType,
  3005. alternativeNo: this.detailData.alternativeNo,
  3006. componentPart: '',
  3007. componentPartDesc: '',
  3008. printUnit: '',
  3009. printUnitName: '',
  3010. qtyPerAssembly: 0,
  3011. componentScrap: 0,
  3012. issueType: 'Reserve And Backflush',
  3013. shrinkageFactor: 0,
  3014. lineItemNo: '',
  3015. operationId: '',
  3016. operationNo: '',
  3017. issueToLoc: '',
  3018. issueToLocName: '',
  3019. noteText: '',
  3020. createBy: this.$store.state.user.name,
  3021. lineSequence: '',
  3022. consumptionItem: 'Consumed',
  3023. productFlag: 'component'
  3024. }
  3025. // 获取子料的序号
  3026. getComponentLineSequence(this.componentData).then(({data}) => {
  3027. if (data && data.code === 0) {
  3028. this.componentData.lineSequence = data.lineSequence
  3029. } else {
  3030. this.$alert(data.msg, '错误', {
  3031. confirmButtonText: '确定'
  3032. })
  3033. }
  3034. })
  3035. this.componentDisableFlag = false
  3036. this.componentSaveModal = true
  3037. },
  3038. /**
  3039. * 副产品新增模态框
  3040. */
  3041. saveByProductModal () {
  3042. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  3043. this.$message.warning('请先选择替代!')
  3044. return
  3045. }
  3046. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  3047. // this.$message.warning('不可编辑的替代状态!')
  3048. // return
  3049. // }
  3050. this.componentData = {
  3051. flag: '1',
  3052. site: this.$store.state.user.site,
  3053. partNo: this.modalData.partNo,
  3054. engChgLevel: this.modalData.engChgLevel,
  3055. bomType: this.modalData.bomType,
  3056. alternativeNo: this.detailData.alternativeNo,
  3057. componentPart: '',
  3058. componentPartDesc: '',
  3059. printUnit: '',
  3060. printUnitName: '',
  3061. qtyPerAssembly: 0,
  3062. componentScrap: 0,
  3063. issueType: 'Reserve And Backflush',
  3064. shrinkageFactor: 0,
  3065. lineItemNo: '',
  3066. operationId: '',
  3067. operationNo: '',
  3068. issueToLoc: '',
  3069. issueToLocName: '',
  3070. noteText: '',
  3071. createBy: this.$store.state.user.name,
  3072. lineSequence: '',
  3073. consumptionItem: '',
  3074. productFlag: 'byProduct'
  3075. }
  3076. // 获取子料的序号
  3077. getComponentLineSequence(this.componentData).then(({data}) => {
  3078. if (data && data.code === 0) {
  3079. this.componentData.lineSequence = data.lineSequence
  3080. } else {
  3081. this.$alert(data.msg, '错误', {
  3082. confirmButtonText: '确定'
  3083. })
  3084. }
  3085. })
  3086. this.componentDisableFlag = false
  3087. this.componentSaveModal = true
  3088. },
  3089. /**
  3090. * 子明细编辑模态框
  3091. */
  3092. updateComponentModal (row) {
  3093. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  3094. // this.$message.warning('不可编辑的替代状态!')
  3095. // return
  3096. // }
  3097. this.componentData = {
  3098. flag: '2',
  3099. site: row.site,
  3100. partNo: row.partNo,
  3101. engChgLevel: row.engChgLevel,
  3102. bomType: row.bomType,
  3103. alternativeNo: row.alternativeNo,
  3104. componentPart: row.componentPart,
  3105. componentPartDesc: row.componentPartDesc,
  3106. printUnit: row.printUnit,
  3107. printUnitName: row.printUnitName,
  3108. qtyPerAssembly: row.qtyPerAssembly,
  3109. componentScrap: row.componentScrap,
  3110. issueType: row.issueType,
  3111. shrinkageFactor: row.shrinkageFactor,
  3112. lineItemNo: row.lineItemNo,
  3113. operationId: row.operationId,
  3114. operationNo: row.operationNo,
  3115. issueToLoc: row.issueToLoc,
  3116. issueToLocName: row.issueToLocName,
  3117. noteText: row.noteText,
  3118. updateBy: this.$store.state.user.name,
  3119. lineSequence: row.lineSequence,
  3120. consumptionItem: row.consumptionItem,
  3121. productFlag: 'component'
  3122. }
  3123. this.componentDisableFlag = true
  3124. this.componentSaveModal = true
  3125. },
  3126. /**
  3127. * 副产品编辑模态框
  3128. */
  3129. updateByProductModal (row) {
  3130. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  3131. // this.$message.warning('不可编辑的替代状态!')
  3132. // return
  3133. // }
  3134. this.componentData = {
  3135. flag: '2',
  3136. site: row.site,
  3137. partNo: row.partNo,
  3138. engChgLevel: row.engChgLevel,
  3139. bomType: row.bomType,
  3140. alternativeNo: row.alternativeNo,
  3141. componentPart: row.componentPart,
  3142. componentPartDesc: row.componentPartDesc,
  3143. printUnit: row.printUnit,
  3144. printUnitName: row.printUnitName,
  3145. qtyPerAssembly: row.qtyPerAssembly,
  3146. componentScrap: row.componentScrap,
  3147. issueType: row.issueType,
  3148. shrinkageFactor: row.shrinkageFactor,
  3149. lineItemNo: row.lineItemNo,
  3150. operationId: row.operationId,
  3151. issueToLoc: row.issueToLoc,
  3152. issueToLocName: row.issueToLocName,
  3153. noteText: row.noteText,
  3154. updateBy: this.$store.state.user.name,
  3155. lineSequence: row.lineSequence,
  3156. consumptionItem: row.consumptionItem,
  3157. productFlag: 'byProduct'
  3158. }
  3159. this.componentDisableFlag = true
  3160. this.componentSaveModal = true
  3161. },
  3162. /**
  3163. * 副产品成本分配编辑模态框
  3164. */
  3165. updateManufStructCostDistribModal (row) {
  3166. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  3167. // this.$message.warning('不可编辑的替代状态!')
  3168. // return
  3169. // }
  3170. this.manufStructCostDistribData = {
  3171. site: row.site,
  3172. partNo: row.partNo,
  3173. engChgLevel: row.engChgLevel,
  3174. bomType: row.bomType,
  3175. alternativeNo: row.alternativeNo,
  3176. byProdLineItemNo: row.byProdLineItemNo,
  3177. componentLineItemNo: row.componentLineItemNo,
  3178. componentPartNo: row.componentPartNo,
  3179. componentPartDesc: row.componentPartDesc,
  3180. byProdPartNo: row.byProdPartNo,
  3181. byProdPartDesc: row.byProdPartDesc,
  3182. itemCostDistribution: row.itemCostDistribution,
  3183. updateBy: this.$store.state.user.name,
  3184. }
  3185. this.manufStructCostDistribModal = true
  3186. },
  3187. // ======== 新增/编辑/删除方法 ========
  3188. /**
  3189. * bom新增/编辑
  3190. */
  3191. saveData () {
  3192. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  3193. this.$message.warning('请选择物料编码!')
  3194. return
  3195. }
  3196. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  3197. this.$message.warning('请选择物料名称!')
  3198. return
  3199. }
  3200. if (this.modalData.bomType === '' || this.modalData.bomType == null) {
  3201. this.$message.warning('请选择制造类型!')
  3202. return
  3203. }
  3204. if (this.modalData.effPhaseInDate === '' || this.modalData.effPhaseInDate == null) {
  3205. this.$message.warning('请选择生效日期!')
  3206. return
  3207. }
  3208. if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) {
  3209. this.$message.warning('请填写BOM版本号!')
  3210. return
  3211. }
  3212. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  3213. this.$message.warning('请选择替代!')
  3214. return
  3215. }
  3216. if (this.detailData.status === '' || this.detailData.status == null) {
  3217. this.$message.warning('请选择替代状态!')
  3218. return
  3219. }
  3220. let tempData = {
  3221. site: this.$store.state.user.site,
  3222. partNo: this.modalData.partNo,
  3223. partDesc: this.modalData.partDesc,
  3224. engChgLevel: this.modalData.engChgLevel,
  3225. bomType: this.modalData.bomType,
  3226. noteText: this.modalData.noteText,
  3227. effPhaseInDate: this.modalData.effPhaseInDate,
  3228. effPhaseOutDate: this.modalData.effPhaseOutDate,
  3229. engRevision: this.modalData.engRevision,
  3230. typeFlag: this.modalData.typeFlag,
  3231. netWeight: this.modalData.netWeight,
  3232. officialFlag: this.modalData.officialFlag,
  3233. alternativeNo: this.detailData.alternativeNo,
  3234. alternativeDescription: this.detailData.alternativeDescription,
  3235. minLotQty: this.detailData.minLotQty,
  3236. defaultFlag: this.detailData.defaultFlag,
  3237. detailNoteText: this.detailData.detailNoteText,
  3238. status: this.detailData.status,
  3239. createBy: this.$store.state.user.name,
  3240. updateBy: this.$store.state.user.name,
  3241. informationList: this.subDetailList
  3242. }
  3243. if (this.modalData.flag === '1') {
  3244. this.saveAllLoading = true
  3245. bomManagementSave(tempData).then(({data}) => {
  3246. if (data && data.code === 0) {
  3247. this.getDataList()
  3248. this.modalFlag = false
  3249. this.$message({
  3250. message: '操作成功',
  3251. type: 'success',
  3252. duration: 1500,
  3253. onClose: () => {}
  3254. })
  3255. } else {
  3256. this.$alert(data.msg, '错误', {
  3257. confirmButtonText: '确定'
  3258. })
  3259. }
  3260. this.saveAllLoading = false
  3261. })
  3262. } else {
  3263. this.saveAllLoading = true
  3264. bomManagementEdit(tempData).then(({data}) => {
  3265. if (data && data.code === 0) {
  3266. this.getDataList()
  3267. this.modalFlag = false
  3268. this.$message({
  3269. message: '操作成功',
  3270. type: 'success',
  3271. duration: 1500,
  3272. onClose: () => {}
  3273. })
  3274. } else {
  3275. this.$alert(data.msg, '错误', {
  3276. confirmButtonText: '确定'
  3277. })
  3278. }
  3279. this.saveAllLoading = false
  3280. })
  3281. }
  3282. },
  3283. /**
  3284. * 新增编辑模态框关闭
  3285. */
  3286. closeModal () {
  3287. // let tempArr = []
  3288. // tempArr.push(this.modalData)
  3289. // if (this.modalData.flag === '1') {
  3290. // this.$confirm(`是否不保存且删除该条BOM记录?`, '提示', {
  3291. // confirmButtonText: '确定',
  3292. // cancelButtonText: '取消',
  3293. // type: 'warning'
  3294. // }).then(() => {
  3295. // let tempData = {
  3296. // informationList: tempArr
  3297. // }
  3298. // bomManagementDelete(tempData).then(({data}) => {
  3299. // if (data && data.code === 0) {
  3300. // this.getDataList()
  3301. // this.modalFlag = false
  3302. // this.$message({
  3303. // message: '操作成功',
  3304. // type: 'success',
  3305. // duration: 1500,
  3306. // onClose: () => {}
  3307. // })
  3308. // } else {
  3309. // this.$alert(data.msg, '错误', {
  3310. // confirmButtonText: '确定'
  3311. // })
  3312. // }
  3313. // })
  3314. // }).catch(() => {
  3315. // })
  3316. // } else {
  3317. // this.modalFlag = false
  3318. // }
  3319. //this.getDataList()
  3320. this.modalFlag = false
  3321. },
  3322. /**
  3323. * 新增编辑模态框关闭
  3324. */
  3325. closeModalX (done) {
  3326. // let tempArr = []
  3327. // tempArr.push(this.modalData)
  3328. // if (this.modalData.flag === '1') {
  3329. // this.$confirm(`是否不保存且删除该条BOM记录?`, '提示', {
  3330. // confirmButtonText: '确定',
  3331. // cancelButtonText: '取消',
  3332. // type: 'warning'
  3333. // }).then(() => {
  3334. // let tempData = {
  3335. // informationList: tempArr
  3336. // }
  3337. // bomManagementDelete(tempData).then(({data}) => {
  3338. // if (data && data.code === 0) {
  3339. // this.getDataList()
  3340. // done()
  3341. // this.$message({
  3342. // message: '操作成功',
  3343. // type: 'success',
  3344. // duration: 1500,
  3345. // onClose: () => {}
  3346. // })
  3347. // } else {
  3348. // this.$alert(data.msg, '错误', {
  3349. // confirmButtonText: '确定'
  3350. // })
  3351. // }
  3352. // })
  3353. // }).catch(() => {
  3354. // })
  3355. // } else {
  3356. // done()
  3357. // }
  3358. //this.getDataList()
  3359. done()
  3360. },
  3361. /**
  3362. * bom删除
  3363. */
  3364. delModal () {
  3365. if (this.bomSelections.length === 0) {
  3366. this.$message.warning('请勾选要删除的BOM!')
  3367. return
  3368. }
  3369. this.$confirm(`是否删除这 `+ this.bomSelections.length +` 条BOM?`, '提示', {
  3370. confirmButtonText: '确定',
  3371. cancelButtonText: '取消',
  3372. type: 'warning'
  3373. }).then(() => {
  3374. let tempData = {
  3375. informationList: this.bomSelections
  3376. }
  3377. bomManagementDelete(tempData).then(({data}) => {
  3378. if (data && data.code === 0) {
  3379. this.getDataList()
  3380. this.bomSelections = []
  3381. this.$message({
  3382. message: '操作成功',
  3383. type: 'success',
  3384. duration: 1500,
  3385. onClose: () => {}
  3386. })
  3387. } else {
  3388. this.$alert(data.msg, '错误', {
  3389. confirmButtonText: '确定'
  3390. })
  3391. }
  3392. })
  3393. }).catch(() => {
  3394. })
  3395. },
  3396. /**
  3397. * 查询物料
  3398. */
  3399. queryPartList () {
  3400. this.partData.limit = this.pageSize2
  3401. this.partData.page = this.pageIndex2
  3402. queryPartListBom(this.partData).then(({data}) => {
  3403. if (data && data.code === 0) {
  3404. this.partList = data.page.list
  3405. this.pageIndex2 = data.page.currPage
  3406. this.pageSize2 = data.page.pageSize
  3407. this.totalPage2 = data.page.totalCount
  3408. this.partModelFlag = true
  3409. } else {
  3410. this.$alert(data.msg, '错误', {
  3411. confirmButtonText: '确定'
  3412. })
  3413. }
  3414. })
  3415. },
  3416. // 物料编码失焦事件
  3417. partNoBlur () {
  3418. this.partData.limit = this.pageSize2
  3419. this.partData.page = this.pageIndex2
  3420. this.partData.partNo = this.modalData.partNo
  3421. queryPartList(this.partData).then(({data}) => {
  3422. if (data && data.code === 0) {
  3423. if (data.page.list.length === 1) {
  3424. this.modalData.partDesc = data.page.list[0].partDesc
  3425. this.modalData.printUnit = data.page.list[0].printUnit
  3426. this.modalData.printUnitName = data.page[0].printUnitName
  3427. return
  3428. }
  3429. }
  3430. })
  3431. this.modalData.partDesc = ''
  3432. this.modalData.printUnit = ''
  3433. this.modalData.printUnitName = ''
  3434. },
  3435. /**
  3436. * 双击选中物料
  3437. * @param row
  3438. */
  3439. getRowData (row) {
  3440. this.modalData.partNo = row.partNo
  3441. this.modalData.partDesc = row.partDesc
  3442. this.modalData.printUnit = row.printUnit
  3443. this.modalData.printUnitName = row.printUnitName
  3444. // // 获取物料的bom版本号
  3445. // getBomEngChgLevel(this.modalData).then(({data}) => {
  3446. // if (data && data.code === 0) {
  3447. // this.modalData.engChgLevel = data.engChgLevel
  3448. // } else {
  3449. // this.$alert(data.msg, '错误', {
  3450. // confirmButtonText: '确定'
  3451. // })
  3452. // }
  3453. // this.partModelFlag = false
  3454. // })
  3455. this.partModelFlag = false
  3456. },
  3457. // bom类型改变
  3458. bomTypeChange () {
  3459. // 获取物料的bom版本号
  3460. getBomEngChgLevel(this.modalData).then(({data}) => {
  3461. if (data && data.code === 0) {
  3462. this.modalData.engChgLevel = data.engChgLevel
  3463. } else {
  3464. this.$alert(data.msg, '错误', {
  3465. confirmButtonText: '确定'
  3466. })
  3467. }
  3468. })
  3469. },
  3470. /**
  3471. * 双击选中工序
  3472. * @param row
  3473. */
  3474. getRowOperationData (row) {
  3475. this.componentData.operationId = row.operationId
  3476. this.componentData.operationNo = row.operationNo
  3477. this.operationModelFlag = false
  3478. },
  3479. // 双击选中子物料
  3480. getComponentRowData (row) {
  3481. this.componentData.componentPart = row.partNo
  3482. this.componentData.componentPartDesc = row.partDesc
  3483. this.componentData.printUnit = row.printUnit
  3484. this.componentData.printUnitName = row.printUnitName
  3485. this.componentPartModelFlag = false
  3486. },
  3487. // 双击选择copy物料
  3488. getCopyRowData (row) {
  3489. if (this.copyPartData.type === '1') {
  3490. this.copyBomData.partNo = row.partNo
  3491. this.copyBomData.partDesc = row.partDesc
  3492. this.copyBomTypeChange()
  3493. } else {
  3494. this.copyAlternativeData.partNo = row.partNo
  3495. this.copyAlternativeData.partDesc = row.partDesc
  3496. }
  3497. this.copyPartModelFlag = false
  3498. },
  3499. /**
  3500. * 子物料列表
  3501. */
  3502. queryComponentPartModal () {
  3503. this.componentPartData.limit = this.pageSize3
  3504. this.componentPartData.page = this.pageIndex3
  3505. this.componentPartData.status = 'Y'
  3506. // 查询所有物料
  3507. queryPartListAll(this.componentPartData).then(({data}) => {
  3508. if (data && data.code === 0) {
  3509. this.componentPartList = data.page.list
  3510. this.pageIndex3 = data.page.currPage
  3511. this.pageSize3 = data.page.pageSize
  3512. this.totalPage3 = data.page.totalCount
  3513. this.componentPartModelFlag = true
  3514. } else {
  3515. this.$alert(data.msg, '错误', {
  3516. confirmButtonText: '确定'
  3517. })
  3518. }
  3519. })
  3520. },
  3521. /**
  3522. * copy物料列表
  3523. */
  3524. queryCopyPartModal () {
  3525. this.copyPartData.limit = this.pageSize4
  3526. this.copyPartData.page = this.pageIndex4
  3527. // 查询所有物料
  3528. queryPartList(this.copyPartData).then(({data}) => {
  3529. if (data && data.code === 0) {
  3530. this.copyPartList = data.page.list
  3531. this.pageIndex4 = data.page.currPage
  3532. this.pageSize4 = data.page.pageSize
  3533. this.totalPage4 = data.page.totalCount
  3534. this.copyPartModelFlag = true
  3535. } else {
  3536. this.$alert(data.msg, '错误', {
  3537. confirmButtonText: '确定'
  3538. })
  3539. }
  3540. })
  3541. },
  3542. /**
  3543. * 物料列表
  3544. */
  3545. queryComponentPartList () {
  3546. this.componentPartData.limit = this.pageSize3
  3547. this.componentPartData.page = this.pageIndex3
  3548. // 查询所有物料
  3549. queryPartListAll(this.componentPartData).then(({data}) => {
  3550. if (data && data.code === 0) {
  3551. this.componentPartList = data.page.list
  3552. this.pageIndex3 = data.page.currPage
  3553. this.pageSize3 = data.page.pageSize
  3554. this.totalPage3 = data.page.totalCount
  3555. } else {
  3556. this.componentPartList = []
  3557. }
  3558. })
  3559. },
  3560. /**
  3561. * copy物料查询列表
  3562. */
  3563. queryCopyPartList () {
  3564. this.copyPartData.limit = this.pageSize4
  3565. this.copyPartData.page = this.pageIndex4
  3566. // 查询所有物料
  3567. queryPartList(this.copyPartData).then(({data}) => {
  3568. if (data && data.code === 0) {
  3569. this.copyPartList = data.page.list
  3570. this.pageIndex4 = data.page.currPage
  3571. this.pageSize4 = data.page.pageSize
  3572. this.totalPage4 = data.page.totalCount
  3573. } else {
  3574. this.copyPartList = []
  3575. }
  3576. })
  3577. },
  3578. // 子物料编码失焦事件
  3579. componentPartBlur () {
  3580. if (this.componentData.componentPart != null && this.componentData.componentPart !== '') {
  3581. this.componentPartData.limit = this.pageSize3
  3582. this.componentPartData.page = this.pageIndex3
  3583. this.componentPartData.partNo = this.componentData.componentPart
  3584. queryPartListAll(this.componentPartData).then(({data}) => {
  3585. if (data && data.code === 0) {
  3586. if (data.page.list.length === 1) {
  3587. this.componentData.componentPartDesc = data.page.list[0].partDesc
  3588. this.componentData.printUnit = data.page.list[0].printUnit
  3589. this.componentData.printUnitName = data.page.list[0].printUnitName
  3590. return
  3591. }
  3592. }
  3593. })
  3594. }
  3595. this.componentData.componentPartDesc = ''
  3596. this.componentData.printUnit = ''
  3597. this.componentData.printUnitName = ''
  3598. },
  3599. // copy物料编码失焦事件
  3600. copyPartBlur () {
  3601. if (this.copyPartData.type === '1') {
  3602. if (this.copyBomData.partNo != null && this.copyBomData.partNo !== '') {
  3603. this.copyPartData.limit = this.pageSize4
  3604. this.copyPartData.page = this.pageIndex4
  3605. this.copyPartData.partNo = this.copyBomData.partNo
  3606. queryPartList(this.copyPartData).then(({data}) => {
  3607. if (data && data.code === 0) {
  3608. if (data.page.list.length === 1) {
  3609. this.copyBomData.partDesc = data.page.list[0].partDesc
  3610. return
  3611. }
  3612. }
  3613. })
  3614. }
  3615. this.copyBomData.partDesc = ''
  3616. } else {
  3617. if (this.copyAlternativeData.partNo != null && this.copyAlternativeData.partNo !== '') {
  3618. this.copyPartData.limit = this.pageSize4
  3619. this.copyPartData.page = this.pageIndex4
  3620. this.copyPartData.partNo = this.copyAlternativeData.partNo
  3621. queryPartList(this.copyPartData).then(({data}) => {
  3622. if (data && data.code === 0) {
  3623. if (data.page.list.length === 1) {
  3624. this.copyAlternativeData.partDesc = data.page.list[0].partDesc
  3625. return
  3626. }
  3627. }
  3628. })
  3629. }
  3630. this.copyAlternativeData.partDesc = ''
  3631. }
  3632. },
  3633. // copy BOM类型改变
  3634. copyBomTypeChange () {
  3635. // 获取物料的bom版本号
  3636. getBomEngChgLevel(this.copyBomData).then(({data}) => {
  3637. if (data && data.code === 0) {
  3638. this.copyBomData.engChgLevel = data.engChgLevel
  3639. } else {
  3640. this.copyBomData.engChgLevel = ''
  3641. }
  3642. })
  3643. },
  3644. /**
  3645. * 表格的新增
  3646. * @param row
  3647. * @param rowIndex
  3648. */
  3649. rowClassName({ row, rowIndex }) {
  3650. row.xh = rowIndex + 1
  3651. },
  3652. /**
  3653. * 选中数据
  3654. * @param selection
  3655. */
  3656. componentSelectionChange(selection) {
  3657. this.checkedDetail = selection
  3658. },
  3659. byProductSelection (selection) {
  3660. this.checkedByProduct = selection
  3661. },
  3662. /**
  3663. * 删除子物料
  3664. */
  3665. deleteComponentPart () {
  3666. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  3667. // this.$message.warning('不可编辑的替代状态!')
  3668. // return
  3669. // }
  3670. if (this.checkedDetail.length === 0) {
  3671. this.$message.warning('请选择要删除子物料!')
  3672. return
  3673. } else {
  3674. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  3675. confirmButtonText: "确定",
  3676. cancelButtonText: "取消",
  3677. type: "warning"
  3678. }).then(() => {
  3679. let tempData = {
  3680. informationList: this.checkedDetail,
  3681. productFlag: 'component'
  3682. }
  3683. deleteBomComponent(tempData).then(({data}) => {
  3684. if (data && data.code === 0) {
  3685. this.subDetailList = data.rows.subDetailList
  3686. this.byProductList = data.rows.byProductList
  3687. this.manufStructCostDistribList = data.rows.manufStructCostDistribList
  3688. this.$message({
  3689. message: '操作成功',
  3690. type: 'success',
  3691. duration: 1500,
  3692. onClose: () => {}
  3693. })
  3694. } else {
  3695. this.$alert(data.msg, '错误', {
  3696. confirmButtonText: '确定'
  3697. })
  3698. }
  3699. })
  3700. }).catch(() => {
  3701. })
  3702. }
  3703. },
  3704. /**
  3705. * 删除子物料
  3706. */
  3707. deleteByProduct () {
  3708. // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
  3709. // this.$message.warning('不可编辑的替代状态!')
  3710. // return
  3711. // }
  3712. if (this.checkedByProduct.length === 0) {
  3713. this.$message.warning('请选择要删除副产品!')
  3714. return
  3715. } else {
  3716. this.$confirm("请是否确认删除该副产品记录?", "提示", {
  3717. confirmButtonText: "确定",
  3718. cancelButtonText: "取消",
  3719. type: "warning"
  3720. }).then(() => {
  3721. let tempData = {
  3722. informationList: this.checkedByProduct,
  3723. productFlag: 'byProduct'
  3724. }
  3725. deleteBomComponent(tempData).then(({data}) => {
  3726. if (data && data.code === 0) {
  3727. this.subDetailList = data.rows.subDetailList
  3728. this.byProductList = data.rows.byProductList
  3729. this.manufStructCostDistribList = data.rows.manufStructCostDistribList
  3730. this.$message({
  3731. message: '操作成功',
  3732. type: 'success',
  3733. duration: 1500,
  3734. onClose: () => {}
  3735. })
  3736. } else {
  3737. this.$alert(data.msg, '错误', {
  3738. confirmButtonText: '确定'
  3739. })
  3740. }
  3741. })
  3742. }).catch(() => {
  3743. })
  3744. }
  3745. },
  3746. /**
  3747. * 子物料
  3748. * @param row
  3749. */
  3750. // componentPartClickRow (row) {
  3751. // this.$refs.componentPartTable.toggleRowSelection(row)
  3752. // },
  3753. componentClickRow (row) {
  3754. this.$refs.componentTable.toggleRowSelection(row)
  3755. },
  3756. byProductClickRow (row) {
  3757. this.$refs.byProductTable.toggleRowSelection(row)
  3758. },
  3759. // /**
  3760. // * 多选子物料
  3761. // * @param val
  3762. // */
  3763. // selectionComponentPart (val) {
  3764. // this.componentPartSelections = val
  3765. // },
  3766. // getRowKeys(row) {
  3767. // // 唯一值,一般都为id
  3768. // return row.partNo
  3769. // },
  3770. /**
  3771. * 新增子明细方法
  3772. */
  3773. componentDataSave (isClose) {
  3774. if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) {
  3775. this.$message.warning('序号不能为空!')
  3776. return
  3777. }
  3778. if (this.componentData.partNo === '' || this.componentData.partNo == null) {
  3779. this.$message.warning('请选择主记录物料编码!')
  3780. return
  3781. }
  3782. if (this.componentData.bomType === '' || this.componentData.bomType == null) {
  3783. this.$message.warning('请选择主记录制造类型!')
  3784. return
  3785. }
  3786. if (this.componentData.engChgLevel === '' || this.componentData.engChgLevel == null) {
  3787. this.$message.warning('请填写主记录BOM版本号!')
  3788. return
  3789. }
  3790. if (this.componentData.componentPart === '' || this.componentData.componentPart == null) {
  3791. this.$message.warning('请选择子物料编码!')
  3792. return
  3793. }
  3794. if (this.componentData.productFlag === 'component' && (this.componentData.consumptionItem === '' || this.componentData.consumptionItem == null)) {
  3795. this.$message.warning('请选择消耗项目!')
  3796. return
  3797. }
  3798. if (this.componentData.qtyPerAssembly === '' || this.componentData.qtyPerAssembly == null) {
  3799. this.$message.warning('请填写单位用量!')
  3800. return
  3801. }
  3802. if (this.componentData.qtyPerAssembly === 0) {
  3803. this.$message.warning('单位用量不能为0!')
  3804. return
  3805. }
  3806. if (this.componentData.componentScrap === '' || this.componentData.componentScrap == null) {
  3807. this.$message.warning('请填写调机量!')
  3808. return
  3809. }
  3810. if (this.componentData.shrinkageFactor === '' || this.componentData.shrinkageFactor == null) {
  3811. this.$message.warning('请填写损耗率!')
  3812. return
  3813. }
  3814. if (this.componentData.issueType === '' || this.componentData.issueType == null) {
  3815. this.$message.warning('请选择生产属性!')
  3816. return
  3817. }
  3818. if (this.componentData.flag === '1') {
  3819. saveBomComponent(this.componentData).then(({data}) => {
  3820. if (data && data.code === 0) {
  3821. this.subDetailList = data.rows.subDetailList
  3822. this.byProductList = data.rows.byProductList
  3823. this.manufStructCostDistribList = data.rows.manufStructCostDistribList
  3824. if (isClose) {
  3825. if (this.subDetailTable === 'by_products') {
  3826. this.saveByProductModal()
  3827. } else {
  3828. this.saveComponentModal()
  3829. }
  3830. } else {
  3831. this.componentSaveModal = false
  3832. }
  3833. this.$message({
  3834. message: '操作成功',
  3835. type: 'success',
  3836. duration: 1500,
  3837. onClose: () => {}
  3838. })
  3839. } else {
  3840. this.$alert(data.msg, '错误', {
  3841. confirmButtonText: '确定'
  3842. })
  3843. }
  3844. })
  3845. } else if (this.componentData.flag === '2') {
  3846. updateBomComponent(this.componentData).then(({data}) => {
  3847. if (data && data.code === 0) {
  3848. this.subDetailList = data.rows.subDetailList
  3849. this.byProductList = data.rows.byProductList
  3850. this.componentSaveModal = false
  3851. this.$message({
  3852. message: '操作成功',
  3853. type: 'success',
  3854. duration: 1500,
  3855. onClose: () => {}
  3856. })
  3857. } else {
  3858. this.$alert(data.msg, '错误', {
  3859. confirmButtonText: '确定'
  3860. })
  3861. }
  3862. })
  3863. }
  3864. },
  3865. /**
  3866. * 编辑副产品成本分配方法
  3867. */
  3868. manufStructCostDistribUpdate () {
  3869. if (this.manufStructCostDistribData.itemCostDistribution < 0 || this.manufStructCostDistribData.itemCostDistribution > 1) {
  3870. this.$message.warning('项目成本分配系数必须介于0和1之间!')
  3871. return
  3872. }
  3873. updateManufStructCostDistrib(this.manufStructCostDistribData).then(({data}) => {
  3874. if (data && data.code === 0) {
  3875. this.manufStructCostDistribList = data.rows.manufStructCostDistribList
  3876. this.manufStructCostDistribModal = false
  3877. this.$message({
  3878. message: '操作成功',
  3879. type: 'success',
  3880. duration: 1500,
  3881. onClose: () => {}
  3882. })
  3883. } else {
  3884. this.$alert(data.msg, '错误', {
  3885. confirmButtonText: '确定'
  3886. })
  3887. }
  3888. })
  3889. },
  3890. /**
  3891. * 回车事件
  3892. */
  3893. focusNextInput (index, type) {
  3894. let aaa = ''
  3895. if (this.subDetailList.length - 1 === index) {
  3896. aaa = `${type}0`
  3897. } else {
  3898. aaa = `${type}${index + 1}`
  3899. }
  3900. this.$nextTick(() => {
  3901. this.$refs[aaa].focus()
  3902. })
  3903. },
  3904. /**
  3905. * 保存主表信息
  3906. */
  3907. saveBomHeader () {
  3908. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  3909. this.$message.warning('请先选择Bom物料!')
  3910. return
  3911. }
  3912. if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) {
  3913. this.$message.warning('请先填写Bom版本号!')
  3914. return
  3915. }
  3916. if (this.modalData.bomType === '' || this.modalData.bomType == null) {
  3917. this.$message.warning('请先选择制造类型!')
  3918. return
  3919. }
  3920. if (this.modalData.typeFlag === '' || this.modalData.typeFlag == null) {
  3921. this.$message.warning('请先选择类型!')
  3922. return
  3923. }
  3924. this.saveHeaderLoading = true
  3925. // 新增主表信息
  3926. saveBomHeader(this.modalData).then(({data}) => {
  3927. if (data && data.code === 0) {
  3928. this.modalData = {
  3929. flag: '1',
  3930. title: 'bom新增',
  3931. site: data.rows.modalData.site,
  3932. partNo: data.rows.modalData.partNo,
  3933. partDesc: data.rows.modalData.partDesc,
  3934. engChgLevel: data.rows.modalData.engChgLevel,
  3935. bomType: data.rows.modalData.bomType,
  3936. noteText: data.rows.modalData.noteText,
  3937. effPhaseInDate: data.rows.modalData.effPhaseInDate,
  3938. effPhaseOutDate: data.rows.modalData.effPhaseOutDate,
  3939. engRevision: data.rows.modalData.engRevision,
  3940. typeFlag: data.rows.modalData.typeFlag,
  3941. netWeight: data.rows.modalData.netWeight,
  3942. officialFlag: data.rows.modalData.officialFlag
  3943. }
  3944. this.detailDataList = data.rows.detailDataList
  3945. this.detailData = data.rows.detailData
  3946. this.subDetailList = []
  3947. this.modalDisableFlag = true
  3948. this.headerSaveFlag = false
  3949. this.$message({
  3950. message: '操作成功',
  3951. type: 'success',
  3952. duration: 1500,
  3953. onClose: () => {}
  3954. })
  3955. } else {
  3956. this.$alert(data.msg, '错误', {
  3957. confirmButtonText: '确定'
  3958. })
  3959. }
  3960. this.saveHeaderLoading = false
  3961. })
  3962. },
  3963. /**
  3964. * 复制bom的模态框
  3965. */
  3966. copyBomRevision () {
  3967. this.copyBomData = {
  3968. site: this.modalData.site,
  3969. partNo: this.modalData.partNo,
  3970. partDesc: this.modalData.partDesc,
  3971. engChgLevel: '',
  3972. bomType: this.modalData.bomType,
  3973. effPhaseInDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
  3974. effPhaseOutDate: '',
  3975. previousVersion: {},
  3976. createBy: this.$store.state.user.name,
  3977. officialFlag: 'N'
  3978. }
  3979. // 获取物料的bom版本号
  3980. getBomEngChgLevel(this.copyBomData).then(({data}) => {
  3981. if (data && data.code === 0) {
  3982. this.copyBomData.engChgLevel = data.engChgLevel
  3983. }
  3984. })
  3985. this.copyPartData = {
  3986. type: '1',
  3987. site: this.$store.state.user.site,
  3988. partNo: '',
  3989. partDesc: '',
  3990. page: 1,
  3991. limit: 10
  3992. }
  3993. this.copyBomModelFlag = true
  3994. },
  3995. /**
  3996. * 复制bom的方法
  3997. */
  3998. copyBom () {
  3999. if (this.copyBomData.partNo === '' || this.copyBomData.partNo == null) {
  4000. this.$message.warning('请选择Bom物料!')
  4001. return
  4002. }
  4003. if (this.copyBomData.engChgLevel === '' || this.copyBomData.engChgLevel == null) {
  4004. this.$message.warning('请填写Bom版本号!')
  4005. return
  4006. }
  4007. if (this.copyBomData.bomType === '' || this.copyBomData.bomType == null) {
  4008. this.$message.warning('请选择制造类型!')
  4009. return
  4010. }
  4011. if (this.copyBomData.effPhaseOutDate != null && this.copyBomData.effPhaseOutDate !== '' && this.copyBomData.effPhaseOutDate < this.copyBomData.effPhaseInDate) {
  4012. this.$message.warning('失效日期必须大于生效日期!')
  4013. return
  4014. }
  4015. this.copyBomData.previousVersion = this.modalData
  4016. this.copyLoading = true
  4017. // 新增主表信息
  4018. copyBom(this.copyBomData).then(({data}) => {
  4019. if (data && data.code === 0) {
  4020. this.copyBomModelFlag = false
  4021. this.updateModal(data.rows)
  4022. this.$message({
  4023. message: '操作成功',
  4024. type: 'success',
  4025. duration: 1500,
  4026. onClose: () => {}
  4027. })
  4028. } else {
  4029. this.$alert(data.msg, '错误', {
  4030. confirmButtonText: '确定'
  4031. })
  4032. }
  4033. this.copyLoading = false
  4034. }).catch(()=>{
  4035. this.copyLoading = false
  4036. })
  4037. },
  4038. /**
  4039. * 复制alternative的模态框
  4040. */
  4041. copyBomAlternative () {
  4042. this.copyAlternativeData = {
  4043. site: this.detailData.site,
  4044. partNo: this.detailData.partNo,
  4045. partDesc: this.modalData.partDesc,
  4046. engChgLevel: this.detailData.engChgLevel,
  4047. bomType: this.detailData.bomType,
  4048. alternativeNo: this.detailData.alternativeNo,
  4049. alternativeDescription: this.detailData.alternativeDescription,
  4050. minLotQty: this.detailData.minLotQty,
  4051. defaultFlag: this.detailData.defaultFlag,
  4052. detailNoteText: this.detailData.detailNoteText,
  4053. status: 'Tentative',
  4054. officialFlag: 'N',
  4055. previousVersion: {},
  4056. createBy: this.$store.state.user.name
  4057. }
  4058. this.copyPartData = {
  4059. type: '2',
  4060. site: this.$store.state.user.site,
  4061. partNo: '',
  4062. partDesc: '',
  4063. page: 1,
  4064. limit: 10
  4065. }
  4066. this.copyAlternativeModelFlag = true
  4067. },
  4068. /**
  4069. * 复制alternative的方法
  4070. */
  4071. copyAlternative () {
  4072. if (this.copyAlternativeData.partNo === '' || this.copyAlternativeData.partNo == null) {
  4073. this.$message.warning('请选择Bom物料!')
  4074. return
  4075. }
  4076. if (this.copyAlternativeData.engChgLevel === '' || this.copyAlternativeData.engChgLevel == null) {
  4077. this.$message.warning('请填写Bom版本号!')
  4078. return
  4079. }
  4080. if (this.copyAlternativeData.bomType === '' || this.copyAlternativeData.bomType == null) {
  4081. this.$message.warning('请选择制造类型!')
  4082. return
  4083. }
  4084. if (this.copyAlternativeData.alternativeNo === '' || this.copyAlternativeData.alternativeNo == null) {
  4085. this.$message.warning('请填写替代编码!')
  4086. return
  4087. }
  4088. if (this.copyAlternativeData.alternativeDescription === '' || this.copyAlternativeData.alternativeDescription == null) {
  4089. this.$message.warning('请填写替代名称!')
  4090. return
  4091. }
  4092. this.copyAlternativeData.previousVersion = this.detailData
  4093. this.copyLoading = true
  4094. copyAlternative(this.copyAlternativeData).then(({data}) => {
  4095. if (data && data.code === 0) {
  4096. this.copyAlternativeModelFlag = false
  4097. this.updateModal(data.rows)
  4098. this.$message({
  4099. message: '操作成功',
  4100. type: 'success',
  4101. duration: 1500,
  4102. onClose: () => {}
  4103. })
  4104. } else {
  4105. this.$alert(data.msg, '错误', {
  4106. confirmButtonText: '确定'
  4107. })
  4108. }
  4109. this.copyLoading = false
  4110. }).catch(()=>{
  4111. this.copyLoading = false
  4112. })
  4113. },
  4114. /**
  4115. * 新增替代方法
  4116. */
  4117. detailDataSave () {
  4118. if (this.saveDetailData.partNo === '' || this.saveDetailData.partNo == null) {
  4119. this.$message.warning('请先选择Bom物料!')
  4120. return
  4121. }
  4122. if (this.saveDetailData.engChgLevel === '' || this.saveDetailData.engChgLevel == null) {
  4123. this.$message.warning('请先填写Bom版本号!')
  4124. return
  4125. }
  4126. if (this.saveDetailData.bomType === '' || this.saveDetailData.bomType == null) {
  4127. this.$message.warning('请先选择制造类型!')
  4128. return
  4129. }
  4130. if (this.saveDetailData.alternativeNo === '' || this.saveDetailData.alternativeNo == null) {
  4131. this.$message.warning('请填写替代编码!')
  4132. return
  4133. }
  4134. if (this.saveDetailData.alternativeDescription === '' || this.saveDetailData.alternativeDescription == null) {
  4135. this.$message.warning('请填写替代名称!')
  4136. return
  4137. }
  4138. if (this.saveDetailData.status === '' || this.saveDetailData.status == null) {
  4139. this.$message.warning('请选择替代状态!')
  4140. return
  4141. }
  4142. // if (this.saveDetailData.minLotQty === '' || this.saveDetailData.minLotQty == null) {
  4143. // this.$message.warning('请填写最小订单数!')
  4144. // return
  4145. // }
  4146. this.saveDetailLoading = true
  4147. if (this.saveDetailData.flag === '1') {
  4148. bomDetailSave(this.saveDetailData).then(({data}) => {
  4149. if (data && data.code === 0) {
  4150. this.detailDataList = data.rows
  4151. this.detailData = this.saveDetailData
  4152. this.subDetailList = []
  4153. this.saveDetailModalFlag = false
  4154. this.$message({
  4155. message: '操作成功',
  4156. type: 'success',
  4157. duration: 1500,
  4158. onClose: () => {}
  4159. })
  4160. } else {
  4161. this.$alert(data.msg, '错误', {
  4162. confirmButtonText: '确定'
  4163. })
  4164. }
  4165. this.saveDetailLoading = false
  4166. })
  4167. } else {
  4168. bomDetailUpdate(this.saveDetailData).then(({data}) => {
  4169. if (data && data.code === 0) {
  4170. this.detailDataList = data.rows.detailDataList
  4171. this.detailData = data.rows.detailData
  4172. this.subDetailList = data.rows.subDetailList
  4173. this.saveDetailModalFlag = false
  4174. this.$message({
  4175. message: '操作成功',
  4176. type: 'success',
  4177. duration: 1500,
  4178. onClose: () => {}
  4179. })
  4180. } else {
  4181. this.$alert(data.msg, '错误', {
  4182. confirmButtonText: '确定'
  4183. })
  4184. }
  4185. this.saveDetailLoading = false
  4186. })
  4187. }
  4188. },
  4189. /**
  4190. * 删除替代
  4191. */
  4192. deleteBomDetail () {
  4193. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  4194. this.$message.warning('请选择要删除的替代编码!')
  4195. return
  4196. }
  4197. if (this.detailData.alternativeNo === '*') {
  4198. this.$message.warning('当前为默认替代,不可以删除!')
  4199. return
  4200. }
  4201. this.$confirm(`是否删除这项替代?`, '提示', {
  4202. confirmButtonText: '确定',
  4203. cancelButtonText: '取消',
  4204. type: 'warning'
  4205. }).then(() => {
  4206. bomDetailDelete(this.detailData).then(({data}) => {
  4207. if (data && data.code === 0) {
  4208. this.detailData = data.rows.detailData
  4209. this.detailDataList = data.rows.detailDataList
  4210. this.subDetailList = data.rows.subDetailList
  4211. this.$message({
  4212. message: '操作成功',
  4213. type: 'success',
  4214. duration: 1500,
  4215. onClose: () => {}
  4216. })
  4217. } else {
  4218. this.$alert(data.msg, '错误', {
  4219. confirmButtonText: '确定'
  4220. })
  4221. }
  4222. })
  4223. }).catch(() => {
  4224. })
  4225. },
  4226. /**
  4227. * 修改替代状态为 Buildable
  4228. */
  4229. updateStatusToBuildable () {
  4230. this.$confirm(`是否修改状态为Buildable?`, '提示', {
  4231. confirmButtonText: '确定',
  4232. cancelButtonText: '取消',
  4233. type: 'warning'
  4234. }).then(() => {
  4235. updateAlternativeStatus(this.detailData).then(({data}) => {
  4236. if (data && data.code === 0) {
  4237. this.detailDataList = data.rows.detailDataList
  4238. this.detailData = data.rows.detailData
  4239. this.subDetailList = data.rows.subDetailList
  4240. this.$message({
  4241. message: '操作成功',
  4242. type: 'success',
  4243. duration: 1500,
  4244. onClose: () => {}
  4245. })
  4246. } else {
  4247. this.$alert(data.msg, '错误', {confirmButtonText: '确定'})
  4248. // 刷新替代和子明细
  4249. this.alternativeChange()
  4250. }
  4251. })
  4252. }).catch(() => {
  4253. })
  4254. },
  4255. /**
  4256. * 修改替代状态为 Obsolete
  4257. */
  4258. updateStatusToObsolete () {
  4259. this.$confirm(`是否修改状态为Obsolete?`, '提示', {
  4260. confirmButtonText: '确定',
  4261. cancelButtonText: '取消',
  4262. type: 'warning'
  4263. }).then(() => {
  4264. updateAlternativeStatus(this.detailData).then(({data}) => {
  4265. if (data && data.code === 0) {
  4266. this.detailDataList = data.rows.detailDataList
  4267. this.detailData = data.rows.detailData
  4268. this.subDetailList = data.rows.subDetailList
  4269. this.$message({
  4270. message: '操作成功',
  4271. type: 'success',
  4272. duration: 1500,
  4273. onClose: () => {}
  4274. })
  4275. } else {
  4276. this.$alert(data.msg, '错误', {confirmButtonText: '确定'})
  4277. // 刷新替代和子明细
  4278. this.alternativeChange()
  4279. }
  4280. })
  4281. }).catch(() => {
  4282. })
  4283. },
  4284. /**
  4285. * 替代改变事件
  4286. */
  4287. alternativeChange () {
  4288. queryBomComponent(this.detailData).then(({data}) => {
  4289. if (data && data.code === 0) {
  4290. this.detailDataList = data.rows.detailDataList
  4291. this.detailData = data.rows.detailData
  4292. this.subDetailList = data.rows.subDetailList
  4293. } else {
  4294. this.$alert(data.msg, '错误', {
  4295. confirmButtonText: '确定'
  4296. })
  4297. }
  4298. })
  4299. },
  4300. // 临时Bom转为正式Bom
  4301. toBecomeOfficialBom () {
  4302. this.toBecomeOfficialLoading = true
  4303. toBecomeOfficialBom(this.detailData).then(({data}) => {
  4304. if (data && data.code === 0) {
  4305. this.getDataList()
  4306. this.modalFlag = false
  4307. this.$message({
  4308. message: '操作成功',
  4309. type: 'success',
  4310. duration: 1500,
  4311. onClose: () => {}
  4312. })
  4313. } else {
  4314. this.$alert(data.msg, '错误', {
  4315. confirmButtonText: '确定'
  4316. })
  4317. }
  4318. this.toBecomeOfficialLoading = false
  4319. }).catch(()=>{
  4320. this.toBecomeOfficialLoading = false
  4321. })
  4322. },
  4323. /**
  4324. * 根据物料编码查询工序
  4325. */
  4326. queryOperationList () {
  4327. this.operationData.partNo = this.modalData.partNo
  4328. // 查询所有
  4329. queryOperationList(this.operationData).then(({data}) => {
  4330. if (data && data.code === 0) {
  4331. this.operationList = data.rows
  4332. this.operationData = {
  4333. site: this.$store.state.user.site,
  4334. partNo: this.modalData.partNo,
  4335. routingRevision: '',
  4336. routingType: '',
  4337. alternativeNo: '',
  4338. operationNo: '',
  4339. operationName: '',
  4340. }
  4341. this.operationModelFlag = true
  4342. } else {
  4343. this.$alert(data.msg, '错误', {
  4344. confirmButtonText: '确定'
  4345. })
  4346. }
  4347. })
  4348. },
  4349. // ======== chooseList相关方法 ========
  4350. /**
  4351. * 获取基础数据列表S
  4352. * @param val
  4353. * @param type
  4354. */
  4355. getBaseList (val, type) {
  4356. this.tagNo = val
  4357. this.$nextTick(() => {
  4358. let strVal = ''
  4359. if (val === 117) {
  4360. strVal = this.componentData.issueToLoc
  4361. }
  4362. this.$refs.baseList.init(val, strVal)
  4363. })
  4364. },
  4365. /**
  4366. * 列表方法的回调
  4367. * @param val
  4368. */
  4369. getBaseData (val) {
  4370. if (this.tagNo === 117) {
  4371. this.componentData.issueToLoc = val.location_id
  4372. this.componentData.issueToLocName = val.location_name
  4373. }
  4374. },
  4375. // ======== 导出相关方法 ========
  4376. /**
  4377. * 导出excel
  4378. */
  4379. async createExportData () {
  4380. this.searchData.limit = -1
  4381. this.searchData.page = 1
  4382. await bomManagementSearch(this.searchData).then(({data}) => {
  4383. this.resultList = data.page.list
  4384. })
  4385. return this.resultList
  4386. },
  4387. startDownload () {},
  4388. finishDownload () {},
  4389. fields () {
  4390. let json = '{'
  4391. this.columnList.forEach((item, index) => {
  4392. if (index == this.columnList.length - 1) {
  4393. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  4394. } else {
  4395. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  4396. }
  4397. })
  4398. json += '}'
  4399. let s = eval('(' + json + ')')
  4400. return s
  4401. },
  4402. // 切换到routing
  4403. checkOutToRouting (partNo) {
  4404. if (this.$router.resolve('part-routingManagement').resolved.name === '404') {
  4405. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',})
  4406. } else {
  4407. this.$router.push({name:"part-routingManagement",params:{partNo: partNo}})
  4408. }
  4409. }
  4410. }
  4411. }
  4412. </script>
  4413. <style scoped lang="scss">
  4414. /deep/ .detail-tab .el-tabs__content {
  4415. height: 165px;
  4416. padding: 15px 0px 0px 0px;
  4417. }
  4418. /deep/ .sub_detail-tab .el-tabs__content {
  4419. height: 280px;
  4420. padding: 0px;
  4421. }
  4422. .numInput /deep/ .el-input__inner{
  4423. text-align: right;
  4424. }
  4425. /deep/ .inlineNumber input::-webkit-outer-spin-button,
  4426. /deep/ .inlineNumber input::-webkit-inner-spin-button {
  4427. -webkit-appearance: none;
  4428. }
  4429. /deep/ .inlineNumber input[type="number"]{
  4430. -moz-appearance: textfield;
  4431. padding-right: 5px !important;
  4432. }
  4433. </style>