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.

5620 lines
191 KiB

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