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.

5481 lines
204 KiB

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