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.

3667 lines
126 KiB

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