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.

3542 lines
119 KiB

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