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.

2101 lines
67 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  5. <el-form-item :label="'物料编码'">
  6. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'物料名称'">
  9. <el-input v-model="searchData.partDesc" clearable style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="' '">
  12. <el-button :loading="queryLoading" @click="getDataList()">查询</el-button>
  13. <el-button type="primary" @click="addModal()">新增</el-button>
  14. <el-button type="primary" @click="delModal()">删除</el-button>
  15. <download-excel
  16. :fields="fields()"
  17. :data="exportData"
  18. type="xls"
  19. :name="exportName"
  20. :header="exportHeader"
  21. :footer="exportFooter"
  22. :fetch="createExportData"
  23. :before-generate="startDownload"
  24. :before-finish="finishDownload"
  25. worksheet="导出信息"
  26. class="el-button el-button--primary el-button--medium">
  27. {{ "导出" }}
  28. </download-excel>
  29. </el-form-item>
  30. </el-form>
  31. <!-- bom列表 -->
  32. <el-table
  33. :height="height"
  34. :data="dataList"
  35. border
  36. @selection-change="selectionBom"
  37. style="width: 100%;">
  38. <el-table-column
  39. type="selection"
  40. header-align="center"
  41. align="center"
  42. :selectable="selectFlag"
  43. width="50">
  44. </el-table-column>
  45. <el-table-column
  46. v-for="(item,index) in columnList" :key="index"
  47. :sortable="item.columnSortable"
  48. :prop="item.columnProp"
  49. :header-align="item.headerAlign"
  50. :show-overflow-tooltip="item.showOverflowTooltip"
  51. :align="item.align"
  52. :fixed="item.fixed === ''?false:item.fixed"
  53. :min-width="item.columnWidth"
  54. :label="item.columnLabel">
  55. <template slot-scope="scope">
  56. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  57. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column
  61. fixed="right"
  62. header-align="center"
  63. align="center"
  64. width="100"
  65. label="操作">
  66. <template slot-scope="scope">
  67. <a type="text" size="small" @click="updateModal(scope.row)">编辑</a>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <!-- 复选统计 -->
  72. <selectDiv ref="selectDiv"></selectDiv>
  73. <!-- 分页插件 -->
  74. <el-pagination style="margin-top: 0px"
  75. @size-change="sizeChangeHandle"
  76. @current-change="currentChangeHandle"
  77. :current-page="pageIndex"
  78. :page-sizes="[20, 50, 100, 200, 500]"
  79. :page-size="pageSize"
  80. :total="totalPage"
  81. layout="total, sizes, prev, pager, next, jumper">
  82. </el-pagination>
  83. <!-- bom新增/编辑模态框 -->
  84. <el-dialog :close-on-click-modal="false" :before-close="closeModalX" v-drag :visible.sync="modalFlag" width="1000px">
  85. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 5px">
  86. <el-form-item prop="partNo" :rules="rules.partNo">
  87. <span v-if="!modalDisableFlag" slot="label" @click="queryPartList()"><a herf="#">物料编码</a></span>
  88. <span v-if="modalDisableFlag" slot="label">物料编码</span>
  89. <el-input v-model="modalData.partNo" :disabled="modalDisableFlag" style="width: 221px"></el-input>
  90. </el-form-item>
  91. <el-form-item :label="'物料名称'" prop="partDesc" :rules="rules.partDesc">
  92. <el-input v-model="modalData.partDesc" disabled style="width: 221px"></el-input>
  93. </el-form-item>
  94. <el-form-item :label="'制造类型'" prop="bomType" :rules="rules.bomType">
  95. <el-select v-model="modalData.bomType" :disabled="modalDisableFlag" style="width: 142px">
  96. <el-option label="制造" value="manufacturing"></el-option>
  97. </el-select>
  98. </el-form-item>
  99. <el-form-item :label="'类型'" prop="typeFlag" :rules="rules.typeFlag">
  100. <el-select v-model="modalData.typeFlag" style="width: 142px">
  101. <el-option label="BOM" value="B"></el-option>
  102. <el-option label="配方" value="F"></el-option>
  103. </el-select>
  104. </el-form-item>
  105. <el-form-item :label="'净重'">
  106. <el-input v-model="modalData.netWeight" type="number" style="width: 141px"></el-input>
  107. </el-form-item>
  108. </el-form>
  109. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  110. <el-form-item label="开始时间" prop="effPhaseInDate" :rules="rules.effPhaseInDate">
  111. <el-date-picker
  112. style="width: 221px"
  113. v-model="modalData.effPhaseInDate"
  114. type="datetime"
  115. value-format="yyyy-MM-dd HH:mm:ss"
  116. format="yyyy-MM-dd HH:mm:ss"
  117. placeholder="请选择时间"
  118. :editable=false>
  119. </el-date-picker>
  120. </el-form-item>
  121. <el-form-item label="结束时间" prop="effPhaseOutDate" :rules="rules.effPhaseOutDate">
  122. <el-date-picker
  123. style="width: 221px"
  124. v-model="modalData.effPhaseOutDate"
  125. type="datetime"
  126. value-format="yyyy-MM-dd HH:mm:ss"
  127. format="yyyy-MM-dd HH:mm:ss"
  128. placeholder="请选择时间"
  129. :editable=false>
  130. </el-date-picker>
  131. </el-form-item>
  132. <el-form-item :label="'BOM版本号'" prop="engChgLevel" :rules="rules.engChgLevel">
  133. <el-input v-model="modalData.engChgLevel" :disabled="modalDisableFlag" style="width: 142px"></el-input>
  134. </el-form-item>
  135. <el-form-item :label="'工程版本号'">
  136. <el-input v-model="modalData.engRevision" style="width: 142px"></el-input>
  137. </el-form-item>
  138. <el-form-item v-if="!modalDisableFlag">
  139. <el-button :loading="saveHeaderLoading" type="primary" @click="saveBomHeader()" style="margin-top: 23px;width: 141px">保存</el-button>
  140. </el-form-item>
  141. </el-form>
  142. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  143. <el-form-item label="备注">
  144. <el-input type="textarea" v-model="modalData.noteText" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 925px;height: 20px"></el-input>
  145. </el-form-item>
  146. </el-form>
  147. <el-tabs v-model="detailTable" style="margin-top: 65px; width: 100%; min-height: 120px" type="border-card" @tab-click="tabDetailClick" class="detail-tab">
  148. <!-- BOM明细信息页签 -->
  149. <el-tab-pane label="Product Structure" name="bom_detail">
  150. <el-form label-position="top" style="margin-top: -10px">
  151. <el-form-item>
  152. <el-button type="primary" @click="saveBomDetail()" style="margin-left: 7px">新增</el-button>
  153. <el-button type="primary" @click="deleteBomDetail()">删除</el-button>
  154. </el-form-item>
  155. </el-form>
  156. <el-form :inline="true" label-position="top" :model="detailData" :rules="rules" style="margin-left: 7px">
  157. <el-form-item :label="'替代编码'" prop="alternativeNo" :rules="rules.alternativeNo">
  158. <el-select v-model="detailData.alternativeNo" @change="alternativeChange()" style="width: 221px">
  159. <el-option
  160. v-for = "(i, index) in detailDataList"
  161. :key = "index"
  162. :label = "i.alternativeNo"
  163. :value = "i.alternativeNo">
  164. </el-option>
  165. </el-select>
  166. </el-form-item>
  167. <el-form-item :label="'替代名称'">
  168. <el-input v-model="detailData.alternativeDescription" disabled style="width: 221px"></el-input>
  169. </el-form-item>
  170. <el-form-item :label="'最小订单数'">
  171. <el-input v-model="detailData.minLotQty" type="number" style="width: 221px"></el-input>
  172. </el-form-item>
  173. </el-form>
  174. <el-form :inline="true" label-position="top" :model="detailData" style="margin-left: 7px">
  175. <el-form-item label="备注">
  176. <el-input type="textarea" v-model="detailData.detailNoteText" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 925px;height: 20px"></el-input>
  177. </el-form-item>
  178. </el-form>
  179. </el-tab-pane>
  180. </el-tabs>
  181. <el-tabs v-model="subDetailTable" style="width: 100%; min-height: 330px" type="border-card" @tab-click="tabSubDetailClick" class="sub_detail-tab">
  182. <!-- BOM子明细信息页签 -->
  183. <el-tab-pane label="Components" name="bom_sub_detail">
  184. <el-form label-position="top" style="margin-top: 5px">
  185. <el-form-item>
  186. <el-button type="primary" @click="saveComponentModal()" style="margin-left: 7px">新增</el-button>
  187. <el-button type="primary" @click="deleteComponentPart()">删除</el-button>
  188. </el-form-item>
  189. </el-form>
  190. <el-table
  191. :data="subDetailList"
  192. height="256px"
  193. border
  194. ref="componentTable"
  195. @row-click="componentClickRow"
  196. :row-class-name="rowClassName"
  197. @selection-change="componentSelectionChange"
  198. style="width:100%">
  199. <el-table-column type="selection" align="center" width="50"></el-table-column>
  200. <el-table-column
  201. v-for="(item,index) in columnSubDetailList" :key="index"
  202. :sortable="item.columnSortable"
  203. :prop="item.columnProp"
  204. :header-align="item.headerAlign"
  205. :show-overflow-tooltip="item.showOverflowTooltip"
  206. :align="item.align"
  207. :fixed="item.fixed == ''?false:item.fixed"
  208. :min-width="item.columnWidth"
  209. :label="item.columnLabel">
  210. <template slot-scope="scope">
  211. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  212. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column
  216. fixed="right"
  217. header-align="center"
  218. align="center"
  219. width="100"
  220. label="操作">
  221. <template slot-scope="scope">
  222. <a type="text" size="small" @click="updateComponentModal(scope.row)">编辑</a>
  223. </template>
  224. </el-table-column>
  225. </el-table>
  226. </el-tab-pane>
  227. </el-tabs>
  228. <el-footer style="height:30px;margin-top:20px;text-align:center">
  229. <el-button :loading="saveAllLoading" type="primary" @click="saveData()">保存</el-button>
  230. <el-button type="primary" @click="closeModal()">关闭</el-button>
  231. </el-footer>
  232. </el-dialog>
  233. <!-- 明细新增模态框 -->
  234. <el-dialog title="新增替代" :close-on-click-modal="false" v-drag :visible.sync="saveDetailModalFlag" width="650px">
  235. <el-form :inline="true" label-position="top" :model="saveDetailData" :rules="detailRules" style="margin-left: 5px">
  236. <el-form-item :label="'替代编码'" prop="alternativeNo" :rules="detailRules.alternativeNo">
  237. <el-input v-model="saveDetailData.alternativeNo" style="width: 221px"></el-input>
  238. </el-form-item>
  239. <el-form-item :label="'替代名称'" prop="alternativeDescription" :rules="detailRules.alternativeDescription">
  240. <el-input v-model="saveDetailData.alternativeDescription" style="width: 221px"></el-input>
  241. </el-form-item>
  242. <el-form-item :label="'最小订单数'" prop="minLotQty" :rules="detailRules.minLotQty">
  243. <el-input v-model="saveDetailData.minLotQty" type="number" style="width: 120px"></el-input>
  244. </el-form-item>
  245. </el-form>
  246. <el-form :inline="true" label-position="top" :model="saveDetailData" style="margin-left: 5px">
  247. <el-form-item label="备注">
  248. <el-input type="textarea" v-model="saveDetailData.detailNoteText" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 600px;height: 20px"></el-input>
  249. </el-form-item>
  250. </el-form>
  251. <el-footer style="height:35px;margin-top:65px;text-align:center">
  252. <el-button :loading="saveDetailLoading" type="primary" @click="detailDataSave()">保存</el-button>
  253. <el-button type="primary" @click="saveDetailModalFlag = false">关闭</el-button>
  254. </el-footer>
  255. </el-dialog>
  256. <!-- 物料模态框 -->
  257. <el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="520px">
  258. <div class="rq">
  259. <el-form :inline="true" label-position="top" :model="partData">
  260. <el-form-item :label="'物料编码'">
  261. <el-input v-model="partData.partNo" clearable style="width: 120px"></el-input>
  262. </el-form-item>
  263. <el-form-item :label="'物料名称'">
  264. <el-input v-model="partData.partDesc" clearable style="width: 120px"></el-input>
  265. </el-form-item>
  266. <el-form-item :label="' '">
  267. <el-button type="primary" @click="queryPartList()">查询</el-button>
  268. </el-form-item>
  269. </el-form>
  270. <el-table
  271. :height="300"
  272. :data="partList"
  273. @row-dblclick="getRowData"
  274. border
  275. style="width: 100%;">
  276. <el-table-column
  277. v-for="(item,index) in partColumnList" :key="index"
  278. :sortable="item.columnSortable"
  279. :prop="item.columnProp"
  280. :header-align="item.headerAlign"
  281. :show-overflow-tooltip="item.showOverflowTooltip"
  282. :align="item.align"
  283. :fixed="item.fixed==''?false:item.fixed"
  284. :min-width="item.columnWidth"
  285. :label="item.columnLabel">
  286. <template slot-scope="scope">
  287. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  288. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  289. </template>
  290. </el-table-column>
  291. </el-table>
  292. </div>
  293. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  294. <el-button type="primary" @click="partModelFlag=false">关闭</el-button>
  295. </el-footer>
  296. </el-dialog>
  297. <!-- 子明细物料模态框 -->
  298. <el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="componentPartModelFlag" width="520px">
  299. <el-form :inline="true" label-position="top" :model="componentPartData">
  300. <el-form-item :label="'物料编码'">
  301. <el-input v-model="componentPartData.partNo" clearable style="width: 120px"></el-input>
  302. </el-form-item>
  303. <el-form-item :label="'物料名称'">
  304. <el-input v-model="componentPartData.partDesc" clearable style="width: 120px"></el-input>
  305. </el-form-item>
  306. <el-form-item :label="' '">
  307. <el-button type="primary" @click="queryComponentPartList()">查询</el-button>
  308. </el-form-item>
  309. </el-form>
  310. <el-table
  311. :height="300"
  312. :data="componentPartList"
  313. @row-dblclick="getComponentRowData"
  314. border
  315. style="width: 100%;">
  316. <el-table-column
  317. v-for="(item,index) in componentPartColumnList" :key="index"
  318. :sortable="item.columnSortable"
  319. :prop="item.columnProp"
  320. :header-align="item.headerAlign"
  321. :show-overflow-tooltip="item.showOverflowTooltip"
  322. :align="item.align"
  323. :fixed="item.fixed==''?false:item.fixed"
  324. :min-width="item.columnWidth"
  325. :label="item.columnLabel">
  326. <template slot-scope="scope">
  327. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  328. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  329. </template>
  330. </el-table-column>
  331. </el-table>
  332. </el-dialog>
  333. <!-- 子明细新增模态框 -->
  334. <el-dialog title="新增子物料" :close-on-click-modal="false" v-drag :visible.sync="componentSaveModal" width="500px">
  335. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  336. <el-form-item prop="componentPart" :rules="componentRules.componentPart">
  337. <span v-if="!componentDisableFlag" slot="label" @click="queryComponentPartList()"><a herf="#">子物料编码</a></span>
  338. <span v-if="componentDisableFlag" slot="label">子物料编码</span>
  339. <el-input v-model="componentData.componentPart" :disabled="componentDisableFlag" style="width: 221px"></el-input>
  340. </el-form-item>
  341. <el-form-item :label="'子物料名称'" prop="componentPartDesc" :rules="componentRules.componentPartDesc">
  342. <el-input v-model="componentData.componentPartDesc" disabled style="width: 221px"></el-input>
  343. </el-form-item>
  344. </el-form>
  345. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  346. <el-form-item :label="'单位'">
  347. <el-input v-model="componentData.printUnitName" disabled style="width: 221px"></el-input>
  348. </el-form-item>
  349. <el-form-item :label="'生产属性'" prop="issueType" :rules="componentRules.issueType">
  350. <el-select v-model="componentData.issueType" clearable style="width: 221px">
  351. <el-option label="领退料倒冲" value="A"></el-option>
  352. <el-option label="工单倒冲" value="B"></el-option>
  353. <el-option label="生产订单倒冲" value="C"></el-option>
  354. <el-option label="投料倒冲" value="D"></el-option>
  355. <el-option label="批次倒冲" value="E"></el-option>
  356. <el-option label="销售订单倒冲" value="F"></el-option>
  357. <el-option label="项目倒冲" value="G"></el-option>
  358. </el-select>
  359. </el-form-item>
  360. </el-form>
  361. <el-form :inline="true" label-position="top" :model="componentData" style="margin-left: 5px">
  362. <el-form-item>
  363. <span slot="label" @click="getBaseList(103)"><a herf="#">工序</a></span>
  364. <el-input v-model="componentData.operationName" style="width: 221px"></el-input>
  365. </el-form-item>
  366. <el-form-item>
  367. <span slot="label" @click="getBaseList(117)"><a herf="#">发料库位</a></span>
  368. <el-input v-model="componentData.issueToLocName" style="width: 221px"></el-input>
  369. </el-form-item>
  370. </el-form>
  371. <el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px">
  372. <el-form-item :label="'单位用量'" prop="qtyPerAssembly" :rules="componentRules.qtyPerAssembly">
  373. <el-input v-model="componentData.qtyPerAssembly" type="number" style="width: 142px"></el-input>
  374. </el-form-item>
  375. <el-form-item :label="'调机量'" prop="componentScrap" :rules="componentRules.componentScrap">
  376. <el-input v-model="componentData.componentScrap" type="number" style="width: 142px"></el-input>
  377. </el-form-item>
  378. <el-form-item :label="'损耗率'" prop="shrinkageFactor" :rules="componentRules.shrinkageFactor">
  379. <el-input v-model="componentData.shrinkageFactor" type="number" style="width: 142px"></el-input>
  380. </el-form-item>
  381. </el-form>
  382. <el-form :inline="true" label-position="top" :model="componentData" style="margin-left: 5px">
  383. <el-form-item label="备注">
  384. <el-input type="textarea" v-model="componentData.noteText" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 455px;height: 20px"></el-input>
  385. </el-form-item>
  386. </el-form>
  387. <el-footer style="height:35px;margin-top:65px;text-align:center">
  388. <el-button :loading="saveComponentLoading" type="primary" @click="componentDataSave()">保存</el-button>
  389. <el-button type="primary" @click="componentSaveModal = false">关闭</el-button>
  390. </el-footer>
  391. </el-dialog>
  392. <!-- chooseList模态框 -->
  393. <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
  394. </div>
  395. </template>
  396. <script>
  397. import {
  398. bomManagementSearch, // bom列表查询
  399. bomManagementSave, // bom新增
  400. bomManagementEdit, // bom编辑
  401. bomManagementDelete, // bom删除
  402. queryBomHeader, // 查询bom主信息
  403. saveBomHeader, // 新增bom主信息
  404. queryBomDetail, // 查bom明细
  405. bomDetailSave, // bom明细新增
  406. bomDetailDelete, // bom明细删除
  407. queryPartList, // 查询物料清单
  408. queryBomComponent, // 查询bom子明细
  409. saveBomComponent, // 新增bom子明细
  410. updateBomComponent, // 修改bom子明细
  411. deleteBomComponent, // 删除bom子明细
  412. } from '@/api/part/bomManagement.js'
  413. import ChooseList from '@/views/modules/common/Chooselist'
  414. import dayjs from "dayjs";
  415. import fa from "element-ui/src/locale/lang/fa";
  416. export default {
  417. // 组件
  418. components: {
  419. ChooseList
  420. },
  421. // 监听
  422. watch: {
  423. searchData: {
  424. deep: true,
  425. handler: function (newV, oldV) {
  426. this.searchData.partNo = this.searchData.partNo.toUpperCase()
  427. }
  428. },
  429. saveDetailData: {
  430. deep: true,
  431. handler: function (newV, oldV) {
  432. this.saveDetailData.alternativeNo = this.saveDetailData.alternativeNo.toUpperCase()
  433. }
  434. }
  435. },
  436. // 对象
  437. data () {
  438. return {
  439. // 导出
  440. exportData: [],
  441. exportName: 'bom物料列表' + this.dayjs().format('YYYYMMDDHHmmss'),
  442. exportHeader: ['bom物料列表'],
  443. exportFooter: [],
  444. resultList: [],
  445. // ======== 行高 ========
  446. height: 200,
  447. // ======== 分页 ========
  448. pageIndex: 1,
  449. pageSize: 50,
  450. totalPage: 0,
  451. selectedDataNum: 0,
  452. // 条件查询
  453. searchData: {
  454. site: this.$store.state.user.site,
  455. partNo: '',
  456. partDesc: '',
  457. page: 1,
  458. limit: 10
  459. },
  460. // loading
  461. queryLoading: false,
  462. saveHeaderLoading: false,
  463. saveDetailLoading: false,
  464. saveComponentLoading: false,
  465. saveAllLoading: false,
  466. // 初始页签
  467. detailTable: 'bom_detail',
  468. subDetailTable: 'bom_sub_detail',
  469. // ======== 数据对象 ========
  470. modalData: {
  471. flag: '',
  472. title: '',
  473. site: this.$store.state.user.site,
  474. partNo: '',
  475. partDesc: '',
  476. engChgLevel: '',
  477. bomType: '',
  478. noteText: '',
  479. effPhaseInDate: '',
  480. effPhaseOutDate: '',
  481. engRevision: '',
  482. typeFlag: '',
  483. netWeight: '',
  484. createDate: '',
  485. createBy: '',
  486. updateDate: '',
  487. updateBy: ''
  488. },
  489. detailData: {
  490. site: this.$store.state.user.site,
  491. partNo: '',
  492. engChgLevel: '',
  493. bomType: '',
  494. alternativeNo: '',
  495. alternativeDescription: '',
  496. minLotQty: '',
  497. defaultFlag: '',
  498. detailNoteText: '',
  499. createDate: '',
  500. createBy: '',
  501. updateDate: '',
  502. updateBy: ''
  503. },
  504. componentData: {
  505. flag: '',
  506. site: this.$store.state.user.site,
  507. partNo: '',
  508. engChgLevel: '',
  509. bomType: '',
  510. alternativeNo: '',
  511. componentPart: '',
  512. componentPartDesc: '',
  513. printUnit: '',
  514. printUnitName: '',
  515. qtyPerAssembly: '',
  516. componentScrap: '',
  517. issueType: '',
  518. shrinkageFactor: '',
  519. lineItemNo: '',
  520. operationNo: '',
  521. operationName: '',
  522. issueToLoc: '',
  523. issueToLocName: '',
  524. noteText: '',
  525. createDate: '',
  526. createBy: '',
  527. updateDate: '',
  528. updateBy: ''
  529. },
  530. partData: {
  531. site: this.$store.state.user.site,
  532. partNo: '',
  533. partDesc: '',
  534. },
  535. componentPartData: {
  536. site: this.$store.state.user.site,
  537. partNo: '',
  538. partDesc: '',
  539. },
  540. saveDetailData: {
  541. site: this.$store.state.user.site,
  542. partNo: '',
  543. engChgLevel: '',
  544. bomType: '',
  545. alternativeNo: '',
  546. alternativeDescription: '',
  547. minLotQty: '',
  548. defaultFlag: '',
  549. detailNoteText: '',
  550. createDate: '',
  551. createBy: '',
  552. updateDate: '',
  553. updateBy: ''
  554. },
  555. // ======== 数据列表 ========
  556. dataList: [],
  557. partList: [],
  558. componentPartList: [],
  559. componentPartSelections: [],
  560. subDetailList: [],
  561. detailDataList: [],
  562. checkedDetail: [],
  563. // ======== 列表表头 ========
  564. columnList: [
  565. {
  566. userId: this.$store.state.user.name,
  567. functionId: 104002,
  568. serialNumber: '104002Table1PartNo',
  569. tableId: '104002Table1',
  570. tableName: 'BOM信息表',
  571. columnProp: 'partNo',
  572. headerAlign: 'center',
  573. align: 'center',
  574. columnLabel: '物料编码',
  575. columnHidden: false,
  576. columnImage: false,
  577. columnSortable: false,
  578. sortLv: 0,
  579. status: true,
  580. fixed: '',
  581. columnWidth: 120
  582. },
  583. {
  584. userId: this.$store.state.user.name,
  585. functionId: 104002,
  586. serialNumber: '104002Table1PartDesc',
  587. tableId: '104002Table1',
  588. tableName: 'BOM信息表',
  589. columnProp: 'partDesc',
  590. headerAlign: 'center',
  591. align: 'left',
  592. columnLabel: '物料名称',
  593. columnHidden: false,
  594. columnImage: false,
  595. columnSortable: false,
  596. sortLv: 0,
  597. status: true,
  598. fixed: '',
  599. columnWidth: 120
  600. },
  601. {
  602. userId: this.$store.state.user.name,
  603. functionId: 104002,
  604. serialNumber: '104002Table1BomType',
  605. tableId: '104002Table1',
  606. tableName: 'BOM信息表',
  607. columnProp: 'bomType',
  608. headerAlign: 'center',
  609. align: 'center',
  610. columnLabel: '制造类型',
  611. columnHidden: false,
  612. columnImage: false,
  613. columnSortable: false,
  614. sortLv: 0,
  615. status: true,
  616. fixed: '',
  617. columnWidth: 120
  618. },
  619. {
  620. userId: this.$store.state.user.name,
  621. functionId: 104002,
  622. serialNumber: '104002Table1EngChgLevel',
  623. tableId: '104002Table1',
  624. tableName: 'BOM信息表',
  625. columnProp: 'engChgLevel',
  626. headerAlign: 'center',
  627. align: 'center',
  628. columnLabel: 'BOM版本号',
  629. columnHidden: false,
  630. columnImage: false,
  631. columnSortable: false,
  632. sortLv: 0,
  633. status: true,
  634. fixed: '',
  635. columnWidth: 120
  636. },
  637. {
  638. userId: this.$store.state.user.name,
  639. functionId: 104002,
  640. serialNumber: '104002Table1engRevision',
  641. tableId: '104002Table1',
  642. tableName: 'BOM信息表',
  643. columnProp: 'engRevision',
  644. headerAlign: 'center',
  645. align: 'center',
  646. columnLabel: '工程版本号',
  647. columnHidden: false,
  648. columnImage: false,
  649. columnSortable: false,
  650. sortLv: 0,
  651. status: true,
  652. fixed: '',
  653. columnWidth: 120
  654. },
  655. {
  656. userId: this.$store.state.user.name,
  657. functionId: 104002,
  658. serialNumber: '104002Table1NetWeight',
  659. tableId: '104002Table1',
  660. tableName: 'BOM信息表',
  661. columnProp: 'netWeight',
  662. headerAlign: 'center',
  663. align: 'right',
  664. columnLabel: '净重',
  665. columnHidden: false,
  666. columnImage: false,
  667. columnSortable: false,
  668. sortLv: 0,
  669. status: true,
  670. fixed: '',
  671. columnWidth: 80
  672. },
  673. {
  674. userId: this.$store.state.user.name,
  675. functionId: 104002,
  676. serialNumber: '104002Table1EffPhaseInDate',
  677. tableId: '104002Table1',
  678. tableName: 'BOM信息表',
  679. columnProp: 'effPhaseInDate',
  680. headerAlign: 'center',
  681. align: 'center',
  682. columnLabel: '开始时间',
  683. columnHidden: false,
  684. columnImage: false,
  685. columnSortable: false,
  686. sortLv: 0,
  687. status: true,
  688. fixed: '',
  689. columnWidth: 130
  690. },
  691. {
  692. userId: this.$store.state.user.name,
  693. functionId: 104002,
  694. serialNumber: '104002Table1EffPhaseOutDate',
  695. tableId: '104002Table1',
  696. tableName: 'BOM信息表',
  697. columnProp: 'effPhaseOutDate',
  698. headerAlign: 'center',
  699. align: 'center',
  700. columnLabel: '结束时间',
  701. columnHidden: false,
  702. columnImage: false,
  703. columnSortable: false,
  704. sortLv: 0,
  705. status: true,
  706. fixed: '',
  707. columnWidth: 130
  708. },
  709. {
  710. userId: this.$store.state.user.name,
  711. functionId: 104002,
  712. serialNumber: '104002Table1CreateDate',
  713. tableId: '104002Table1',
  714. tableName: 'BOM信息表',
  715. columnProp: 'createDate',
  716. headerAlign: 'center',
  717. align: 'center',
  718. columnLabel: '创建时间',
  719. columnHidden: false,
  720. columnImage: false,
  721. columnSortable: false,
  722. sortLv: 0,
  723. status: true,
  724. fixed: '',
  725. columnWidth: 130
  726. },
  727. {
  728. userId: this.$store.state.user.name,
  729. functionId: 104002,
  730. serialNumber: '104002Table1CreateBy',
  731. tableId: '104002Table1',
  732. tableName: 'BOM信息表',
  733. columnProp: 'createBy',
  734. headerAlign: 'center',
  735. align: 'center',
  736. columnLabel: '创建人',
  737. columnHidden: false,
  738. columnImage: false,
  739. columnSortable: false,
  740. sortLv: 0,
  741. status: true,
  742. fixed: '',
  743. columnWidth: 80
  744. },
  745. {
  746. userId: this.$store.state.user.name,
  747. functionId: 104002,
  748. serialNumber: '104002Table1UpdateDate',
  749. tableId: '104002Table1',
  750. tableName: 'BOM信息表',
  751. columnProp: 'updateDate',
  752. headerAlign: 'center',
  753. align: 'center',
  754. columnLabel: '更新时间',
  755. columnHidden: false,
  756. columnImage: false,
  757. columnSortable: false,
  758. sortLv: 0,
  759. status: true,
  760. fixed: '',
  761. columnWidth: 130
  762. },
  763. {
  764. userId: this.$store.state.user.name,
  765. functionId: 104002,
  766. serialNumber: '104002Table1UpdateBy',
  767. tableId: '104002Table1',
  768. tableName: 'BOM信息表',
  769. columnProp: 'updateBy',
  770. headerAlign: 'center',
  771. align: 'center',
  772. columnLabel: '更新人',
  773. columnHidden: false,
  774. columnImage: false,
  775. columnSortable: false,
  776. sortLv: 0,
  777. status: true,
  778. fixed: '',
  779. columnWidth: 80
  780. }
  781. ],
  782. partColumnList: [
  783. {
  784. columnProp: 'partNo',
  785. headerAlign: "center",
  786. align: "center",
  787. columnLabel: '物料编码',
  788. columnHidden: false,
  789. columnImage: false,
  790. columnSortable: false,
  791. sortLv: 0,
  792. status: true,
  793. fixed: '',
  794. },
  795. {
  796. columnProp: 'partDesc',
  797. headerAlign: "center",
  798. align: "center",
  799. columnLabel: '物料名称',
  800. columnHidden: false,
  801. columnImage: false,
  802. columnSortable: false,
  803. sortLv: 0,
  804. status: true,
  805. fixed: '',
  806. },
  807. ],
  808. componentPartColumnList: [
  809. {
  810. columnProp: 'partNo',
  811. headerAlign: "center",
  812. align: "center",
  813. columnLabel: '物料编码',
  814. columnHidden: false,
  815. columnImage: false,
  816. columnSortable: false,
  817. sortLv: 0,
  818. status: true,
  819. fixed: '',
  820. },
  821. {
  822. columnProp: 'partDesc',
  823. headerAlign: "center",
  824. align: "center",
  825. columnLabel: '物料名称',
  826. columnHidden: false,
  827. columnImage: false,
  828. columnSortable: false,
  829. sortLv: 0,
  830. status: true,
  831. fixed: '',
  832. }
  833. ],
  834. columnSubDetailList: [
  835. {
  836. userId: this.$store.state.user.name,
  837. functionId: 104002,
  838. serialNumber: '104002Table2ComponentPart',
  839. tableId: '104002Table2',
  840. tableName: 'BOM子物料表',
  841. columnProp: 'componentPart',
  842. headerAlign: 'center',
  843. align: 'center',
  844. columnLabel: '物料编码',
  845. columnHidden: false,
  846. columnImage: false,
  847. columnSortable: false,
  848. sortLv: 0,
  849. status: true,
  850. fixed: '',
  851. columnWidth: 120
  852. },
  853. {
  854. userId: this.$store.state.user.name,
  855. functionId: 104002,
  856. serialNumber: '104002Table2ComponentPartDesc',
  857. tableId: '104002Table2',
  858. tableName: 'BOM子物料表',
  859. columnProp: 'componentPartDesc',
  860. headerAlign: 'center',
  861. align: 'left',
  862. columnLabel: '物料名称',
  863. columnHidden: false,
  864. columnImage: false,
  865. columnSortable: false,
  866. sortLv: 0,
  867. status: true,
  868. fixed: '',
  869. columnWidth: 120
  870. },
  871. {
  872. userId: this.$store.state.user.name,
  873. functionId: 104002,
  874. serialNumber: '104002Table2QtyPerAssembly',
  875. tableId: '104002Table2',
  876. tableName: 'BOM子物料表',
  877. columnProp: 'qtyPerAssembly',
  878. headerAlign: 'center',
  879. align: 'right',
  880. columnLabel: '单位用量',
  881. columnHidden: false,
  882. columnImage: false,
  883. columnSortable: false,
  884. sortLv: 0,
  885. status: true,
  886. fixed: '',
  887. columnWidth: 80
  888. },
  889. {
  890. userId: this.$store.state.user.name,
  891. functionId: 104002,
  892. serialNumber: '104002Table2ComponentScrap',
  893. tableId: '104002Table2',
  894. tableName: 'BOM子物料表',
  895. columnProp: 'componentScrap',
  896. headerAlign: 'center',
  897. align: 'right',
  898. columnLabel: '调机量',
  899. columnHidden: false,
  900. columnImage: false,
  901. columnSortable: false,
  902. sortLv: 0,
  903. status: true,
  904. fixed: '',
  905. columnWidth: 80
  906. },
  907. {
  908. userId: this.$store.state.user.name,
  909. functionId: 104002,
  910. serialNumber: '104002Table2ShrinkageFactor',
  911. tableId: '104002Table2',
  912. tableName: 'BOM子物料表',
  913. columnProp: 'shrinkageFactor',
  914. headerAlign: 'center',
  915. align: 'right',
  916. columnLabel: '损耗率',
  917. columnHidden: false,
  918. columnImage: false,
  919. columnSortable: false,
  920. sortLv: 0,
  921. status: true,
  922. fixed: '',
  923. columnWidth: 80
  924. },
  925. {
  926. userId: this.$store.state.user.name,
  927. functionId: 104002,
  928. serialNumber: '104002Table2PrintUnitName',
  929. tableId: '104002Table2',
  930. tableName: 'BOM子物料表',
  931. columnProp: 'printUnitName',
  932. headerAlign: 'center',
  933. align: 'center',
  934. columnLabel: '单位',
  935. columnHidden: false,
  936. columnImage: false,
  937. columnSortable: false,
  938. sortLv: 0,
  939. status: true,
  940. fixed: '',
  941. columnWidth: 60
  942. },
  943. {
  944. userId: this.$store.state.user.name,
  945. functionId: 104002,
  946. serialNumber: '104002Table2IssueType',
  947. tableId: '104002Table2',
  948. tableName: 'BOM子物料表',
  949. columnProp: 'issueTypeName',
  950. headerAlign: 'center',
  951. align: 'center',
  952. columnLabel: '生产属性',
  953. columnHidden: false,
  954. columnImage: false,
  955. columnSortable: false,
  956. sortLv: 0,
  957. status: true,
  958. fixed: '',
  959. columnWidth: 80
  960. },
  961. {
  962. userId: this.$store.state.user.name,
  963. functionId: 104002,
  964. serialNumber: '104002Table2OperationDesc',
  965. tableId: '104002Table2',
  966. tableName: 'BOM子物料表',
  967. columnProp: 'operationNo',
  968. headerAlign: 'center',
  969. align: 'left',
  970. columnLabel: '工序',
  971. columnHidden: false,
  972. columnImage: false,
  973. columnSortable: false,
  974. sortLv: 0,
  975. status: true,
  976. fixed: '',
  977. columnWidth: 80
  978. },
  979. {
  980. userId: this.$store.state.user.name,
  981. functionId: 104002,
  982. serialNumber: '104002Table2IssueToLoc',
  983. tableId: '104002Table2',
  984. tableName: 'BOM子物料表',
  985. columnProp: 'issueToLocName',
  986. headerAlign: 'center',
  987. align: 'center',
  988. columnLabel: '发料库位',
  989. columnHidden: false,
  990. columnImage: false,
  991. columnSortable: false,
  992. sortLv: 0,
  993. status: true,
  994. fixed: '',
  995. columnWidth: 80
  996. },
  997. {
  998. userId: this.$store.state.user.name,
  999. functionId: 104002,
  1000. serialNumber: '104002Table2NoteText',
  1001. tableId: '104002Table2',
  1002. tableName: 'BOM子物料表',
  1003. columnProp: 'componentNoteText',
  1004. headerAlign: 'center',
  1005. align: 'left',
  1006. columnLabel: '备注',
  1007. columnHidden: false,
  1008. columnImage: false,
  1009. columnSortable: false,
  1010. sortLv: 0,
  1011. status: true,
  1012. fixed: '',
  1013. columnWidth: 150
  1014. },
  1015. ],
  1016. // ======== 必填规则 ========
  1017. rules: {
  1018. partNo: [
  1019. {
  1020. required: true,
  1021. message: ' ',
  1022. trigger: 'change'
  1023. }
  1024. ],
  1025. partDesc: [
  1026. {
  1027. required: true,
  1028. message: ' ',
  1029. trigger: 'change'
  1030. }
  1031. ],
  1032. bomType: [
  1033. {
  1034. required: true,
  1035. message: ' ',
  1036. trigger: 'change'
  1037. }
  1038. ],
  1039. effPhaseInDate: [
  1040. {
  1041. required: true,
  1042. message: ' ',
  1043. trigger: 'change'
  1044. }
  1045. ],
  1046. effPhaseOutDate: [
  1047. {
  1048. required: true,
  1049. message: ' ',
  1050. trigger: 'change'
  1051. }
  1052. ],
  1053. engChgLevel: [
  1054. {
  1055. required: true,
  1056. message: ' ',
  1057. trigger: 'change'
  1058. }
  1059. ],
  1060. alternativeNo: [
  1061. {
  1062. required: true,
  1063. message: ' ',
  1064. trigger: 'change'
  1065. }
  1066. ],
  1067. typeFlag: [
  1068. {
  1069. required: true,
  1070. message: ' ',
  1071. trigger: 'change'
  1072. }
  1073. ]
  1074. },
  1075. detailRules: {
  1076. alternativeNo: [
  1077. {
  1078. required: true,
  1079. message: ' ',
  1080. trigger: 'change'
  1081. }
  1082. ],
  1083. alternativeDescription: [
  1084. {
  1085. required: true,
  1086. message: ' ',
  1087. trigger: 'change'
  1088. }
  1089. ],
  1090. minLotQty: [
  1091. {
  1092. required: true,
  1093. message: ' ',
  1094. trigger: 'change'
  1095. }
  1096. ],
  1097. },
  1098. componentRules: {
  1099. componentPart: [
  1100. {
  1101. required: true,
  1102. message: ' ',
  1103. trigger: 'change'
  1104. }
  1105. ],
  1106. componentPartDesc: [
  1107. {
  1108. required: true,
  1109. message: ' ',
  1110. trigger: 'change'
  1111. }
  1112. ],
  1113. qtyPerAssembly: [
  1114. {
  1115. required: true,
  1116. message: ' ',
  1117. trigger: 'change'
  1118. }
  1119. ],
  1120. componentScrap: [
  1121. {
  1122. required: true,
  1123. message: ' ',
  1124. trigger: 'change'
  1125. }
  1126. ],
  1127. shrinkageFactor: [
  1128. {
  1129. required: true,
  1130. message: ' ',
  1131. trigger: 'change'
  1132. }
  1133. ],
  1134. issueType: [
  1135. {
  1136. required: true,
  1137. message: ' ',
  1138. trigger: 'change'
  1139. }
  1140. ]
  1141. },
  1142. // ======== 复选数据集 ========
  1143. bomSelections: [],
  1144. // ======== 模态框开关控制 ========
  1145. modalFlag: false,
  1146. modalDisableFlag: false,
  1147. partModelFlag: false,
  1148. componentPartModelFlag: false,
  1149. saveDetailModalFlag :false,
  1150. componentSaveModal: false,
  1151. componentDisableFlag: false
  1152. }
  1153. },
  1154. mounted () {
  1155. this.$nextTick(() => {
  1156. this.height = window.innerHeight - 180
  1157. })
  1158. },
  1159. created () {
  1160. this.getDataList()
  1161. },
  1162. // js
  1163. methods: {
  1164. // ======== 分页相关方法 ========
  1165. /**
  1166. * 每页数
  1167. * @param val
  1168. */
  1169. sizeChangeHandle (val) {
  1170. this.pageSize = val
  1171. this.pageIndex = 1
  1172. this.getDataList()
  1173. },
  1174. /**
  1175. * 当前页
  1176. * @param val
  1177. */
  1178. currentChangeHandle (val) {
  1179. this.pageIndex = val
  1180. this.getDataList()
  1181. },
  1182. // ======== 页签切换相关方法 ========
  1183. /**
  1184. * 明细页签选择替换
  1185. * @param tab
  1186. * @param event
  1187. */
  1188. tabDetailClick (tab, event) {
  1189. // 刷新列表数据
  1190. this.refreshDetailTable()
  1191. },
  1192. /**
  1193. * 子明细页签选择替换
  1194. * @param tab
  1195. * @param event
  1196. */
  1197. tabSubDetailClick (tab, event) {
  1198. // 刷新列表数据
  1199. this.refreshSubDetailTable()
  1200. },
  1201. /**
  1202. * 刷新明细页签的table数据
  1203. */
  1204. refreshDetailTable () {
  1205. if (this.detailTable === 'bom_detail') {
  1206. }
  1207. },
  1208. /**
  1209. * 刷新子明细页签的table数据
  1210. */
  1211. refreshSubDetailTable () {
  1212. if (this.subDetailTable === 'bom_sub_detail') {
  1213. }
  1214. },
  1215. // ======== 列表数据操作方法 ========
  1216. /**
  1217. * 未知
  1218. * @returns {boolean}
  1219. */
  1220. selectFlag () {
  1221. return true
  1222. },
  1223. /**
  1224. * 获取数据列表
  1225. */
  1226. getDataList () {
  1227. this.searchData.limit = this.pageSize
  1228. this.searchData.page = this.pageIndex
  1229. this.queryLoading = true
  1230. bomManagementSearch(this.searchData).then(({data}) => {
  1231. if (data.code === 0) {
  1232. this.dataList = data.page.list
  1233. this.pageIndex = data.page.currPage
  1234. this.pageSize = data.page.pageSize
  1235. this.totalPage = data.page.totalCount
  1236. this.$refs.selectDiv.setLengthAll( this.dataList.length)
  1237. }
  1238. this.queryLoading = false
  1239. })
  1240. },
  1241. /**
  1242. * 复选列表信息
  1243. * @param val
  1244. */
  1245. selectionBom (val) {
  1246. this.bomSelections = val
  1247. this.$refs.selectDiv.setLengthselected(this.bomSelections.length)
  1248. },
  1249. // ======== 新增/编辑模态框 ========
  1250. /**
  1251. * bom新增模态框
  1252. */
  1253. addModal () {
  1254. this.modalData = {
  1255. flag: '1',
  1256. title: 'bom新增',
  1257. site: this.$store.state.user.site,
  1258. partNo: '',
  1259. partDesc: '',
  1260. engChgLevel: '',
  1261. bomType: '',
  1262. noteText: '',
  1263. effPhaseInDate: '',
  1264. effPhaseOutDate: '',
  1265. engRevision: '',
  1266. typeFlag: 'B',
  1267. netWeight: 0,
  1268. createBy: this.$store.state.user.name
  1269. }
  1270. this.detailData = {
  1271. site: this.$store.state.user.site,
  1272. partNo: '',
  1273. engChgLevel: '',
  1274. bomType: '',
  1275. alternativeNo: '',
  1276. alternativeDescription: '',
  1277. minLotQty: '',
  1278. defaultFlag: '',
  1279. detailNoteText: '',
  1280. createDate: '',
  1281. createBy: '',
  1282. updateDate: '',
  1283. updateBy: ''
  1284. }
  1285. this.subDetailList = []
  1286. this.modalDisableFlag = false
  1287. this.modalFlag = true
  1288. },
  1289. /**
  1290. * bom编辑模态框
  1291. */
  1292. async updateModal (row) {
  1293. this.modalData = {
  1294. flag: '2',
  1295. site: row.site,
  1296. partNo: row.partNo,
  1297. partDesc: row.partDesc,
  1298. engChgLevel: row.engChgLevel,
  1299. bomType: row.bomType,
  1300. noteText: row.noteText,
  1301. effPhaseInDate: row.effPhaseInDate,
  1302. effPhaseOutDate: row.effPhaseOutDate,
  1303. engRevision: row.engRevision,
  1304. typeFlag: row.typeFlag,
  1305. netWeight: row.netWeight,
  1306. updateBy: this.$store.state.user.name
  1307. }
  1308. // 查bom明细
  1309. queryBomDetail(this.modalData).then(({data}) => {
  1310. if (data && data.code === 0) {
  1311. this.detailDataList = data.rows.detailList
  1312. this.subDetailList = data.rows.componentList
  1313. this.detailData = data.rows.detailData
  1314. this.modalDisableFlag = true
  1315. this.modalFlag = true
  1316. } else {
  1317. this.$alert(data.msg, '错误', {
  1318. confirmButtonText: '确定'
  1319. })
  1320. }
  1321. })
  1322. },
  1323. /**
  1324. * 新增子明细
  1325. */
  1326. saveComponentModal () {
  1327. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  1328. this.$message.warning('请先选择替代!')
  1329. return
  1330. }
  1331. this.componentData = {
  1332. flag: '1',
  1333. site: this.$store.state.user.site,
  1334. partNo: this.modalData.partNo,
  1335. engChgLevel: this.modalData.engChgLevel,
  1336. bomType: this.modalData.bomType,
  1337. alternativeNo: this.detailData.alternativeNo,
  1338. componentPart: '',
  1339. componentPartDesc: '',
  1340. printUnit: '',
  1341. printUnitName: '',
  1342. qtyPerAssembly: '',
  1343. componentScrap: '',
  1344. issueType: '',
  1345. shrinkageFactor: '',
  1346. lineItemNo: '',
  1347. operationNo: '',
  1348. operationName: '',
  1349. issueToLoc: '',
  1350. issueToLocName: '',
  1351. noteText: '',
  1352. createBy: this.$store.state.user.name,
  1353. }
  1354. this.componentDisableFlag = false
  1355. this.componentSaveModal = true
  1356. },
  1357. /**
  1358. * 编辑模态框
  1359. */
  1360. updateComponentModal (row) {
  1361. this.componentData = {
  1362. flag: '2',
  1363. site: row.site,
  1364. partNo: row.partNo,
  1365. engChgLevel: row.engChgLevel,
  1366. bomType: row.bomType,
  1367. alternativeNo: row.alternativeNo,
  1368. componentPart: row.componentPart,
  1369. componentPartDesc: row.componentPartDesc,
  1370. printUnit: row.printUnit,
  1371. printUnitName: row.printUnitName,
  1372. qtyPerAssembly: row.qtyPerAssembly,
  1373. componentScrap: row.componentScrap,
  1374. issueType: row.issueType,
  1375. shrinkageFactor: row.shrinkageFactor,
  1376. lineItemNo: row.lineItemNo,
  1377. operationNo: row.operationNo,
  1378. operationName: row.operationName,
  1379. issueToLoc: row.issueToLoc,
  1380. issueToLocName: row.issueToLocName,
  1381. noteText: row.noteText,
  1382. updateBy: this.$store.state.user.name,
  1383. }
  1384. this.componentDisableFlag = true
  1385. this.componentSaveModal = true
  1386. },
  1387. // ======== 新增/编辑/删除方法 ========
  1388. /**
  1389. * bom新增/编辑
  1390. */
  1391. saveData () {
  1392. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  1393. this.$message.warning('请选择物料编码!')
  1394. return
  1395. }
  1396. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  1397. this.$message.warning('请选择物料名称!')
  1398. return
  1399. }
  1400. if (this.modalData.bomType === '' || this.modalData.bomType == null) {
  1401. this.$message.warning('请选择制造类型!')
  1402. return
  1403. }
  1404. if (this.modalData.effPhaseInDate === '' || this.modalData.effPhaseInDate == null) {
  1405. this.$message.warning('请选择开始时间!')
  1406. return
  1407. }
  1408. if (this.modalData.effPhaseOutDate === '' || this.modalData.effPhaseOutDate == null) {
  1409. this.$message.warning('请选择结束时间!')
  1410. return
  1411. }
  1412. if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) {
  1413. this.$message.warning('请填写BOM版本号!')
  1414. return
  1415. }
  1416. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  1417. this.$message.warning('请选择替代!')
  1418. return
  1419. }
  1420. let tempData = {
  1421. site: this.$store.state.user.site,
  1422. partNo: this.modalData.partNo,
  1423. partDesc: this.modalData.partDesc,
  1424. engChgLevel: this.modalData.engChgLevel,
  1425. bomType: this.modalData.bomType,
  1426. noteText: this.modalData.noteText,
  1427. effPhaseInDate: this.modalData.effPhaseInDate,
  1428. effPhaseOutDate: this.modalData.effPhaseOutDate,
  1429. engRevision: this.modalData.engRevision,
  1430. typeFlag: this.modalData.typeFlag,
  1431. netWeight: this.modalData.netWeight,
  1432. alternativeNo: this.detailData.alternativeNo,
  1433. alternativeDescription: this.detailData.alternativeDescription,
  1434. minLotQty: this.detailData.minLotQty,
  1435. defaultFlag: this.detailData.defaultFlag,
  1436. detailNoteText: this.detailData.detailNoteText,
  1437. createBy: this.$store.state.user.name,
  1438. updateBy: this.$store.state.user.name,
  1439. informationList: this.subDetailList
  1440. }
  1441. if (this.modalData.flag === '1') {
  1442. this.saveAllLoading = true
  1443. bomManagementSave(tempData).then(({data}) => {
  1444. if (data && data.code === 0) {
  1445. this.getDataList()
  1446. this.modalFlag = false
  1447. this.$message({
  1448. message: '操作成功',
  1449. type: 'success',
  1450. duration: 1500,
  1451. onClose: () => {}
  1452. })
  1453. } else {
  1454. this.$alert(data.msg, '错误', {
  1455. confirmButtonText: '确定'
  1456. })
  1457. }
  1458. this.saveAllLoading = false
  1459. })
  1460. } else {
  1461. this.saveAllLoading = true
  1462. bomManagementEdit(tempData).then(({data}) => {
  1463. if (data && data.code === 0) {
  1464. this.getDataList()
  1465. this.modalFlag = false
  1466. this.$message({
  1467. message: '操作成功',
  1468. type: 'success',
  1469. duration: 1500,
  1470. onClose: () => {}
  1471. })
  1472. } else {
  1473. this.$alert(data.msg, '错误', {
  1474. confirmButtonText: '确定'
  1475. })
  1476. }
  1477. this.saveAllLoading = false
  1478. })
  1479. }
  1480. },
  1481. /**
  1482. * 新增编辑模态框关闭
  1483. */
  1484. closeModal () {
  1485. let tempArr = []
  1486. tempArr.push(this.modalData)
  1487. if (this.modalData.flag === '1') {
  1488. this.$confirm(`是否不保存且删除该条BOM记录?`, '提示', {
  1489. confirmButtonText: '确定',
  1490. cancelButtonText: '取消',
  1491. type: 'warning'
  1492. }).then(() => {
  1493. let tempData = {
  1494. informationList: tempArr
  1495. }
  1496. bomManagementDelete(tempData).then(({data}) => {
  1497. if (data && data.code === 0) {
  1498. this.getDataList()
  1499. this.modalFlag = false
  1500. this.$message({
  1501. message: '操作成功',
  1502. type: 'success',
  1503. duration: 1500,
  1504. onClose: () => {}
  1505. })
  1506. } else {
  1507. this.$alert(data.msg, '错误', {
  1508. confirmButtonText: '确定'
  1509. })
  1510. }
  1511. })
  1512. }).catch(() => {
  1513. })
  1514. } else {
  1515. this.modalFlag = false
  1516. }
  1517. },
  1518. /**
  1519. * 新增编辑模态框关闭
  1520. */
  1521. closeModalX (done) {
  1522. let tempArr = []
  1523. tempArr.push(this.modalData)
  1524. if (this.modalData.flag === '1') {
  1525. this.$confirm(`是否不保存且删除该条BOM记录?`, '提示', {
  1526. confirmButtonText: '确定',
  1527. cancelButtonText: '取消',
  1528. type: 'warning'
  1529. }).then(() => {
  1530. let tempData = {
  1531. informationList: tempArr
  1532. }
  1533. bomManagementDelete(tempData).then(({data}) => {
  1534. if (data && data.code === 0) {
  1535. this.getDataList()
  1536. done()
  1537. this.$message({
  1538. message: '操作成功',
  1539. type: 'success',
  1540. duration: 1500,
  1541. onClose: () => {}
  1542. })
  1543. } else {
  1544. this.$alert(data.msg, '错误', {
  1545. confirmButtonText: '确定'
  1546. })
  1547. }
  1548. })
  1549. }).catch(() => {
  1550. })
  1551. } else {
  1552. done()
  1553. }
  1554. },
  1555. /**
  1556. * bom删除
  1557. */
  1558. delModal () {
  1559. if(this.bomSelections.length === 0){
  1560. this.$message.warning('请勾选要删除的BOM!')
  1561. return
  1562. }
  1563. this.$confirm(`是否删除这 `+ this.bomSelections.length +` 条BOM?`, '提示', {
  1564. confirmButtonText: '确定',
  1565. cancelButtonText: '取消',
  1566. type: 'warning'
  1567. }).then(() => {
  1568. let tempData = {
  1569. informationList: this.bomSelections
  1570. }
  1571. bomManagementDelete(tempData).then(({data}) => {
  1572. if (data && data.code === 0) {
  1573. this.getDataList()
  1574. this.bomSelections = []
  1575. this.$message({
  1576. message: '操作成功',
  1577. type: 'success',
  1578. duration: 1500,
  1579. onClose: () => {}
  1580. })
  1581. } else {
  1582. this.$alert(data.msg, '错误', {
  1583. confirmButtonText: '确定'
  1584. })
  1585. }
  1586. })
  1587. }).catch(() => {
  1588. })
  1589. },
  1590. /**
  1591. * 查询物料
  1592. */
  1593. queryPartList () {
  1594. queryPartList(this.partData).then(({data}) => {
  1595. if (data && data.code === 0) {
  1596. this.partList = data.rows
  1597. this.partModelFlag = true
  1598. } else {
  1599. this.$alert(data.msg, '错误', {
  1600. confirmButtonText: '确定'
  1601. })
  1602. }
  1603. })
  1604. },
  1605. /**
  1606. * 双击选中物料
  1607. * @param row
  1608. */
  1609. getRowData (row) {
  1610. this.modalData.partNo = row.partNo
  1611. this.modalData.partDesc = row.partDesc
  1612. this.partModelFlag = false
  1613. },
  1614. getComponentRowData (row) {
  1615. this.componentData.componentPart = row.partNo
  1616. this.componentData.componentPartDesc = row.partDesc
  1617. this.componentPartModelFlag = false
  1618. },
  1619. /**
  1620. * 物料列表
  1621. */
  1622. queryComponentPartList () {
  1623. // 查询所有物料
  1624. queryPartList(this.componentPartData).then(({data}) => {
  1625. if (data && data.code === 0) {
  1626. this.componentPartList = data.rows
  1627. this.componentPartModelFlag = true
  1628. } else {
  1629. this.$alert(data.msg, '错误', {
  1630. confirmButtonText: '确定'
  1631. })
  1632. }
  1633. })
  1634. },
  1635. /**
  1636. * 表格的新增
  1637. * @param row
  1638. * @param rowIndex
  1639. */
  1640. rowClassName({ row, rowIndex }) {
  1641. row.xh = rowIndex + 1;
  1642. },
  1643. /**
  1644. * 单选框选中数据
  1645. * @param selection
  1646. */
  1647. componentSelectionChange(selection) {
  1648. this.checkedDetail = selection
  1649. },
  1650. /**
  1651. * 删除子物料
  1652. */
  1653. deleteComponentPart () {
  1654. if (this.checkedDetail.length === 0) {
  1655. this.$message.warning('请选择要删除子物料!')
  1656. return
  1657. } else {
  1658. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  1659. confirmButtonText: "确定",
  1660. cancelButtonText: "取消",
  1661. type: "warning"
  1662. }).then(() => {
  1663. let tempData = {
  1664. informationList: this.checkedDetail
  1665. }
  1666. deleteBomComponent(tempData).then(({data}) => {
  1667. if (data && data.code === 0) {
  1668. this.subDetailList = data.rows
  1669. this.$message({
  1670. message: '操作成功',
  1671. type: 'success',
  1672. duration: 1500,
  1673. onClose: () => {}
  1674. })
  1675. } else {
  1676. this.$alert(data.msg, '错误', {
  1677. confirmButtonText: '确定'
  1678. })
  1679. }
  1680. })
  1681. }).catch(() => {
  1682. })
  1683. }
  1684. },
  1685. /**
  1686. * 子物料
  1687. * @param row
  1688. */
  1689. // componentPartClickRow (row) {
  1690. // this.$refs.componentPartTable.toggleRowSelection(row)
  1691. // },
  1692. componentClickRow (row) {
  1693. this.$refs.componentTable.toggleRowSelection(row)
  1694. },
  1695. // /**
  1696. // * 多选子物料
  1697. // * @param val
  1698. // */
  1699. // selectionComponentPart (val) {
  1700. // this.componentPartSelections = val
  1701. // },
  1702. // getRowKeys(row) {
  1703. // // 唯一值,一般都为id
  1704. // return row.partNo
  1705. // },
  1706. /**
  1707. * 新增子明细方法
  1708. */
  1709. componentDataSave () {
  1710. if (this.componentData.partNo === '' || this.componentData.partNo == null) {
  1711. this.$message.warning('请选择主记录物料编码!')
  1712. return
  1713. }
  1714. if (this.componentData.bomType === '' || this.componentData.bomType == null) {
  1715. this.$message.warning('请选择主记录制造类型!')
  1716. return
  1717. }
  1718. if (this.componentData.engChgLevel === '' || this.componentData.engChgLevel == null) {
  1719. this.$message.warning('请填写主记录BOM版本号!')
  1720. return
  1721. }
  1722. if (this.componentData.componentPart === '' || this.componentData.componentPart == null) {
  1723. this.$message.warning('请选择子物料编码!')
  1724. return
  1725. }
  1726. if (this.componentData.componentPartDesc === '' || this.componentData.componentPartDesc == null) {
  1727. this.$message.warning('请选择子物料名称!')
  1728. return
  1729. }
  1730. if (this.componentData.qtyPerAssembly === '' || this.componentData.qtyPerAssembly == null) {
  1731. this.$message.warning('请填写单位用量!')
  1732. return
  1733. }
  1734. if (this.componentData.componentScrap === '' || this.componentData.componentScrap == null) {
  1735. this.$message.warning('请填写调机量!')
  1736. return
  1737. }
  1738. if (this.componentData.shrinkageFactor === '' || this.componentData.shrinkageFactor == null) {
  1739. this.$message.warning('请填写损耗率!')
  1740. return
  1741. }
  1742. if (this.componentData.issueType === '' || this.componentData.issueType == null) {
  1743. this.$message.warning('请选择生产属性!')
  1744. return
  1745. }
  1746. if (this.componentData.flag === '1') {
  1747. this.saveComponentLoading = true
  1748. saveBomComponent(this.componentData).then(({data}) => {
  1749. if (data && data.code === 0) {
  1750. this.subDetailList = data.rows
  1751. this.componentSaveModal = false
  1752. this.$message({
  1753. message: '操作成功',
  1754. type: 'success',
  1755. duration: 1500,
  1756. onClose: () => {}
  1757. })
  1758. } else {
  1759. this.$alert(data.msg, '错误', {
  1760. confirmButtonText: '确定'
  1761. })
  1762. }
  1763. this.saveComponentLoading = false
  1764. })
  1765. } else if (this.componentData.flag === '2') {
  1766. this.saveComponentLoading = true
  1767. updateBomComponent(this.componentData).then(({data}) => {
  1768. if (data && data.code === 0) {
  1769. this.subDetailList = data.rows
  1770. this.componentSaveModal = false
  1771. this.$message({
  1772. message: '操作成功',
  1773. type: 'success',
  1774. duration: 1500,
  1775. onClose: () => {}
  1776. })
  1777. } else {
  1778. this.$alert(data.msg, '错误', {
  1779. confirmButtonText: '确定'
  1780. })
  1781. }
  1782. this.saveComponentLoading = false
  1783. })
  1784. }
  1785. },
  1786. /**
  1787. * 回车事件
  1788. */
  1789. focusNextInput (index, type) {
  1790. let aaa = ''
  1791. if (this.subDetailList.length - 1 === index) {
  1792. aaa = `${type}0`
  1793. } else {
  1794. aaa = `${type}${index + 1}`
  1795. }
  1796. this.$nextTick(() => {
  1797. this.$refs[aaa].focus()
  1798. })
  1799. },
  1800. /**
  1801. * 保存主表信息
  1802. */
  1803. saveBomHeader () {
  1804. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  1805. this.$message.warning('请先选择Bom物料!')
  1806. return
  1807. }
  1808. if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) {
  1809. this.$message.warning('请先填写Bom版本号!')
  1810. return
  1811. }
  1812. if (this.modalData.bomType === '' || this.modalData.bomType == null) {
  1813. this.$message.warning('请先选择制造类型!')
  1814. return
  1815. }
  1816. if (this.modalData.typeFlag === '' || this.modalData.typeFlag == null) {
  1817. this.$message.warning('请先选择类型!')
  1818. return
  1819. }
  1820. this.saveHeaderLoading = true
  1821. // 新增主表信息
  1822. saveBomHeader(this.modalData).then(({data}) => {
  1823. if (data && data.code === 0) {
  1824. this.modalData = {
  1825. flag: '1',
  1826. title: 'bom新增',
  1827. site: data.rows.modalData.site,
  1828. partNo: data.rows.modalData.partNo,
  1829. partDesc: data.rows.modalData.partDesc,
  1830. engChgLevel: data.rows.modalData.engChgLevel,
  1831. bomType: data.rows.modalData.bomType,
  1832. noteText: data.rows.modalData.noteText,
  1833. effPhaseInDate: data.rows.modalData.effPhaseInDate,
  1834. effPhaseOutDate: data.rows.modalData.effPhaseOutDate,
  1835. engRevision: data.rows.modalData.engRevision,
  1836. typeFlag: data.rows.modalData.typeFlag,
  1837. netWeight: data.rows.modalData.netWeight,
  1838. }
  1839. this.detailDataList = data.rows.detailDataList
  1840. this.detailData = data.rows.detailData
  1841. this.subDetailList = []
  1842. this.modalDisableFlag = true
  1843. this.$message({
  1844. message: '操作成功',
  1845. type: 'success',
  1846. duration: 1500,
  1847. onClose: () => {}
  1848. })
  1849. } else {
  1850. this.$alert(data.msg, '错误', {
  1851. confirmButtonText: '确定'
  1852. })
  1853. }
  1854. this.saveHeaderLoading = false
  1855. })
  1856. },
  1857. /**
  1858. * 新增替代模态框
  1859. */
  1860. saveBomDetail () {
  1861. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  1862. this.$message.warning('请先选择Bom物料!')
  1863. return
  1864. }
  1865. if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) {
  1866. this.$message.warning('请先填写Bom版本号!')
  1867. return
  1868. }
  1869. if (this.modalData.bomType === '' || this.modalData.bomType == null) {
  1870. this.$message.warning('请先选择制造类型!')
  1871. return
  1872. }
  1873. this.saveDetailData = {
  1874. site: this.$store.state.user.site,
  1875. partNo: this.modalData.partNo,
  1876. engChgLevel: this.modalData.engChgLevel,
  1877. bomType: this.modalData.bomType,
  1878. alternativeNo: '',
  1879. alternativeDescription: '',
  1880. minLotQty: '',
  1881. defaultFlag: '',
  1882. detailNoteText: '',
  1883. createDate: '',
  1884. createBy: this.$store.state.user.name,
  1885. }
  1886. // 查询bom主信息
  1887. queryBomHeader(this.modalData).then(({data}) => {
  1888. if (data && data.code === 0) {
  1889. if (data.rows.length > 0) {
  1890. this.saveDetailModalFlag = true
  1891. } else {
  1892. this.$message.warning('请先保存BOM主记录!')
  1893. }
  1894. } else {
  1895. this.$alert(data.msg, '提示', {
  1896. confirmButtonText: '确定'
  1897. })
  1898. }
  1899. })
  1900. },
  1901. /**
  1902. * 新增替代方法
  1903. */
  1904. detailDataSave () {
  1905. if (this.saveDetailData.partNo === '' || this.saveDetailData.partNo == null) {
  1906. this.$message.warning('请先选择Bom物料!')
  1907. return
  1908. }
  1909. if (this.saveDetailData.engChgLevel === '' || this.saveDetailData.engChgLevel == null) {
  1910. this.$message.warning('请先填写Bom版本号!')
  1911. return
  1912. }
  1913. if (this.saveDetailData.bomType === '' || this.saveDetailData.bomType == null) {
  1914. this.$message.warning('请先选择制造类型!')
  1915. return
  1916. }
  1917. if (this.saveDetailData.alternativeNo === '' || this.saveDetailData.alternativeNo == null) {
  1918. this.$message.warning('请填写替代编码!')
  1919. return
  1920. }
  1921. if (this.saveDetailData.alternativeDescription === '' || this.saveDetailData.alternativeDescription == null) {
  1922. this.$message.warning('请填写替代名称!')
  1923. return
  1924. }
  1925. if (this.saveDetailData.minLotQty === '' || this.saveDetailData.minLotQty == null) {
  1926. this.$message.warning('请填写最小订单数!')
  1927. return
  1928. }
  1929. this.saveDetailLoading = true
  1930. bomDetailSave(this.saveDetailData).then(({data}) => {
  1931. if (data && data.code === 0) {
  1932. this.detailDataList = data.rows
  1933. this.detailData = this.saveDetailData
  1934. this.subDetailList = []
  1935. this.saveDetailModalFlag = false
  1936. this.$message({
  1937. message: '操作成功',
  1938. type: 'success',
  1939. duration: 1500,
  1940. onClose: () => {}
  1941. })
  1942. } else {
  1943. this.$alert(data.msg, '错误', {
  1944. confirmButtonText: '确定'
  1945. })
  1946. }
  1947. this.saveDetailLoading = false
  1948. })
  1949. },
  1950. /**
  1951. * 删除替代
  1952. */
  1953. deleteBomDetail () {
  1954. if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
  1955. this.$message.warning('请选择要删除的替代编码!')
  1956. return
  1957. }
  1958. if (this.detailData.alternativeNo === '*') {
  1959. this.$message.warning('当前为默认替代,不可以删除!')
  1960. return
  1961. }
  1962. this.$confirm(`是否删除这项替代?`, '提示', {
  1963. confirmButtonText: '确定',
  1964. cancelButtonText: '取消',
  1965. type: 'warning'
  1966. }).then(() => {
  1967. bomDetailDelete(this.detailData).then(({data}) => {
  1968. if (data && data.code === 0) {
  1969. this.detailData = data.rows.detailData
  1970. this.detailDataList = data.rows.detailDataList
  1971. this.subDetailList = data.rows.subDetailList
  1972. this.$message({
  1973. message: '操作成功',
  1974. type: 'success',
  1975. duration: 1500,
  1976. onClose: () => {}
  1977. })
  1978. } else {
  1979. this.$alert(data.msg, '错误', {
  1980. confirmButtonText: '确定'
  1981. })
  1982. }
  1983. })
  1984. }).catch(() => {
  1985. })
  1986. },
  1987. /**
  1988. * 替代改变事件
  1989. */
  1990. alternativeChange () {
  1991. queryBomComponent(this.detailData).then(({data}) => {
  1992. if (data && data.code === 0) {
  1993. this.detailData = data.rows.detailData
  1994. this.subDetailList = data.rows.componentList
  1995. } else {
  1996. this.$alert(data.msg, '错误', {
  1997. confirmButtonText: '确定'
  1998. })
  1999. }
  2000. })
  2001. },
  2002. // ======== chooseList相关方法 ========
  2003. /**
  2004. * 获取基础数据列表S
  2005. * @param val
  2006. * @param type
  2007. */
  2008. getBaseList (val, type) {
  2009. this.tagNo = val
  2010. this.$nextTick(() => {
  2011. let strVal = ''
  2012. if (val === 117) {
  2013. strVal = this.componentData.issueToLoc
  2014. }
  2015. this.$refs.baseList.init(val, strVal)
  2016. })
  2017. },
  2018. /**
  2019. * 列表方法的回调
  2020. * @param val
  2021. */
  2022. getBaseData (val) {
  2023. if (this.tagNo === 117) {
  2024. this.componentData.issueToLoc = val.location_id
  2025. this.componentData.issueToLocName = val.location_name
  2026. }
  2027. },
  2028. // ======== 导出相关方法 ========
  2029. /**
  2030. * 导出excel
  2031. */
  2032. async createExportData () {
  2033. this.searchData.limit = -1
  2034. this.searchData.page = 1
  2035. await bomManagementSearch(this.searchData).then(({data}) => {
  2036. this.resultList = data.page.list
  2037. })
  2038. return this.resultList
  2039. },
  2040. startDownload () {
  2041. },
  2042. finishDownload () {
  2043. },
  2044. fields () {
  2045. let json = '{'
  2046. this.columnList.forEach((item, index) => {
  2047. if (index == this.columnList.length - 1) {
  2048. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  2049. } else {
  2050. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  2051. }
  2052. })
  2053. json += '}'
  2054. let s = eval('(' + json + ')')
  2055. return s
  2056. }
  2057. }
  2058. }
  2059. </script>
  2060. <style scoped lang="scss">
  2061. /deep/ .detail-tab .el-tabs__content {
  2062. height: 180px;
  2063. padding: 15px 0px 0px 0px;
  2064. }
  2065. /deep/ .sub_detail-tab .el-tabs__content {
  2066. height: 280px;
  2067. padding: 0px;
  2068. }
  2069. </style>