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.

1856 lines
62 KiB

2 years ago
​
​
2 years ago
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
2 years ago
2 years ago
2 years ago
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
2 years ago
​
2 years ago
​
​
2 years ago
2 years ago
​
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
2 years ago
​
​
​
​
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
​
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
​
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
2 years ago
2 years ago
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
​
2 years ago
​
2 years ago
​
​
2 years ago
​
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
2 years ago
​
​
​
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
​
​
2 years ago
​
2 years ago
​
​
2 years ago
2 years ago
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
2 years ago
​
​
​
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
​
​
2 years ago
​
​
​
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
2 years ago
​
2 years ago
​
2 years ago
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
2 years ago
​
​
​
​
2 years ago
​
2 years ago
​
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
​
2 years ago
2 years ago
​
​
​
​
​
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
​
2 years ago
2 years ago
​
​
​
2 years ago
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
2 years ago
2 years ago
​
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
2 years ago
2 years ago
​
​
2 years ago
​
2 years ago
​
​
​
2 years ago
​
2 years ago
​
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
​
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
2 years ago
​
2 years ago
​
2 years ago
2 years ago
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
2 years ago
​
2 years ago
2 years ago
2 years ago
2 years ago
​
2 years ago
2 years ago
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
2 years ago
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
2 years ago
​
​
2 years ago
  1. <script>
  2. import {
  3. downLoadObjectFile, getProvisionalDataList, provisionalDataAlterHandle,
  4. queryFileId,
  5. removeExternalPart,
  6. saveExternalPart, savePartInfoByExcel,
  7. selectExternalPartList, selectExternalPartPage,
  8. selectUnitList,
  9. updateExternalPart,
  10. verifyData
  11. } from '../../../api/part/external'
  12. import Chooselist from '@/views/modules/common/Chooselist_eam'
  13. import dayjs from 'dayjs'
  14. import PictureModule from './picture/picture.vue'
  15. import LinkedCustomer from './customer/linkedCustomer.vue'
  16. import {getExternalPartCustomerList} from '../../../api/part/externalPartCustomer'
  17. import {getExternalPartPictureList} from '../../../api/part/externalPartPicture'
  18. import LinkedManufacturer from './manufacturer/linkedManufacturer.vue'
  19. import {getExternalPartManufacturerList} from '../../../api/part/externalPartManufacturer'
  20. import {getTableDefaultListLanguage, getTableUserListLanguage} from '../../../api/table'
  21. import {Decimal} from 'decimal.js'
  22. import {getCategoryList} from '../../../api/category/category'
  23. import {countryList} from '../../../api/dict/country'
  24. import {getSiteDetail} from '../../../api/factory/site'
  25. import LabelTemplate from './template/labelTemplate.vue'
  26. let part = {
  27. site: '',
  28. partNo: '',
  29. partDesc: '',
  30. umId: '',
  31. freeInfo: '',
  32. freeInfo2: '',
  33. rev: '',
  34. active: '',
  35. tradingMark: 'N',
  36. packingWeight: undefined,
  37. weightUmId: undefined,
  38. moldCode: '',
  39. category: '',
  40. qtyPerCarton: 0,
  41. qtyPerRoll: 0,
  42. rollsPerCarton: 0,
  43. printStr1: '',
  44. printStr2: '',
  45. printStr3: '',
  46. rollLabelFlag: 'Y',
  47. }
  48. export default {
  49. name: 'ExternalPart',
  50. components: {LabelTemplate, LinkedManufacturer, LinkedCustomer, PictureModule,Chooselist},
  51. props: {
  52. height: {
  53. type: Number,
  54. default: 310
  55. },
  56. ofComponents: {
  57. type: Boolean,
  58. default: false
  59. }
  60. },
  61. data(){
  62. return{
  63. // 导出
  64. exportData: [],
  65. exportName: 'Part Info' + this.dayjs().format('YYYYMMDDHHmmss'),
  66. exportHeader: [],
  67. exportFooter: [],
  68. resultList: [],
  69. // 导入
  70. visible: false,
  71. fileList: [],
  72. provisionalDataVisible: false,
  73. provisionalDataList: [],
  74. isLoading: false,
  75. isLoading2: false,
  76. isLoading3: false,
  77. no: 1,
  78. size: 50,
  79. total: 0,
  80. part: {
  81. ...part
  82. },
  83. savePart: {
  84. ...part,
  85. active: 'Y',
  86. },
  87. tempData:{
  88. orderRef1: 'partInfo',
  89. orderRef2: 'partInfoFormat',
  90. site: this.$store.state.user.site,
  91. siteName: this.$store.state.user.siteName,
  92. },
  93. partCategoryList: [],
  94. category: {},
  95. partRules: {
  96. partNo: [{required: true, message: 'Please input Part No', trigger: ['blur', 'change']}],
  97. partDesc: [{required: true, message: 'Please input Part Description', trigger: ['blur', 'change']}],
  98. umId: [{required: true, message: 'Please select UM', trigger: ['blur', 'change']}],
  99. rev: [{required: true, message: 'Please select Rev No', trigger: ['blur', 'change']}],
  100. moldCode: [{required: true, message: 'Please select Mold Code', trigger: ['blur', 'change']}],
  101. qtyPerCarton: [{required: true, message: 'Please input Qty Per Carton', trigger: ['blur', 'change']}],
  102. qtyPerRoll: [{required: true, message: 'Please input Qty Per Roll', trigger: ['blur', 'change']}],
  103. rollsPerCarton: [{required: true, message: 'Please input Rolls Per Carton', trigger: ['blur', 'change']}],
  104. freeInfo2: [{required: true, message: 'Please select OOC', trigger: ['blur', 'change']}],
  105. },
  106. savePartVisible: false,
  107. partTableLoading: false,
  108. partList: [],
  109. unitList: [],
  110. columnList: [
  111. {
  112. userId: this.$store.state.user.name,
  113. functionId: 10002,
  114. serialNumber: '10002TablePartNo',
  115. tableId: '10002Table',
  116. tableName: 'Part Table',
  117. columnProp: 'partNo',
  118. headerAlign: 'center',
  119. align: 'left',
  120. columnLabel: 'Part No',
  121. columnHidden: false,
  122. columnImage: false,
  123. columnSortable: false,
  124. sortLv: 10,
  125. status: true,
  126. fixed: '',
  127. columnWidth: 80
  128. }, {
  129. userId: this.$store.state.user.name,
  130. functionId: 10002,
  131. serialNumber: '10002TablePartDesc',
  132. tableId: '10002Table',
  133. tableName: 'Part Table',
  134. columnProp: 'partDesc',
  135. headerAlign: 'center',
  136. align: 'left',
  137. columnLabel: 'Part Description',
  138. columnHidden: false,
  139. columnImage: false,
  140. columnSortable: false,
  141. sortLv: 10,
  142. status: true,
  143. fixed: '',
  144. columnWidth: 140
  145. }, {
  146. userId: this.$store.state.user.name,
  147. functionId: 10002,
  148. serialNumber: '10002TableRev',
  149. tableId: '10002Table',
  150. tableName: 'Part Table',
  151. columnProp: 'rev',
  152. headerAlign: 'center',
  153. align: 'left',
  154. columnLabel: 'REV No',
  155. columnHidden: false,
  156. columnImage: false,
  157. columnSortable: false,
  158. sortLv: 10,
  159. status: true,
  160. fixed: '',
  161. columnWidth: 80
  162. }, {
  163. userId: this.$store.state.user.name,
  164. functionId: 10002,
  165. serialNumber: '10002TableCategory',
  166. tableId: '10002Table',
  167. tableName: 'Part Table',
  168. columnProp: 'category',
  169. headerAlign: 'center',
  170. align: 'left',
  171. columnLabel: 'Part Category',
  172. columnHidden: false,
  173. columnImage: false,
  174. columnSortable: false,
  175. sortLv: 10,
  176. status: true,
  177. fixed: '',
  178. columnWidth: 140
  179. },
  180. {
  181. userId: this.$store.state.user.name,
  182. functionId: 10002,
  183. serialNumber: '10002TableUmName',
  184. tableId: '10002Table',
  185. tableName: 'Part Table',
  186. columnProp: 'moldCode',
  187. headerAlign: 'center',
  188. align: 'left',
  189. columnLabel: 'Mold Code',
  190. columnHidden: false,
  191. columnImage: false,
  192. columnSortable: false,
  193. sortLv: 10,
  194. status: true,
  195. fixed: '',
  196. columnWidth: 80
  197. }, {
  198. userId: this.$store.state.user.name,
  199. functionId: 10002,
  200. serialNumber: '10002TableUmName',
  201. tableId: '10002Table',
  202. tableName: 'Part Table',
  203. columnProp: 'manufacturer',
  204. headerAlign: 'center',
  205. align: 'left',
  206. columnLabel: 'Manufacturer',
  207. columnHidden: false,
  208. columnImage: false,
  209. columnSortable: false,
  210. sortLv: 10,
  211. status: true,
  212. fixed: '',
  213. columnWidth: 120
  214. }, {
  215. userId: this.$store.state.user.name,
  216. functionId: 10002,
  217. serialNumber: '10002TableUmName',
  218. tableId: '10002Table',
  219. tableName: 'Part Table',
  220. columnProp: 'umName',
  221. headerAlign: 'center',
  222. align: 'left',
  223. columnLabel: 'UM',
  224. columnHidden: false,
  225. columnImage: false,
  226. columnSortable: false,
  227. sortLv: 10,
  228. status: true,
  229. fixed: '',
  230. columnWidth: 60
  231. },
  232. {
  233. userId: this.$store.state.user.name,
  234. functionId: 10002,
  235. serialNumber: '10002TableQtyPerRoll',
  236. tableId: '10002Table',
  237. tableName: 'Part Table',
  238. columnProp: 'qtyPerRoll',
  239. headerAlign: 'center',
  240. align: 'left',
  241. columnLabel: 'Qty Per Roll',
  242. columnHidden: false,
  243. columnImage: false,
  244. columnSortable: false,
  245. sortLv: 10,
  246. status: true,
  247. fixed: '',
  248. columnWidth: 120
  249. }, {
  250. userId: this.$store.state.user.name,
  251. functionId: 10002,
  252. serialNumber: '10002TableRollsPerCarton',
  253. tableId: '10002Table',
  254. tableName: 'Part Table',
  255. columnProp: 'rollsPerCarton',
  256. headerAlign: 'center',
  257. align: 'left',
  258. columnLabel: 'Rolls Per Carton',
  259. columnHidden: false,
  260. columnImage: false,
  261. columnSortable: false,
  262. sortLv: 10,
  263. status: true,
  264. fixed: '',
  265. columnWidth: 120
  266. }, {
  267. userId: this.$store.state.user.name,
  268. functionId: 10002,
  269. serialNumber: '10002TableQtyPerCarton',
  270. tableId: '10002Table',
  271. tableName: 'Part Table',
  272. columnProp: 'qtyPerCarton',
  273. headerAlign: 'center',
  274. align: 'left',
  275. columnLabel: 'Qty Per Carton',
  276. columnHidden: false,
  277. columnImage: false,
  278. columnSortable: false,
  279. sortLv: 10,
  280. status: true,
  281. fixed: '',
  282. columnWidth: 120
  283. },
  284. {
  285. userId: this.$store.state.user.name,
  286. functionId: 10002,
  287. serialNumber: '10002TableFreeInfo',
  288. tableId: '10002Table',
  289. tableName: 'Part Table',
  290. columnProp: 'freeInfo',
  291. headerAlign: 'center',
  292. align: 'left',
  293. columnLabel: 'Free Info',
  294. columnHidden: false,
  295. columnImage: false,
  296. columnSortable: false,
  297. sortLv: 10,
  298. status: true,
  299. fixed: '',
  300. columnWidth: 120
  301. }, {
  302. userId: this.$store.state.user.name,
  303. functionId: 10002,
  304. serialNumber: '10002TableFreeInfo2',
  305. tableId: '10002Table',
  306. tableName: 'Part Table',
  307. columnProp: 'freeInfo2',
  308. headerAlign: 'center',
  309. align: 'left',
  310. columnLabel: 'Free Info2',
  311. columnHidden: false,
  312. columnImage: false,
  313. columnSortable: false,
  314. sortLv: 10,
  315. status: true,
  316. fixed: '',
  317. columnWidth: 120
  318. }, {
  319. userId: this.$store.state.user.name,
  320. functionId: 10002,
  321. serialNumber: '10002TableTradingMark',
  322. tableId: '10002Table',
  323. tableName: 'Part Table',
  324. columnProp: 'tradingMark',
  325. headerAlign: 'center',
  326. align: 'left',
  327. columnLabel: 'Trading Mark',
  328. columnHidden: false,
  329. columnImage: false,
  330. columnSortable: false,
  331. sortLv: 10,
  332. status: true,
  333. fixed: '',
  334. columnWidth: 120
  335. }, {
  336. userId: this.$store.state.user.name,
  337. functionId: 10002,
  338. serialNumber: '10002TablePackingWeight',
  339. tableId: '10002Table',
  340. tableName: 'Part Table',
  341. columnProp: 'packingWeight',
  342. headerAlign: 'center',
  343. align: 'left',
  344. columnLabel: 'Packing Weight',
  345. columnHidden: false,
  346. columnImage: false,
  347. columnSortable: false,
  348. sortLv: 10,
  349. status: true,
  350. fixed: '',
  351. columnWidth: 120
  352. }, {
  353. userId: this.$store.state.user.name,
  354. functionId: 10002,
  355. serialNumber: '10002TableWeightUM',
  356. tableId: '10002Table',
  357. tableName: 'Part Table',
  358. columnProp: 'weightUmName',
  359. headerAlign: 'center',
  360. align: 'left',
  361. columnLabel: 'Weight UM',
  362. columnHidden: false,
  363. columnImage: false,
  364. columnSortable: false,
  365. sortLv: 10,
  366. status: true,
  367. fixed: '',
  368. columnWidth: 120
  369. },
  370. {
  371. userId: this.$store.state.user.name,
  372. functionId: 10002,
  373. serialNumber: '10002TableActive',
  374. tableId: '10002Table',
  375. tableName: 'Part Table',
  376. columnProp: 'active',
  377. headerAlign: 'center',
  378. align: 'left',
  379. columnLabel: 'Active',
  380. columnHidden: false,
  381. columnImage: false,
  382. columnSortable: false,
  383. sortLv: 10,
  384. status: true,
  385. fixed: '',
  386. columnWidth: 80
  387. }, {
  388. userId: this.$store.state.user.name,
  389. functionId: 10002,
  390. serialNumber: '10002TableCreateBy',
  391. tableId: '10002Table',
  392. tableName: 'Part Table',
  393. columnProp: 'createBy',
  394. headerAlign: 'center',
  395. align: 'left',
  396. columnLabel: 'Created By',
  397. columnHidden: false,
  398. columnImage: false,
  399. columnSortable: false,
  400. sortLv: 10,
  401. status: true,
  402. fixed: '',
  403. columnWidth: 80
  404. }, {
  405. userId: this.$store.state.user.name,
  406. functionId: 10002,
  407. serialNumber: '10002TableCreateTime',
  408. tableId: '10002Table',
  409. tableName: 'Part Table',
  410. columnProp: 'createTime',
  411. headerAlign: 'center',
  412. align: 'left',
  413. columnLabel: 'Created Time',
  414. columnHidden: false,
  415. columnImage: false,
  416. columnSortable: false,
  417. sortLv: 10,
  418. status: true,
  419. fixed: '',
  420. columnWidth: 140
  421. }, {
  422. userId: this.$store.state.user.name,
  423. functionId: 10002,
  424. serialNumber: '10002TableUpdateBy',
  425. tableId: '10002Table',
  426. tableName: 'Part Table',
  427. columnProp: 'updateBy',
  428. headerAlign: 'center',
  429. align: 'left',
  430. columnLabel: 'Updated By',
  431. columnHidden: false,
  432. columnImage: false,
  433. columnSortable: false,
  434. sortLv: 10,
  435. status: true,
  436. fixed: '',
  437. columnWidth: 80
  438. }, {
  439. userId: this.$store.state.user.name,
  440. functionId: 10002,
  441. serialNumber: '10002TableUpdateTime',
  442. tableId: '10002Table',
  443. tableName: 'Part Table',
  444. columnProp: 'updateTime',
  445. headerAlign: 'center',
  446. align: 'left',
  447. columnLabel: 'Updated Time',
  448. columnHidden: false,
  449. columnImage: false,
  450. columnSortable: false,
  451. sortLv: 10,
  452. status: true,
  453. fixed: '',
  454. columnWidth: 140
  455. },
  456. ],
  457. pictureColumnList: [
  458. {
  459. userId: this.$store.state.user.name,
  460. functionId: 10002,
  461. serialNumber: '10002Table22PictureNo',
  462. tableId: '10002Table2',
  463. tableName: '外部料号图片信息表',
  464. columnProp: 'certificationNo',
  465. headerAlign: 'center',
  466. align: 'left',
  467. columnLabel: 'Certification Code',
  468. columnHidden: false,
  469. columnImage: false,
  470. columnSortable: false,
  471. sortLv: 10,
  472. status: true,
  473. fixed: '',
  474. columnWidth: 80
  475. }, {
  476. userId: this.$store.state.user.name,
  477. functionId: 10002,
  478. serialNumber: '10002Table22PictureDesc',
  479. tableId: '10002Table2',
  480. tableName: '外部料号图片信息表',
  481. columnProp: 'pictureDesc',
  482. headerAlign: 'center',
  483. align: 'left',
  484. columnLabel: 'Certification Desc',
  485. columnHidden: false,
  486. columnImage: false,
  487. columnSortable: false,
  488. sortLv: 10,
  489. status: true,
  490. fixed: '',
  491. columnWidth: 180
  492. }, {
  493. userId: this.$store.state.user.name,
  494. functionId: 10002,
  495. serialNumber: '10002Table22CreateBy',
  496. tableId: '10002Table2',
  497. tableName: '外部料号图片信息表',
  498. columnProp: 'createBy',
  499. headerAlign: 'center',
  500. align: 'left',
  501. columnLabel: 'Created By',
  502. columnHidden: false,
  503. columnImage: false,
  504. columnSortable: false,
  505. sortLv: 10,
  506. status: true,
  507. fixed: '',
  508. columnWidth: 80
  509. }, {
  510. userId: this.$store.state.user.name,
  511. functionId: 10002,
  512. serialNumber: '10002Table22CreateTime',
  513. tableId: '10002Table2',
  514. tableName: '外部料号图片信息表',
  515. columnProp: 'createTime',
  516. headerAlign: 'center',
  517. align: 'center',
  518. columnLabel: 'Created Time',
  519. columnHidden: false,
  520. columnImage: false,
  521. columnSortable: false,
  522. sortLv: 10,
  523. status: true,
  524. fixed: '',
  525. columnWidth: 180
  526. }, {
  527. userId: this.$store.state.user.name,
  528. functionId: 10002,
  529. serialNumber: '10002Table22UpdateBy',
  530. tableId: '10002Table2',
  531. tableName: '外部料号图片信息表',
  532. columnProp: 'updateBy',
  533. headerAlign: 'center',
  534. align: 'left',
  535. columnLabel: 'Updated By',
  536. columnHidden: false,
  537. columnImage: false,
  538. columnSortable: false,
  539. sortLv: 10,
  540. status: true,
  541. fixed: '',
  542. columnWidth: 80
  543. }, {
  544. userId: this.$store.state.user.name,
  545. functionId: 10002,
  546. serialNumber: '10002Table22UpdateTime',
  547. tableId: '10002Table2',
  548. tableName: '外部料号图片信息表',
  549. columnProp: 'updateTime',
  550. headerAlign: 'center',
  551. align: 'center',
  552. columnLabel: 'Updated Time',
  553. columnHidden: false,
  554. columnImage: false,
  555. columnSortable: false,
  556. sortLv: 10,
  557. status: true,
  558. fixed: '',
  559. columnWidth: 180
  560. },
  561. ],
  562. customerColumnList: [
  563. {
  564. userId: this.$store.state.user.name,
  565. functionId: 10002,
  566. serialNumber: '10002Table3CustomerNo',
  567. tableId: '10002Table3',
  568. tableName: '外部料号客户信息表',
  569. columnProp: 'customerNo',
  570. headerAlign: 'center',
  571. align: 'left',
  572. columnLabel: 'Customer No',
  573. columnHidden: false,
  574. columnImage: false,
  575. columnSortable: false,
  576. sortLv: 10,
  577. status: true,
  578. fixed: '',
  579. columnWidth: 80
  580. }, {
  581. userId: this.$store.state.user.name,
  582. functionId: 10002,
  583. serialNumber: '10002Table3CustomerName',
  584. tableId: '10002Table3',
  585. tableName: '外部料号客户信息表',
  586. columnProp: 'customerName',
  587. headerAlign: 'center',
  588. align: 'left',
  589. columnLabel: 'Customer Name',
  590. columnHidden: false,
  591. columnImage: false,
  592. columnSortable: false,
  593. sortLv: 10,
  594. status: true,
  595. fixed: '',
  596. columnWidth: 120
  597. }, {
  598. userId: this.$store.state.user.name,
  599. functionId: 10002,
  600. serialNumber: '10002Table3CreateTime',
  601. tableId: '10002Table3',
  602. tableName: '外部料号客户信息表',
  603. columnProp: 'createTime',
  604. headerAlign: 'center',
  605. align: 'center',
  606. columnLabel: 'Created Time',
  607. columnHidden: false,
  608. columnImage: false,
  609. columnSortable: false,
  610. sortLv: 10,
  611. status: true,
  612. fixed: '',
  613. columnWidth: 140
  614. }, {
  615. userId: this.$store.state.user.name,
  616. functionId: 10002,
  617. serialNumber: '10002Table3CreateBy',
  618. tableId: '10002Table3',
  619. tableName: '外部料号客户信息表',
  620. columnProp: 'createBy',
  621. headerAlign: 'center',
  622. align: 'left',
  623. columnLabel: 'Created By',
  624. columnHidden: false,
  625. columnImage: false,
  626. columnSortable: false,
  627. sortLv: 10,
  628. status: true,
  629. fixed: '',
  630. columnWidth: 80
  631. }, {
  632. userId: this.$store.state.user.name,
  633. functionId: 10002,
  634. serialNumber: '10002Table3UpdateTime',
  635. tableId: '10002Table3',
  636. tableName: '外部料号客户信息表',
  637. columnProp: 'updateTime',
  638. headerAlign: 'center',
  639. align: 'center',
  640. columnLabel: 'Updated Time',
  641. columnHidden: false,
  642. columnImage: false,
  643. columnSortable: false,
  644. sortLv: 10,
  645. status: true,
  646. fixed: '',
  647. columnWidth: 140
  648. }, {
  649. userId: this.$store.state.user.name,
  650. functionId: 10002,
  651. serialNumber: '10002Table3UpdateBy',
  652. tableId: '10002Table3',
  653. tableName: '外部料号客户信息表',
  654. columnProp: 'updateBy',
  655. headerAlign: 'center',
  656. align: 'left',
  657. columnLabel: 'Updated By',
  658. columnHidden: false,
  659. columnImage: false,
  660. columnSortable: false,
  661. sortLv: 10,
  662. status: true,
  663. fixed: '',
  664. columnWidth: 80
  665. },
  666. ],
  667. manufacturerColumnList: [
  668. {
  669. userId: this.$store.state.user.name,
  670. functionId: 10002,
  671. serialNumber: '10002Table4ManufacturerNo',
  672. tableId: '10002Table4',
  673. tableName: '外部料号供应商信息表',
  674. columnProp: 'manufacturerNo',
  675. headerAlign: 'center',
  676. align: 'left',
  677. columnLabel: 'Manufacturer No',
  678. columnHidden: false,
  679. columnImage: false,
  680. columnSortable: false,
  681. sortLv: 10,
  682. status: true,
  683. fixed: '',
  684. columnWidth: 80
  685. }, {
  686. userId: this.$store.state.user.name,
  687. functionId: 10002,
  688. serialNumber: '10002Table4ManufacturerName',
  689. tableId: '10002Table4',
  690. tableName: '外部料号供应商信息表',
  691. columnProp: 'manufacturerName',
  692. headerAlign: 'center',
  693. align: 'left',
  694. columnLabel: 'Manufacturer Name',
  695. columnHidden: false,
  696. columnImage: false,
  697. columnSortable: false,
  698. sortLv: 10,
  699. status: true,
  700. fixed: '',
  701. columnWidth: 120
  702. }, {
  703. userId: this.$store.state.user.name,
  704. functionId: 10002,
  705. serialNumber: '10002Table4CreateTime',
  706. tableId: '10002Table4',
  707. tableName: '外部料号供应商信息表',
  708. columnProp: 'createTime',
  709. headerAlign: 'center',
  710. align: 'center',
  711. columnLabel: 'Created Time',
  712. columnHidden: false,
  713. columnImage: false,
  714. columnSortable: false,
  715. sortLv: 10,
  716. status: true,
  717. fixed: '',
  718. columnWidth: 140
  719. }, {
  720. userId: this.$store.state.user.name,
  721. functionId: 10002,
  722. serialNumber: '10002Table4CreateBy',
  723. tableId: '10002Table4',
  724. tableName: '外部料号供应商信息表',
  725. columnProp: 'createBy',
  726. headerAlign: 'center',
  727. align: 'left',
  728. columnLabel: 'Created By',
  729. columnHidden: false,
  730. columnImage: false,
  731. columnSortable: false,
  732. sortLv: 10,
  733. status: true,
  734. fixed: '',
  735. columnWidth: 80
  736. }, {
  737. userId: this.$store.state.user.name,
  738. functionId: 10002,
  739. serialNumber: '10002Table4UpdateTime',
  740. tableId: '10002Table4',
  741. tableName: '外部料号供应商信息表',
  742. columnProp: 'updateTime',
  743. headerAlign: 'center',
  744. align: 'center',
  745. columnLabel: 'Updated Time',
  746. columnHidden: false,
  747. columnImage: false,
  748. columnSortable: false,
  749. sortLv: 10,
  750. status: true,
  751. fixed: '',
  752. columnWidth: 140
  753. }, {
  754. userId: this.$store.state.user.name,
  755. functionId: 10002,
  756. serialNumber: '10002Table4UpdateBy',
  757. tableId: '10002Table4',
  758. tableName: '外部料号供应商信息表',
  759. columnProp: 'updateBy',
  760. headerAlign: 'center',
  761. align: 'left',
  762. columnLabel: 'Updated By',
  763. columnHidden: false,
  764. columnImage: false,
  765. columnSortable: false,
  766. sortLv: 10,
  767. status: true,
  768. fixed: '',
  769. columnWidth: 80
  770. },
  771. ],
  772. rules: {
  773. site: [
  774. {
  775. required: true,
  776. message: ' ',
  777. trigger: ['blur', 'change']
  778. }
  779. ],
  780. },
  781. activeName: 'partPicture',
  782. currentPart: {},
  783. externalPartCustomerList: [],
  784. pictureList: [],
  785. externalPartManufacturerList: [],
  786. base64List: [],
  787. countryList: [],
  788. pound:0,
  789. }
  790. },
  791. watch: {
  792. currentPart (newVal, oldVal) {
  793. if (!this.ofComponents) {
  794. // 调用 子组件信息查询
  795. this.getExternalPartCustomerList()
  796. this.getExternalPartPictureList()
  797. this.getExternalPartManufacturerList()
  798. }
  799. },
  800. 'savePart.partNo' (newVal, oldVal) {
  801. this.savePart.partNo = newVal.toUpperCase()
  802. },
  803. 'savePart.category' (newVal, oldVal) {
  804. const category = this.partCategoryList.find((item) => item.categoryValue === newVal)
  805. if (category) {
  806. // this.savePart.manufacturerRequired = category.manufacturerRequired;
  807. // this.savePart.moldCodeRequired = category.moldCodeRequired;
  808. // this.savePart.serialNumberRequired = category.serialNumberRequired;
  809. // this.savePart.rollLabelRequired = category.rollLabelRequired;
  810. // if (this.savePart.serialNumberRequired === 'Y'){
  811. // this.savePart.qtyPerRoll = 1;
  812. // this.savePart.rollsPerCarton = 1;
  813. // }
  814. // if (category.showCartonQtyPerRoll === 'N'){
  815. // this.savePart.qtyPerRoll = 1;
  816. // }
  817. // if (category.showCartonRollsPerCarton === 'N'){
  818. // this.savePart.rollsPerCarton = 1;
  819. // }
  820. // this.partRules.rollsPerCarton[0].message = `Please input ${category.qtyPerRollPart}`
  821. // this.savePart.qtyPerCarton = this.qtyPerCarton();
  822. this.category = JSON.parse(JSON.stringify(category))
  823. }
  824. },
  825. 'part.partNo' (newVal, oldVal) {
  826. this.part.partNo = newVal.toUpperCase()
  827. },
  828. 'savePart.qtyPerRoll' (newVal, oldVal) {
  829. this.savePart.qtyPerCarton = this.qtyPerCarton()
  830. },
  831. 'savePart.rollsPerCarton' (newVal, oldVal) {
  832. this.savePart.qtyPerCarton = this.qtyPerCarton()
  833. },
  834. 'savePart.packingWeight'(newVal, oldVal) {
  835. if (newVal){
  836. if (newVal !== oldVal){
  837. this.pound = this.savePart.packingWeight * 2.20462
  838. }
  839. }else {
  840. this.pound = 0
  841. }
  842. },
  843. pound(newVal,oldVal){
  844. if (newVal){
  845. if (newVal !== oldVal){
  846. this.savePart.packingWeight = newVal / 2.20462
  847. }
  848. }else {
  849. this.savePart.packingWeight = 0
  850. }
  851. }
  852. },
  853. methods: {
  854. // 获取基础数据列表S
  855. getBaseList (val,type) {
  856. this.tagNo = val
  857. this.$nextTick(() => {
  858. let strVal = ''
  859. let conSql = ''
  860. if (val === 93 ) {
  861. strVal = this.tempData.site ? this.tempData.site : ''
  862. }
  863. this.$refs.baseList.init(val, strVal,conSql)
  864. })
  865. },
  866. /* 列表方法的回调 */
  867. getBaseData (val) {
  868. if (this.tagNo === 93) {
  869. this.tempData.site = val.SiteID
  870. this.tempData.siteName = val.SiteName
  871. }
  872. },
  873. getExternalPartPictureList (val) {
  874. let params = {
  875. partNo: this.currentPart.partNo,
  876. site: this.currentPart.site,
  877. pictureClassify: 'BoxPicture',
  878. }
  879. getExternalPartPictureList(params).then(({data}) => {
  880. if (data && data.code === 0) {
  881. this.pictureList = data.rows
  882. if (val === true) {
  883. this.$nextTick(() => {
  884. this.$refs.picture.handleBasePictureList()
  885. })
  886. }
  887. } else {
  888. this.$message.warning(data.msg)
  889. }
  890. }).catch((error) => {
  891. this.$message.error(error)
  892. })
  893. },
  894. rowPartStyle ({row}) {
  895. if (row.partNo === this.currentPart.partNo) {
  896. return {
  897. background: 'rgb(232,246,246)',
  898. }
  899. }
  900. },
  901. selectUnitList () {
  902. selectUnitList().then(({data}) => {
  903. if (data && data.code === 0) {
  904. this.unitList = data.rows
  905. if (this.unitList.length > 0) {
  906. this.savePart.umId = this.unitList[0].umId
  907. }
  908. } else {
  909. this.$message.warning(data.msg)
  910. }
  911. }).catch((error) => {
  912. this.$message.error(error)
  913. })
  914. },
  915. selectExternalPartList () {
  916. let params = {
  917. ...this.part,
  918. site: this.$store.state.user.site,
  919. provisionalData: 'N',
  920. }
  921. selectExternalPartList(params).then(({data}) => {
  922. if (data && data.code === 0) {
  923. this.partList = data.rows
  924. if (this.partList.length > 0 && !this.ofComponents) {
  925. this.currentPart = {...this.partList[0]}
  926. }
  927. } else {
  928. this.$message.warning(data.msg)
  929. }
  930. }).catch((error) => {
  931. this.$message.error(error)
  932. })
  933. },
  934. handleSave () {
  935. if (this.savePartVisible) {
  936. if ((this.savePart.packingWeight || this.savePart.packingWeight === 0) && !this.savePart.weightUmId) {
  937. this.$message.warning('Please select Weight UM')
  938. return
  939. }
  940. this.$refs.savePartForm.validate((valid, obj) => {
  941. if (valid) {
  942. if (this.savePart.qtyPerCarton === 0) {
  943. this.$message.warning('Qty Per Carton can not be 0')
  944. return
  945. }
  946. let params = {
  947. ...this.savePart,
  948. site: this.$store.state.user.site,
  949. createBy: this.$store.state.user.name,
  950. createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
  951. }
  952. saveExternalPart(params).then(({data}) => {
  953. if (data && data.code === 0) {
  954. this.handleSelectExternalPartPage()
  955. this.savePartVisible = false
  956. this.$message.success(data.msg)
  957. } else {
  958. this.$message.warning(data.msg)
  959. }
  960. }).catch((error) => {
  961. this.$message.error(error)
  962. })
  963. } else {
  964. for (let i = 0; i < Object.keys(obj).length; i++) {
  965. this.$message.warning(obj[Object.keys(obj)[i]][0].message)
  966. break
  967. }
  968. }
  969. })
  970. } else {
  971. this.savePart = {
  972. ...part,
  973. active: 'Y',
  974. umId: this.unitList.length > 0 ? this.unitList[0].umId : '',
  975. category: '',
  976. manufacturerRequired: 'N',
  977. moldCodeRequired: 'N',
  978. serialNumberRequired: 'N',
  979. weightUmId: 5
  980. }
  981. this.getCountryList()
  982. this.savePart.freeInfo2 = this.defaultCountry
  983. this.savePart.category = this.partCategoryList.length > 0 ? this.partCategoryList[0].categoryValue : ''
  984. this.savePartVisible = true
  985. }
  986. },
  987. closeSavePart () {
  988. this.savePart = {
  989. ...part,
  990. active: 'Y',
  991. }
  992. if (this.unitList.length > 0) {
  993. this.savePart.umId = this.unitList[0].umId
  994. }
  995. this.$refs.savePartForm.resetFields()
  996. },
  997. removeExternalPart (row) {
  998. removeExternalPart(row).then(({data}) => {
  999. if (data && data.code === 0) {
  1000. this.selectExternalPartList()
  1001. this.$message.success(data.msg)
  1002. } else {
  1003. this.$message.warning(data.msg)
  1004. }
  1005. }).catch((error) => {
  1006. this.$message.error(error)
  1007. })
  1008. },
  1009. handleRowClick (row, column, event, type) {
  1010. this.currentPart = {...row}
  1011. if (type === 0) {
  1012. this.getCountryList()
  1013. this.savePart = {...row}
  1014. if (!this.savePart.weightUmId){
  1015. this.savePart.weightUmId = 5
  1016. }
  1017. this.savePartVisible = true
  1018. }
  1019. },
  1020. handleDblRowClick (row, column, event, type) {
  1021. if (this.ofComponents) {
  1022. this.$emit('rowClick', row)
  1023. } else {
  1024. this.currentPart = {...row}
  1025. if (type === 0) {
  1026. this.savePart = {...row}
  1027. this.savePartVisible = true
  1028. }
  1029. }
  1030. },
  1031. handleUpdate () {
  1032. if ((this.savePart.packingWeight || this.savePart.packingWeight == 0) && !this.savePart.weightUmId) {
  1033. this.$message.warning('Please select Weight UM')
  1034. return
  1035. }
  1036. this.$refs.savePartForm.validate((valid, obj) => {
  1037. if (valid) {
  1038. if (this.savePart.qtyPerCarton === 0) {
  1039. this.$message.warning('Qty Per Carton can not be 0')
  1040. return
  1041. }
  1042. let params = {
  1043. ...this.savePart,
  1044. site: this.$store.state.user.site,
  1045. createBy: undefined,
  1046. createTime: undefined,
  1047. updateBy: this.$store.state.user.name,
  1048. updateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
  1049. }
  1050. updateExternalPart(params).then(({data}) => {
  1051. if (data && data.code === 0) {
  1052. this.handleSelectExternalPartPage()
  1053. this.savePartVisible = false
  1054. this.$message.success(data.msg)
  1055. } else {
  1056. this.$message.warning(data.msg)
  1057. }
  1058. }).catch((error) => {
  1059. this.$message.error(error)
  1060. })
  1061. } else {
  1062. for (let i = 0; i < Object.keys(obj).length; i++) {
  1063. this.$message.warning(obj[Object.keys(obj)[i]][0].message)
  1064. break
  1065. }
  1066. }
  1067. })
  1068. },
  1069. getExternalPartCustomerList () {
  1070. let params = {
  1071. partNo: this.currentPart.partNo,
  1072. site: this.currentPart.site,
  1073. }
  1074. getExternalPartCustomerList(params).then(({data}) => {
  1075. if (data && data.code === 0) {
  1076. this.externalPartCustomerList = data.rows
  1077. } else {
  1078. this.$message.warning(data.msg)
  1079. }
  1080. }).catch((error) => {
  1081. this.$message.error(error)
  1082. })
  1083. },
  1084. getExternalPartManufacturerList () {
  1085. let params = {
  1086. partNo: this.currentPart.partNo,
  1087. site: this.currentPart.site,
  1088. }
  1089. getExternalPartManufacturerList(params).then(({data}) => {
  1090. if (data && data.code === 0) {
  1091. this.externalPartManufacturerList = data.rows
  1092. } else {
  1093. this.$message.warning(data.msg)
  1094. }
  1095. }).catch((error) => {
  1096. this.$message.error(error)
  1097. })
  1098. },
  1099. async convertToBase64 (fileUrls) {
  1100. this.base64List = []
  1101. for (const fileUrl of fileUrls) {
  1102. const base64Url = await this.getFileAsBase64(fileUrl)
  1103. this.base64List.push(base64Url)
  1104. }
  1105. },
  1106. getFileAsBase64 (fileUrl) {
  1107. return new Promise((resolve, reject) => {
  1108. const img = new Image()
  1109. img.crossOrigin = 'Anonymous'
  1110. img.src = fileUrl
  1111. img.onload = () => {
  1112. const canvas = document.createElement('canvas')
  1113. const ctx = canvas.getContext('2d')
  1114. canvas.width = img.width
  1115. canvas.height = img.height
  1116. ctx.drawImage(img, 0, 0)
  1117. const base64data = canvas.toDataURL('image/jpeg')
  1118. resolve(base64data)
  1119. }
  1120. img.onerror = (error) => {
  1121. reject(error)
  1122. }
  1123. })
  1124. },
  1125. async getTableUserColumn (tableId, columnId) {
  1126. let queryTableUser = {
  1127. userId: this.$store.state.user.name,
  1128. functionId: this.$route.meta.menuId,
  1129. tableId: tableId,
  1130. status: true,
  1131. languageCode: this.$i18n.locale
  1132. }
  1133. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1134. if (data.rows.length > 0) {
  1135. this.caseTable(data.rows, columnId)
  1136. } else {
  1137. this.getColumnList(tableId, columnId)
  1138. }
  1139. })
  1140. },
  1141. // 获取 tableDefault 列
  1142. async getColumnList (tableId, columnId) {
  1143. let queryTable = {
  1144. functionId: this.$route.meta.menuId,
  1145. tableId: tableId,
  1146. languageCode: this.$i18n.locale
  1147. }
  1148. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1149. if (data.rows.length > 0) {
  1150. this.caseTable(data.rows, columnId)
  1151. } else {
  1152. }
  1153. })
  1154. },
  1155. caseTable (list, columnId) {
  1156. if (list.length > 0) {
  1157. switch (columnId) {
  1158. case 1:
  1159. this.columnList = list
  1160. break
  1161. case 2:
  1162. this.pictureColumnList = list
  1163. break
  1164. case 3:
  1165. this.customerColumnList = list
  1166. break
  1167. case 4:
  1168. this.manufacturerColumnList = list
  1169. break
  1170. }
  1171. }
  1172. },
  1173. qtyPerCarton () {
  1174. return new Decimal(this.savePart.qtyPerRoll).mul(this.savePart.rollsPerCarton).toNumber()
  1175. },
  1176. getCategoryList () {
  1177. let params = {}
  1178. getCategoryList(params).then(({data}) => {
  1179. if (data && data.code === 0) {
  1180. this.partCategoryList = data.rows
  1181. } else {
  1182. this.$message.warning(data.msg)
  1183. }
  1184. }).catch((error) => {
  1185. this.$message.error(error)
  1186. })
  1187. },
  1188. changeQtyRollCarton () {
  1189. this.savePart.qtyPerRoll = this.savePart.qtyPerCarton
  1190. },
  1191. getCountryList () {
  1192. let params = {}
  1193. countryList(params).then(({data}) => {
  1194. if (data && data.code === 0) {
  1195. this.countryList = data.rows
  1196. } else {
  1197. this.$message.warning(data.msg)
  1198. }
  1199. }).catch((error) => {
  1200. this.$message.error(error)
  1201. })
  1202. },
  1203. getUserSiteDefaultCountry () {
  1204. let params = this.$store.state.user.site
  1205. getSiteDetail(params).then(({data}) => {
  1206. if (data && data.code === 0) {
  1207. if (data.row && data.row.defaultCountry) {
  1208. this.defaultCountry = data.row.defaultCountry
  1209. }
  1210. } else {
  1211. this.$message.warning(data.msg)
  1212. }
  1213. }).catch((error) => {
  1214. this.$message.error(error)
  1215. })
  1216. },
  1217. handleSelectExternalPartPage () {
  1218. let params = {
  1219. ...this.part,
  1220. site: this.$store.state.user.site,
  1221. no: this.no,
  1222. size: this.size,
  1223. provisionalData: 'N',
  1224. }
  1225. selectExternalPartPage(params).then(({data}) => {
  1226. if (data && data.code === 0) {
  1227. this.partList = data.rows
  1228. if (this.partList.length > 0 && !this.ofComponents) {
  1229. this.currentPart = {...this.partList[0]}
  1230. }
  1231. this.total = data.total
  1232. } else {
  1233. this.$message.warning(data.msg)
  1234. }
  1235. }).catch((error) => {
  1236. this.$message.error(error)
  1237. })
  1238. },
  1239. handleSizeChange (val) {
  1240. this.size = val
  1241. this.handleSelectExternalPartPage()
  1242. },
  1243. handleCurrentChange (val) {
  1244. this.no = val
  1245. this.handleSelectExternalPartPage()
  1246. },
  1247. changeCategory (val) {
  1248. const category = this.partCategoryList.find((item) => item.categoryValue === val)
  1249. if (category) {
  1250. this.savePart.manufacturerRequired = category.manufacturerRequired
  1251. this.savePart.moldCodeRequired = category.moldCodeRequired
  1252. this.savePart.serialNumberRequired = category.serialNumberRequired
  1253. this.savePart.rollLabelRequired = category.rollLabelRequired
  1254. if (this.savePart.serialNumberRequired === 'Y') {
  1255. this.savePart.qtyPerRoll = 1
  1256. this.savePart.rollsPerCarton = 1
  1257. }
  1258. if (category.showCartonQtyPerRoll === 'N') {
  1259. this.savePart.qtyPerRoll = 1
  1260. }
  1261. if (category.showCartonRollsPerCarton === 'N') {
  1262. this.savePart.rollsPerCarton = 1
  1263. }
  1264. this.partRules.rollsPerCarton[0].message = `Please input ${category.qtyPerRollPart}`
  1265. this.savePart.qtyPerCarton = this.qtyPerCarton()
  1266. this.category = JSON.parse(JSON.stringify(category))
  1267. }
  1268. },
  1269. siteBlur (tagNo) {
  1270. if (this.tempData.site != null) {
  1271. let inData = {
  1272. tagno: tagNo,
  1273. conditionSql: " and SiteID = '" + this.tempData.site + "'"
  1274. }
  1275. verifyData(inData).then(({data}) => {
  1276. if (data && data.code === 0) {
  1277. if (data.baseListData.length > 0) {
  1278. this.tempData.siteName = data.baseListData[0].SiteName
  1279. } else {
  1280. this.tempData.siteName = ''
  1281. }
  1282. } else {
  1283. this.$message.warning(data.msg)
  1284. this.tempData.siteName = ''
  1285. }
  1286. }).catch(error => {
  1287. console.error(error);
  1288. this.$message.error('校验失败,请重试');
  1289. this.tempData.siteName = '';
  1290. });
  1291. }else {
  1292. this.tempData.siteName = ''
  1293. }
  1294. },
  1295. // ======== 导出相关方法 ========
  1296. /**
  1297. * 导出excel
  1298. */
  1299. async createExportData () {
  1300. let params = {
  1301. ...this.part,
  1302. site: this.$store.state.user.site,
  1303. no:1,
  1304. size:-1,
  1305. }
  1306. await selectExternalPartPage(params).then(({data}) => {
  1307. this.resultList = data.rows
  1308. })
  1309. return this.resultList
  1310. },
  1311. startDownload () {},
  1312. finishDownload () {},
  1313. fields () {
  1314. let json = '{'
  1315. this.columnList.forEach((item, index) => {
  1316. if (index == this.columnList.length - 1) {
  1317. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  1318. } else {
  1319. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  1320. }
  1321. })
  1322. json += '}'
  1323. let s = eval('(' + json + ')')
  1324. return s
  1325. },
  1326. partUpload () {
  1327. let inData = {
  1328. tagno: 93,
  1329. conditionSql: " and SiteID = '" + this.tempData.site + "'"
  1330. }
  1331. verifyData(inData).then(({data}) => {
  1332. if (data && data.code === 0) {
  1333. if (data.baseListData.length > 0) {
  1334. this.tempData.siteName = data.baseListData[0].SiteName
  1335. } else {
  1336. this.tempData.siteName = ''
  1337. }
  1338. } else {
  1339. this.$message.warning(data.msg)
  1340. this.tempData.siteName = ''
  1341. }
  1342. }).catch(error => {
  1343. console.error(error);
  1344. this.$message.error('校验失败,请重试');
  1345. this.tempData.siteName = '';
  1346. });
  1347. this.visible = true
  1348. },
  1349. // 关闭modal
  1350. closeUploadDialog () {
  1351. this.fileList = []
  1352. // 清空文件上传记录
  1353. this.$refs.uploadFile.clearFiles()
  1354. // 关闭当前的页面
  1355. this.visible = false
  1356. },
  1357. // 保修当前的数据
  1358. saveUploadFile () {
  1359. // 判断文件是否上传
  1360. if (null == this.fileList || 0 === this.fileList.length) {
  1361. this.$message.error("Please upload the file first!")
  1362. return false
  1363. }
  1364. // 提示将删除之前的数据
  1365. this.$confirm('Do you confirm the upload? If the Part Info already exists, we will delete it!', 'Warning', {
  1366. confirmButtonText: 'OK',
  1367. cancelButtonText: 'Cancel',
  1368. type: 'warning'
  1369. }).then(() => {
  1370. // 判断文件是否上传
  1371. if (null == this.fileList || 0 === this.fileList.length) {
  1372. this.$message.error("请先上传文件!")
  1373. return false
  1374. }
  1375. const formData = new FormData()
  1376. formData.append("file", this.fileList[0].raw)
  1377. formData.append("createBy", this.$store.state.user.name)
  1378. formData.append("site", this.tempData.site.toString())
  1379. this.isLoading = true
  1380. savePartInfoByExcel(formData).then(({data}) => {
  1381. if (data.code === 0) {
  1382. // 关闭窗口并刷新页面
  1383. this.provisionalDataDialogHandle()
  1384. } else {
  1385. this.isLoading = false
  1386. this.$message.warning(data.msg)
  1387. }
  1388. })
  1389. }).catch(() => {
  1390. this.$message({
  1391. type: 'info',
  1392. message: 'Cancel upload'
  1393. })
  1394. });
  1395. },
  1396. provisionalDataDialogHandle () {
  1397. getProvisionalDataList().then(({data}) => {
  1398. if (data.code === 0) {
  1399. this.provisionalDataList = data.rows
  1400. this.isLoading = false
  1401. this.provisionalDataVisible = true
  1402. } else {
  1403. this.isLoading = false
  1404. this.$message.warning(data.msg)
  1405. }
  1406. })
  1407. },
  1408. // 上传之前
  1409. beforeUploadHandle (file) {
  1410. let extName = file[0].name.substring(file[0].name.lastIndexOf('.')).toLowerCase()
  1411. if (!(extName === '.xlsx' || extName === '.xls')) {
  1412. this.$message.error('数据导入失败,请选择正确的xlsx模板文件')
  1413. return false
  1414. }
  1415. },
  1416. // 选择上传文件时
  1417. onRemove(file, fileList){
  1418. this.fileList = fileList
  1419. },
  1420. onChange(file, fileList){
  1421. this.fileList = fileList
  1422. },
  1423. // 下载
  1424. async downloadFile () {
  1425. let file = {
  1426. id: 0,
  1427. fileName: ''
  1428. }
  1429. let tempData = this.tempData
  1430. await queryFileId(tempData).then(({data}) => {
  1431. if (data && data.code === 0) {
  1432. file.id = data.data.id
  1433. file.fileName = data.data.fileName
  1434. } else {
  1435. this.$alert(data.msg, '错误', {
  1436. confirmButtonText: '确定'
  1437. })
  1438. }
  1439. })
  1440. await downLoadObjectFile(file).then(({data}) => {
  1441. // 不限制文件下载类型
  1442. const blob = new Blob([data], {type: "application/octet-stream"})
  1443. // 下载文件名称
  1444. const fileName = file.fileName
  1445. // a标签下载
  1446. const linkNode = document.createElement('a')
  1447. // a标签的download属性规定下载文件的名称
  1448. linkNode.download = fileName
  1449. linkNode.style.display = 'none'
  1450. // 生成一个Blob URL
  1451. linkNode.href = URL.createObjectURL(blob)
  1452. document.body.appendChild(linkNode)
  1453. // 模拟在按钮上的一次鼠标单击
  1454. linkNode.click()
  1455. // 释放URL 对象
  1456. URL.revokeObjectURL(linkNode.href)
  1457. document.body.removeChild(linkNode)
  1458. })
  1459. },
  1460. provisionalDataAlterHandle (type) {
  1461. if (type === 1){
  1462. this.isLoading2 = true
  1463. } else if (type === 2){
  1464. this.isLoading3 = true
  1465. }
  1466. let inData={
  1467. provisionalDataList: this.provisionalDataList,
  1468. type: type
  1469. }
  1470. provisionalDataAlterHandle(inData).then(({data}) => {
  1471. if (data.code === 0) {
  1472. if (type === 1) {
  1473. this.$message.success(data.msg)
  1474. this.provisionalDataVisible = false
  1475. this.visible = false
  1476. this.handleSelectExternalPartPage()
  1477. this.isLoading2 = false
  1478. } else if (type === 2) {
  1479. this.$message.warning('Import cancelled!')
  1480. this.provisionalDataVisible = false
  1481. this.isLoading3 = false
  1482. }
  1483. } else {
  1484. this.$message.warning(data.msg)
  1485. if (type === 1) {
  1486. this.isLoading2 = false
  1487. } else if (type === 2) {
  1488. this.isLoading3 = false
  1489. }
  1490. }
  1491. })
  1492. },
  1493. },
  1494. computed: {},
  1495. activated () {
  1496. if (this.$route.query.site && this.$route.query.partNo) {
  1497. this.part.site = this.$route.query.site
  1498. this.part.partNo = this.$route.query.partNo
  1499. this.handleSelectExternalPartPage()
  1500. }
  1501. },
  1502. created () {
  1503. this.provisionalDataAlterHandle(3)
  1504. this.selectUnitList()
  1505. this.getCategoryList()
  1506. // this.getCountryList();
  1507. // this.selectExternalPartList();
  1508. this.handleSelectExternalPartPage()
  1509. this.getUserSiteDefaultCountry()
  1510. this.getTableUserColumn('10002Table', 1)
  1511. this.getTableUserColumn('10002Table2', 2)
  1512. this.getTableUserColumn('10002Table3', 3)
  1513. this.getTableUserColumn('10002Table4', 4)
  1514. },
  1515. }
  1516. </script>
  1517. <template>
  1518. <div>
  1519. <el-form :inline="true" label-position="top" :model="part" label-width="100px">
  1520. <el-form-item label="Part No">
  1521. <el-input v-model="part.partNo"></el-input>
  1522. </el-form-item>
  1523. <el-form-item label="Part Description">
  1524. <el-input v-model="part.partDesc"></el-input>
  1525. </el-form-item>
  1526. <el-form-item label="Part Category">
  1527. <el-select v-model="part.category" placeholder="">
  1528. <el-option label="All" value=""></el-option>
  1529. <el-option :label="item.categoryName" :value="item.categoryValue" :key="item.id"
  1530. v-for="item in partCategoryList"></el-option>
  1531. </el-select>
  1532. </el-form-item>
  1533. <el-form-item label="Active">
  1534. <el-select v-model="part.active" placeholder="">
  1535. <el-option label="All" value=""></el-option>
  1536. <el-option label="Active" value="Y"></el-option>
  1537. <el-option label="Not Active" value="N"></el-option>
  1538. </el-select>
  1539. </el-form-item>
  1540. <el-form-item label=" ">
  1541. <el-button type="primary" @click="handleSave" v-if="!ofComponents">New</el-button>
  1542. <!-- <el-button type="primary" @click="selectExternalPartList">Query</el-button>-->
  1543. <el-button type="primary" @click="handleSelectExternalPartPage">Query</el-button>
  1544. <el-button type="primary" icon="el-icon-upload" v-if="this.$store.state.user.userType !== 'Common Users'" @click="partUpload()">Import Part Info</el-button>
  1545. <download-excel
  1546. :fields="fields()"
  1547. :data="exportData"
  1548. type="xls"
  1549. :name="exportName"
  1550. :header="exportHeader"
  1551. :footer="exportFooter"
  1552. :fetch="createExportData"
  1553. :before-generate="startDownload"
  1554. :before-finish="finishDownload"
  1555. worksheet="Export Information"
  1556. class="el-button el-button--primary el-button--medium">
  1557. {{ "Export" }}
  1558. </download-excel>
  1559. </el-form-item>
  1560. </el-form>
  1561. <el-table :data="partList" :height="height" :row-style="rowPartStyle" @row-click="handleRowClick"
  1562. @row-dblclick="handleDblRowClick" :loading="partTableLoading" border style="width: 100%;margin-top: 5px">
  1563. <el-table-column v-if="!ofComponents"
  1564. header-align="center"
  1565. align="center"
  1566. width="100"
  1567. fixed="left"
  1568. label="Actions">
  1569. <template slot-scope="scope">
  1570. <el-link style="cursor:pointer;" @click="handleRowClick(scope.row,null,null,0)">Edit</el-link>
  1571. <el-link style="cursor:pointer;" @click="removeExternalPart(scope.row)">Delete</el-link>
  1572. </template>
  1573. </el-table-column>
  1574. <el-table-column
  1575. v-for="(item,index) in columnList" :key="index"
  1576. :sortable="item.columnSortable"
  1577. :prop="item.columnProp"
  1578. :header-align="item.headerAlign"
  1579. :show-overflow-tooltip="item.showOverflowTooltip"
  1580. :align="item.align"
  1581. :fixed="item.fixed==''?false:item.fixed"
  1582. :min-width="item.columnWidth"
  1583. :label="item.columnLabel">
  1584. <template slot-scope="scope">
  1585. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  1586. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  1587. style="width: 100px; height: 80px"/></span>
  1588. </template>
  1589. </el-table-column>
  1590. </el-table>
  1591. <el-pagination
  1592. @size-change="handleSizeChange"
  1593. @current-change="handleCurrentChange"
  1594. :current-page.sync="no"
  1595. :page-sizes="[50,100, 200, 300, 400]"
  1596. :page-size="size"
  1597. layout="sizes, prev, pager, next,total"
  1598. :total="total">
  1599. </el-pagination>
  1600. <el-tabs v-model="activeName" v-if="!ofComponents">
  1601. <el-tab-pane label="Part Certification" name="partPicture">
  1602. <picture-module ref="picture" :column-list="pictureColumnList" :part="currentPart" :data-list="pictureList"
  1603. @refresh="getExternalPartPictureList"></picture-module>
  1604. </el-tab-pane>
  1605. <el-tab-pane label="Linked Customer" name="linkedCustomer">
  1606. <linked-customer :column-list="customerColumnList" :part="currentPart" :data-list="externalPartCustomerList"
  1607. @refresh="getExternalPartCustomerList" :visible="true"></linked-customer>
  1608. </el-tab-pane>
  1609. <el-tab-pane label="Linked Manufacturer" name="linkedManufacturer">
  1610. <linked-manufacturer :column-list="manufacturerColumnList" :part="currentPart"
  1611. :data-list="externalPartManufacturerList" @refresh="getExternalPartManufacturerList"
  1612. :visible="true"></linked-manufacturer>
  1613. </el-tab-pane>
  1614. <el-tab-pane label="Product Label" name="productLabel" v-if="this.$store.state.user.autoSerialNumber === 'Y'">
  1615. <label-template :part="currentPart"></label-template>
  1616. </el-tab-pane>
  1617. </el-tabs>
  1618. <el-dialog v-drag :title="`Part`" :close-on-click-modal="false" @close="closeSavePart" width="550px"
  1619. :visible.sync="savePartVisible">
  1620. <el-form :model="savePart" label-position="top" ref="savePartForm" :rules="partRules">
  1621. <el-row :gutter="10">
  1622. <el-col :span="8">
  1623. <el-form-item label="Part No" prop="partNo" :show-message="false">
  1624. <el-input :readonly="savePart.site !== ''" :disabled="savePart.site !== ''"
  1625. v-model="savePart.partNo"></el-input>
  1626. </el-form-item>
  1627. </el-col>
  1628. <el-col :span="15">
  1629. <el-form-item label="Part Description" prop="partDesc" :show-message="false">
  1630. <el-input v-model="savePart.partDesc"></el-input>
  1631. </el-form-item>
  1632. </el-col>
  1633. <el-col :span="8" v-if="$store.state.user.autoSerialNumber === 'Y'">
  1634. <el-form-item label="Print Str1" :show-message="false">
  1635. <el-input v-model="savePart.printStr1"></el-input>
  1636. </el-form-item>
  1637. </el-col>
  1638. <el-col :span="7" v-if="$store.state.user.autoSerialNumber === 'Y'">
  1639. <el-form-item label="Print Str2" :show-message="false">
  1640. <el-input v-model="savePart.printStr2"></el-input>
  1641. </el-form-item>
  1642. </el-col>
  1643. <el-col :span="8" v-if="$store.state.user.autoSerialNumber === 'Y'">
  1644. <el-form-item label="Print Str3" :show-message="false">
  1645. <el-input v-model="savePart.printStr3"></el-input>
  1646. </el-form-item>
  1647. </el-col>
  1648. <el-col :span="11">
  1649. <el-form-item label="Part Category" prop="category" :show-message="false">
  1650. <el-select v-model="savePart.category" placeholder="" @change="changeCategory" style="width: 100%">
  1651. <el-option :label="item.categoryName" :value="item.categoryValue" :key="item.id"
  1652. v-for="item in partCategoryList"></el-option>
  1653. </el-select>
  1654. </el-form-item>
  1655. </el-col>
  1656. <el-col :span="4">
  1657. <el-form-item label="UM" prop="umId" :show-message="false">
  1658. <el-select v-model="savePart.umId" placeholder="" :show-message="false" style="width: 100%">
  1659. <el-option v-for="item in unitList" :key="item.umId" :label="item.umName"
  1660. :value="item.umId"></el-option>
  1661. </el-select>
  1662. </el-form-item>
  1663. </el-col>
  1664. <el-col :span="8">
  1665. <el-form-item v-if="savePart.moldCodeRequired === 'Y'" key="moldCode" label="Mold Code" prop="moldCode"
  1666. :show-message="false">
  1667. <el-input v-model="savePart.moldCode"></el-input>
  1668. </el-form-item>
  1669. <el-form-item v-else label="Mold Code">
  1670. <el-input v-model="savePart.moldCode" disabled></el-input>
  1671. </el-form-item>
  1672. </el-col>
  1673. </el-row>
  1674. <el-row :gutter="10">
  1675. <el-col :span="8" v-if="category.rollLabelRequired === 'Y'">
  1676. <el-form-item label="Qty Per Roll" prop="qtyPerRoll" :show-message="false">
  1677. <el-input-number :step="0" :min="0" :controls="false"
  1678. :disabled="this.savePart.serialNumberRequired === 'Y'"
  1679. v-model="savePart.qtyPerRoll"></el-input-number>
  1680. </el-form-item>
  1681. </el-col>
  1682. <el-col :span="7" v-if="category.rollLabelRequired === 'Y'">
  1683. <el-form-item label="Rolls Per Carton" prop="rollsPerCarton" :show-message="false">
  1684. <el-input-number :step="0" :min="0" :controls="false"
  1685. :disabled="this.savePart.serialNumberRequired === 'Y'"
  1686. v-model="savePart.rollsPerCarton"></el-input-number>
  1687. </el-form-item>
  1688. </el-col>
  1689. <el-col :span="8">
  1690. <el-form-item :label="category.qtyPerRollPart" prop="qtyPerCarton" :show-message="false">
  1691. <el-input-number :step="0" :min="0" :controls="false" @change="changeQtyRollCarton"
  1692. :disabled="category.editQtyPerCarton === 'N'"
  1693. v-model="savePart.qtyPerCarton"></el-input-number>
  1694. </el-form-item>
  1695. </el-col>
  1696. </el-row>
  1697. <el-row :gutter="10">
  1698. <el-col :span="8">
  1699. <el-form-item label="OOC" :show-message="false" prop="freeInfo2">
  1700. <el-select v-model="savePart.freeInfo2" placeholder="" style="width: 100%">
  1701. <el-option v-for="item in countryList" :label="item.countryNo" :value="item.countryNo"
  1702. :key="item.countryNo"></el-option>
  1703. </el-select>
  1704. </el-form-item>
  1705. </el-col>
  1706. <el-col :span="7">
  1707. <el-form-item label="Rev No" prop="rev" :show-message="false">
  1708. <el-input v-model="savePart.rev"></el-input>
  1709. </el-form-item>
  1710. </el-col>
  1711. <el-col :span="8">
  1712. <el-form-item label="Free Info" :show-message="false">
  1713. <el-input v-model="savePart.freeInfo"></el-input>
  1714. </el-form-item>
  1715. </el-col>
  1716. </el-row>
  1717. <el-row :gutter="10">
  1718. <el-col :span="3">
  1719. <el-form-item label=" " :show-message="false">
  1720. <el-checkbox v-model="savePart.active" true-label="Y" false-label="N">Active</el-checkbox>
  1721. </el-form-item>
  1722. </el-col>
  1723. <el-col :span="5">
  1724. <el-form-item label=" " :show-message="false">
  1725. <el-checkbox v-model="savePart.tradingMark" true-label="Y" false-label="N">Trading Mark</el-checkbox>
  1726. </el-form-item>
  1727. </el-col>
  1728. <el-col :span="7">
  1729. <el-form-item label="Packing Weight" prop="packingWeight">
  1730. <el-input-number :min="0" :controls="false" v-model="savePart.packingWeight"
  1731. :precision="6"></el-input-number>
  1732. </el-form-item>
  1733. </el-col>
  1734. <el-col :span="4">
  1735. <el-form-item label="Weight UM" :show-message="false">
  1736. <!-- <el-select disabled v-model="savePart.weightUmId" placeholder="" :show-message="false" clearable-->
  1737. <!-- style="width: 100%">-->
  1738. <!-- <el-option v-for="item in unitList" :key="item.weightUmId" :label="item.umName"-->
  1739. <!-- :value="item.umId"></el-option>-->
  1740. <!-- </el-select>-->
  1741. <el-input value="KG" disabled></el-input>
  1742. </el-form-item>
  1743. </el-col>
  1744. <el-col :span="8">
  1745. <el-form-item label=" " :show-message="false">
  1746. <el-checkbox v-model="savePart.rollLabelFlag" true-label="Y" false-label="N">45*20 Label</el-checkbox>
  1747. </el-form-item>
  1748. </el-col>
  1749. <el-col :span="7">
  1750. <el-form-item label="Packing Weight in LBS">
  1751. <el-input-number :min="0" :controls="false" v-model="pound"
  1752. :precision="6"></el-input-number>
  1753. </el-form-item>
  1754. </el-col>
  1755. <el-col :span="4">
  1756. <el-form-item label="Weight UM" :show-message="false">
  1757. <el-input value="LBS" disabled></el-input>
  1758. </el-form-item>
  1759. </el-col>
  1760. </el-row>
  1761. </el-form>
  1762. <div slot="footer" class="dialog-footer">
  1763. <el-button type="primary" v-if="savePart.site !== ''" @click="handleUpdate">Save</el-button>
  1764. <el-button type="primary" v-else @click="handleSave">Save</el-button>
  1765. <el-button @click="savePartVisible = false">Cancel</el-button>
  1766. </div>
  1767. </el-dialog>
  1768. <el-dialog title="File Import" :z-index="1999" @close="closeUploadDialog" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;">
  1769. <el-form :inline="true" label-position="top" label-width="80px">
  1770. <el-form-item prop="site" :rules="rules.site">
  1771. <span slot="label" style="" class="big-label">
  1772. <a herf="#" @click="getBaseList(93)">Site</a>
  1773. </span>
  1774. <el-input v-model="tempData.site" @blur="siteBlur(93)" style="width: 50px"></el-input>
  1775. <el-input v-model="tempData.siteName" disabled style="width: 130px"></el-input>
  1776. </el-form-item>
  1777. <el-form-item label=" ">
  1778. <el-button type="primary" @click="downloadFile()">Download file template</el-button>
  1779. </el-form-item>
  1780. <el-row>
  1781. <el-col :span="24">
  1782. <el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls"
  1783. :before-upload="beforeUploadHandle" :on-remove="onRemove" :on-change="onChange" :auto-upload="false" style="text-align: left;">
  1784. <i class="el-icon-upload"></i>
  1785. <div class="el-upload__text">Drag the file here,or<em> click to upload</em></div>
  1786. </el-upload>
  1787. </el-col>
  1788. </el-row>
  1789. </el-form>
  1790. <span slot="footer" class="dialog-footer">
  1791. <el-button type="primary" :disabled="isLoading" @click="saveUploadFile">{{ isLoading ? 'Saving...' : 'Save' }} </el-button>
  1792. <el-button type="primary" @click="closeUploadDialog">Cancel</el-button>
  1793. </span>
  1794. </el-dialog>
  1795. <el-dialog title="Import Info View" @close="provisionalDataAlterHandle(3)" :close-on-click-modal="false" :visible.sync="provisionalDataVisible" width="1100px">
  1796. <el-table :data="provisionalDataList" :height="height + 200" border style="width: 100%;margin-top: 5px">
  1797. <el-table-column
  1798. v-for="(item,index) in columnList" :key="index"
  1799. :sortable="item.columnSortable"
  1800. :prop="item.columnProp"
  1801. :header-align="item.headerAlign"
  1802. :show-overflow-tooltip="item.showOverflowTooltip"
  1803. :align="item.align"
  1804. :fixed="item.fixed==''?false:item.fixed"
  1805. :min-width="item.columnWidth"
  1806. :label="item.columnLabel">
  1807. <template slot-scope="scope">
  1808. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  1809. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  1810. style="width: 100px; height: 80px"/></span>
  1811. </template>
  1812. </el-table-column>
  1813. </el-table>
  1814. <span slot="footer" class="dialog-footer">
  1815. <el-button type="primary" @click="provisionalDataAlterHandle(1)">{{ isLoading2 ? 'Saving...' : 'Confirm Import'}}</el-button>
  1816. <el-button type="primary" @click="provisionalDataAlterHandle(2)">{{ isLoading3 ? 'Canceling...' : 'Cancel'}}</el-button>
  1817. </span>
  1818. </el-dialog>
  1819. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  1820. <div v-show="false">
  1821. <img :src="item" v-for="(item,index) in base64List" :key="index" style="display: none">
  1822. </div>
  1823. </div>
  1824. </template>
  1825. <style scoped>
  1826. .big-label {
  1827. font-size: small /* 调整字号 */
  1828. }
  1829. </style>