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