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.

4026 lines
136 KiB

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