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.

4366 lines
149 KiB

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