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.

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