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.

3650 lines
124 KiB

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