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.

5843 lines
217 KiB

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