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.

3762 lines
127 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <el-form-item :label="'BU'">
  6. <el-select v-model="searchData.buNo" placeholder="请选择" clearable style="width: 130px">
  7. <el-option
  8. v-for = "i in buList"
  9. :key = "i.buNo"
  10. :label = "i.buDesc"
  11. :value = "i.buNo">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item :label="'物料编码'">
  16. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'物料描述'">
  19. <el-input v-model="searchData.partDesc" clearable style="width: 210px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'录入时间'">
  22. <el-date-picker
  23. style="width: 120px"
  24. v-model="searchData.startDate"
  25. type="date"
  26. value-format="yyyy-MM-dd"
  27. placeholder="选择日期">
  28. </el-date-picker>
  29. </el-form-item>
  30. <el-form-item style="margin-top: 23px;">
  31. <label style="margin-left: 0px;font-size: 19px">&#10142</label>
  32. </el-form-item>
  33. <el-form-item :label="' '">
  34. <el-date-picker
  35. style="width: 120px"
  36. v-model="searchData.endDate"
  37. type="date"
  38. value-format="yyyy-MM-dd"
  39. placeholder="选择日期">
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item :label="' '">
  43. <el-button v-if="!authSearch" @click="getDataList">查询</el-button>
  44. <el-button v-if="!authSave" type="primary" @click="addModal">新增</el-button>
  45. <!-- <el-button type="primary" @click="delModal()">删除</el-button>-->
  46. <download-excel
  47. :fields="fields()"
  48. :data="exportData"
  49. type="xls"
  50. :name="exportName"
  51. :header="exportHeader"
  52. :footer="exportFooter"
  53. :fetch="createExportData"
  54. :before-generate="startDownload"
  55. :before-finish="finishDownload"
  56. worksheet="导出信息"
  57. class="el-button el-button--primary el-button--medium">
  58. {{ "导出" }}
  59. </download-excel>
  60. </el-form-item>
  61. </el-form>
  62. <!-- 物料列表 -->
  63. <el-table
  64. @header-dragend="handleColumnResize"
  65. :height="height"
  66. :data="dataList"
  67. border
  68. ref="partTable"
  69. :row-style="rowStyle"
  70. @row-click="partClickRow"
  71. @selection-change="selectionPart"
  72. @current-change="changeCurrentRow"
  73. style="width: 100%;">
  74. <el-table-column
  75. v-for="(item,index) in columnList" :key="index"
  76. :sortable="item.columnSortable"
  77. :prop="item.columnProp"
  78. :header-align="item.headerAlign"
  79. :show-overflow-tooltip="item.showOverflowTooltip"
  80. :align="item.align"
  81. :fixed="item.fixed === ''?false:item.fixed"
  82. :min-width="item.columnWidth"
  83. :label="item.columnLabel">
  84. <template slot-scope="scope">
  85. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  86. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column
  90. fixed="right"
  91. header-align="center"
  92. align="center"
  93. width="100"
  94. label="操作">
  95. <template slot-scope="scope">
  96. <el-link v-if="!authUpdate" style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link>
  97. <el-dropdown trigger="click">
  98. <el-link style="cursor: pointer;font-size: 12px">
  99. 更多
  100. </el-link >
  101. <el-dropdown-menu slot="dropdown">
  102. <el-dropdown-item @click.native="toMenu('BOM',scope.row)">BOM</el-dropdown-item>
  103. <el-dropdown-item @click.native="toMenu('Routing',scope.row)">Routing</el-dropdown-item>
  104. </el-dropdown-menu>
  105. </el-dropdown>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <selectDiv ref="selectDiv"></selectDiv>
  110. <!-- 分页插件 -->
  111. <el-pagination
  112. @size-change="sizeChangeHandle"
  113. @current-change="currentChangeHandle"
  114. :current-page="pageIndex"
  115. :page-sizes="[20, 50, 100, 200, 500]"
  116. :page-size="pageSize"
  117. :total="totalPage"
  118. layout="total, sizes, prev, pager, next, jumper">
  119. </el-pagination>
  120. <!-- 物料新增/编辑模态框 -->
  121. <el-dialog :title="modalData.title" top="10vh" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="1000px">
  122. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  123. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules">
  124. <el-form-item label="物料编码" prop="partNo">
  125. <el-input v-model="modalData.partNo" disabled style="width: 128px"></el-input>
  126. </el-form-item>
  127. <el-form-item label="物料描述" prop="partDesc" style="margin-left: -10px">
  128. <el-input v-model="modalData.partDesc" clearable style="width: 346px"></el-input>
  129. </el-form-item>
  130. <el-form-item label="物料描述(英文)">
  131. <el-input v-model="modalData.partDesceEn" style="width: 477px"></el-input>
  132. </el-form-item>
  133. </el-form>
  134. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  135. <el-form-item prop="spec" label="规格">
  136. <el-input v-model="modalData.spec" style="width: 477px"></el-input>
  137. </el-form-item>
  138. <el-form-item label="BU" prop="bu">
  139. <el-select v-model="modalData.bu" placeholder="请选择" @change="getPreviousPartNo" :disabled="modalDisableFlag" style="width: 90px">
  140. <el-option
  141. v-for = "i in userBuList"
  142. :key = "i.buNo"
  143. :label = "i.buDesc"
  144. :value = "i.buNo">
  145. </el-option>
  146. </el-select>
  147. </el-form-item>
  148. <el-form-item prop="active" label="是否在用">
  149. <el-select v-model="modalData.active" style="width: 80px">
  150. <el-option label="是" value="Y"></el-option>
  151. <el-option label="否" value="N"></el-option>
  152. </el-select>
  153. </el-form-item>
  154. <el-form-item prop="partType2" label="零件类型">
  155. <el-select v-model="modalData.partType2" style="width: 120px">
  156. <el-option label="成品" value="Manufactured"></el-option>
  157. <el-option label="半成品" value="Manufactured Recipe"></el-option>
  158. <el-option label="原材料" value="Purchased (raw)"></el-option>
  159. </el-select>
  160. </el-form-item>
  161. <el-form-item v-if="modalData.flag === '2'" :label="' '">
  162. <el-button type="primary" @click="toCopyPartModal">Copy</el-button>
  163. </el-form-item>
  164. <el-form-item v-if="modalData.flag === '1'" style="margin-top: 23px">
  165. <el-checkbox v-model="modalData.tblBaseFlag" true-label="Y">复制属性({{previousPartNo}})</el-checkbox>
  166. </el-form-item>
  167. </el-form>
  168. <el-tabs v-model="inventoryPartTable" style="width: 100%;height: 305px;" type="border-card" @tab-click="inventoryPartClick">
  169. <el-tab-pane label="General" name="General">
  170. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  171. <el-form-item prop="umId2">
  172. <span style="cursor: pointer" slot="label" @click="getBaseList(510)"><a herf="#">计量单位</a></span>
  173. <el-input v-model="modalData.umId2" @blur="umIdBlur(510)" style="width: 128px"></el-input>
  174. <el-input v-model="modalData.umName" disabled style="width: 330px"></el-input>
  175. </el-form-item>
  176. <el-form-item>
  177. <span style="cursor: pointer" slot="label" @click="getBaseList(214)"><a herf="#">物料分类</a></span>
  178. <el-input v-model="modalData.familyID" @blur="partFamilyBlur(214)" style="width: 128px"></el-input>
  179. <el-input v-model="modalData.familyName" disabled style="width: 330px"></el-input>
  180. </el-form-item>
  181. </el-form>
  182. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  183. </el-form>
  184. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  185. <el-form-item>
  186. <span style="cursor: pointer" slot="label" @click="getBaseList(211)"><a herf="#">商品组1</a></span>
  187. <el-input v-model="modalData.productGroupId1" @blur="productGroupId1Blur(211)" style="width: 128px"></el-input>
  188. <el-input v-model="modalData.productGroupName1" disabled style="width: 330px"></el-input>
  189. </el-form-item>
  190. <el-form-item>
  191. <span style="cursor: pointer" slot="label" @click="getBaseList(212)"><a herf="#">商品组2</a></span>
  192. <el-input v-model="modalData.productGroupId2" @blur="productGroupId2Blur(212)" style="width: 128px"></el-input>
  193. <el-input v-model="modalData.productGroupName2" disabled style="width: 330px"></el-input>
  194. </el-form-item>
  195. </el-form>
  196. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  197. <el-form-item>
  198. <span style="cursor: pointer" slot="label" @click="getBaseList(213)"><a herf="#">商品组3</a></span>
  199. <el-input v-model="modalData.productGroupId3" @blur="productGroupId3Blur(213)" style="width: 128px"></el-input>
  200. <el-input v-model="modalData.productGroupName3" disabled style="width: 330px"></el-input>
  201. </el-form-item>
  202. <el-form-item>
  203. <span style="cursor: pointer" slot="label" @click="getBaseList(219)"><a herf="#">属性模板</a></span>
  204. <el-input v-model="modalData.codeNo" @blur="modelBlur(219)" style="width: 128px"></el-input>
  205. <el-input v-model="modalData.codeDesc" disabled style="width: 330px"></el-input>
  206. </el-form-item>
  207. </el-form>
  208. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
  209. <el-form-item label="备注" style="height: 135px">
  210. <el-input type="textarea" v-model="modalData.remark" :rows="5" resize='none' show-word-limit style="width: 939px"></el-input>
  211. </el-form-item>
  212. </el-form>
  213. </el-tab-pane>
  214. </el-tabs>
  215. </el-form>
  216. <el-footer style="height:35px;margin-top: 20px;text-align:center">
  217. <el-button type="primary" @click="saveData">保存</el-button>
  218. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  219. </el-footer>
  220. </el-dialog>
  221. <!-- 页签 -->
  222. <el-tabs v-model="activeTable" style="width: 100%" type="border-card" @tab-click="tabClick" class="customer-tab">
  223. <!-- 物料属性页签 -->
  224. <el-tab-pane label="物料属性" name="part_item">
  225. <el-form label-position="top" style="margin-top: 2px; margin-left: 2px;">
  226. <el-button type="primary" @click="addOrDelItem">新增</el-button>
  227. <el-button type="primary" :loading="loading" @click="clickSave">{{ attributeDialog?'编辑':'保存' }}</el-button>
  228. </el-form>
  229. <div class="rq " v-if="attributeDialog">
  230. <el-table
  231. :data="partItemList"
  232. :height="secondHeight-50"
  233. border
  234. style="width: 100%;">
  235. <el-table-column
  236. v-for="(item,index) in columnItemList" :key="index"
  237. :sortable="item.columnSortable"
  238. :prop="item.columnProp"
  239. :header-align="item.headerAlign"
  240. :show-overflow-tooltip="item.showOverflowTooltip"
  241. :align="item.align"
  242. :fixed="item.fixed==''?false:item.fixed"
  243. :min-width="item.columnWidth"
  244. :label="item.columnLabel">
  245. <template slot-scope="scope">
  246. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  247. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  248. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  249. </div>
  250. <div v-else>
  251. <template v-if="item.columnProp==='textValue' && scope.row.valueTypeDb==='T'">
  252. {{ scope.row['textValue'] }}
  253. </template>
  254. <template v-else-if="item.columnProp==='textValue' && scope.row.valueTypeDb==='N'">
  255. {{ scope.row['numValue'] }}
  256. </template>
  257. </div>
  258. </template>
  259. </el-table-column>
  260. </el-table>
  261. </div>
  262. <div class="rq " v-else>
  263. <el-table
  264. :data="copyAttributeList"
  265. :height="secondHeight-50"
  266. border
  267. style="width: 100%">
  268. <el-table-column
  269. v-for="(item,index) in columnItemList" :key="index"
  270. :sortable="item.columnSortable"
  271. :prop="item.columnProp"
  272. :header-align="item.headerAlign"
  273. :show-overflow-tooltip="item.showOverflowTooltip"
  274. :align="item.align"
  275. :fixed="item.fixed===''?false:item.fixed"
  276. :min-width="item.columnWidth"
  277. :label="item.columnLabel">
  278. <template slot-scope="scope">
  279. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  280. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  281. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  282. </div>
  283. <div v-else>
  284. <div v-if="scope.row.valueChooseFlag !== 'Y'">
  285. <el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueTypeDb === 'N'" :controls="false"></el-input-number>
  286. <el-input v-model="scope.row.textValue" v-else></el-input>
  287. </div>
  288. <div v-else>
  289. <el-select style="width: 100%;" v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue">
  290. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  291. </el-select>
  292. <el-select style="width: 100%;" v-else v-model="scope.row.numValue">
  293. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  294. </el-select>
  295. </div>
  296. </div>
  297. </template>
  298. </el-table-column>
  299. </el-table>
  300. </div>
  301. </el-tab-pane>
  302. <!-- 代理商页签 -->
  303. <el-tab-pane label="代理商" name="part_agent">
  304. <el-form label-position="top" style="margin-top: 2px; margin-left: 2px;">
  305. <el-button type="primary" @click="savePartAgent">新增</el-button>
  306. </el-form>
  307. <el-table
  308. :data="partAgentList"
  309. :height="secondHeight-50"
  310. border
  311. style="width: 100%;">
  312. <el-table-column
  313. v-for="(item,index) in columnAgentList" :key="index"
  314. :sortable="item.columnSortable"
  315. :prop="item.columnProp"
  316. :header-align="item.headerAlign"
  317. :show-overflow-tooltip="item.showOverflowTooltip"
  318. :align="item.align"
  319. :fixed="item.fixed==''?false:item.fixed"
  320. :min-width="item.columnWidth"
  321. :label="item.columnLabel">
  322. <template slot-scope="scope">
  323. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  324. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  325. </template>
  326. </el-table-column>
  327. <el-table-column
  328. header-align="center"
  329. align="center"
  330. width="100"
  331. fixed="right"
  332. label="操作">
  333. <template slot-scope="scope">
  334. <el-link style="cursor: pointer" @click="deleteAgent2(scope.row)">删除</el-link>
  335. </template>
  336. </el-table-column>
  337. </el-table>
  338. </el-tab-pane>
  339. <!-- 制造商页签 -->
  340. <el-tab-pane label="制造商" name="part_manufacturer">
  341. <el-form label-position="top" style="margin-top: 2px; margin-left: 2px;">
  342. <el-button type="primary" @click="savePartManufacturer">新增</el-button>
  343. </el-form>
  344. <el-table
  345. :data="partManufacturerList"
  346. :height="secondHeight-50"
  347. border
  348. style="width: 100%;">
  349. <el-table-column
  350. v-for="(item,index) in columnManufacturerList" :key="index"
  351. :sortable="item.columnSortable"
  352. :prop="item.columnProp"
  353. :header-align="item.headerAlign"
  354. :show-overflow-tooltip="item.showOverflowTooltip"
  355. :align="item.align"
  356. :fixed="item.fixed==''?false:item.fixed"
  357. :min-width="item.columnWidth"
  358. :label="item.columnLabel">
  359. <template slot-scope="scope">
  360. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  361. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column
  365. header-align="center"
  366. align="center"
  367. width="100"
  368. fixed="right"
  369. label="操作">
  370. <template slot-scope="scope">
  371. <el-link style="cursor: pointer" @click="deleteManufacturer2(scope.row)">删除</el-link>
  372. </template>
  373. </el-table-column>
  374. </el-table>
  375. </el-tab-pane>
  376. <!-- 默认库位页签 -->
  377. <el-tab-pane label="默认库位" name="default_locations">
  378. <el-form label-position="top" style="margin-top: 2px; margin-left: 2px;">
  379. <el-button type="primary" @click="saveDefaultLocation()">新增</el-button>
  380. </el-form>
  381. <el-table
  382. :data="defaultLocationList"
  383. :height="secondHeight-50"
  384. border
  385. style="width: 100%;">
  386. <el-table-column
  387. v-for="(item,index) in columnLocationList" :key="index"
  388. :sortable="item.columnSortable"
  389. :prop="item.columnProp"
  390. :header-align="item.headerAlign"
  391. :show-overflow-tooltip="item.showOverflowTooltip"
  392. :align="item.align"
  393. :fixed="item.fixed==''?false:item.fixed"
  394. :min-width="item.columnWidth"
  395. :label="item.columnLabel">
  396. <template slot-scope="scope">
  397. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  398. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  399. </template>
  400. </el-table-column>
  401. <el-table-column
  402. header-align="center"
  403. align="center"
  404. width="100"
  405. fixed="right"
  406. label="操作">
  407. <template slot-scope="scope">
  408. <el-link style="cursor: pointer" @click="deleteLocation2(scope.row)">删除</el-link>
  409. </template>
  410. </el-table-column>
  411. </el-table>
  412. </el-tab-pane>
  413. <!-- 文档页签 -->
  414. <el-tab-pane label="文档" name="part_file">
  415. <el-form label-position="top" style="margin-top: 2px; margin-left: 2px;">
  416. <el-button type="primary" @click="uploadFile">上传文件</el-button>
  417. </el-form>
  418. <el-table
  419. :data="fileContentList"
  420. :height="secondHeight-50"
  421. border
  422. style="width: 100%; ">
  423. <el-table-column
  424. v-for="(item,index) in columnFileList" :key="index"
  425. :sortable="item.columnSortable"
  426. :prop="item.columnProp"
  427. :header-align="item.headerAlign"
  428. :show-overflow-tooltip="item.showOverflowTooltip"
  429. :align="item.align"
  430. :fixed="item.fixed==''?false:item.fixed"
  431. :min-width="item.columnWidth"
  432. :label="item.columnLabel">
  433. <template slot-scope="scope">
  434. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  435. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  436. </template>
  437. </el-table-column>
  438. <el-table-column
  439. fixed="right"
  440. header-align="center"
  441. align="center"
  442. width="130"
  443. label="操作">
  444. <template slot-scope="scope">
  445. <el-link style="cursor: pointer" @click="previewFile(scope.row)">预览</el-link>
  446. <el-link style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link>
  447. <el-link style="cursor: pointer" @click="deleteFile(scope.row)">删除</el-link>
  448. </template>
  449. </el-table-column>
  450. </el-table>
  451. </el-tab-pane>
  452. </el-tabs>
  453. <!-- 物料属性值编辑模态框 -->
  454. <el-dialog title="物料属性" :close-on-click-modal="false" v-drag :visible.sync="updateItemModelFlag" width="1000px">
  455. <div class="rq ">
  456. <el-table
  457. :data="updatePartItemList"
  458. height="350px"
  459. border
  460. style="width: 100%;">
  461. <el-table-column
  462. v-for="(item,index) in updateColumnItemList" :key="index"
  463. :sortable="item.columnSortable"
  464. :prop="item.columnProp"
  465. :header-align="item.headerAlign"
  466. :show-overflow-tooltip="item.showOverflowTooltip"
  467. :align="item.align"
  468. :fixed="item.fixed==''?false:item.fixed"
  469. :min-width="item.columnWidth"
  470. :label="item.columnLabel">
  471. <template slot-scope="scope">
  472. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  473. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  474. </template>
  475. </el-table-column>
  476. <el-table-column
  477. prop="textValue"
  478. header-align="center"
  479. align="right"
  480. min-width="80"
  481. label="文本值">
  482. <template slot-scope="scope">
  483. <el-input v-if="scope.row.valueTypeDb === 'T' && scope.row.valueChooseFlag === 'N'" v-model="scope.row.textValue" style="height: 11px;width:98%"></el-input>
  484. <el-select v-if="scope.row.valueTypeDb === 'T' && scope.row.valueChooseFlag === 'Y'" v-model="scope.row.textValue" style="width: 180px" placeholder="请选择">
  485. <el-option v-for="item in scope.row.availableValueList" :key="index" :label="item.availableValue" :value="item.availableValue"></el-option>
  486. </el-select>
  487. <el-input v-if="scope.row.valueTypeDb !== 'T'" v-model="scope.row.textValue" disabled style="height: 11px;width:98%"></el-input>
  488. </template>
  489. </el-table-column>
  490. <el-table-column
  491. prop="numValue"
  492. header-align="center"
  493. align="right"
  494. min-width="80"
  495. label="数字值">
  496. <template slot-scope="scope">
  497. <el-input v-if="scope.row.valueTypeDb === 'N' && scope.row.valueChooseFlag === 'N'" v-model="scope.row.numValue" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  498. <el-select v-if="scope.row.valueTypeDb === 'N' && scope.row.valueChooseFlag === 'Y'" v-model="scope.row.numValue" style="width: 180px" placeholder="请选择">
  499. <el-option v-for="item in scope.row.availableValueList" :key="index" :label="item.availableValue" :value="item.availableValue"></el-option>
  500. </el-select>
  501. <el-input v-if="scope.row.valueTypeDb !== 'N'" v-model="scope.row.numValue" disabled style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  502. </template>
  503. </el-table-column>
  504. </el-table>
  505. </div>
  506. <span slot="footer" class="dialog-footer">
  507. <el-button type="primary" @click="commitItemValue()">保存</el-button>
  508. <el-button type="primary" @click="updateItemModelFlag=false">关闭</el-button>
  509. </span>
  510. </el-dialog>
  511. <!-- 物料属性-> 快速新增 -->
  512. <el-dialog title="新增" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1000px">
  513. <div style="font-size: 12px">
  514. <el-form :inline="true" label-position="top" :model="itemData">
  515. <el-form-item :label="'属性编码'">
  516. <el-input v-model="itemData.propertiesItemNo" clearable style="width: 120px"></el-input>
  517. </el-form-item>
  518. <el-form-item :label="'属性名称'">
  519. <el-input v-model="itemData.itemDesc" clearable style="width: 150px"></el-input>
  520. </el-form-item>
  521. <el-form-item :label="' '">
  522. <el-button type="primary" @click="queryPartItem()">查询</el-button>
  523. </el-form-item>
  524. </el-form>
  525. </div>
  526. <el-container style="margin-top: 0px;">
  527. <el-main style="width: 350px;padding: 1px">
  528. <span style="font-size: 12px" >可选属性</span>
  529. <el-table
  530. height="400px"
  531. :data="itemList1"
  532. border
  533. ref="itemTable1"
  534. @row-click="itemClickRow1"
  535. @selection-change="selectionItem1"
  536. highlight-current-row
  537. style="width: 100%">
  538. <el-table-column
  539. type="selection"
  540. header-align="center"
  541. align="center"
  542. width="50">
  543. </el-table-column>
  544. <el-table-column
  545. prop="itNo"
  546. header-align="center"
  547. align="center"
  548. min-width="80"
  549. label="属性编码">
  550. </el-table-column>
  551. <el-table-column
  552. prop="itemDesc"
  553. header-align="center"
  554. align="center"
  555. min-width="200"
  556. label="属性名称">
  557. </el-table-column>
  558. </el-table>
  559. </el-main>
  560. <el-main style="width: 10px;padding: 1px">
  561. <div style="margin-top: 200px;margin-left: 18px">
  562. <el-button type="primary" @click="addItem()">添加>></el-button>
  563. </div>
  564. <div style="margin-top: 15px;margin-left: 18px">
  565. <el-button type="primary" @click="deleteItem()">删除<<</el-button>
  566. </div>
  567. </el-main>
  568. <el-main style="width: 350px;padding: 1px">
  569. <span style="font-size: 12px" >已有属性</span>
  570. <el-table
  571. height="400px"
  572. :data="itemList2"
  573. border
  574. ref="itemTable2"
  575. @row-click="itemClickRow2"
  576. @selection-change="selectionItem2"
  577. highlight-current-row
  578. style="width: 100%">
  579. <el-table-column
  580. type="selection"
  581. header-align="center"
  582. align="center"
  583. width="50">
  584. </el-table-column>
  585. <el-table-column
  586. prop="itNo"
  587. header-align="center"
  588. align="center"
  589. min-width="80"
  590. label="属性编码">
  591. </el-table-column>
  592. <el-table-column
  593. prop="itemDesc"
  594. header-align="center"
  595. align="center"
  596. min-width="200"
  597. label="属性名称">
  598. </el-table-column>
  599. </el-table>
  600. </el-main>
  601. </el-container>
  602. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  603. <el-button type="primary" @click="fastAddFlag = false">关闭</el-button>
  604. </el-footer>
  605. </el-dialog>
  606. <!-- 代理商-> 快速新增 -->
  607. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="agentModelFlag" width="900px">
  608. <div style="font-size: 12px">
  609. <el-form :inline="true" label-position="top" :model="agentData">
  610. <el-form-item :label="'代理商编码'">
  611. <el-input v-model="agentData.agentId" clearable style="width: 120px"></el-input>
  612. </el-form-item>
  613. <el-form-item :label="'代理商名称'">
  614. <el-input v-model="agentData.agentName" clearable style="width: 120px"></el-input>
  615. </el-form-item>
  616. <el-form-item :label="' '">
  617. <el-button type="primary" @click="getAgentList">查询</el-button>
  618. </el-form-item>
  619. </el-form>
  620. </div>
  621. <el-container style="margin-top: 0px;">
  622. <el-main style="width: 350px; padding: 1px">
  623. <span style="font-size: 12px" >可选代理商:</span>
  624. <el-table
  625. height="400px"
  626. :data="agentList1"
  627. border
  628. ref="agentTable1"
  629. @row-click="agentClickRow1"
  630. @selection-change="selectionAgent1"
  631. highlight-current-row
  632. style="width: 100%">
  633. <el-table-column
  634. type="selection"
  635. header-align="center"
  636. align="center"
  637. width="50">
  638. </el-table-column>
  639. <el-table-column
  640. prop="agentId"
  641. header-align="center"
  642. align="center"
  643. min-width="80"
  644. label="代理商编码">
  645. </el-table-column>
  646. <el-table-column
  647. prop="agentName"
  648. header-align="center"
  649. align="center"
  650. min-width="120"
  651. label="代理商名称">
  652. </el-table-column>
  653. </el-table>
  654. </el-main>
  655. <el-main style="width: 111px;padding: -1px">
  656. <div style="margin-top: 182px;margin-left: 18px">
  657. <el-button type="primary" @click="addAgent">添加>></el-button>
  658. </div>
  659. <div style="margin-top: 15px;margin-left: 18px">
  660. <el-button type="primary" @click="deleteAgent">删除<<</el-button>
  661. </div>
  662. </el-main>
  663. <el-main style="width: 350px;padding: 1px">
  664. <span style="font-size: 12px" >已有代理商:</span>
  665. <el-table
  666. height="400px"
  667. :data="agentList2"
  668. border
  669. ref="agentTable2"
  670. @row-click="agentClickRow2"
  671. @selection-change="selectionAgent2"
  672. highlight-current-row
  673. style="width: 100%">
  674. <el-table-column
  675. type="selection"
  676. header-align="center"
  677. align="center"
  678. width="50">
  679. </el-table-column>
  680. <el-table-column
  681. prop="agentId"
  682. header-align="center"
  683. align="center"
  684. min-width="80"
  685. label="代理商编码">
  686. </el-table-column>
  687. <el-table-column
  688. prop="agentName"
  689. header-align="center"
  690. align="center"
  691. min-width="120"
  692. label="代理商名称">
  693. </el-table-column>
  694. </el-table>
  695. </el-main>
  696. </el-container>
  697. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  698. <el-button type="primary" @click="agentModelFlag = false">关闭</el-button>
  699. </el-footer>
  700. </el-dialog>
  701. <!-- 制造商-> 快速新增 -->
  702. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="manufacturerModelFlag" width="900px">
  703. <div style="font-size: 12px">
  704. <el-form :inline="true" label-position="top" :model="manufacturerData">
  705. <el-form-item :label="'制造商编码'">
  706. <el-input v-model="manufacturerData.manufacturerId" clearable style="width: 120px"></el-input>
  707. </el-form-item>
  708. <el-form-item :label="'制造商名称'">
  709. <el-input v-model="manufacturerData.manufacturerName" clearable style="width: 120px"></el-input>
  710. </el-form-item>
  711. <el-form-item :label="' '">
  712. <el-button type="primary" @click="getManufacturerList()">查询</el-button>
  713. </el-form-item>
  714. </el-form>
  715. </div>
  716. <el-container style="margin-top: 0px;">
  717. <el-main style="width: 350px; padding: 1px">
  718. <span style="font-size: 12px" >可选制造商:</span>
  719. <el-table
  720. height="400px"
  721. :data="manufacturerList1"
  722. border
  723. ref="manufacturerTable1"
  724. @row-click="manufacturerClickRow1"
  725. @selection-change="selectionManufacturer1"
  726. highlight-current-row
  727. style="width: 100%">
  728. <el-table-column
  729. type="selection"
  730. header-align="center"
  731. align="center"
  732. width="50">
  733. </el-table-column>
  734. <el-table-column
  735. prop="manufacturerId"
  736. header-align="center"
  737. align="center"
  738. min-width="80"
  739. label="制造商编码">
  740. </el-table-column>
  741. <el-table-column
  742. prop="manufacturerName"
  743. header-align="center"
  744. align="center"
  745. min-width="120"
  746. label="制造商名称">
  747. </el-table-column>
  748. </el-table>
  749. </el-main>
  750. <el-main style="width: 111px;padding: -1px">
  751. <div style="margin-top: 182px;margin-left: 18px">
  752. <el-button type="primary" @click="addManufacturer()">添加>></el-button>
  753. </div>
  754. <div style="margin-top: 15px;margin-left: 18px">
  755. <el-button type="primary" @click="deleteManufacturer()">删除<<</el-button>
  756. </div>
  757. </el-main>
  758. <el-main style="width: 350px;padding: 1px">
  759. <span style="font-size: 12px" >已有制造商:</span>
  760. <el-table
  761. height="400px"
  762. :data="manufacturerList2"
  763. border
  764. ref="manufacturerTable2"
  765. @row-click="manufacturerClickRow2"
  766. @selection-change="selectionManufacturer2"
  767. highlight-current-row
  768. style="width: 100%">
  769. <el-table-column
  770. type="selection"
  771. header-align="center"
  772. align="center"
  773. width="50">
  774. </el-table-column>
  775. <el-table-column
  776. prop="manufacturerId"
  777. header-align="center"
  778. align="center"
  779. min-width="80"
  780. label="制造商编码">
  781. </el-table-column>
  782. <el-table-column
  783. prop="manufacturerName"
  784. header-align="center"
  785. align="center"
  786. min-width="120"
  787. label="制造商名称">
  788. </el-table-column>
  789. </el-table>
  790. </el-main>
  791. </el-container>
  792. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  793. <el-button type="primary" @click="manufacturerModelFlag = false">关闭</el-button>
  794. </el-footer>
  795. </el-dialog>
  796. <!-- 默认库位-> 快速新增 -->
  797. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="locationModelFlag" width="900px">
  798. <div style="font-size: 12px">
  799. <el-form :inline="true" label-position="top" :model="locationData">
  800. <el-form-item :label="'库位编码'">
  801. <el-input v-model="locationData.locationId" clearable style="width: 120px"></el-input>
  802. </el-form-item>
  803. <el-form-item :label="'库位名称'">
  804. <el-input v-model="locationData.locationName" clearable style="width: 120px"></el-input>
  805. </el-form-item>
  806. <el-form-item :label="' '">
  807. <el-button type="primary" @click="getLocationList()">查询</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="locationList1"
  817. border
  818. ref="locationTable1"
  819. @row-click="locationClickRow1"
  820. @selection-change="selectionLocation1"
  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="locationId"
  831. header-align="center"
  832. align="center"
  833. min-width="80"
  834. label="库位编码">
  835. </el-table-column>
  836. <el-table-column
  837. prop="locationName"
  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="addLocation()">添加>></el-button>
  848. </div>
  849. <div style="margin-top: 15px;margin-left: 18px">
  850. <el-button type="primary" @click="deleteLocation()">删除<<</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="locationList2"
  858. border
  859. ref="locationTable2"
  860. @row-click="locationClickRow2"
  861. @selection-change="selectionLocation2"
  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="locationId"
  872. header-align="center"
  873. align="center"
  874. min-width="80"
  875. label="库位编码">
  876. </el-table-column>
  877. <el-table-column
  878. prop="locationName"
  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="locationModelFlag = false">关闭</el-button>
  889. </el-footer>
  890. </el-dialog>
  891. <!-- copyPart -->
  892. <el-dialog title="Copy Part" :close-on-click-modal="false" v-drag :visible.sync="copyPartModelFlag" width="500px">
  893. <fieldset style="width: 474px">
  894. <legend>Part No To Copy</legend>
  895. <el-form :inline="true" style="margin-left: 7px">
  896. <el-form-item label="From Part">
  897. <el-input v-model="modalData.partNo" readonly style="width: 140px"></el-input>
  898. <el-input v-model="modalData.partDesc" readonly style="width: 287px"></el-input>
  899. </el-form-item>
  900. <el-form-item label="To Part">
  901. <el-input v-model="copyPartData.partNo" style="width: 140px"></el-input>
  902. <el-input v-model="copyPartData.partDesc" style="width: 287px"></el-input>
  903. </el-form-item>
  904. </el-form>
  905. </fieldset>
  906. <fieldset style="width: 474px">
  907. <legend>Select Part Information to Copy</legend>
  908. <el-form :inline="true" style="margin-left: 7px">
  909. <el-form-item label=" ">
  910. <el-checkbox v-model="copyPartData.copyGeneral" true-label="Y">General</el-checkbox>
  911. </el-form-item>
  912. <!-- <el-form-item label=" ">-->
  913. <!-- <el-checkbox v-model="copyPartData.copyCosts" true-label="Y">Costs</el-checkbox>-->
  914. <!-- </el-form-item>-->
  915. <!-- <el-form-item label=" ">-->
  916. <!-- <el-checkbox v-model="copyPartData.copyPlanningData" true-label="Y">Planning Data</el-checkbox>-->
  917. <!-- </el-form-item>-->
  918. </el-form>
  919. <!-- <el-form :inline="true" style="margin-left: 7px">-->
  920. <!-- <el-form-item label=" ">-->
  921. <!-- <el-checkbox v-model="copyPartData.copyManufacturing" true-label="Y">Manufacturing</el-checkbox>-->
  922. <!-- </el-form-item>-->
  923. <!-- <el-form-item label=" ">-->
  924. <!-- <el-checkbox v-model="copyPartData.copyDefaultLocation" true-label="Y">Default Location</el-checkbox>-->
  925. <!-- </el-form-item>-->
  926. <!-- <el-form-item label=" ">-->
  927. <!-- <el-checkbox v-model="copyPartData.copyRevision" true-label="Y">Revision</el-checkbox>-->
  928. <!-- </el-form-item>-->
  929. <!-- </el-form>-->
  930. </fieldset>
  931. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  932. <el-button type="primary" @click="copyPart">保存</el-button>
  933. <el-button type="primary" @click="copyPartModelFlag = false">关闭</el-button>
  934. </el-footer>
  935. </el-dialog>
  936. <!-- chooseList模态框 -->
  937. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  938. <!-- 上传文件的modal -->
  939. <partUploadFile ref="partUploadFile" @refreshPageTables="getFileContentData" v-drag></partUploadFile>
  940. </div>
  941. </template>
  942. <script>
  943. import {
  944. partInformationSearch, // 物料信息列表查询
  945. partInformationSave, // 物料信息新增
  946. partInformationEdit, // 物料信息编辑
  947. partInformationDelete, // 物料信息删除
  948. getPartItem, // 查询物料属性
  949. getAgentList, // 获取代理商列表
  950. getPartAgent, // 获取物料代理商
  951. getAgentListBy, // 根据条件查询可选代理商
  952. addPartAgent, // 新增物料代理商
  953. deletePartAgent, // 删除物料代理商
  954. deleteAgent, // 删除物料代理商(单删)
  955. getManufacturerList, // 获取制造商列表
  956. getPartManufacturer, // 获取物料制造商
  957. getManufacturerListBy, // 根据条件查询可选制造商
  958. addPartManufacturer, // 新增物料制造商
  959. deletePartManufacturer, // 删除物料制造商
  960. deleteManufacturer, // 删除物料制造商(单删)
  961. getLocationList, // 获取库位列表
  962. getDefaultLocation, // 获取物料库位
  963. getLocationListBy, // 根据条件查询可选库位
  964. addDefaultLocation, // 新增物料库位
  965. deleteDefaultLocation, // 删除物料库位
  966. deleteLocation, // 删除物料库位(单删)
  967. commitItemValue, // 修改物料属性值
  968. getItemLists, // 获取模板属性
  969. addPartItem, // 新增物料属性
  970. deletePartItem, // 删除物料属性
  971. queryPartItem,
  972. copyPart, // 复制物料
  973. getProjectPartNo, // 获取物料编码
  974. verifyData, // 校验参数
  975. getPreviousPartNo, // 获取上一个物料编码
  976. } from '@/api/part/partInformation.js'
  977. import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  978. import {deleteObjectFile} from '@/api/eam/eam.js'
  979. import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js"
  980. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  981. import Chooselist from '@/views/modules/common/Chooselist_eam'
  982. import partUploadFile from "./part_upload_file"
  983. import {updateColumnSize} from "../../../api/table";
  984. export default {
  985. components: {
  986. Chooselist,
  987. partUploadFile
  988. },
  989. watch: {
  990. searchData: {
  991. deep: true,
  992. handler: function (newV, oldV) {
  993. this.searchData.partNo = this.searchData.partNo.toUpperCase()
  994. }
  995. },
  996. modalData: {
  997. deep: true,
  998. handler: function (newV, oldV) {
  999. this.modalData.partNo = this.modalData.partNo.toUpperCase()
  1000. }
  1001. },
  1002. itemData: {
  1003. deep: true,
  1004. handler: function (newV, oldV) {
  1005. this.itemData.propertiesItemNo = this.itemData.propertiesItemNo.toUpperCase()
  1006. }
  1007. },
  1008. agentData: {
  1009. deep: true,
  1010. handler: function (newV, oldV) {
  1011. this.agentData.agentId = this.agentData.agentId.toUpperCase()
  1012. }
  1013. },
  1014. manufacturerData: {
  1015. deep: true,
  1016. handler: function (newV, oldV) {
  1017. this.manufacturerData.manufacturerId = this.manufacturerData.manufacturerId.toUpperCase()
  1018. }
  1019. },
  1020. locationData: {
  1021. deep: true,
  1022. handler: function (newV, oldV) {
  1023. this.locationData.locationId = this.locationData.locationId.toUpperCase()
  1024. }
  1025. },
  1026. uploadDialog (newValue,oldValue) {
  1027. if (newValue === false) {
  1028. this.getFileContentData()
  1029. }
  1030. },
  1031. },
  1032. data () {
  1033. return {
  1034. // 导出
  1035. exportData: [],
  1036. exportName: '物料档案管理' + this.dayjs().format('YYYYMMDDHHmmss'),
  1037. exportHeader: ['物料档案管理'],
  1038. exportFooter: [],
  1039. resultList: [],
  1040. userBuList: [],
  1041. buList: [],
  1042. // ======== 行高 ========
  1043. height: 200,
  1044. secondHeight: 200,
  1045. // ======== 分页 ========
  1046. pageIndex: 1,
  1047. pageSize: 20,
  1048. totalPage: 0,
  1049. selectedDataNum: 0,
  1050. tempCodeNo: '',
  1051. // 条件查询
  1052. searchData: {
  1053. site: '',
  1054. userName: this.$store.state.user.name,
  1055. buNo: '',
  1056. partNo: '',
  1057. startDate: '',
  1058. endDate: '',
  1059. partDesc: '',
  1060. page: 1,
  1061. limit: 10
  1062. },
  1063. // 其它
  1064. loading: false,
  1065. // 初始页签
  1066. activeTable: 'part_item',
  1067. inventoryPartTable: 'General',
  1068. // ======== 数据对象 ========
  1069. modalData: {
  1070. flag: '',
  1071. title: '',
  1072. site: '',
  1073. buNo: '',
  1074. bu: '',
  1075. partNo: '',
  1076. partDesc: '',
  1077. umId2: '',
  1078. umName: '',
  1079. spec: '',
  1080. active: '',
  1081. partType2: '',
  1082. standardBoxQty: '',
  1083. productGroupId1: '',
  1084. productGroupName1: '',
  1085. productGroupId2: '',
  1086. productGroupName2: '',
  1087. productGroupId3: '',
  1088. productGroupName3: '',
  1089. familyID: '',
  1090. familyName: '',
  1091. partDesceEn: '',
  1092. remark: '',
  1093. codeNo: '',
  1094. codeDesc: '',
  1095. tblBaseFlag: ''
  1096. },
  1097. itemData: {
  1098. site: this.$store.state.user.site,
  1099. partNo: '',
  1100. propertiesItemNo: '',
  1101. codeNo: '',
  1102. itemDesc: '',
  1103. textValue: '',
  1104. numValue: '',
  1105. recordType: ''
  1106. },
  1107. agentData: {
  1108. site: '',
  1109. buNo: '',
  1110. agentId: '',
  1111. agentName: '',
  1112. },
  1113. manufacturerData: {
  1114. site: '',
  1115. buNo: '',
  1116. manufacturerId: '',
  1117. manufacturerName: '',
  1118. },
  1119. locationData: {
  1120. site: '',
  1121. buNo: '',
  1122. locationId: '',
  1123. locationName: '',
  1124. },
  1125. copyPartData: {
  1126. site: '',
  1127. partNo: '',
  1128. partDesc: '',
  1129. copyGeneral: 'Y',
  1130. copyCosts: '',
  1131. copyPlanningData: '',
  1132. copyManufacturing: '',
  1133. copyDefaultLocation: '',
  1134. copyRevision: '',
  1135. previousVersion: {},
  1136. createBy: ''
  1137. },
  1138. // ======== 数据列表 ========
  1139. dataList: [],
  1140. partItemList: [],
  1141. updatePartItemList: [],
  1142. partAgentList: [],
  1143. partManufacturerList: [],
  1144. defaultLocationList: [],
  1145. fileContentList: [],
  1146. availableValueList:[],
  1147. agentList: [],
  1148. agentSelections: [],
  1149. agentSelections1: [],
  1150. agentSelections2: [],
  1151. agentList1: [],
  1152. agentList2: [],
  1153. manufacturerList: [],
  1154. manufacturerSelections: [],
  1155. manufacturerSelections1: [],
  1156. manufacturerSelections2: [],
  1157. manufacturerList1: [],
  1158. manufacturerList2: [],
  1159. locationList: [],
  1160. locationSelections: [],
  1161. locationSelections1: [],
  1162. locationSelections2: [],
  1163. locationList1: [],
  1164. locationList2: [],
  1165. itemSelections1: [],
  1166. itemSelections2: [],
  1167. itemList1:[],
  1168. itemList2:[],
  1169. revisionList: [],
  1170. bomAlternativeList: [],
  1171. routingAlternativeList: [],
  1172. copyAttributeList: [],
  1173. fileList: [],
  1174. // ======== 列表表头 ========
  1175. columnList: [
  1176. {
  1177. userId: this.$store.state.user.name,
  1178. functionId: 601001,
  1179. serialNumber: '601001Table1Bu',
  1180. tableId: '601001Table1',
  1181. tableName: '物料信息表',
  1182. columnProp: 'buDesc',
  1183. headerAlign: 'center',
  1184. align: 'center',
  1185. columnLabel: 'BU',
  1186. columnHidden: false,
  1187. columnImage: false,
  1188. columnSortable: false,
  1189. sortLv: 0,
  1190. status: true,
  1191. fixed: '',
  1192. columnWidth: 80
  1193. },
  1194. {
  1195. userId: this.$store.state.user.name,
  1196. functionId: 601001,
  1197. serialNumber: '601001Table1PartNo',
  1198. tableId: '601001Table1',
  1199. tableName: '物料信息表',
  1200. columnProp: 'partNo',
  1201. headerAlign: 'center',
  1202. align: 'center',
  1203. columnLabel: '物料编码',
  1204. columnHidden: false,
  1205. columnImage: false,
  1206. columnSortable: false,
  1207. sortLv: 0,
  1208. status: true,
  1209. fixed: '',
  1210. columnWidth: 120
  1211. },
  1212. {
  1213. userId: this.$store.state.user.name,
  1214. functionId: 601001,
  1215. serialNumber: '601001Table1PartDesc',
  1216. tableId: '601001Table1',
  1217. tableName: '物料信息表',
  1218. columnProp: 'partDesc',
  1219. headerAlign: 'center',
  1220. align: 'center',
  1221. columnLabel: '物料描述',
  1222. columnHidden: false,
  1223. columnImage: false,
  1224. columnSortable: false,
  1225. sortLv: 0,
  1226. status: true,
  1227. fixed: '',
  1228. columnWidth: 300
  1229. },
  1230. {
  1231. userId: this.$store.state.user.name,
  1232. functionId: 601001,
  1233. serialNumber: '601001Table1PartDesceEn',
  1234. tableId: '601001Table1',
  1235. tableName: '物料信息表',
  1236. columnProp: 'partDesceEn',
  1237. headerAlign: 'center',
  1238. align: 'center',
  1239. columnLabel: '物料描述(英文)',
  1240. columnHidden: false,
  1241. columnImage: false,
  1242. columnSortable: false,
  1243. sortLv: 0,
  1244. status: true,
  1245. fixed: '',
  1246. columnWidth: 300
  1247. },
  1248. {
  1249. userId: this.$store.state.user.name,
  1250. functionId: 601001,
  1251. serialNumber: '601001Table1Spec',
  1252. tableId: '601001Table1',
  1253. tableName: '物料信息表',
  1254. columnProp: 'spec',
  1255. headerAlign: 'center',
  1256. align: 'center',
  1257. columnLabel: '规格',
  1258. columnHidden: false,
  1259. columnImage: false,
  1260. columnSortable: false,
  1261. sortLv: 0,
  1262. status: true,
  1263. fixed: '',
  1264. columnWidth: 300
  1265. },
  1266. {
  1267. userId: this.$store.state.user.name,
  1268. functionId: 601001,
  1269. serialNumber: '601001Table1ActiveDesc',
  1270. tableId: '601001Table1',
  1271. tableName: '物料信息表',
  1272. columnProp: 'activeDesc',
  1273. headerAlign: 'center',
  1274. align: 'center',
  1275. columnLabel: '是否在用',
  1276. columnHidden: false,
  1277. columnImage: false,
  1278. columnSortable: false,
  1279. sortLv: 0,
  1280. status: true,
  1281. fixed: '',
  1282. columnWidth: 80
  1283. },
  1284. {
  1285. userId: this.$store.state.user.name,
  1286. functionId: 601001,
  1287. serialNumber: '601001Table1PartType2Desc',
  1288. tableId: '601001Table1',
  1289. tableName: '物料信息表',
  1290. columnProp: 'partType2Desc',
  1291. headerAlign: 'center',
  1292. align: 'center',
  1293. columnLabel: '零件类型',
  1294. columnHidden: false,
  1295. columnImage: false,
  1296. columnSortable: false,
  1297. sortLv: 0,
  1298. status: true,
  1299. fixed: '',
  1300. columnWidth: 100
  1301. },
  1302. {
  1303. userId: this.$store.state.user.name,
  1304. functionId: 601001,
  1305. serialNumber: '601001Table1UmId',
  1306. tableId: '601001Table1',
  1307. tableName: '物料信息表',
  1308. columnProp: 'umId2',
  1309. headerAlign: 'center',
  1310. align: 'center',
  1311. columnLabel: '计量单位编码',
  1312. columnHidden: false,
  1313. columnImage: false,
  1314. columnSortable: false,
  1315. sortLv: 0,
  1316. status: true,
  1317. fixed: '',
  1318. columnWidth: 100
  1319. },
  1320. {
  1321. userId: this.$store.state.user.name,
  1322. functionId: 601001,
  1323. serialNumber: '601001Table1UmName',
  1324. tableId: '601001Table1',
  1325. tableName: '物料信息表',
  1326. columnProp: 'umName',
  1327. headerAlign: 'center',
  1328. align: 'center',
  1329. columnLabel: '计量单位名称',
  1330. columnHidden: false,
  1331. columnImage: false,
  1332. columnSortable: false,
  1333. sortLv: 0,
  1334. status: true,
  1335. fixed: '',
  1336. columnWidth: 150
  1337. },
  1338. {
  1339. userId: this.$store.state.user.name,
  1340. functionId: 601001,
  1341. serialNumber: '601001Table1FamilyID',
  1342. tableId: '601001Table1',
  1343. tableName: '物料信息表',
  1344. columnProp: 'familyID',
  1345. headerAlign: 'center',
  1346. align: 'center',
  1347. columnLabel: '物料分类编码',
  1348. columnHidden: false,
  1349. columnImage: false,
  1350. columnSortable: false,
  1351. sortLv: 0,
  1352. status: true,
  1353. fixed: '',
  1354. columnWidth: 100
  1355. },
  1356. {
  1357. userId: this.$store.state.user.name,
  1358. functionId: 601001,
  1359. serialNumber: '601001Table1FamilyName',
  1360. tableId: '601001Table1',
  1361. tableName: '物料信息表',
  1362. columnProp: 'familyName',
  1363. headerAlign: 'center',
  1364. align: 'center',
  1365. columnLabel: '物料分类名称',
  1366. columnHidden: false,
  1367. columnImage: false,
  1368. columnSortable: false,
  1369. sortLv: 0,
  1370. status: true,
  1371. fixed: '',
  1372. columnWidth: 150
  1373. },
  1374. {
  1375. userId: this.$store.state.user.name,
  1376. functionId: 601001,
  1377. serialNumber: '601001Table1OtherGroup1',
  1378. tableId: '601001Table1',
  1379. tableName: '物料信息表',
  1380. columnProp: 'productGroupId1',
  1381. headerAlign: 'center',
  1382. align: 'center',
  1383. columnLabel: '商品组1编码',
  1384. columnHidden: false,
  1385. columnImage: false,
  1386. columnSortable: false,
  1387. sortLv: 0,
  1388. status: true,
  1389. fixed: '',
  1390. columnWidth: 100
  1391. },
  1392. {
  1393. userId: this.$store.state.user.name,
  1394. functionId: 601001,
  1395. serialNumber: '601001Table1OtherGroupName1',
  1396. tableId: '601001Table1',
  1397. tableName: '物料信息表',
  1398. columnProp: 'productGroupName1',
  1399. headerAlign: 'center',
  1400. align: 'center',
  1401. columnLabel: '商品组1名称',
  1402. columnHidden: false,
  1403. columnImage: false,
  1404. columnSortable: false,
  1405. sortLv: 0,
  1406. status: true,
  1407. fixed: '',
  1408. columnWidth: 150
  1409. },
  1410. {
  1411. userId: this.$store.state.user.name,
  1412. functionId: 601001,
  1413. serialNumber: '601001Table1OtherGroup2',
  1414. tableId: '601001Table1',
  1415. tableName: '物料信息表',
  1416. columnProp: 'productGroupId2',
  1417. headerAlign: 'center',
  1418. align: 'center',
  1419. columnLabel: '商品组2编码',
  1420. columnHidden: false,
  1421. columnImage: false,
  1422. columnSortable: false,
  1423. sortLv: 0,
  1424. status: true,
  1425. fixed: '',
  1426. columnWidth: 100
  1427. },
  1428. {
  1429. userId: this.$store.state.user.name,
  1430. functionId: 601001,
  1431. serialNumber: '601001Table1OtherGroupName2',
  1432. tableId: '601001Table1',
  1433. tableName: '物料信息表',
  1434. columnProp: 'productGroupName2',
  1435. headerAlign: 'center',
  1436. align: 'center',
  1437. columnLabel: '商品组2名称',
  1438. columnHidden: false,
  1439. columnImage: false,
  1440. columnSortable: false,
  1441. sortLv: 0,
  1442. status: true,
  1443. fixed: '',
  1444. columnWidth: 150
  1445. },
  1446. {
  1447. userId: this.$store.state.user.name,
  1448. functionId: 601001,
  1449. serialNumber: '601001Table1OtherGroup3',
  1450. tableId: '601001Table1',
  1451. tableName: '物料信息表',
  1452. columnProp: 'productGroupId3',
  1453. headerAlign: 'center',
  1454. align: 'center',
  1455. columnLabel: '商品组3编码',
  1456. columnHidden: false,
  1457. columnImage: false,
  1458. columnSortable: false,
  1459. sortLv: 0,
  1460. status: true,
  1461. fixed: '',
  1462. columnWidth: 100
  1463. },
  1464. {
  1465. userId: this.$store.state.user.name,
  1466. functionId: 601001,
  1467. serialNumber: '601001Table1OtherGroupName3',
  1468. tableId: '601001Table1',
  1469. tableName: '物料信息表',
  1470. columnProp: 'productGroupName3',
  1471. headerAlign: 'center',
  1472. align: 'center',
  1473. columnLabel: '商品组3名称',
  1474. columnHidden: false,
  1475. columnImage: false,
  1476. columnSortable: false,
  1477. sortLv: 0,
  1478. status: true,
  1479. fixed: '',
  1480. columnWidth: 150
  1481. },
  1482. {
  1483. userId: this.$store.state.user.name,
  1484. functionId: 601001,
  1485. serialNumber: '601001Table1CodeNo',
  1486. tableId: '601001Table1',
  1487. tableName: '物料信息表',
  1488. columnProp: 'codeNo',
  1489. headerAlign: 'center',
  1490. align: 'center',
  1491. columnLabel: '属性模板编码',
  1492. columnHidden: false,
  1493. columnImage: false,
  1494. columnSortable: false,
  1495. sortLv: 0,
  1496. status: true,
  1497. fixed: '',
  1498. columnWidth: 150
  1499. },
  1500. {
  1501. userId: this.$store.state.user.name,
  1502. functionId: 601001,
  1503. serialNumber: '601001Table1CodeDesc',
  1504. tableId: '601001Table1',
  1505. tableName: '物料信息表',
  1506. columnProp: 'codeDesc',
  1507. headerAlign: 'center',
  1508. align: 'center',
  1509. columnLabel: '属性模板名称',
  1510. columnHidden: false,
  1511. columnImage: false,
  1512. columnSortable: false,
  1513. sortLv: 0,
  1514. status: true,
  1515. fixed: '',
  1516. columnWidth: 200
  1517. },
  1518. {
  1519. userId: this.$store.state.user.name,
  1520. functionId: 601001,
  1521. serialNumber: '601001Table1Remark',
  1522. tableId: '601001Table1',
  1523. tableName: '物料信息表',
  1524. columnProp: 'remark',
  1525. headerAlign: 'center',
  1526. align: 'center',
  1527. columnLabel: '备注',
  1528. columnHidden: false,
  1529. columnImage: false,
  1530. columnSortable: false,
  1531. sortLv: 0,
  1532. status: true,
  1533. fixed: '',
  1534. columnWidth: 300
  1535. },
  1536. {
  1537. userId: this.$store.state.user.name,
  1538. functionId: 601001,
  1539. serialNumber: '601001Table1CreateDate',
  1540. tableId: '601001Table1',
  1541. tableName: '物料信息表',
  1542. columnProp: 'createDate',
  1543. headerAlign: 'center',
  1544. align: 'center',
  1545. columnLabel: '创建时间',
  1546. columnHidden: false,
  1547. columnImage: false,
  1548. columnSortable: false,
  1549. sortLv: 0,
  1550. status: true,
  1551. fixed: '',
  1552. columnWidth: 150
  1553. },
  1554. {
  1555. userId: this.$store.state.user.name,
  1556. functionId: 601001,
  1557. serialNumber: '601001Table1CreateBy',
  1558. tableId: '601001Table1',
  1559. tableName: '物料信息表',
  1560. columnProp: 'createBy',
  1561. headerAlign: 'center',
  1562. align: 'center',
  1563. columnLabel: '创建人',
  1564. columnHidden: false,
  1565. columnImage: false,
  1566. columnSortable: false,
  1567. sortLv: 0,
  1568. status: true,
  1569. fixed: '',
  1570. columnWidth: 100
  1571. },
  1572. ],
  1573. columnItemList: [
  1574. {
  1575. userId: this.$store.state.user.name,
  1576. functionId: 601001,
  1577. serialNumber: '601001Table2PropertiesItemID',
  1578. tableId: "601001Table2",
  1579. tableName: "物料属性表",
  1580. columnProp: 'propertiesItemNo',
  1581. headerAlign: "center",
  1582. align: "center",
  1583. columnLabel: '属性编码',
  1584. columnHidden: false,
  1585. columnImage: false,
  1586. status: true,
  1587. fixed: '',
  1588. columnWidth: 100,
  1589. },
  1590. {
  1591. userId: this.$store.state.user.name,
  1592. functionId: 601001,
  1593. serialNumber: '601001Table2PropertiesItemDesc',
  1594. tableId: "601001Table2",
  1595. tableName: "物料属性表",
  1596. columnProp: 'itemDesc',
  1597. headerAlign: "center",
  1598. align: "center",
  1599. columnLabel: '属性名称',
  1600. columnHidden: false,
  1601. columnImage: false,
  1602. status: true,
  1603. fixed: '',
  1604. columnWidth: 120,
  1605. },
  1606. {
  1607. userId: this.$store.state.user.name,
  1608. functionId: 601001,
  1609. serialNumber: '601001Table2ValueType',
  1610. tableId: "601001Table2",
  1611. tableName: "物料属性表",
  1612. columnProp: 'valueType',
  1613. headerAlign: "center",
  1614. align: "center",
  1615. columnLabel: '属性类型',
  1616. columnHidden: false,
  1617. columnImage: false,
  1618. status: true,
  1619. fixed: '',
  1620. columnWidth: 100,
  1621. },
  1622. {
  1623. userId: this.$store.state.user.name,
  1624. functionId: 601001,
  1625. serialNumber: '601001Table2ValueChooseFlag',
  1626. tableId: "601001Table2",
  1627. tableName: "物料属性表",
  1628. columnProp: 'textValue',
  1629. headerAlign: "center",
  1630. align: "center",
  1631. columnLabel: '属性值',
  1632. columnHidden: false,
  1633. columnImage: false,
  1634. status: true,
  1635. fixed: '',
  1636. columnWidth: 100,
  1637. },
  1638. // {
  1639. // userId: this.$store.state.user.name,
  1640. // functionId: 601001,
  1641. // serialNumber: '601001Table2ValueChooseFlag',
  1642. // tableId: "601001Table2",
  1643. // tableName: "物料属性表",
  1644. // columnProp: 'numValue',
  1645. // headerAlign: "center",
  1646. // align: "center",
  1647. // columnLabel: '数字值',
  1648. // columnHidden: false,
  1649. // columnImage: false,
  1650. // status: true,
  1651. // fixed: '',
  1652. // columnWidth: 70,
  1653. // },
  1654. ],
  1655. updateColumnItemList: [
  1656. {
  1657. userId: this.$store.state.user.name,
  1658. functionId: 601001,
  1659. serialNumber: '601001Table6PropertiesItemID',
  1660. tableId: "601001Table6",
  1661. tableName: "物料属性表",
  1662. columnProp: 'propertiesItemNo',
  1663. headerAlign: "center",
  1664. align: "center",
  1665. columnLabel: '属性编码',
  1666. columnHidden: false,
  1667. columnImage: false,
  1668. status: true,
  1669. fixed: '',
  1670. columnWidth: 90,
  1671. },
  1672. {
  1673. userId: this.$store.state.user.name,
  1674. functionId: 601001,
  1675. serialNumber: '601001Table6PropertiesItemDesc',
  1676. tableId: "601001Table6",
  1677. tableName: "物料属性表",
  1678. columnProp: 'itemDesc',
  1679. headerAlign: "center",
  1680. align: "center",
  1681. columnLabel: '属性名称',
  1682. columnHidden: false,
  1683. columnImage: false,
  1684. status: true,
  1685. fixed: '',
  1686. columnWidth: 90,
  1687. },
  1688. {
  1689. userId: this.$store.state.user.name,
  1690. functionId: 601001,
  1691. serialNumber: '601001Table6ValueType',
  1692. tableId: "601001Table6",
  1693. tableName: "物料属性表",
  1694. columnProp: 'valueType',
  1695. headerAlign: "center",
  1696. align: "center",
  1697. columnLabel: '属性类型',
  1698. columnHidden: false,
  1699. columnImage: false,
  1700. status: true,
  1701. fixed: '',
  1702. columnWidth: 70,
  1703. },
  1704. ],
  1705. columnAgentList: [
  1706. {
  1707. userId: this.$store.state.user.name,
  1708. functionId: 601001,
  1709. serialNumber: '601001Table3AgentId',
  1710. tableId: "601001Table3",
  1711. tableName: "物料代理商表",
  1712. columnProp: 'agentId',
  1713. headerAlign: "center",
  1714. align: "center",
  1715. columnLabel: '代理商编码',
  1716. columnHidden: false,
  1717. columnImage: false,
  1718. status: true,
  1719. fixed: '',
  1720. },
  1721. {
  1722. userId: this.$store.state.user.name,
  1723. functionId: 601001,
  1724. serialNumber: '601001Table3AgentName',
  1725. tableId: "601001Table3",
  1726. tableName: "物料代理商表",
  1727. columnProp: 'agentName',
  1728. headerAlign: "center",
  1729. align: "center",
  1730. columnLabel: '代理商名称',
  1731. columnHidden: false,
  1732. columnImage: false,
  1733. status: true,
  1734. fixed: '',
  1735. },
  1736. {
  1737. userId: this.$store.state.user.name,
  1738. functionId: 601001,
  1739. serialNumber: '601001Table3Active',
  1740. tableId: '601001Table3',
  1741. tableName: '物料代理商表',
  1742. columnProp: 'active',
  1743. headerAlign: 'center',
  1744. align: 'center',
  1745. columnLabel: '是否在用',
  1746. columnHidden: false,
  1747. columnImage: false,
  1748. status: true,
  1749. fixed: '',
  1750. },
  1751. {
  1752. userId: this.$store.state.user.name,
  1753. functionId: 601001,
  1754. serialNumber: '601001Table3CreateDate',
  1755. tableId: '601001Table3',
  1756. tableName: '物料代理商表',
  1757. columnProp: 'createDate',
  1758. headerAlign: 'center',
  1759. align: 'center',
  1760. columnLabel: '创建时间',
  1761. columnHidden: false,
  1762. columnImage: false,
  1763. status: true,
  1764. fixed: '',
  1765. },
  1766. {
  1767. userId: this.$store.state.user.name,
  1768. functionId: 601001,
  1769. serialNumber: '601001Table3CreateBy',
  1770. tableId: '601001Table3',
  1771. tableName: '物料代理商表',
  1772. columnProp: 'createBy',
  1773. headerAlign: 'center',
  1774. align: 'center',
  1775. columnLabel: '创建人',
  1776. columnHidden: false,
  1777. columnImage: false,
  1778. status: true,
  1779. fixed: '',
  1780. },
  1781. {
  1782. userId: this.$store.state.user.name,
  1783. functionId: 601001,
  1784. serialNumber: '601001Table3UpdateDate',
  1785. tableId: '601001Table3',
  1786. tableName: '物料代理商表',
  1787. columnProp: 'updateDate',
  1788. headerAlign: 'center',
  1789. align: 'center',
  1790. columnLabel: '更新时间',
  1791. columnHidden: false,
  1792. columnImage: false,
  1793. status: true,
  1794. fixed: '',
  1795. },
  1796. {
  1797. userId: this.$store.state.user.name,
  1798. functionId: 601001,
  1799. serialNumber: '601001Table3UpdateBy',
  1800. tableId: '601001Table3',
  1801. tableName: '物料代理商表',
  1802. columnProp: 'updateBy',
  1803. headerAlign: 'center',
  1804. align: 'center',
  1805. columnLabel: '更新人',
  1806. columnHidden: false,
  1807. columnImage: false,
  1808. status: true,
  1809. fixed: '',
  1810. }
  1811. ],
  1812. columnManufacturerList: [
  1813. {
  1814. userId: this.$store.state.user.name,
  1815. functionId: 601001,
  1816. serialNumber: '601001Table5ManufacturerId',
  1817. tableId: "601001Table5",
  1818. tableName: "物料制造商表",
  1819. columnProp: 'manufacturerId',
  1820. headerAlign: "center",
  1821. align: "center",
  1822. columnLabel: '制造商编码',
  1823. columnHidden: false,
  1824. columnImage: false,
  1825. status: true,
  1826. fixed: '',
  1827. },
  1828. {
  1829. userId: this.$store.state.user.name,
  1830. functionId: 601001,
  1831. serialNumber: '601001Table5ManufacturerName',
  1832. tableId: "601001Table5",
  1833. tableName: "物料制造商表",
  1834. columnProp: 'manufacturerName',
  1835. headerAlign: "center",
  1836. align: "center",
  1837. columnLabel: '制造商名称',
  1838. columnHidden: false,
  1839. columnImage: false,
  1840. status: true,
  1841. fixed: '',
  1842. },
  1843. {
  1844. userId: this.$store.state.user.name,
  1845. functionId: 601001,
  1846. serialNumber: '601001Table5Active',
  1847. tableId: '601001Table5',
  1848. tableName: '物料制造商表',
  1849. columnProp: 'active',
  1850. headerAlign: 'center',
  1851. align: 'center',
  1852. columnLabel: '是否在用',
  1853. columnHidden: false,
  1854. columnImage: false,
  1855. status: true,
  1856. fixed: '',
  1857. },
  1858. {
  1859. userId: this.$store.state.user.name,
  1860. functionId: 601001,
  1861. serialNumber: '601001Table5CreateDate',
  1862. tableId: '601001Table5',
  1863. tableName: '物料制造商表',
  1864. columnProp: 'createDate',
  1865. headerAlign: 'center',
  1866. align: 'center',
  1867. columnLabel: '创建时间',
  1868. columnHidden: false,
  1869. columnImage: false,
  1870. status: true,
  1871. fixed: '',
  1872. },
  1873. {
  1874. userId: this.$store.state.user.name,
  1875. functionId: 601001,
  1876. serialNumber: '601001Table5CreateBy',
  1877. tableId: '601001Table5',
  1878. tableName: '物料制造商表',
  1879. columnProp: 'createBy',
  1880. headerAlign: 'center',
  1881. align: 'center',
  1882. columnLabel: '创建人',
  1883. columnHidden: false,
  1884. columnImage: false,
  1885. status: true,
  1886. fixed: '',
  1887. },
  1888. {
  1889. userId: this.$store.state.user.name,
  1890. functionId: 601001,
  1891. serialNumber: '601001Table5UpdateDate',
  1892. tableId: '601001Table5',
  1893. tableName: '物料制造商表',
  1894. columnProp: 'updateDate',
  1895. headerAlign: 'center',
  1896. align: 'center',
  1897. columnLabel: '更新时间',
  1898. columnHidden: false,
  1899. columnImage: false,
  1900. status: true,
  1901. fixed: '',
  1902. },
  1903. {
  1904. userId: this.$store.state.user.name,
  1905. functionId: 601001,
  1906. serialNumber: '601001Table5UpdateBy',
  1907. tableId: '601001Table5',
  1908. tableName: '物料制造商表',
  1909. columnProp: 'updateBy',
  1910. headerAlign: 'center',
  1911. align: 'center',
  1912. columnLabel: '更新人',
  1913. columnHidden: false,
  1914. columnImage: false,
  1915. status: true,
  1916. fixed: '',
  1917. }
  1918. ],
  1919. columnLocationList: [
  1920. {
  1921. userId: this.$store.state.user.name,
  1922. functionId: 601001,
  1923. serialNumber: '601001Table7LocationId',
  1924. tableId: "601001Table7",
  1925. tableName: "物料库位表",
  1926. columnProp: 'locationId',
  1927. headerAlign: "center",
  1928. align: "center",
  1929. columnLabel: '库位编码',
  1930. columnHidden: false,
  1931. columnImage: false,
  1932. status: true,
  1933. fixed: '',
  1934. },
  1935. {
  1936. userId: this.$store.state.user.name,
  1937. functionId: 601001,
  1938. serialNumber: '601001Table7LocationName',
  1939. tableId: "601001Table7",
  1940. tableName: "物料库位表",
  1941. columnProp: 'locationName',
  1942. headerAlign: "center",
  1943. align: "center",
  1944. columnLabel: '库位名称',
  1945. columnHidden: false,
  1946. columnImage: false,
  1947. status: true,
  1948. fixed: '',
  1949. },
  1950. {
  1951. userId: this.$store.state.user.name,
  1952. functionId: 601001,
  1953. serialNumber: '601001Table7warehouseId',
  1954. tableId: "601001Table7",
  1955. tableName: "物料库位表",
  1956. columnProp: 'warehouseId',
  1957. headerAlign: "center",
  1958. align: "center",
  1959. columnLabel: '仓库编码',
  1960. columnHidden: false,
  1961. columnImage: false,
  1962. status: true,
  1963. fixed: '',
  1964. },
  1965. {
  1966. userId: this.$store.state.user.name,
  1967. functionId: 601001,
  1968. serialNumber: '601001Table7Active',
  1969. tableId: '601001Table7',
  1970. tableName: '物料库位表',
  1971. columnProp: 'active',
  1972. headerAlign: 'center',
  1973. align: 'center',
  1974. columnLabel: '是否在用',
  1975. columnHidden: false,
  1976. columnImage: false,
  1977. status: true,
  1978. fixed: '',
  1979. },
  1980. {
  1981. userId: this.$store.state.user.name,
  1982. functionId: 601001,
  1983. serialNumber: '601001Table7CreateDate',
  1984. tableId: '601001Table7',
  1985. tableName: '物料库位表',
  1986. columnProp: 'createDate',
  1987. headerAlign: 'center',
  1988. align: 'center',
  1989. columnLabel: '创建时间',
  1990. columnHidden: false,
  1991. columnImage: false,
  1992. status: true,
  1993. fixed: '',
  1994. },
  1995. {
  1996. userId: this.$store.state.user.name,
  1997. functionId: 601001,
  1998. serialNumber: '601001Table7CreateBy',
  1999. tableId: '601001Table7',
  2000. tableName: '物料库位表',
  2001. columnProp: 'createBy',
  2002. headerAlign: 'center',
  2003. align: 'center',
  2004. columnLabel: '创建人',
  2005. columnHidden: false,
  2006. columnImage: false,
  2007. status: true,
  2008. fixed: '',
  2009. },
  2010. {
  2011. userId: this.$store.state.user.name,
  2012. functionId: 601001,
  2013. serialNumber: '601001Table7UpdateDate',
  2014. tableId: '601001Table7',
  2015. tableName: '物料库位表',
  2016. columnProp: 'updateDate',
  2017. headerAlign: 'center',
  2018. align: 'center',
  2019. columnLabel: '更新时间',
  2020. columnHidden: false,
  2021. columnImage: false,
  2022. status: true,
  2023. fixed: '',
  2024. },
  2025. {
  2026. userId: this.$store.state.user.name,
  2027. functionId: 601001,
  2028. serialNumber: '601001Table7UpdateBy',
  2029. tableId: '601001Table7',
  2030. tableName: '物料库位表',
  2031. columnProp: 'updateBy',
  2032. headerAlign: 'center',
  2033. align: 'center',
  2034. columnLabel: '更新人',
  2035. columnHidden: false,
  2036. columnImage: false,
  2037. status: true,
  2038. fixed: '',
  2039. }
  2040. ],
  2041. columnFileList: [
  2042. {
  2043. userId: this.$store.state.user.name,
  2044. functionId: 601001,
  2045. serialNumber: '601001Table4FileName',
  2046. tableId: '601001Table4',
  2047. tableName: '文件信息表',
  2048. columnProp: 'fileName',
  2049. headerAlign: 'center',
  2050. align: 'center',
  2051. columnLabel: '文件名称',
  2052. columnHidden: false,
  2053. columnImage: false,
  2054. status: true,
  2055. fixed: '',
  2056. columnWidth: 200,
  2057. },
  2058. {
  2059. userId: this.$store.state.user.name,
  2060. functionId: 601001,
  2061. serialNumber: '601001Table4FileRemark',
  2062. tableId: '601001Table4',
  2063. tableName: '文件信息表',
  2064. columnProp: 'url',
  2065. headerAlign: 'center',
  2066. align: 'center',
  2067. columnLabel: '文件路径',
  2068. columnHidden: false,
  2069. columnImage: false,
  2070. status: true,
  2071. fixed: '',
  2072. columnWidth: 300,
  2073. },
  2074. {
  2075. userId: this.$store.state.user.name,
  2076. functionId: 601001,
  2077. serialNumber: '601001Table4CreateDate',
  2078. tableId: '601001Table4',
  2079. tableName: '文件信息表',
  2080. columnProp: 'createDate',
  2081. headerAlign: 'center',
  2082. align: 'center',
  2083. columnLabel: '上传时间',
  2084. columnHidden: false,
  2085. columnImage: false,
  2086. status: true,
  2087. fixed: '',
  2088. columnWidth: 170,
  2089. },
  2090. {
  2091. userId: this.$store.state.user.name,
  2092. functionId: 601001,
  2093. serialNumber: '601001Table4CreatedBy',
  2094. tableId: '601001Table4',
  2095. tableName: '文件信息表',
  2096. columnProp: 'createdBy',
  2097. headerAlign: 'center',
  2098. align: 'center',
  2099. columnLabel: '上传人',
  2100. columnHidden: false,
  2101. columnImage: false,
  2102. status: true,
  2103. fixed: '',
  2104. columnWidth: 120,
  2105. }
  2106. ],
  2107. // ======== 必填规则 ========
  2108. rules: {
  2109. bu: [
  2110. {
  2111. required: true,
  2112. message: ' ',
  2113. trigger: ['blur','change']
  2114. }
  2115. ],
  2116. partNo: [
  2117. {
  2118. required: true,
  2119. message: ' ',
  2120. trigger: ['blur','change']
  2121. }
  2122. ],
  2123. partDesc: [
  2124. {
  2125. required: true,
  2126. message: ' ',
  2127. trigger: ['blur','change']
  2128. }
  2129. ],
  2130. umId2: [
  2131. {
  2132. required: true,
  2133. message: ' ',
  2134. trigger: ['blur','change']
  2135. }
  2136. ],
  2137. codeNo: [
  2138. {
  2139. required: true,
  2140. message: ' ',
  2141. trigger: ['blur','change']
  2142. }
  2143. ],
  2144. manufacturerName: [
  2145. {
  2146. required: true,
  2147. message: ' ',
  2148. trigger: ['blur','change']
  2149. }
  2150. ],
  2151. active: [
  2152. {
  2153. required: true,
  2154. message: ' ',
  2155. trigger: ['blur','change']
  2156. }
  2157. ],
  2158. agentName: [
  2159. {
  2160. required: true,
  2161. message: ' ',
  2162. trigger: ['blur','change']
  2163. }
  2164. ],
  2165. partType2: [
  2166. {
  2167. required: true,
  2168. message: ' ',
  2169. trigger: ['blur','change']
  2170. }
  2171. ],
  2172. productGroupId4: [
  2173. {
  2174. required: true,
  2175. message: ' ',
  2176. trigger: ['blur','change']
  2177. }
  2178. ],
  2179. lotTrackingCode: [
  2180. {
  2181. required: true,
  2182. message: ' ',
  2183. trigger: ['blur','change']
  2184. }
  2185. ],
  2186. },
  2187. // ======== 复选数据集 ========
  2188. partSelections: [],
  2189. bomAlternativeSelections: [],
  2190. routingAlternativeSelections: [],
  2191. // ======== 选中的当前行数据 ========
  2192. partCurrentRow: {},
  2193. // ======== 模态框开关控制 ========
  2194. authSearch: false,
  2195. authSave: false,
  2196. authUpdate: false,
  2197. authDelete: false,
  2198. modalFlag: false,
  2199. modalDisableFlag: false,
  2200. itemChooseFlag: false,
  2201. itemTextDisableFlag: false,
  2202. itemNumberDisableFlag: false,
  2203. itemModalDisableFlag: false,
  2204. itemModalFlag: false,
  2205. agentModelFlag: false,
  2206. manufacturerModelFlag: false,
  2207. updateItemModelFlag: false,
  2208. fastAddFlag: false,
  2209. locationModelFlag: false,
  2210. copyPartModelFlag: false,
  2211. attributeDialog: true,
  2212. uploadDialog: false,
  2213. menuId: this.$route.meta.menuId,
  2214. previousPartNo: ''
  2215. }
  2216. },
  2217. mounted () {
  2218. this.$nextTick(() => {
  2219. this.height = window.innerHeight / 2 - 120
  2220. /*第二个表格高度的动态调整*/
  2221. this.secondHeight = window.innerHeight - this.height - 175
  2222. })
  2223. },
  2224. created () {
  2225. // 按钮控制
  2226. this.getButtonAuthData()
  2227. // 获取用户的 site 和 bu
  2228. this.getSiteAndBuByUserName()
  2229. // 获取用户的 site 和 bu
  2230. this.getSiteAndBuByUserName2()
  2231. // 动态列
  2232. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  2233. if (!this.authSearch) {
  2234. // 获取数据列表
  2235. this.getDataList()
  2236. }
  2237. },
  2238. methods: {
  2239. handleColumnResize(newWidth, oldWidth, column, event){
  2240. let inData= this.columnList.filter(item => item.columnProp === column.property)[0]
  2241. inData.columnWidth=newWidth
  2242. updateColumnSize(inData).then(({data}) => {
  2243. if (data.code === 0) {
  2244. console.log("栏位宽度保存成功!")
  2245. }
  2246. })
  2247. },
  2248. // 获取用户的bu
  2249. getSiteAndBuByUserName2 () {
  2250. let tempData = {
  2251. username: this.$store.state.user.name,
  2252. }
  2253. getSiteAndBuByUserName2(tempData).then(({data}) => {
  2254. if (data.code === 0) {
  2255. this.buList = data.rows
  2256. }
  2257. })
  2258. },
  2259. // 获取用户的bu
  2260. getSiteAndBuByUserName () {
  2261. let tempData = {
  2262. username: this.$store.state.user.name,
  2263. }
  2264. getSiteAndBuByUserName(tempData).then(({data}) => {
  2265. if (data.code === 0) {
  2266. this.userBuList = data.rows
  2267. }
  2268. })
  2269. },
  2270. // 页签选择替换
  2271. inventoryPartClick (tab, event) {
  2272. this.refreshInventoryPartTable()
  2273. },
  2274. // 刷新页签的table数据
  2275. refreshInventoryPartTable () {
  2276. },
  2277. clickSave () {
  2278. if (!this.attributeDialog) { // 保存
  2279. this.updateItemValue()
  2280. } else { // 编辑
  2281. this.copyAttributeList = JSON.parse(JSON.stringify(this.partItemList))
  2282. this.attributeDialog = false
  2283. }
  2284. },
  2285. /**
  2286. * 编辑物料属性
  2287. */
  2288. updateItemValue () {
  2289. this.loading = true
  2290. let tempData = {
  2291. itemList: JSON.parse(JSON.stringify(this.copyAttributeList))
  2292. }
  2293. commitItemValue(tempData).then(({data}) => {
  2294. if (data && data.code === 0) {
  2295. this.getPartItem()
  2296. this.attributeDialog = true
  2297. this.$message({
  2298. message: '操作成功',
  2299. type: 'success',
  2300. duration: 1500,
  2301. onClose: () => {}
  2302. })
  2303. } else {
  2304. this.$alert(data.msg, '错误', {
  2305. confirmButtonText: '确定'
  2306. })
  2307. }
  2308. this.loading = false
  2309. }).catch((error) => {
  2310. this.$message.error(error)
  2311. this.loading = false
  2312. })
  2313. },
  2314. /**
  2315. * 新增/删除物料属性
  2316. */
  2317. addOrDelItem () {
  2318. if (!this.attributeDialog) {
  2319. this.$message.warning('请保存属性更改!')
  2320. return
  2321. }
  2322. this.itemSelections1 = null
  2323. this.itemSelections2 = null
  2324. this.itemData.propertiesItemNo = ''
  2325. this.itemData.itemDesc = ''
  2326. let tempData = {
  2327. site: this.partCurrentRow.site,
  2328. buNo: this.partCurrentRow.buNo,
  2329. partNo: this.partCurrentRow.partNo,
  2330. codeNo: this.partCurrentRow.codeNo,
  2331. recordType: 'IP'
  2332. }
  2333. getItemLists(tempData).then(({data}) => {
  2334. this.itemList1 = data.row1
  2335. this.itemList2 = data.row2
  2336. })
  2337. this.fastAddFlag = true
  2338. },
  2339. // 可选属性
  2340. itemClickRow1 (row) {
  2341. this.$refs.itemTable1.toggleRowSelection(row)
  2342. },
  2343. // 已有属性
  2344. itemClickRow2 (row) {
  2345. this.$refs.itemTable2.toggleRowSelection(row)
  2346. },
  2347. selectionItem1 (val) {
  2348. this.itemSelections1 = val
  2349. },
  2350. selectionItem2 (val) {
  2351. this.itemSelections2 = val
  2352. },
  2353. // 物料项目新增
  2354. addItem () {
  2355. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  2356. this.$message.warning('请选择可选属性!')
  2357. return
  2358. }
  2359. let inData = {
  2360. site: this.partCurrentRow.site,
  2361. buNo: this.partCurrentRow.buNo,
  2362. partNo: this.partCurrentRow.partNo,
  2363. codeNo: this.partCurrentRow.codeNo,
  2364. codeDesc: this.partCurrentRow.codeDesc,
  2365. recordType: 'IP',
  2366. itemList: this.itemSelections1
  2367. }
  2368. addPartItem(inData).then(({data}) => {
  2369. if (data && data.code === 0) {
  2370. getItemLists(inData).then(({data}) => {
  2371. this.itemList1 = data.row1
  2372. this.itemList2 = data.row2
  2373. })
  2374. this.getPartItem()
  2375. this.itemSelections1 = []
  2376. } else {
  2377. this.$alert(data.msg, '错误', {
  2378. confirmButtonText: '确定'
  2379. })
  2380. }
  2381. })
  2382. },
  2383. // 物料项目删除
  2384. deleteItem () {
  2385. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  2386. this.$alert("请选择已有属性!", '提示', {
  2387. confirmButtonText: '确定'
  2388. })
  2389. return false
  2390. }
  2391. let inData = {
  2392. site: this.partCurrentRow.site,
  2393. buNo: this.partCurrentRow.buNo,
  2394. partNo: this.partCurrentRow.partNo,
  2395. codeNo: this.partCurrentRow.codeNo,
  2396. codeDesc: this.partCurrentRow.codeDesc,
  2397. recordType: 'IP',
  2398. itemList: this.itemSelections2
  2399. }
  2400. deletePartItem(inData).then(({data}) => {
  2401. if (data && data.code === 0) {
  2402. getItemLists(inData).then(({data}) => {
  2403. this.itemList1 = data.row1
  2404. this.itemList2 = data.row2
  2405. })
  2406. this.getPartItem()
  2407. this.itemSelections2 = []
  2408. } else {
  2409. this.$alert(data.msg, '错误', {
  2410. confirmButtonText: '确定'
  2411. })
  2412. }
  2413. })
  2414. },
  2415. // 查询物料项目
  2416. queryPartItem () {
  2417. this.itemData.partNo = this.partCurrentRow.partNo
  2418. this.itemData.codeNo = this.partCurrentRow.codeNo
  2419. this.itemData.partNo = this.partCurrentRow.partNo
  2420. queryPartItem(this.itemData).then(({data}) => {
  2421. if (data && data.code === 0) {
  2422. this.itemList1 = data.rows
  2423. } else {
  2424. this.itemList1 = []
  2425. }
  2426. })
  2427. },
  2428. // 确认修改物料属性
  2429. commitItemValue () {
  2430. let tempData = {
  2431. itemList: JSON.parse(JSON.stringify(this.updatePartItemList))
  2432. }
  2433. commitItemValue(tempData).then(({data}) => {
  2434. if (data && data.code === 0) {
  2435. this.getPartItem()
  2436. this.updateItemModelFlag = false
  2437. this.$message({
  2438. message: '操作成功',
  2439. type: 'success',
  2440. duration: 1500,
  2441. onClose: () => {}
  2442. })
  2443. } else {
  2444. this.$alert(data.msg, '错误', {
  2445. confirmButtonText: '确定'
  2446. })
  2447. }
  2448. })
  2449. },
  2450. // ======= 正则校验 =======
  2451. handleInput (value, type) {
  2452. // 大于等于0,且只能输入4位小数
  2453. let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1')
  2454. if (val === null || val === undefined || val === '') {
  2455. val = 0
  2456. }
  2457. if (type === 1) {
  2458. }
  2459. },
  2460. // ======== 分页相关方法 ========
  2461. /**
  2462. * 每页数
  2463. * @param val
  2464. */
  2465. sizeChangeHandle (val) {
  2466. this.pageSize = val
  2467. this.pageIndex = 1
  2468. this.getDataList()
  2469. },
  2470. /**
  2471. * 当前页
  2472. * @param val
  2473. */
  2474. currentChangeHandle (val) {
  2475. this.pageIndex = val
  2476. this.getDataList()
  2477. },
  2478. // ======== 页签切换相关方法 ========
  2479. /**
  2480. * 列表表格选择替换
  2481. * @param tab
  2482. * @param event
  2483. */
  2484. tabClick (tab, event) {
  2485. // 刷新列表数据
  2486. this.refreshCurrentTabTable()
  2487. },
  2488. /**
  2489. * 当前值发生变化的时候修改
  2490. * @param row
  2491. * @param oldRow
  2492. */
  2493. changeCurrentRow (row, oldRow) {
  2494. // 判断是否是获取焦点的事件
  2495. if (row) {
  2496. this.partCurrentRow = JSON.parse(JSON.stringify(row))
  2497. //刷新当前页表
  2498. this.refreshCurrentTabTable()
  2499. }
  2500. },
  2501. /**
  2502. * 刷新页签的table数据
  2503. */
  2504. refreshCurrentTabTable () {
  2505. if (this.activeTable === 'part_item') {
  2506. this.getPartItem()
  2507. } else if (this.activeTable === 'part_agent') {
  2508. this.getPartAgent()
  2509. } else if (this.activeTable === 'part_file') {
  2510. this.getFileContentData()
  2511. } else if (this.activeTable === 'part_manufacturer') {
  2512. this.getPartManufacturer()
  2513. } else if (this.activeTable === 'default_locations') {
  2514. this.getDefaultLocation()
  2515. }
  2516. },
  2517. // ======== 列表数据刷新方法 ========
  2518. /**
  2519. * 查询物料属性
  2520. */
  2521. getPartItem () {
  2522. let tempData = {
  2523. site: this.partCurrentRow.site,
  2524. buNo: this.partCurrentRow.buNo,
  2525. partNo: this.partCurrentRow.partNo,
  2526. codeNo: this.partCurrentRow.codeNo,
  2527. recordType: 'IP'
  2528. }
  2529. getPartItem(tempData).then(({data}) => {
  2530. if (data && data.code === 0) {
  2531. this.partItemList = data.rows
  2532. } else {
  2533. this.partItemList = []
  2534. }
  2535. })
  2536. },
  2537. /**
  2538. * 查询物料代理商
  2539. */
  2540. getPartAgent () {
  2541. let tempData = {
  2542. site: this.partCurrentRow.site,
  2543. buNo: this.partCurrentRow.buNo,
  2544. partNo: this.partCurrentRow.partNo,
  2545. }
  2546. getPartAgent(tempData).then(({data}) => {
  2547. if (data && data.code === 0) {
  2548. this.partAgentList = data.rows
  2549. } else {
  2550. this.partAgentList = []
  2551. }
  2552. })
  2553. },
  2554. /**
  2555. * 查询物料制造商
  2556. */
  2557. getPartManufacturer () {
  2558. let tempData = {
  2559. site: this.partCurrentRow.site,
  2560. buNo: this.partCurrentRow.buNo,
  2561. partNo: this.partCurrentRow.partNo,
  2562. }
  2563. getPartManufacturer(tempData).then(({data}) => {
  2564. if (data && data.code === 0) {
  2565. this.partManufacturerList = data.rows
  2566. } else {
  2567. this.partManufacturerList = []
  2568. }
  2569. })
  2570. },
  2571. /**
  2572. * 查询物料库位
  2573. */
  2574. getDefaultLocation () {
  2575. let tempData = {
  2576. site: this.partCurrentRow.site,
  2577. buNo: this.partCurrentRow.buNo,
  2578. partNo: this.partCurrentRow.partNo,
  2579. }
  2580. getDefaultLocation(tempData).then(({data}) => {
  2581. if (data && data.code === 0) {
  2582. this.defaultLocationList = data.rows
  2583. } else {
  2584. this.defaultLocationList = []
  2585. }
  2586. })
  2587. },
  2588. // ======== 列表数据刷新方法 ========
  2589. /**
  2590. * 获取数据列表
  2591. */
  2592. getDataList () {
  2593. this.searchData.limit = this.pageSize
  2594. this.searchData.page = this.pageIndex
  2595. partInformationSearch(this.searchData).then(({data}) => {
  2596. if (data.code === 0) {
  2597. this.dataList = data.page.list
  2598. this.pageIndex = data.page.currPage
  2599. this.pageSize = data.page.pageSize
  2600. this.totalPage = data.page.totalCount
  2601. this.$refs.selectDiv.setLengthAll(this.dataList.length)
  2602. // 判断是否全部存在数据
  2603. if (this.dataList.length > 0) {
  2604. // 设置选中行
  2605. this.$refs.partTable.setCurrentRow(this.dataList[0])
  2606. this.partClickRow(this.dataList[0])
  2607. } else {
  2608. this.partCurrentRow = {}
  2609. }
  2610. // 加载当前的页签的table
  2611. //this.refreshCurrentTabTable()
  2612. }
  2613. })
  2614. },
  2615. // ======== 新增/编辑模态框 ========
  2616. /**
  2617. * 物料信息新增模态框
  2618. */
  2619. addModal () {
  2620. this.modalData = {
  2621. flag: '1',
  2622. title: '物料新增',
  2623. site: '',
  2624. buNo: '',
  2625. bu: this.userBuList[0].buNo,
  2626. partNo: '',
  2627. partDesc: '',
  2628. umId2: '',
  2629. umName: '',
  2630. spec: '',
  2631. active: 'Y',
  2632. partType2: 'Purchased (raw)',
  2633. standardBoxQty: '',
  2634. productGroupId1: '',
  2635. productGroupName1: '',
  2636. productGroupId2: '',
  2637. productGroupName2: '',
  2638. productGroupId3: '',
  2639. productGroupName3: '',
  2640. familyID: '',
  2641. familyName: '',
  2642. partDesceEn: '',
  2643. remark: '',
  2644. codeNo: '',
  2645. codeDesc: '',
  2646. tblBaseFlag: '',
  2647. createBy: this.$store.state.user.name
  2648. }
  2649. this.inventoryPartTable = 'General'
  2650. this.modalDisableFlag = false
  2651. this.modalFlag = true
  2652. this.getPreviousPartNo()
  2653. },
  2654. // 获取上一个物料编码
  2655. getPreviousPartNo () {
  2656. let tempData = {
  2657. site: this.modalData.bu.split('_')[0],
  2658. type: 'thePreviousPartItem',
  2659. thirdType: this.modalData.bu.split('_')[1],
  2660. secondType: this.$store.state.user.name
  2661. }
  2662. getPreviousPartNo(tempData).then(({data}) => {
  2663. if (data && data.code === 0) {
  2664. this.previousPartNo = data.previousPartNo
  2665. } else {
  2666. this.previousPartNo = ''
  2667. }
  2668. })
  2669. },
  2670. /**
  2671. * 物料信息编辑模态框
  2672. * @param row
  2673. */
  2674. updateModal (row) {
  2675. this.modalData = {
  2676. flag: '2',
  2677. title: '物料编辑',
  2678. bu: row.site + '_' + row.buNo,
  2679. site: row.site,
  2680. buNo: row.buNo,
  2681. partNo: row.partNo,
  2682. partDesc: row.partDesc,
  2683. umId2: row.umId2,
  2684. umName: row.umName,
  2685. spec: row.spec,
  2686. active: row.active,
  2687. partType2: row.partType2,
  2688. standardBoxQty: row.standardBoxQty,
  2689. productGroupId1: row.productGroupId1,
  2690. productGroupName1: row.productGroupName1,
  2691. productGroupId2: row.productGroupId2,
  2692. productGroupName2: row.productGroupName2,
  2693. productGroupId3: row.productGroupId3,
  2694. productGroupName3: row.productGroupName3,
  2695. familyID: row.familyID,
  2696. familyName: row.familyName,
  2697. partDesceEn: row.partDesceEn,
  2698. remark: row.remark,
  2699. codeNo: row.codeNo,
  2700. codeDesc: row.codeDesc,
  2701. tblBaseFlag: '',
  2702. createBy: ''
  2703. }
  2704. this.inventoryPartTable = 'General'
  2705. this.modalDisableFlag = true
  2706. this.modalFlag = true
  2707. },
  2708. /**
  2709. * 选择代理商
  2710. */
  2711. getAgentList () {
  2712. // 查询所有代理商
  2713. getAgentListBy(this.agentData).then(({data}) => {
  2714. if (data && data.code === 0) {
  2715. this.agentList1 = data.rows
  2716. } else {
  2717. this.$alert(data.msg, '错误', {
  2718. confirmButtonText: '确定'
  2719. })
  2720. }
  2721. })
  2722. },
  2723. savePartAgent () {
  2724. this.agentSelections1 = null
  2725. this.agentSelections2 = null
  2726. getAgentList(this.partCurrentRow).then(({data}) => {
  2727. this.agentList1 = data.row1
  2728. this.agentList2 = data.row2
  2729. })
  2730. this.agentData = {
  2731. site: this.partCurrentRow.site,
  2732. buNo: this.partCurrentRow.buNo,
  2733. agentId: '',
  2734. agentName: '',
  2735. }
  2736. this.agentModelFlag = true
  2737. },
  2738. // 可选代理商
  2739. agentClickRow1 (row) {
  2740. this.$refs.agentTable1.toggleRowSelection(row)
  2741. },
  2742. // 已有代理商
  2743. agentClickRow2 (row) {
  2744. this.$refs.agentTable2.toggleRowSelection(row)
  2745. },
  2746. selectionAgent1 (val) {
  2747. this.agentSelections1 = val
  2748. },
  2749. selectionAgent2 (val) {
  2750. this.agentSelections2 = val
  2751. },
  2752. // 添加代理商
  2753. addAgent () {
  2754. if (this.agentSelections1 == null || this.agentSelections1.length === 0) {
  2755. this.$message.warning('请选择可选代理商!')
  2756. return
  2757. }
  2758. let inData = {
  2759. site: this.partCurrentRow.site,
  2760. buNo: this.partCurrentRow.buNo,
  2761. partNo: this.partCurrentRow.partNo,
  2762. agentList: this.agentSelections1
  2763. }
  2764. addPartAgent(inData).then(({data}) => {
  2765. if (data && data.code === 0) {
  2766. getAgentList(this.partCurrentRow).then(({data}) => {
  2767. this.agentList1 = data.row1
  2768. this.agentList2 = data.row2
  2769. })
  2770. this.agentSelections1 = []
  2771. } else {
  2772. this.$alert(data.msg, '错误', {
  2773. confirmButtonText: '确定'
  2774. })
  2775. }
  2776. })
  2777. },
  2778. // 删除物料代理商
  2779. deleteAgent () {
  2780. if(this.agentSelections2 == null || this.agentSelections2.length === 0){
  2781. this.$message.warning('请选择已有代理商!')
  2782. return
  2783. }
  2784. let inData = {
  2785. site: this.partCurrentRow.site,
  2786. buNo: this.partCurrentRow.buNo,
  2787. partNo: this.partCurrentRow.partNo,
  2788. agentList: this.agentSelections2
  2789. }
  2790. deletePartAgent(inData).then(({data}) => {
  2791. if (data && data.code === 0) {
  2792. getAgentList(this.partCurrentRow).then(({data}) => {
  2793. this.agentList1 = data.row1
  2794. this.agentList2 = data.row2
  2795. })
  2796. this.agentSelections2 = []
  2797. } else {
  2798. this.$alert(data.msg, '错误', {
  2799. confirmButtonText: '确定'
  2800. })
  2801. }
  2802. })
  2803. },
  2804. // 单删
  2805. deleteAgent2 (row) {
  2806. this.$confirm(`是否删除该代理商?`, '提示', {
  2807. confirmButtonText: '确定',
  2808. cancelButtonText: '取消',
  2809. type: 'warning'
  2810. }).then(() => {
  2811. deleteAgent(row).then(({data}) => {
  2812. if (data && data.code === 0) {
  2813. this.getPartAgent()
  2814. this.$message({
  2815. message: '操作成功',
  2816. type: 'success',
  2817. duration: 1500,
  2818. onClose: () => {}
  2819. })
  2820. } else {
  2821. this.$alert(data.msg, '错误', {
  2822. confirmButtonText: '确定'
  2823. })
  2824. }
  2825. })
  2826. }).catch(() => {
  2827. })
  2828. },
  2829. /**
  2830. * 选择制造商
  2831. */
  2832. getManufacturerList () {
  2833. // 查询所有代理商
  2834. getManufacturerListBy(this.manufacturerData).then(({data}) => {
  2835. if (data && data.code === 0) {
  2836. this.manufacturerList1 = data.rows
  2837. } else {
  2838. this.$alert(data.msg, '错误', {
  2839. confirmButtonText: '确定'
  2840. })
  2841. }
  2842. })
  2843. },
  2844. /**
  2845. * 选择默认库位
  2846. */
  2847. getLocationList () {
  2848. // 查询所有库位
  2849. getLocationListBy(this.locationData).then(({data}) => {
  2850. if (data && data.code === 0) {
  2851. this.locationList1 = data.rows
  2852. } else {
  2853. this.$alert(data.msg, '错误', {
  2854. confirmButtonText: '确定'
  2855. })
  2856. }
  2857. })
  2858. },
  2859. savePartManufacturer () {
  2860. this.manufacturerSelections1 = null
  2861. this.manufacturerSelections2 = null
  2862. getManufacturerList(this.partCurrentRow).then(({data}) => {
  2863. this.manufacturerList1 = data.row1
  2864. this.manufacturerList2 = data.row2
  2865. })
  2866. this.manufacturerData = {
  2867. site: this.partCurrentRow.site,
  2868. buNo: this.partCurrentRow.buNo,
  2869. manufacturerId: '',
  2870. manufacturerName: '',
  2871. }
  2872. this.manufacturerModelFlag = true
  2873. },
  2874. // 可选制造商
  2875. manufacturerClickRow1 (row) {
  2876. this.$refs.manufacturerTable1.toggleRowSelection(row)
  2877. },
  2878. // 已有制造商
  2879. manufacturerClickRow2 (row) {
  2880. this.$refs.manufacturerTable2.toggleRowSelection(row)
  2881. },
  2882. selectionManufacturer1 (val) {
  2883. this.manufacturerSelections1 = val
  2884. },
  2885. selectionManufacturer2 (val) {
  2886. this.manufacturerSelections2 = val
  2887. },
  2888. // 添加制造商
  2889. addManufacturer () {
  2890. if (this.manufacturerSelections1 == null || this.manufacturerSelections1.length === 0) {
  2891. this.$message.warning('请选择可选制造商!')
  2892. return
  2893. }
  2894. let inData = {
  2895. site: this.partCurrentRow.site,
  2896. buNo: this.partCurrentRow.buNo,
  2897. partNo: this.partCurrentRow.partNo,
  2898. manufacturerList: this.manufacturerSelections1
  2899. }
  2900. addPartManufacturer(inData).then(({data}) => {
  2901. if (data && data.code === 0) {
  2902. getManufacturerList(this.partCurrentRow).then(({data}) => {
  2903. this.manufacturerList1 = data.row1
  2904. this.manufacturerList2 = data.row2
  2905. })
  2906. this.manufacturerSelections1 = []
  2907. } else {
  2908. this.$alert(data.msg, '错误', {
  2909. confirmButtonText: '确定'
  2910. })
  2911. }
  2912. })
  2913. },
  2914. // 删除物料制造商
  2915. deleteManufacturer () {
  2916. if (this.manufacturerSelections2 == null || this.manufacturerSelections2.length === 0) {
  2917. this.$message.warning('请选择已有制造商!')
  2918. return
  2919. }
  2920. let inData = {
  2921. site: this.partCurrentRow.site,
  2922. buNo: this.partCurrentRow.buNo,
  2923. partNo: this.partCurrentRow.partNo,
  2924. manufacturerList: this.manufacturerSelections2
  2925. }
  2926. deletePartManufacturer(inData).then(({data}) => {
  2927. if (data && data.code === 0) {
  2928. getManufacturerList(this.partCurrentRow).then(({data}) => {
  2929. this.manufacturerList1 = data.row1
  2930. this.manufacturerList2 = data.row2
  2931. })
  2932. this.manufacturerSelections2 = []
  2933. } else {
  2934. this.$alert(data.msg, '错误', {
  2935. confirmButtonText: '确定'
  2936. })
  2937. }
  2938. })
  2939. },
  2940. // 单删
  2941. deleteManufacturer2 (row) {
  2942. this.$confirm(`是否删除该制造商?`, '提示', {
  2943. confirmButtonText: '确定',
  2944. cancelButtonText: '取消',
  2945. type: 'warning'
  2946. }).then(() => {
  2947. deleteManufacturer(row).then(({data}) => {
  2948. if (data && data.code === 0) {
  2949. this.getPartManufacturer()
  2950. this.$message({
  2951. message: '操作成功',
  2952. type: 'success',
  2953. duration: 1500,
  2954. onClose: () => {}
  2955. })
  2956. } else {
  2957. this.$alert(data.msg, '错误', {
  2958. confirmButtonText: '确定'
  2959. })
  2960. }
  2961. })
  2962. }).catch(() => {
  2963. })
  2964. },
  2965. saveDefaultLocation () {
  2966. this.locationSelections1 = null
  2967. this.locationSelections2 = null
  2968. getLocationList(this.partCurrentRow).then(({data}) => {
  2969. this.locationList1 = data.row1
  2970. this.locationList2 = data.row2
  2971. })
  2972. this.locationData = {
  2973. site: this.partCurrentRow.site,
  2974. buNo: this.partCurrentRow.buNo,
  2975. locationId: '',
  2976. locationName: '',
  2977. }
  2978. this.locationModelFlag = true
  2979. },
  2980. // 可选库位
  2981. locationClickRow1 (row) {
  2982. this.$refs.locationTable1.toggleRowSelection(row)
  2983. },
  2984. // 已有库位
  2985. locationClickRow2 (row) {
  2986. this.$refs.locationTable2.toggleRowSelection(row)
  2987. },
  2988. selectionLocation1 (val) {
  2989. this.locationSelections1 = val
  2990. },
  2991. selectionLocation2 (val) {
  2992. this.locationSelections2 = val
  2993. },
  2994. // 添加库位
  2995. addLocation () {
  2996. if (this.locationSelections1 == null || this.locationSelections1.length === 0) {
  2997. this.$message.warning('请选择可选库位!')
  2998. return
  2999. }
  3000. let inData = {
  3001. site: this.partCurrentRow.site,
  3002. buNo: this.partCurrentRow.buNo,
  3003. partNo: this.partCurrentRow.partNo,
  3004. locationList: this.locationSelections1
  3005. }
  3006. addDefaultLocation(inData).then(({data}) => {
  3007. if (data && data.code === 0) {
  3008. getLocationList(this.partCurrentRow).then(({data}) => {
  3009. this.locationList1 = data.row1
  3010. this.locationList2 = data.row2
  3011. })
  3012. this.locationSelections1 = []
  3013. } else {
  3014. this.$alert(data.msg, '错误', {
  3015. confirmButtonText: '确定'
  3016. })
  3017. }
  3018. })
  3019. },
  3020. // 删除库位
  3021. deleteLocation () {
  3022. if (this.locationSelections2 == null || this.locationSelections2.length === 0) {
  3023. this.$message.warning('请选择已有库位!')
  3024. return
  3025. }
  3026. let inData = {
  3027. site: this.partCurrentRow.site,
  3028. buNo: this.partCurrentRow.buNo,
  3029. partNo: this.partCurrentRow.partNo,
  3030. locationList: this.locationSelections2
  3031. }
  3032. deleteDefaultLocation(inData).then(({data}) => {
  3033. if (data && data.code === 0) {
  3034. getLocationList(this.partCurrentRow).then(({data}) => {
  3035. this.locationList1 = data.row1
  3036. this.locationList2 = data.row2
  3037. })
  3038. this.locationSelections2 = []
  3039. } else {
  3040. this.$alert(data.msg, '错误', {
  3041. confirmButtonText: '确定'
  3042. })
  3043. }
  3044. })
  3045. },
  3046. // 单删
  3047. deleteLocation2 (row) {
  3048. this.$confirm(`是否删除该库位?`, '提示', {
  3049. confirmButtonText: '确定',
  3050. cancelButtonText: '取消',
  3051. type: 'warning'
  3052. }).then(() => {
  3053. deleteLocation(row).then(({data}) => {
  3054. if (data && data.code === 0) {
  3055. this.getDefaultLocation()
  3056. this.$message({
  3057. message: '操作成功',
  3058. type: 'success',
  3059. duration: 1500,
  3060. onClose: () => {}
  3061. })
  3062. } else {
  3063. this.$alert(data.msg, '错误', {
  3064. confirmButtonText: '确定'
  3065. })
  3066. }
  3067. })
  3068. }).catch(() => {
  3069. })
  3070. },
  3071. // 关闭后刷新列表
  3072. refreshDetailList () {
  3073. this.getPartAgent()
  3074. this.getPartManufacturer()
  3075. this.getDefaultLocation()
  3076. },
  3077. // ======== 新增/编辑/删除方法 ========
  3078. /**
  3079. * 物料信息新增/编辑
  3080. */
  3081. saveData () {
  3082. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  3083. this.$message.warning('请填写物料描述!')
  3084. return
  3085. }
  3086. if (this.modalData.bu === '' || this.modalData.bu == null) {
  3087. this.$message.warning('请选择BU!')
  3088. return
  3089. }
  3090. if (this.modalData.umId2 === '' || this.modalData.umId2 == null) {
  3091. this.$message.warning('请选择计量单位!')
  3092. return
  3093. }
  3094. if (this.modalData.tblBaseFlag === 'Y' && this.modalData.codeNo === '') {
  3095. this.$message.warning('请选择属性模板!')
  3096. return
  3097. }
  3098. if (this.modalData.flag === '1') {
  3099. partInformationSave(this.modalData).then(({data}) => {
  3100. if (data && data.code === 0) {
  3101. this.searchData.partNo = data.partNo
  3102. this.getDataList()
  3103. this.modalFlag = false
  3104. this.$message({
  3105. message: '操作成功',
  3106. type: 'success',
  3107. duration: 1500,
  3108. onClose: () => {}
  3109. })
  3110. } else {
  3111. this.$alert(data.msg, '错误', {
  3112. confirmButtonText: '确定'
  3113. })
  3114. }
  3115. })
  3116. } else {
  3117. partInformationEdit(this.modalData).then(({data}) => {
  3118. if (data && data.code === 0) {
  3119. this.getDataList()
  3120. this.modalFlag = false
  3121. this.$message({
  3122. message: '操作成功',
  3123. type: 'success',
  3124. duration: 1500,
  3125. onClose: () => {}
  3126. })
  3127. } else {
  3128. this.$alert(data.msg, '错误', {
  3129. confirmButtonText: '确定'
  3130. })
  3131. }
  3132. })
  3133. }
  3134. },
  3135. /**
  3136. * 物料信息删除
  3137. */
  3138. delModal () {
  3139. if (this.partSelections.length === 0) {
  3140. this.$message.warning('请勾选要删除的物料信息!')
  3141. return
  3142. }
  3143. this.$confirm(`是否删除这 `+ this.partSelections.length +` 条物料信息?`, '提示', {
  3144. confirmButtonText: '确定',
  3145. cancelButtonText: '取消',
  3146. type: 'warning'
  3147. }).then(() => {
  3148. let tempData = {
  3149. informationList: this.partSelections
  3150. }
  3151. partInformationDelete(tempData).then(({data}) => {
  3152. if (data && data.code === 0) {
  3153. this.getDataList()
  3154. this.partSelections = []
  3155. this.$message({
  3156. message: '操作成功',
  3157. type: 'success',
  3158. duration: 1500,
  3159. onClose: () => {}
  3160. })
  3161. } else {
  3162. this.$alert(data.msg, '错误', {
  3163. confirmButtonText: '确定'
  3164. })
  3165. }
  3166. })
  3167. }).catch(() => {
  3168. })
  3169. },
  3170. // 复制物料的模态框
  3171. toCopyPartModal () {
  3172. this.copyPartData = {
  3173. site: this.modalData.site,
  3174. buNo: this.modalData.buNo,
  3175. partNo: this.modalData.partNo,
  3176. partDesc: this.modalData.partDesc,
  3177. copyGeneral: 'Y',
  3178. copyCosts: '',
  3179. copyPlanningData: '',
  3180. copyManufacturing: '',
  3181. copyDefaultLocation: '',
  3182. copyRevision: '',
  3183. previousVersion: this.modalData,
  3184. createBy: this.$store.state.user.name
  3185. }
  3186. this.copyPartModelFlag = true
  3187. },
  3188. // 复制物料的方法
  3189. copyPart () {
  3190. if (this.copyPartData.partNo === '' || this.copyPartData.partNo == null) {
  3191. this.$message.warning('请输入物料编码!')
  3192. return
  3193. }
  3194. if (this.copyPartData.partDesc === '' || this.copyPartData.partDesc == null) {
  3195. this.$message.warning('请输入物料名称!')
  3196. return
  3197. }
  3198. if (this.copyPartData.copyGeneral === '' || this.copyPartData.copyGeneral == null) {
  3199. this.$message.warning('General信息必选!')
  3200. return
  3201. }
  3202. copyPart(this.copyPartData).then(({data}) => {
  3203. if (data && data.code === 0) {
  3204. this.getDataList()
  3205. this.copyPartModelFlag = false
  3206. this.$message({
  3207. message: '操作成功',
  3208. type: 'success',
  3209. duration: 1500,
  3210. onClose: () => {}
  3211. })
  3212. } else {
  3213. this.$alert(data.msg, '错误', {
  3214. confirmButtonText: '确定'
  3215. })
  3216. }
  3217. })
  3218. },
  3219. // ======== 列表操作方法 ========
  3220. /**
  3221. * 单机选中物料信息
  3222. * @param row
  3223. */
  3224. partClickRow (row,column) {
  3225. this.partCurrentRow = JSON.parse(JSON.stringify(row))
  3226. },
  3227. /**
  3228. * 复选物料信息
  3229. * @param val
  3230. */
  3231. selectionPart (val) {
  3232. this.partSelections = val
  3233. this.$refs.selectDiv.setLengthselected(this.partSelections.length)
  3234. },
  3235. // ======== 附件的相关方法 ========
  3236. /**
  3237. * 获取物料附件列表
  3238. */
  3239. getFileContentData () {
  3240. let currentData = {
  3241. orderRef1: this.partCurrentRow.site,
  3242. orderRef2: this.partCurrentRow.partNo,
  3243. orderRef3: 'part',
  3244. orderRef4: this.partCurrentRow.buNo,
  3245. }
  3246. getFileContentList(currentData).then(({data}) => {
  3247. if (data && data.code === 200) {
  3248. this.fileContentList = data.rows
  3249. } else {
  3250. this.fileContentList = []
  3251. }
  3252. })
  3253. },
  3254. /**
  3255. * 上传文件
  3256. */
  3257. uploadFile () {
  3258. let currentData = {
  3259. titleCon: '物料附件上传',
  3260. site: this.partCurrentRow.site,
  3261. buNo: this.partCurrentRow.buNo,
  3262. createBy: this.$store.state.user.name,
  3263. partNo: this.partCurrentRow.partNo,
  3264. folder: 'part'
  3265. }
  3266. this.uploadDialog = true
  3267. // 打开组件去做新增业务
  3268. this.$nextTick(() => {
  3269. this.$refs.partUploadFile.init(currentData);
  3270. })
  3271. },
  3272. /**
  3273. * 文件删除
  3274. * @param row
  3275. */
  3276. deleteFile (row) {
  3277. this.$confirm('确定要删除此文件?', '提示', {
  3278. confirmButtonText: '确定',
  3279. cancelButtonText: '取消',
  3280. type: 'warning'
  3281. }).then(() => {
  3282. deleteObjectFile(row).then(({data}) => {
  3283. if (data && data.code === 0) {
  3284. this.getFileContentData()
  3285. this.$message({
  3286. message: '操作成功',
  3287. type: 'success',
  3288. duration: 1500,
  3289. onClose: () => {}
  3290. })
  3291. } else {
  3292. this.$alert(data.msg, '错误', {
  3293. confirmButtonText: '确定'
  3294. })
  3295. }
  3296. })
  3297. }).catch(() => {
  3298. })
  3299. },
  3300. /**
  3301. * 文件下载
  3302. * @param row
  3303. */
  3304. downloadFile (row) {
  3305. downLoadObjectFile(row).then(({data}) => {
  3306. // 不限制文件下载类型
  3307. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  3308. // 下载文件名称
  3309. const fileName = row.fileName
  3310. // a标签下载
  3311. const linkNode = document.createElement('a')
  3312. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  3313. linkNode.style.display = 'none'
  3314. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  3315. document.body.appendChild(linkNode)
  3316. linkNode.click() // 模拟在按钮上的一次鼠标单击
  3317. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  3318. document.body.removeChild(linkNode)
  3319. })
  3320. },
  3321. // 预览
  3322. previewFile (row) {
  3323. // 预览文件
  3324. let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
  3325. let type = ''
  3326. if (image.includes(row.fileType.toLowerCase())) {
  3327. type = 'image/' + row.fileType
  3328. }
  3329. let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']
  3330. if (video.includes(row.fileType.toLowerCase())) {
  3331. type = 'video/' + row.fileType
  3332. }
  3333. let txt = ['txt']
  3334. if (txt.includes(row.fileType.toLowerCase())) {
  3335. type = 'text/plain'
  3336. }
  3337. let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
  3338. if (office.includes(row.fileType.toLowerCase())) {
  3339. this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
  3340. return
  3341. }
  3342. let pdf = ['pdf']
  3343. if (pdf.includes(row.fileType.toLowerCase())) {
  3344. type = 'application/pdf'
  3345. }
  3346. if (type === ''){
  3347. this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
  3348. return;
  3349. }
  3350. downLoadObjectFile(row).then(({data}) => {
  3351. const blob = new Blob([data], { type: type });
  3352. // 创建URL来生成预览
  3353. const fileURL = URL.createObjectURL(blob);
  3354. // 在新标签页中打开文件预览
  3355. const newTab = window.open(fileURL, '_blank')
  3356. })
  3357. },
  3358. // 计量单位输入校验
  3359. umIdBlur (tagNo) {
  3360. if (this.modalData.umId2 != null && this.modalData.umId2 !== '') {
  3361. let tempData = {
  3362. tagno: tagNo,
  3363. conditionSql: " and UMID = '" + this.modalData.umId2 + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'"
  3364. }
  3365. verifyData(tempData).then(({data}) => {
  3366. if (data && data.code === 0) {
  3367. if (data.baseListData.length > 0) {
  3368. this.modalData.umId2 = data.baseListData[0].UMID
  3369. this.modalData.umName = data.baseListData[0].UMName
  3370. return
  3371. }
  3372. }
  3373. })
  3374. }
  3375. this.modalData.umName = ''
  3376. },
  3377. // 商品组1输入校验
  3378. productGroupId1Blur (tagNo) {
  3379. if (this.modalData.productGroupId1 != null && this.modalData.productGroupId1 !== '') {
  3380. let tempData = {
  3381. tagno: tagNo,
  3382. conditionSql: " and product_group_id = '" + this.modalData.productGroupId1 + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
  3383. }
  3384. verifyData(tempData).then(({data}) => {
  3385. if (data && data.code === 0) {
  3386. if (data.baseListData.length > 0) {
  3387. this.modalData.productGroupId1 = data.baseListData[0].product_group_id
  3388. this.modalData.productGroupName1 = data.baseListData[0].product_group_name
  3389. return
  3390. }
  3391. }
  3392. })
  3393. }
  3394. this.modalData.productGroupName1 = ''
  3395. },
  3396. // 商品组2输入校验
  3397. productGroupId2Blur (tagNo) {
  3398. if (this.modalData.productGroupId2 != null && this.modalData.productGroupId2 !== '') {
  3399. let tempData = {
  3400. tagno: tagNo,
  3401. conditionSql: " and product_group_id = '" + this.modalData.productGroupId2 + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
  3402. }
  3403. verifyData(tempData).then(({data}) => {
  3404. if (data && data.code === 0) {
  3405. if (data.baseListData.length > 0) {
  3406. this.modalData.productGroupId2 = data.baseListData[0].product_group_id
  3407. this.modalData.productGroupName2 = data.baseListData[0].product_group_name
  3408. return
  3409. }
  3410. }
  3411. })
  3412. }
  3413. this.modalData.productGroupName2 = ''
  3414. },
  3415. // 商品组3输入校验
  3416. productGroupId3Blur (tagNo) {
  3417. if (this.modalData.productGroupId3 != null && this.modalData.productGroupId3 !== '') {
  3418. let tempData = {
  3419. tagno: tagNo,
  3420. conditionSql: " and product_group_id = '" + this.modalData.productGroupId3 + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
  3421. }
  3422. verifyData(tempData).then(({data}) => {
  3423. if (data && data.code === 0) {
  3424. if (data.baseListData.length > 0) {
  3425. this.modalData.productGroupId3 = data.baseListData[0].product_group_id
  3426. this.modalData.productGroupName3 = data.baseListData[0].product_group_name
  3427. return
  3428. }
  3429. }
  3430. })
  3431. }
  3432. this.modalData.productGroupName3 = ''
  3433. },
  3434. // 物料分类输入校验
  3435. partFamilyBlur (tagNo) {
  3436. if (this.modalData.familyID != null && this.modalData.familyID !== '') {
  3437. let tempData = {
  3438. tagno: tagNo,
  3439. conditionSql: " and family_id = '" + this.modalData.familyID + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
  3440. }
  3441. verifyData(tempData).then(({data}) => {
  3442. if (data && data.code === 0) {
  3443. if (data.baseListData.length > 0) {
  3444. this.modalData.familyID = data.baseListData[0].family_id
  3445. this.modalData.familyName = data.baseListData[0].family_name
  3446. return
  3447. }
  3448. }
  3449. })
  3450. }
  3451. this.modalData.familyName = ''
  3452. },
  3453. // 属性输入校验
  3454. modelBlur (tagNo) {
  3455. if (this.modalData.codeNo != null && this.modalData.codeNo !== '') {
  3456. let tempData = {
  3457. tagno: tagNo,
  3458. conditionSql: " and code_no = '" + this.modalData.codeNo + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
  3459. }
  3460. verifyData(tempData).then(({data}) => {
  3461. if (data && data.code === 0) {
  3462. if (data.baseListData.length > 0) {
  3463. this.modalData.codeNo = data.baseListData[0].code_no
  3464. this.modalData.codeDesc = data.baseListData[0].code_desc
  3465. return
  3466. }
  3467. }
  3468. })
  3469. }
  3470. this.modalData.codeDesc = ''
  3471. },
  3472. // ======== chooseList相关方法 ========
  3473. /**
  3474. * 获取基础数据列表S
  3475. * @param val
  3476. * @param type
  3477. */
  3478. getBaseList (val, type) {
  3479. this.tagNo = val
  3480. this.tempCodeNo = this.modalData.codeNo
  3481. this.$nextTick(() => {
  3482. let strVal = ''
  3483. let conSql = ''
  3484. if (this.modalData.bu === null || this.modalData.bu === '') {
  3485. this.$message.warning("请选择BU!")
  3486. return
  3487. } else {
  3488. conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
  3489. }
  3490. if (val === 510) {
  3491. strVal = this.modalData.umId2
  3492. conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'"
  3493. } else if (val === 211) {
  3494. strVal = this.modalData.productGroupId1
  3495. } else if (val === 212) {
  3496. strVal = this.modalData.productGroupId2
  3497. } else if (val === 213) {
  3498. strVal = this.modalData.productGroupId3
  3499. } else if (val === 214) {
  3500. strVal = this.modalData.familyID
  3501. } else if (val === 219) {
  3502. strVal = this.modalData.codeNo
  3503. }
  3504. this.$refs.baseList.init(val, strVal, conSql)
  3505. })
  3506. },
  3507. /**
  3508. * 列表方法的回调
  3509. * @param val
  3510. */
  3511. getBaseData (val) {
  3512. if (this.tagNo === 510) {
  3513. this.modalData.umId2 = val.UMID
  3514. this.modalData.umName = val.UMName
  3515. } else if (this.tagNo === 211) {
  3516. this.modalData.productGroupId1 = val.product_group_id
  3517. this.modalData.productGroupName1 = val.product_group_name
  3518. } else if (this.tagNo === 212) {
  3519. this.modalData.productGroupId2 = val.product_group_id
  3520. this.modalData.productGroupName2 = val.product_group_name
  3521. } else if (this.tagNo === 213) {
  3522. this.modalData.productGroupId3 = val.product_group_id
  3523. this.modalData.productGroupName3 = val.product_group_name
  3524. } else if (this.tagNo === 214) {
  3525. this.modalData.familyID = val.family_id
  3526. this.modalData.familyName = val.family_name
  3527. } else if (this.tagNo === 219) {
  3528. if (this.modalData.flag === '2') {
  3529. if (val.code_no != this.tempCodeNo) {
  3530. this.$confirm(`更换属性模板将替换下方物料属性数据,请确认?`, '提示', {
  3531. confirmButtonText: '确定',
  3532. cancelButtonText: '取消',
  3533. type: 'warning'
  3534. }).then(() => {
  3535. this.modalData.codeNo = val.code_no
  3536. this.$set(this.modalData, 'codeDesc', val.code_desc)
  3537. }).catch(() => {
  3538. })
  3539. }
  3540. } else {
  3541. this.modalData.codeNo = val.code_no
  3542. this.$set(this.modalData, 'codeDesc', val.code_desc)
  3543. }
  3544. }
  3545. },
  3546. // ======== 导出相关方法 ========
  3547. /**
  3548. * 导出excel
  3549. */
  3550. async createExportData () {
  3551. this.searchData.limit = -1
  3552. this.searchData.page = 1
  3553. await partInformationSearch(this.searchData).then(({data}) => {
  3554. this.resultList = data.page.list
  3555. })
  3556. return this.resultList
  3557. },
  3558. startDownload () {},
  3559. finishDownload () {},
  3560. fields () {
  3561. let json = '{'
  3562. this.columnList.forEach((item, index) => {
  3563. if (index == this.columnList.length - 1) {
  3564. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  3565. } else {
  3566. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  3567. }
  3568. })
  3569. json += '}'
  3570. let s = eval('(' + json + ')')
  3571. return s
  3572. },
  3573. toMenu (type,row) {
  3574. let path = '';
  3575. if (type === 'Routing'){
  3576. path = 'routing'
  3577. }else if (type === 'BOM'){
  3578. path = 'bom'
  3579. }
  3580. this.$router.push({name:`part-${path}Management`,params:{partNo:row.partNo},})
  3581. },
  3582. rowStyle ({row}) {
  3583. if (this.partCurrentRow.partNo === row.partNo) {
  3584. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  3585. }
  3586. },
  3587. // 动态列开始 获取 用户保存的 格式列
  3588. async getTableUserColumn(tableId, columnId) {
  3589. let queryTableUser = {
  3590. userId: this.$store.state.user.name,
  3591. functionId: this.$route.meta.menuId,
  3592. tableId: tableId,
  3593. status: true,
  3594. languageCode: this.$i18n.locale
  3595. }
  3596. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  3597. if (data.rows.length > 0) {
  3598. switch (columnId) {
  3599. case 1:
  3600. this.columnList = data.rows
  3601. break;
  3602. }
  3603. } else {
  3604. this.getColumnList(tableId, columnId)
  3605. }
  3606. })
  3607. },
  3608. // 获取 tableDefault 列
  3609. async getColumnList (tableId, columnId) {
  3610. let queryTable= {
  3611. functionId: this.$route.meta.menuId,
  3612. tableId: tableId,
  3613. languageCode: this.$i18n.locale
  3614. }
  3615. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  3616. if (!data.rows.length === 0) {
  3617. switch (columnId) {
  3618. case 1:
  3619. this.columnList = data.rows
  3620. break;
  3621. }
  3622. }
  3623. })
  3624. },
  3625. //获取按钮的权限数据
  3626. getButtonAuthData () {
  3627. let searchFlag = this.isAuth(this.menuId+":search")
  3628. let saveFlag = this.isAuth(this.menuId+":save")
  3629. let updateFlag = this.isAuth(this.menuId+":update")
  3630. let deleteFlag = this.isAuth(this.menuId+":delete")
  3631. //处理页面的权限数据
  3632. this.authSearch = !searchFlag
  3633. this.authSave = !saveFlag
  3634. this.authUpdate = !updateFlag
  3635. this.authDelete = !deleteFlag
  3636. },
  3637. }
  3638. }
  3639. </script>
  3640. <style scoped lang="scss">
  3641. /deep/ .customer-tab .el-tabs__content {
  3642. padding: 0px !important;
  3643. }
  3644. ///deep/ .customer-tab .el-tabs__content {
  3645. //
  3646. //}
  3647. .el-table /deep/ .cell{
  3648. height: auto;
  3649. line-height: 1.5;
  3650. }
  3651. </style>