detailsFabricDrawer.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. <template>
  2. <!-- 新增面料 装箱单 -->
  3. <div id="addFabricDrawer">
  4. <a-drawer title="详情" width="89%" placement="right" :closable="true" :visible="visible" @close="handleCancel">
  5. <!-- 主表信息 填写-->
  6. <a-card :bordered="true">
  7. <div class="table-page-search-wrapper">
  8. <a-form-model layout="inline" ref="form" :model="addFabric" :rules="validatorRules">
  9. <a-row :gutter="24">
  10. <a-col :md="6" :sm="8">
  11. <a-form-model-item label="单号" prop="oddNum">
  12. {{addFabric.documentNo}}
  13. <!-- <a-input placeholder="自动生成" v-model="addFabric.documentNo"></a-input> -->
  14. </a-form-model-item>
  15. </a-col>
  16. <a-col :md="6" :sm="8">
  17. <a-form-model-item label="集装箱号" prop="containerNumber">
  18. {{addFabric.containerNumber}}
  19. <!-- <a-input placeholder="请输入集装箱号" v-model="addFabric.containerNumber"></a-input> -->
  20. </a-form-model-item>
  21. </a-col>
  22. <a-col :md="6" :sm="8">
  23. <a-form-model-item label="铅分号" prop="plumbumNo">
  24. {{addFabric.plumbumNo}}
  25. <!-- <a-input placeholder="请输入铅分号" v-model="addFabric.plumbumNo"></a-input> -->
  26. </a-form-model-item>
  27. </a-col>
  28. <a-col :md="6" :sm="8">
  29. <a-form-model-item label="装柜日期" prop="latestDateOfShipment">
  30. {{addFabric.latestDateOfShipment}}
  31. <!-- <a-date-picker
  32. placeholder="请选择装柜日期"
  33. :format="dateFormat"
  34. style="width: 100%"
  35. v-model="addFabric.latestDateOfShipment"
  36. /> -->
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :md="6" :sm="8">
  40. <a-form-model-item label="成衣工厂" prop="garmentFactory">
  41. {{addFabric.garmentFactory}}
  42. <!-- <a-input placeholder="勾选数据自动生成" v-model="addFabric.garmentFactory"></a-input> -->
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :md="6" :sm="8">
  46. <a-form-model-item label="外销发票号" prop="exportInvoiceNo">
  47. {{addFabric.exportInvoiceNo}}
  48. <!-- <a-input placeholder="请输入外销发票号" v-model="addFabric.exportInvoiceNo"></a-input> -->
  49. </a-form-model-item>
  50. </a-col>
  51. <a-col :md="6" :sm="8">
  52. <a-form-model-item label="托书号" prop="shippingOrderNumber">
  53. {{addFabric.shippingOrderNumber}}
  54. <!-- <a-input placeholder="请输入托书号" v-model="addFabric.shippingOrderNumber"></a-input> -->
  55. </a-form-model-item>
  56. </a-col>
  57. <a-col :md="6" :sm="8">
  58. <a-form-model-item label="备注" prop="remarks">
  59. {{addFabric.remarks}}
  60. <!-- <a-input placeholder="请输入备注" v-model="addFabric.remarks"></a-input> -->
  61. </a-form-model-item>
  62. </a-col>
  63. </a-row>
  64. </a-form-model>
  65. </div>
  66. </a-card>
  67. <!--操作按钮区域 参照发运明细 増行-->
  68. <a-card :bordered="true" style="margin:10px 0 60px 0;">
  69. <!-- 子表 -->
  70. <a-spin :spinning="confirmLoading">
  71. <a-form-model ref="formRef" :rules="validatorRules">
  72. <a-table
  73. bordered
  74. :columns="addFabricColumns"
  75. :data-source="addFabricData"
  76. :loading="loading"
  77. :pagination="false"
  78. :scroll="{ x: 1500 ,y: 300}"
  79. @change="handleTableChange"
  80. >
  81. </a-table>
  82. </a-form-model>
  83. </a-spin>
  84. <a-col :span="12">
  85. <a-form-model-item label="附件" prop="accessory">
  86. <ul v-for="(item, index) in accessory" :key="index" >
  87. <li>
  88. <a @click="accessoryDownload(item)">{{item}}</a>
  89. </li>
  90. </ul>
  91. </a-form-model-item>
  92. </a-col>
  93. </a-card>
  94. <!-- 页面底部提交取消 -->
  95. <div
  96. :style="{
  97. position: 'absolute',
  98. right: 0,
  99. bottom: 0,
  100. width: '100%',
  101. borderTop: '1px solid #e9e9e9',
  102. padding: '10px 16px',
  103. background: '#fff',
  104. textAlign: 'right',
  105. zIndex: 1
  106. }"
  107. >
  108. <a-button type="primary" @click="handleCancel">
  109. 关闭
  110. </a-button>
  111. </div>
  112. </a-drawer>
  113. </div>
  114. </template>
  115. <script>
  116. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  117. import JEllipsis from '@/components/jeecg/JEllipsis'
  118. import { downFile } from '@/api/manage'
  119. export default {
  120. name: 'AddFabricDrawer', // 新增 装箱单 -面料
  121. mixins: [JeecgListMixin],
  122. computed: {},
  123. components: { JEllipsis}, // 参照发运明细 弹框
  124. data() {
  125. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  126. return {
  127. // 表头
  128. addFabricColumns: [
  129. {
  130. title: '业务员 Merchandiser',
  131. dataIndex: 'salesman',
  132. width: 120,
  133. // fixed: 'left',
  134. className: 'replacecolor',
  135. ellipsis: true,
  136. },
  137. {
  138. title: '计划单号',
  139. dataIndex: 'planLotNumber',
  140. width: 160,
  141. // fixed: 'left',
  142. className: 'replacecolor',
  143. ellipsis: true,
  144. },
  145. {
  146. title: '款号/Kimball',
  147. dataIndex: 'itemNumber',
  148. width: 120,
  149. className: 'replacecolor',
  150. ellipsis: true,
  151. },
  152. {
  153. title: '缸号/Batch no.',
  154. dataIndex: 'dyelotNumber',
  155. // scopedSlots: { customRender: 'dyelotNumber' },
  156. width: 120,
  157. className: 'replacecolor',
  158. ellipsis: true,
  159. },
  160. {
  161. title: '颜色/Color',
  162. dataIndex: 'colour',
  163. width: 120,
  164. className: 'replacecolor',
  165. ellipsis: true,
  166. },
  167. {
  168. title: '项目/Item(存货编码)',
  169. dataIndex: 'inventoryCode',
  170. width: 120,
  171. className: 'replacecolor',
  172. ellipsis: true,
  173. },
  174. {
  175. title: '存货名称(辅料名称)',
  176. dataIndex: 'inventoryName',
  177. width: 160,
  178. className: 'replacecolor',
  179. ellipsis: true,
  180. },
  181. {
  182. title: '报关品名',
  183. dataIndex: 'declarationName',
  184. width: 120,
  185. className: 'replacecolor',
  186. ellipsis: true,
  187. },
  188. {
  189. title: '成分/Composition',
  190. dataIndex: 'composition',
  191. // scopedSlots: { customRender: 'composition' },
  192. width: 150,
  193. className: 'replacecolor',
  194. ellipsis: true,
  195. },
  196. {
  197. title: '门幅/Width',
  198. dataIndex: 'width',
  199. // scopedSlots: { customRender: 'width' },
  200. width: 140,
  201. className: 'replacecolor',
  202. ellipsis: true,
  203. },
  204. {
  205. title: '匹数/Rolls',
  206. dataIndex: 'rolls',
  207. // scopedSlots: { customRender: 'rolls' },
  208. width: 120,
  209. className: 'replacecolor',
  210. ellipsis: true,
  211. },
  212. {
  213. title: '毛重/GW/kg',
  214. dataIndex: 'grossWeight',
  215. // scopedSlots: { customRender: 'grossWeight' },
  216. width: 120,
  217. className: 'replacecolor',
  218. ellipsis: true,
  219. },
  220. {
  221. title: '净重/NW/kg',
  222. // scopedSlots: { customRender: 'netWeight' },
  223. dataIndex: 'netWeight',
  224. width: 120,
  225. className: 'replacecolor',
  226. ellipsis: true,
  227. },
  228. {
  229. title: '染后重',
  230. dataIndex: 'afterHeavy',
  231. // scopedSlots: { customRender: 'afterHeavy' },
  232. width: 90,
  233. className: 'replacecolor',
  234. ellipsis: true,
  235. },
  236. {
  237. title: '拷布重',
  238. dataIndex: 'kaoClothWeight',
  239. // scopedSlots: { customRender: 'kaoClothWeight' },
  240. width: 120,
  241. className: 'replacecolor',
  242. ellipsis: true,
  243. },
  244. {
  245. title: '米数/Length/m',
  246. dataIndex: 'meter',
  247. width: 130,
  248. className: 'replacecolor',
  249. ellipsis: true,
  250. },
  251. // {
  252. // title: '价格',
  253. // dataIndex: 'price',
  254. // width: 120,
  255. // className: 'replacecolor'
  256. // },
  257. {
  258. title: '克重/G',
  259. dataIndex: 'gramWeight',
  260. width: 120,
  261. className: 'replacecolor',
  262. ellipsis: true,
  263. },
  264. {
  265. title: '供应商编码(染厂)',
  266. dataIndex: 'supplierCodeDyeingPlant',
  267. // scopedSlots: { customRender: 'supplierCodeDyeingPlant' },
  268. width: 120,
  269. className: 'replacecolor',
  270. ellipsis: true,
  271. },
  272. {
  273. title: '供应商(染厂)',
  274. dataIndex: 'supplierDyeingPlant',
  275. // scopedSlots: { customRender: 'supplierDyeingPlant' },
  276. width: 120,
  277. className: 'replacecolor',
  278. ellipsis: true,
  279. },
  280. {
  281. title: '供应商编码(印厂)',
  282. // scopedSlots: { customRender: 'supplierCodePrintingPlant' },
  283. dataIndex: 'supplierCodePrintingPlant',
  284. width: 120,
  285. className: 'replacecolor',
  286. ellipsis: true,
  287. },
  288. {
  289. title: '供应商(印厂)',
  290. dataIndex: 'supplierPrintingPlant',
  291. // scopedSlots: { customRender: 'supplierPrintingPlant' },
  292. width: 120,
  293. className: 'replacecolor',
  294. ellipsis: true,
  295. },
  296. {
  297. title: '包装方式',
  298. dataIndex: 'mannerOfPacking',
  299. // scopedSlots: { customRender: 'mannerOfPacking' },
  300. width: 120,
  301. className: 'replacecolor',
  302. ellipsis: true,
  303. },
  304. {
  305. title: '处理方式',
  306. // scopedSlots: { customRender: 'treatmentMethod' },
  307. dataIndex: 'treatmentMethod',
  308. width: 120,
  309. className: 'replacecolor',
  310. ellipsis: true,
  311. },
  312. {
  313. title: '是否手册纱',
  314. dataIndex: 'manualYarnFlag',
  315. // scopedSlots: { customRender: 'manualYarnFlag' },
  316. width: 120,
  317. className: 'replacecolor',
  318. ellipsis: true,
  319. },
  320. {
  321. title: '手册纱单价',
  322. dataIndex: 'manualYarnUnitPrice',
  323. // scopedSlots: { customRender: 'manualYarnUnitPrice' },
  324. width: 120,
  325. className: 'replacecolor',
  326. ellipsis: true,
  327. },
  328. {
  329. title: '手册纱占比%',
  330. dataIndex: 'manualYarnProportion',
  331. // scopedSlots: { customRender: 'manualYarnProportion' },
  332. width: 120,
  333. className: 'replacecolor',
  334. ellipsis: true,
  335. },
  336. {
  337. title: '柜号',
  338. dataIndex: 'containerNumber',
  339. // scopedSlots: { customRender: 'containerNumber' },
  340. width: 120,
  341. className: 'replacecolor',
  342. ellipsis: true,
  343. },
  344. {
  345. title: '规格型号',
  346. dataIndex: 'specificationAndModel',
  347. width: 120,
  348. className: 'replacecolor',
  349. ellipsis: true,
  350. },
  351. {
  352. title: '实际报关数量',
  353. dataIndex: 'actualDeclaredQuantity',
  354. // scopedSlots: { customRender: 'actualDeclaredQuantity' },
  355. width: 120,
  356. className: 'replacecolor',
  357. ellipsis: true,
  358. },
  359. {
  360. title: '超发',
  361. dataIndex: 'excessQuantity',
  362. width: 120,
  363. className: 'replacecolor',
  364. ellipsis: true,
  365. },
  366. {
  367. title: '单位',
  368. dataIndex: 'masterMetering',
  369. width: 80,
  370. className: 'replacecolor',
  371. ellipsis: true,
  372. },
  373. {
  374. title: '价格',
  375. dataIndex: 'price',
  376. width: 100,
  377. className: 'replacecolor',
  378. ellipsis: true,
  379. },
  380. {
  381. title: '总价',
  382. dataIndex: 'totalPrice',
  383. width: 100,
  384. className: 'replacecolor',
  385. ellipsis: true,
  386. },
  387. {
  388. title: '备注(U8)',
  389. dataIndex: 'remarks2',
  390. width: 160,
  391. ellipsis: true,
  392. // fixed: 'right',
  393. // scopedSlots: { customRender: 'remarks2' },
  394. className: 'replacecolor'
  395. },
  396. ],
  397. accessory:[],
  398. addFabricData: [],
  399. loading: false, // 表格加载
  400. addFabric: {},
  401. visible: false,
  402. confirmLoading: false,
  403. validatorRules: { },
  404. dateFormat: 'YYYY-MM-DD'
  405. }
  406. },
  407. created() {},
  408. mounted() {},
  409. methods: {
  410. // 抽屉 取消
  411. handleCancel() {
  412. console.log('点击抽屉取消')
  413. this.close()
  414. },
  415. judageCloumn(){
  416. this.addFabricColumns.map(item => {
  417. if(item.title == "匹数/Rolls"){
  418. item.title = '箱数'
  419. }
  420. })
  421. var obj = {
  422. title: '尺码',
  423. dataIndex: 'size',
  424. width: 120,
  425. className: 'replacecolor'
  426. }
  427. this.addFabricColumns.splice(30,0,obj)
  428. },
  429. // -------------------------------------
  430. close() {
  431. this.$emit('close')
  432. this.visible = false
  433. this.addFabric = {}
  434. this.addFabricData = []
  435. this.addFabricColumns = this.addFabricColumns.filter(item => item.title !== '尺码')
  436. this.addFabricColumns.map(item => {
  437. if(item.title == "箱数"){
  438. item.title = '匹数/Rolls'
  439. }
  440. })
  441. },
  442. accessoryDownload(name){
  443. downFile(`/sys/common/static/${name}`).then(data => {
  444. if (!data) {
  445. this.$message.warning('文件下载失败')
  446. return
  447. }
  448. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  449. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
  450. } else {
  451. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  452. let link = document.createElement('a')
  453. link.style.display = 'none'
  454. link.href = url
  455. link.setAttribute('download', name + '.xls')
  456. document.body.appendChild(link)
  457. link.click()
  458. document.body.removeChild(link) // 下载完成移除元素
  459. window.URL.revokeObjectURL(url) // 释放掉blob对象
  460. }
  461. })
  462. },
  463. // 分页、排序、筛选变化时触发
  464. // handleTableChange(pagination, filters, sorter) {
  465. // // console.log('当前页信息>>>>',pagination)
  466. // this.queryParam.pageNo = pagination.current
  467. // this.getAnnList()
  468. // }
  469. }
  470. }
  471. </script>
  472. <style lang="less" scoped>
  473. @import '~@assets/less/common.less';
  474. @import '~@assets/less/overwriter.less';
  475. /deep/ .ant-table-thead > tr > th {
  476. text-align: center;
  477. // font-weight: 700;
  478. }
  479. /deep/ .ant-table-tbody {
  480. text-align: center;
  481. }
  482. // /deep/ th.replacecolor {
  483. // background-color: #ccc;
  484. // }
  485. // 抽屉里的card样式
  486. /deep/ .ant-drawer-content {
  487. background-color: #f0f2f5;
  488. }
  489. /deep/ .ant-drawer-body {
  490. padding: 10px;
  491. }
  492. </style>