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.

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