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.

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