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.

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