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.

4504 lines
150 KiB

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