clothesAddDrawer.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. <template>
  2. <!-- 新增成衣 -->
  3. <div id="clothesAddDrawer">
  4. <a-drawer
  5. title="新增成衣"
  6. width="89%"
  7. placement="right"
  8. :closable="true"
  9. :visible="visible"
  10. @close="handleCancel">
  11. <!-- 主表信息 填写-->
  12. <a-card :bordered="true">
  13. <div class="table-page-search-wrapper">
  14. <a-form-model layout="inline" ref="form" :model="clothesAdd" :rules="validatorRules">
  15. <a-row :gutter="24">
  16. <a-col :md="6" :sm="8">
  17. <a-form-model-item label="订单号" prop="orderNum">
  18. <a-input placeholder="请输入订单号" v-model="clothesAdd.orderNum"></a-input>
  19. </a-form-model-item>
  20. </a-col>
  21. <a-col :md="6" :sm="8">
  22. <a-form-model-item label="款号" prop="styleNum">
  23. <a-input placeholder="请输入款号" v-model="clothesAdd.styleNum"></a-input>
  24. </a-form-model-item>
  25. </a-col>
  26. <a-col :md="6" :sm="8">
  27. <a-form-model-item label="品名" prop="name">
  28. <a-input placeholder="请输入品名" v-model="clothesAdd.name"></a-input>
  29. </a-form-model-item>
  30. </a-col>
  31. <a-col :md="6" :sm="8">
  32. <a-form-model-item label="尺码范围" prop="sizeRange">
  33. <a-input placeholder="请输入尺码范围" v-model="clothesAdd.sizeRange"></a-input>
  34. <!-- <a-select placeholder="请选择尺码范围">
  35. <a-select-option value="">请选择</a-select-option>
  36. <a-select-option value="0">客户1</a-select-option>
  37. <a-select-option value="1">客户2</a-select-option>
  38. <a-select-option value="2">客户3</a-select-option>
  39. </a-select> -->
  40. </a-form-model-item>
  41. </a-col>
  42. <a-col :md="6" :sm="8">
  43. <a-form-model-item label="客户" prop="customer">
  44. <a-input placeholder="请输入客户" v-model="clothesAdd.customer"></a-input>
  45. </a-form-model-item>
  46. </a-col>
  47. <a-col :md="6" :sm="8">
  48. <a-form-model-item label="集装箱代号" prop="containerCode">
  49. <a-input placeholder="请输入集装箱代号" v-model="clothesAdd.containerCode"></a-input>
  50. </a-form-model-item>
  51. </a-col>
  52. <a-col :md="6" :sm="8">
  53. <a-form-model-item label="集装箱号" prop="containerNo">
  54. <a-input placeholder="请输入集装箱号" v-model="clothesAdd.containerNo"></a-input>
  55. </a-form-model-item>
  56. </a-col>
  57. <a-col :md="6" :sm="8">
  58. <a-form-model-item label="备注" prop="note">
  59. <a-input placeholder="请输入备注" v-model="clothesAdd.note"></a-input>
  60. </a-form-model-item>
  61. </a-col>
  62. <a-col :md="6" :sm="8">
  63. <a-form-model-item label="成衣工厂" prop="clothesFactory">
  64. <a-input placeholder="请输入成衣工厂" v-model="clothesAdd.clothesFactory"></a-input>
  65. </a-form-model-item>
  66. </a-col>
  67. <a-col :md="6" :sm="8">
  68. <a-form-model-item label="外销发票号" prop="exportInvoiceNo">
  69. <a-input placeholder="请输入外销发票号" v-model="clothesAdd.exportInvoiceNo"></a-input>
  70. </a-form-model-item>
  71. </a-col>
  72. <a-col :md="6" :sm="8">
  73. <a-form-model-item label="托书号" prop="bookNum">
  74. <a-input placeholder="请输入托书号" v-model="clothesAdd.bookNum"></a-input>
  75. </a-form-model-item>
  76. </a-col>
  77. </a-row>
  78. </a-form-model>
  79. </div>
  80. </a-card>
  81. <!--操作按钮区域 参照预装箱单 増行-->
  82. <a-card :bordered="true" style="margin:10px 0 60px 0;">
  83. <div class="table-operator">
  84. <a-button type="primary" @click="referadvancePackingList" icon="ordered-list">参照预装箱单</a-button>
  85. <a-button type="primary" @click="handleAddColumn" icon="plus" style="margin-left: 20px">増行</a-button>
  86. </div>
  87. <!-- 子表 :pagination="ipagination" -->
  88. <a-spin :spinning="confirmLoading">
  89. <a-form-model ref="formRef" :rules="validatorRules">
  90. <a-table
  91. bordered
  92. :row-key="record => record.id"
  93. :columns="clothesAddColumns"
  94. :data-source="clothesAddData"
  95. :loading="loading"
  96. :pagination="ipagination"
  97. :scroll="{ x: 1500 }"
  98. @change="handleTableChange"
  99. >
  100. <!-- 启始箱号 输入框-->
  101. <template slot="inceptionBoxNo" slot-scope="text, record, index">
  102. <a-form-model-item prop="inceptionBoxNo" :rules="rules.styleNum" required>
  103. <a-input style="width:100%" type="text" v-model="record.inceptionBoxNo" />
  104. </a-form-model-item>
  105. </template>
  106. <!-- 结束箱号 输入框-->
  107. <template slot="endBoxNo" slot-scope="text, record, index">
  108. <a-form-model-item prop="endBoxNo" :rules="rules.styleNum" required>
  109. <a-input style="width:100%" type="text" v-model="record.endBoxNo" />
  110. </a-form-model-item>
  111. </template>
  112. <!-- 件数/箱 输入框-->
  113. <template slot="packagesBox" slot-scope="text, record, index">
  114. <a-form-model-item prop="packagesBox" :rules="rules.styleNum" required>
  115. <a-input style="width:100%" type="text" v-model="record.packagesBox" />
  116. </a-form-model-item>
  117. </template>
  118. <!--箱数 输入框-->
  119. <template slot="boxes" slot-scope="text, record, index">
  120. <a-form-model-item prop="boxes" :rules="rules.styleNum" required>
  121. <a-input style="width:100%" type="text" v-model="record.boxes" />
  122. </a-form-model-item>
  123. </template>
  124. <!--净重/箱 输入框-->
  125. <template slot="suttle" slot-scope="text, record, index">
  126. <a-form-model-item prop="suttle" :rules="rules.styleNum" required>
  127. <a-input style="width:100%" type="text" v-model="record.suttle" />
  128. </a-form-model-item>
  129. </template>
  130. <!--毛重/箱 输入框-->
  131. <template slot="roughWeight" slot-scope="text, record, index">
  132. <a-form-model-item prop="roughWeight" :rules="rules.styleNum" required>
  133. <a-input style="width:100%" type="text" v-model="record.roughWeight" />
  134. </a-form-model-item>
  135. </template>
  136. <!--外箱长度 输入框-->
  137. <template slot="boxLength" slot-scope="text, record, index">
  138. <a-form-model-item prop="boxLength" :rules="rules.styleNum" required>
  139. <a-input style="width:100%" type="text" v-model="record.boxLength" />
  140. </a-form-model-item>
  141. </template>
  142. <!--外箱宽度 输入框-->
  143. <template slot="boxWidth" slot-scope="text, record, index">
  144. <a-form-model-item prop="boxWidth" :rules="rules.styleNum" required>
  145. <a-input style="width:100%" type="text" v-model="record.boxWidth" />
  146. </a-form-model-item>
  147. </template>
  148. <!--外箱高度 输入框-->
  149. <template slot="boxHeight" slot-scope="text, record, index">
  150. <a-form-model-item prop="boxHeight" :rules="rules.styleNum" required>
  151. <a-input style="width:100%" type="text" v-model="record.boxHeight" />
  152. </a-form-model-item>
  153. </template>
  154. <!-- 操作 -->
  155. <span slot="operationSlot" slot-scope="text, record">
  156. <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
  157. <a href="javascript:void(0);" style="color:red;">删除</a>
  158. </a-popconfirm>
  159. <a-divider type="vertical" />
  160. <a @click="copy(record)">复制</a>
  161. </span>
  162. </a-table>
  163. </a-form-model>
  164. </a-spin>
  165. </a-card>
  166. <!-- 页面底部提交取消 -->
  167. <div
  168. :style="{
  169. position: 'absolute',
  170. right: 0,
  171. bottom: 0,
  172. width: '100%',
  173. borderTop: '1px solid #e9e9e9',
  174. padding: '10px 16px',
  175. background: '#fff',
  176. textAlign: 'right',
  177. zIndex: 1
  178. }"
  179. >
  180. <a-popconfirm title="确定放弃新增?" @confirm="handleCancel" okText="确定" cancelText="取消">
  181. <a-button :style="{ marginRight: '8px' }">取消</a-button>
  182. </a-popconfirm>
  183. <a-button type="primary" @click="submitAdd">
  184. 提交
  185. </a-button>
  186. </div>
  187. </a-drawer>
  188. <!-- 参照预装箱单 -->
  189. <advancePackingList-modal ref="advancePackingListModal" :father="aa" @ok="modalFormOk"></advancePackingList-modal>
  190. </div>
  191. </template>
  192. <script>
  193. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  194. import JEllipsis from '@/components/jeecg/JEllipsis'
  195. import AdvancePackingListModal from '@views/pre-book/advancePackingListModal.vue'
  196. export default {
  197. name: 'ClothesAddDrawer', // 新增-装箱单 -成衣
  198. mixins: [JeecgListMixin],
  199. computed: {},
  200. components: { AdvancePackingListModal, JEllipsis }, // 参照预装箱单 弹框
  201. data() {
  202. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  203. return {
  204. // 表头
  205. clothesAddColumns: [
  206. {
  207. title: '账套',
  208. dataIndex: 'accountSet',
  209. width: 160,
  210. fixed: 'left',
  211. className: 'replacecolor'
  212. },
  213. {
  214. title: '成衣工厂',
  215. dataIndex: 'clothesFactory',
  216. width: 120,
  217. fixed: 'left',
  218. className: 'replacecolor'
  219. },
  220. {
  221. title: 'HOD',
  222. dataIndex: 'hod',
  223. width: 120,
  224. className: 'replacecolor'
  225. },
  226. {
  227. title: 'STYLE NO.',
  228. dataIndex: 'styleNo',
  229. width: 120,
  230. className: 'replacecolor'
  231. },
  232. {
  233. title: 'PO NO.',
  234. dataIndex: 'poNo',
  235. width: 90,
  236. className: 'replacecolor'
  237. },
  238. {
  239. title: 'ITEM NO./SKU NO./UPC NO./PACKS CODE',
  240. dataIndex: 'itemNo',
  241. width: 340,
  242. className: 'replacecolor'
  243. },
  244. {
  245. title: '分销点/DC/LABEL',
  246. dataIndex: 'dcLabel',
  247. width: 200,
  248. className: 'replacecolor'
  249. },
  250. {
  251. title: 'S',
  252. dataIndex: 's',
  253. width: 90,
  254. className: 'replacecolor'
  255. },
  256. {
  257. title: 'M',
  258. dataIndex: 'm',
  259. width: 90,
  260. className: 'replacecolor'
  261. },
  262. {
  263. title: 'L',
  264. dataIndex: 'l',
  265. width: 90,
  266. className: 'replacecolor'
  267. },
  268. {
  269. title: 'XL',
  270. dataIndex: 'xl',
  271. width: 90,
  272. className: 'replacecolor'
  273. },
  274. {
  275. title: 'XXL',
  276. dataIndex: 'xxl',
  277. width: 90,
  278. className: 'replacecolor'
  279. },
  280. {
  281. title: '3XL',
  282. dataIndex: '3xl',
  283. width: 90,
  284. className: 'replacecolor'
  285. },
  286. {
  287. title: '启始箱号',
  288. dataIndex: 'inceptionBoxNo',
  289. scopedSlots: { customRender: 'inceptionBoxNo' },
  290. width: 120,
  291. className: 'replacecolor'
  292. },
  293. {
  294. title: '结束箱号',
  295. dataIndex: 'endBoxNo',
  296. width: 120,
  297. scopedSlots: { customRender: 'endBoxNo' },
  298. className: 'replacecolor'
  299. },
  300. {
  301. title: '颜色(中英文)',
  302. dataIndex: 'colorChUsa',
  303. width: 140,
  304. className: 'replacecolor'
  305. },
  306. {
  307. title: '配码',
  308. dataIndex: 'configCode',
  309. width: 120,
  310. className: 'replacecolor'
  311. },
  312. {
  313. title: '件数/箱',
  314. dataIndex: 'packagesBox',
  315. width: 120,
  316. scopedSlots: { customRender: 'packagesBox' },
  317. className: 'replacecolor'
  318. },
  319. {
  320. title: '箱数',
  321. dataIndex: 'boxes',
  322. width: 120,
  323. scopedSlots: { customRender: 'boxes' },
  324. className: 'replacecolor'
  325. },
  326. {
  327. title: '总件数',
  328. dataIndex: 'totalPackagesNum',
  329. width: 90,
  330. className: 'replacecolor'
  331. },
  332. {
  333. title: '净重/箱',
  334. dataIndex: 'suttle',
  335. width: 120,
  336. scopedSlots: { customRender: 'suttle' },
  337. className: 'replacecolor'
  338. },
  339. {
  340. title: '总净重',
  341. dataIndex: 'totalSuttle',
  342. width: 90,
  343. className: 'replacecolor'
  344. },
  345. {
  346. title: '毛重/箱',
  347. dataIndex: 'roughWeight',
  348. width: 120,
  349. scopedSlots: { customRender: 'roughWeight' },
  350. className: 'replacecolor'
  351. },
  352. {
  353. title: '总毛重',
  354. dataIndex: 'totalRoughWeigh',
  355. width: 90,
  356. className: 'replacecolor'
  357. },
  358. {
  359. title: '外箱长度',
  360. dataIndex: 'boxLength',
  361. width: 120,
  362. scopedSlots: { customRender: 'boxLength' },
  363. className: 'replacecolor'
  364. },
  365. {
  366. title: '外箱宽度',
  367. dataIndex: 'boxWidth',
  368. width: 120,
  369. scopedSlots: { customRender: 'boxWidth' },
  370. className: 'replacecolor'
  371. },
  372. {
  373. title: '外箱高度',
  374. dataIndex: 'boxHeight',
  375. width: 120,
  376. scopedSlots: { customRender: 'boxHeight' },
  377. className: 'replacecolor'
  378. },
  379. {
  380. title: '总体积',
  381. dataIndex: 'totalVolume',
  382. width: 120,
  383. className: 'replacecolor'
  384. },
  385. {
  386. title: '净净重',
  387. dataIndex: 'netNetWeight',
  388. width: 120,
  389. className: 'replacecolor'
  390. },
  391. {
  392. title: '单价',
  393. dataIndex: 'price',
  394. width: 120,
  395. className: 'replacecolor'
  396. },
  397. {
  398. title: '总价',
  399. dataIndex: 'totalPrices',
  400. width: 120,
  401. className: 'replacecolor'
  402. },
  403. {
  404. title: '备注',
  405. dataIndex: 'note',
  406. width: 140,
  407. customRender: t => ellipsis(t),
  408. fixed: 'right',
  409. className: 'replacecolor'
  410. },
  411. {
  412. title: '操作',
  413. dataIndex: 'operation',
  414. scopedSlots: { customRender: 'operationSlot' },
  415. width: 160,
  416. fixed: 'right',
  417. className: 'replacecolor'
  418. }
  419. ],
  420. clothesAddData: [{}, {}, {}],
  421. loading: false, // 表格加载
  422. clothesAdd: {},
  423. visible: false,
  424. confirmLoading: false,
  425. validatorRules: {
  426. orderNum: [{ required: true, message: '订单号不能为空', trigger: 'blur' }],
  427. styleNum: [{ required: true, message: '款号不能为空', trigger: 'blur' }],
  428. name: [{ required: true, message: '品名不能为空', trigger: 'blur' }]
  429. // 待确定还有哪些必填信息
  430. }
  431. // dateFormat: 'YYYY-MM-DD'
  432. }
  433. },
  434. created() {},
  435. mounted() {},
  436. methods: {
  437. // 参照预装箱单
  438. referadvancePackingList() {
  439. console.log('打开参照订单数据')
  440. // 打开订单数据弹框
  441. this.$refs.advancePackingListModal.advancePackingListModVis = true
  442. },
  443. // 増行
  444. handleAddColumn() {
  445. console.log('増行')
  446. const addrow = {
  447. accountSet: '',
  448. clothesFactory: '',
  449. hod: '',
  450. styleNo: '',
  451. poNo: '',
  452. itemNo: '',
  453. dcLabel: '',
  454. s: '',
  455. m: '',
  456. l: '',
  457. xl: '',
  458. xxl: '',
  459. xxxl: '',
  460. inceptionBoxNo: '',
  461. endBoxNo: '',
  462. colorChUsa: '',
  463. configCode: '',
  464. packagesBox: '',
  465. boxes: '',
  466. totalPackagesNum: '',
  467. suttle: '',
  468. totalSuttle: '',
  469. roughWeight: '',
  470. totalRoughWeigh: '',
  471. boxLength: '',
  472. boxWidth: '',
  473. boxHeight: '',
  474. totalVolume: '',
  475. netNetWeight: '',
  476. price: '',
  477. totalPrices: '',
  478. note: '',
  479. operation: ''
  480. }
  481. this.clothesAddData.push(addrow)
  482. },
  483. // -------------------------------------
  484. // 操作 删除
  485. handleDelete(id) {
  486. console.log('id:', id)
  487. },
  488. // 操作按钮 复制
  489. copy(record) {},
  490. // -------------------------------------
  491. // 抽屉 取消
  492. handleCancel() {
  493. console.log('点击抽屉取消')
  494. this.close()
  495. },
  496. // 抽屉 提交
  497. submitAdd() {
  498. console.log('保存新增、刷新发运明细列表')
  499. const that = this
  500. // 触发表单验证
  501. this.$refs.form.validate(valid => {
  502. if (valid) {
  503. that.confirmLoading = true
  504. }
  505. })
  506. this.close()
  507. // this.getShipmentList() // 刷新 装箱单-成衣列表
  508. },
  509. // -------------------------------------
  510. close() {
  511. this.$emit('close')
  512. this.visible = false
  513. this.$refs.form.resetFields()
  514. },
  515. // - father------------------------------------
  516. aa() {},
  517. modalFormOk() {}
  518. // 分页、排序、筛选变化时触发
  519. // handleTableChange(pagination, filters, sorter) {
  520. // // console.log('当前页信息>>>>',pagination)
  521. // this.queryParam.pageNo = pagination.current
  522. // this.getAnnList()
  523. // }'
  524. }
  525. }
  526. </script>
  527. <style lang="less" scoped>
  528. @import '~@assets/less/common.less';
  529. @import '~@assets/less/overwriter.less';
  530. /deep/ .ant-table-thead > tr > th {
  531. text-align: center;
  532. // font-weight: 700;
  533. }
  534. /deep/ .ant-table-tbody {
  535. text-align: center;
  536. }
  537. // /deep/ th.replacecolor {
  538. // background-color: #ccc;
  539. // }
  540. // 抽屉里的card样式
  541. /deep/ .ant-drawer-content {
  542. background-color: #f0f2f5;
  543. }
  544. /deep/ .ant-drawer-body {
  545. padding: 10px;
  546. }
  547. </style>