addShipDetDrawer.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. <template>
  2. <!-- 新增 发运明细 -->
  3. <div id="AddShipDetDrawer">
  4. <a-drawer
  5. title="新增发运明细"
  6. width="89%"
  7. placement="right"
  8. :closable="true"
  9. :visible="visible"
  10. @close="handleCancel"
  11. >
  12. <!-- 主表信息 填写-->
  13. <a-card :bordered="true">
  14. <div class="table-page-search-wrapper">
  15. <!-- :rules="validatorRules" -->
  16. <a-form-model layout="inline" ref="form" :model="addShipDet" :rules="validatorRules">
  17. <a-row :gutter="24">
  18. <a-col :md="6" :sm="8">
  19. <!-- required 必填项 disabled 禁用 -->
  20. <a-form-model-item label="单据号" prop="documentNo">
  21. <a-input placeholder="自动生成" v-model="addShipDet.documentNo" readOnly></a-input>
  22. </a-form-model-item>
  23. </a-col>
  24. <a-col :md="6" :sm="8">
  25. <a-form-model-item label="单据日期" prop="documentDate">
  26. <a-date-picker
  27. placeholder="请选择单据日期"
  28. format="YYYY-MM-DD"
  29. style="width:100%;"
  30. v-model="addShipDet.documentDate"
  31. />
  32. </a-form-model-item>
  33. </a-col>
  34. <a-col :md="6" :sm="8">
  35. <a-form-model-item label="客户" prop="customer">
  36. <a-input placeholder="请输入客户" v-model="addShipDet.customer"></a-input>
  37. </a-form-model-item>
  38. </a-col>
  39. <!-- <a-col :md="6" :sm="8">
  40. <a-form-model-item label="预发货日期" prop="preDeliveryDate">
  41. <a-date-picker
  42. placeholder="请选择预发货时间"
  43. format="YYYY-MM-DD"
  44. style="width:100%;"
  45. v-model="addShipDet.preDeliveryDate"
  46. />
  47. </a-form-model-item>
  48. </a-col> -->
  49. <!-- <a-col :md="6" :sm="8">
  50. <a-form-model-item label="预完工日期" prop="preCompletionDate">
  51. <a-date-picker
  52. placeholder="请选择预完工日期"
  53. format="YYYY-MM-DD"
  54. style="width:100%;"
  55. v-model="addShipDet.preCompletionDate"
  56. />
  57. </a-form-model-item>
  58. </a-col> -->
  59. <a-col :md="6" :sm="8">
  60. <a-form-model-item label="订单类型" prop="orderType">
  61. <a-input placeholder="请输入订单类型" v-model="addShipDet.orderType"></a-input>
  62. </a-form-model-item>
  63. </a-col>
  64. <!-- <a-col :md="6" :sm="8">
  65. <a-form-model-item label="成衣工厂" prop="garmentFactory">
  66. <a-input placeholder="请输入成衣工厂" v-model="addShipDet.garmentFactory"></a-input>
  67. </a-form-model-item>
  68. </a-col> -->
  69. <!--
  70. <a-col :md="6" :sm="8">
  71. <a-form-model-item label="整单合计" prop="wholeOrderTotal">
  72. <a-input placeholder="整单合计" v-model="addShipDet.wholeOrderTotal"></a-input>
  73. </a-form-model-item>
  74. </a-col> -->
  75. <!-- U8系统适用 -->
  76. <a-col :md="12" :sm="12">
  77. <a-form-model-item label="备注" prop="memo">
  78. <a-input placeholder="U8系统适用" v-model="addShipDet.memo"></a-input>
  79. </a-form-model-item>
  80. </a-col>
  81. </a-row>
  82. </a-form-model>
  83. </div>
  84. </a-card>
  85. <!-- 参照订单数据 増行-->
  86. <a-card :bordered="true" style="margin:10px 0">
  87. <div class="table-operator">
  88. <a-button type="primary" @click.stop="referOrderDataOpen" icon="ordered-list">参照订单数据</a-button>
  89. <!-- <a-button type="primary" @click.stop="handleAddColumn" icon="plus" style="margin-left: 20px">増行</a-button> -->
  90. </div>
  91. <!-- 子表 :model="form" rowKey="id" ,y:800 -->
  92. <a-spin :spinning="confirmLoading">
  93. <a-form-model ref="formRef">
  94. <a-table
  95. :loading="loading"
  96. v-if="syShippingDetailsItemList"
  97. bordered
  98. :rowKey="record => record.id"
  99. :columns="columns"
  100. :data-source="syShippingDetailsItemList"
  101. :pagination="false"
  102. :scroll="{ x: 1500, y: 400 }"
  103. size="small"
  104. >
  105. <!-- 款号 输入框 :rules="rules.itemNumber" -->
  106. <template slot="itemNumber" slot-scope="text, record, index">
  107. <a-form-model-item prop="itemNumber">
  108. <a-input style="width:100%" type="text" v-model="record.itemNumber" readOnly />
  109. </a-form-model-item>
  110. </template>
  111. <!-- 发货数量 :rules="rules.shipQuantity"-->
  112. <template slot="shipmentQuantity" slot-scope="text, record, index">
  113. <a-form-model-item prop="shipmentQuantity">
  114. <a-input style="width:100%" type="text" v-model="record.shipmentQuantity" />
  115. </a-form-model-item>
  116. </template>
  117. <!-- 是否TC功能 :rules="rules.isTC"-->
  118. <!-- isTc ' 是否 tc 功能 0 否 1 是', -->
  119. <template slot="isTC" slot-scope="text, record, index">
  120. <a-form-model-item prop="isTc">
  121. <a-select v-model="record.isTc">
  122. <a-select-option value="">请选择</a-select-option>
  123. <a-select-option :value="1">是</a-select-option>
  124. <a-select-option :value="0">否</a-select-option>
  125. </a-select>
  126. </a-form-model-item>
  127. </template>
  128. <!-- 物料成分 :rules="rules.materialComposition"-->
  129. <template slot="materialComposition" slot-scope="text, record, index">
  130. <a-form-model-item prop="materialComposition">
  131. <a-input style="width:100%" type="text" v-model="record.materialComposition" />
  132. </a-form-model-item>
  133. </template>
  134. <!-- 采购/委外订单号 :rules="rules.purOrSubOrder"-->
  135. <template slot="purOrSubOrder" slot-scope="text, record, index">
  136. <a-form-model-item prop="purOrSubOrder">
  137. <a-input style="width:100%" type="text" v-model="record.purOrSubOrder" />
  138. </a-form-model-item>
  139. </template>
  140. <!-- 报关单价 :rules="rules.customsDeclarationUnitPrice"-->
  141. <template slot="customsDeclarationUnitPrice" slot-scope="text, record, index">
  142. <a-form-model-item prop="customsDeclarationUnitPrice">
  143. <a-input style="width:100%" type="text" v-model="record.customsDeclarationUnitPrice" />
  144. </a-form-model-item>
  145. </template>
  146. <!-- 套装件数 :rules="rules.numberOfSets"-->
  147. <template slot="numberOfSets" slot-scope="text, record, index">
  148. <a-form-model-item prop="numberOfSets">
  149. <a-input style="width:100%" type="text" v-model="record.numberOfSets" />
  150. </a-form-model-item>
  151. </template>
  152. <!-- 工厂单价 :rules="rules.factoryUnitPrice"-->
  153. <template slot="factoryUnitPrice" slot-scope="text, record, index">
  154. <a-form-model-item prop="factoryUnitPrice">
  155. <a-input style="width:100%" type="text" v-model="record.factoryUnitPrice" />
  156. </a-form-model-item>
  157. </template>
  158. <!--处理方式 -->
  159. <template slot="treatmentMethod" slot-scope="text, record, index">
  160. <a-form-model-item prop="treatmentMethod">
  161. <a-input style="width:100%" type="text" v-model="record.treatmentMethod" />
  162. </a-form-model-item>
  163. </template>
  164. <!--是否手册纱 -->
  165. <template slot="manualYarnFlag" slot-scope="text, record, index">
  166. <a-form-model-item prop="manualYarnFlag">
  167. <a-select v-model="record.manualYarnFlag">
  168. <a-select-option value="">请选择</a-select-option>
  169. <a-select-option :value="1">是</a-select-option>
  170. <a-select-option :value="0">否</a-select-option>
  171. </a-select>
  172. </a-form-model-item>
  173. </template>
  174. <!--手册纱单价 -->
  175. <template slot="manualYarnUnitPrice" slot-scope="text, record, index">
  176. <a-form-model-item prop="manualYarnUnitPrice">
  177. <a-input style="width:100%" type="text" v-model="record.manualYarnUnitPrice" />
  178. </a-form-model-item>
  179. </template>
  180. <!--手册纱占比 -->
  181. <template slot="manualYarnProportion" slot-scope="text, record, index">
  182. <a-form-model-item prop="manualYarnProportion">
  183. <a-input style="width:100%" type="text" v-model="record.manualYarnProportion" />
  184. </a-form-model-item>
  185. </template>
  186. <!-- 操作 -->
  187. <template slot="operationSlot" slot-scope="text, record, index">
  188. <a-popconfirm
  189. v-if="syShippingDetailsItemList.length"
  190. title="确定删除吗?"
  191. @confirm="handleDelete(index)"
  192. >
  193. <a href="javascript:void(0);" style="color:red;">删除</a>
  194. </a-popconfirm>
  195. <a-divider type="vertical" />
  196. <a @click="copy(record)">复制</a>
  197. </template>
  198. </a-table>
  199. </a-form-model>
  200. </a-spin>
  201. </a-card>
  202. <!-- 页面底部保存取消 -->
  203. <div
  204. :style="{
  205. position: 'absolute',
  206. right: 0,
  207. bottom: 0,
  208. width: '100%',
  209. borderTop: '1px solid #e9e9e9',
  210. padding: '10px 16px',
  211. background: '#fff',
  212. textAlign: 'right',
  213. zIndex: 1
  214. }"
  215. >
  216. <a-popconfirm title="确定放弃新增?" @confirm="handleCancel" okText="确定" cancelText="取消">
  217. <a-button :style="{ marginRight: '8px' }">取消</a-button>
  218. </a-popconfirm>
  219. <a-button type="primary" @click="addSave">
  220. 保存
  221. </a-button>
  222. </div>
  223. </a-drawer>
  224. <!-- 参照订单数据弹框 -->
  225. <referOrderData-modal ref="referOrderDataModal" @bao="getSon" @ok="referOrderDataOk"></referOrderData-modal>
  226. </div>
  227. </template>
  228. <script>
  229. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  230. import JEllipsis from '@/components/jeecg/JEllipsis'
  231. import moment from 'moment'
  232. import ReferOrderDataModal from '@views/shipment-details/referOrderDataModal.vue'
  233. import { addShipmentList } from '@api/document/shipmentList'
  234. export default {
  235. name: 'AddShipDetDrawer', // 新增 发运明细 抽屉
  236. mixins: [JeecgListMixin],
  237. components: { JEllipsis, ReferOrderDataModal, moment }, // 参照订单数据 弹框
  238. data() {
  239. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  240. return {
  241. id: '',
  242. validatorRules:{
  243. documentDate:[{required: true, message: '请输入单据日期!'}],
  244. // customer:[{required: true, message: '请选择客户!'}],
  245. // preDeliveryDate:[{required: true, message: '请选择预发货时间!'}],
  246. // preCompletionDate:[{required: true, message: '请选择预完工日期!'}],
  247. // orderType:[{required: true, message: '请输入订单类型!'}],
  248. },
  249. // 表头
  250. columns: [
  251. {
  252. title: '账套',
  253. dataIndex: 'account',
  254. width: 80,
  255. fixed: 'left',
  256. className: 'replacecolor'
  257. },
  258. {
  259. title: '订单号',
  260. dataIndex: 'orderNumber',
  261. width: 120,
  262. fixed: 'left',
  263. className: 'replacecolor'
  264. },
  265. {
  266. title: '款号',
  267. dataIndex: 'itemNumber',
  268. fixed: 'left',
  269. width: 180,
  270. className: 'replacecolor'
  271. },
  272. {
  273. title: '订单日期',
  274. dataIndex: 'orderDate',
  275. width: 120,
  276. className: 'replacecolor',
  277. customRender: text => {
  278. return moment(text).format('YYYY-MM-DD')
  279. }
  280. },
  281. {
  282. title: '预发货日期',
  283. dataIndex: 'preDeliveryDate',
  284. width: 100,
  285. className: 'replacecolor',
  286. },
  287. {
  288. title: '预完工日期',
  289. dataIndex: 'preCompletionDate',
  290. width: 100,
  291. className: 'replacecolor',
  292. },
  293. {
  294. title: '成衣工厂',
  295. dataIndex: 'garmentFactory',
  296. width: 100,
  297. className: 'replacecolor'
  298. },
  299. {
  300. title: '业务类型',
  301. dataIndex: 'businessTypeText',
  302. width: 120,
  303. className: 'replacecolor'
  304. },
  305. {
  306. title: '订单主表ID',
  307. dataIndex: 'syOrderDataId',
  308. width: 100,
  309. className: 'replacecolor'
  310. },
  311. {
  312. title: '客户订单',
  313. dataIndex: 'customerOrder',
  314. width: 120,
  315. className: 'replacecolor'
  316. },
  317. {
  318. title: '小po',
  319. dataIndex: 'smallPo',
  320. width: 120,
  321. className: 'replacecolor'
  322. },
  323. {
  324. title: 'Pack Id',
  325. dataIndex: 'packId',
  326. width: 120,
  327. className: 'replacecolor'
  328. },
  329. {
  330. title: '分销点',
  331. dataIndex: 'distributionPoint',
  332. width: 120,
  333. className: 'replacecolor'
  334. },
  335. {
  336. title: '采购/委外订单号',
  337. dataIndex: 'purOrSubOrder',
  338. scopedSlots: { customRender: 'purOrSubOrder' },
  339. // fixed: 'left',
  340. width: 180,
  341. className: 'replacecolor'
  342. },
  343. {
  344. title: ' 报关单价',
  345. dataIndex: 'customsDeclarationUnitPrice',
  346. scopedSlots: { customRender: 'customsDeclarationUnitPrice' },
  347. // fixed: 'left',
  348. width: 180,
  349. className: 'replacecolor'
  350. },
  351. {
  352. title: '订单数量',
  353. dataIndex: 'orderQuantity',
  354. width: 120,
  355. className: 'replacecolor'
  356. },
  357. {
  358. title: '订单剩余数量',
  359. dataIndex: 'orderRemainingQuantity',
  360. width: 120,
  361. className: 'replacecolor'
  362. },
  363. {
  364. title: '发货数量',
  365. dataIndex: 'shipmentQuantity',
  366. scopedSlots: { customRender: 'shipmentQuantity' },
  367. width: 120,
  368. },
  369. {
  370. title: '套装件数',
  371. dataIndex: 'numberOfSets',
  372. scopedSlots: { customRender: 'numberOfSets' },
  373. width: 120,
  374. className: 'replacecolor'
  375. },
  376. {
  377. title: '是否TC功能',
  378. dataIndex: 'isTC',
  379. width: 90,
  380. scopedSlots: { customRender: 'isTC' },
  381. className: 'replacecolor'
  382. },
  383. {
  384. title: '物料成分',
  385. dataIndex: 'materialComposition',
  386. scopedSlots: { customRender: 'materialComposition' },
  387. width: 140,
  388. className: 'replacecolor'
  389. },
  390. {
  391. title: '销售类型',
  392. dataIndex: 'salesTypeText',
  393. width: 120,
  394. className: 'replacecolor'
  395. },
  396. {
  397. title: '客户简称',
  398. dataIndex: 'customerAbbreviation',
  399. width: 220,
  400. align: 'left',
  401. className: 'replacecolor'
  402. },
  403. {
  404. title: '客户名称',
  405. dataIndex: 'customerName',
  406. width: 220,
  407. align: 'left',
  408. className: 'replacecolor'
  409. },
  410. {
  411. title: '汇率',
  412. dataIndex: 'exchangeRate',
  413. width: 120,
  414. className: 'replacecolor'
  415. },
  416. {
  417. title: '销售部门',
  418. dataIndex: 'salesDepartment',
  419. width: 120,
  420. className: 'replacecolor'
  421. },
  422. {
  423. title: '业务员',
  424. dataIndex: 'salesman',
  425. width: 120,
  426. className: 'replacecolor'
  427. },
  428. {
  429. title: '币种',
  430. dataIndex: 'currencyText',
  431. width: 120,
  432. className: 'replacecolor'
  433. },
  434. {
  435. title: '品牌方',
  436. dataIndex: 'brandSide',
  437. width: 120,
  438. className: 'replacecolor'
  439. },
  440. {
  441. title: '第三方',
  442. dataIndex: 'thirdParty',
  443. width: 220,
  444. align: 'left',
  445. className: 'replacecolor'
  446. },
  447. {
  448. title: '定金比例(%)',
  449. dataIndex: 'depositRatio',
  450. width: 120,
  451. className: 'replacecolor'
  452. },
  453. {
  454. title: '定金',
  455. dataIndex: 'deposit',
  456. width: 120,
  457. className: 'replacecolor'
  458. },
  459. {
  460. title: '协同路线',
  461. dataIndex: 'collaborativeRoute',
  462. width: 120,
  463. className: 'replacecolor'
  464. },
  465. {
  466. title: '单价(销售)',
  467. dataIndex: 'salesUnitPrice',
  468. width: 120,
  469. className: 'replacecolor'
  470. },
  471. {
  472. title: '工厂单价',
  473. dataIndex: 'factoryUnitPrice',
  474. width: 120,
  475. scopedSlots: { customRender: 'factoryUnitPrice' },
  476. className: 'replacecolor'
  477. },
  478. {
  479. title: '付款条件',
  480. dataIndex: 'termOfPayment',
  481. width: 160,
  482. customRender: t => ellipsis(t),
  483. className: 'replacecolor'
  484. },
  485. {
  486. title: '最终客户',
  487. dataIndex: 'endCustomer',
  488. width: 120,
  489. className: 'replacecolor'
  490. },
  491. {
  492. title: '订单备注',
  493. dataIndex: 'orderRemarks',
  494. width: 160,
  495. customRender: t => ellipsis(t),
  496. className: 'replacecolor'
  497. },
  498. {
  499. title: '价格备注',
  500. dataIndex: 'priceRemarks',
  501. width: 160,
  502. customRender: t => ellipsis(t),
  503. className: 'replacecolor'
  504. },
  505. {
  506. title: '订单变更说明',
  507. dataIndex: 'orderChangeDescription',
  508. width: 160,
  509. customRender: t => ellipsis(t),
  510. className: 'replacecolor'
  511. },
  512. {
  513. title: '订单子表ID',
  514. dataIndex: 'syOrderDataItemId',
  515. width: 160,
  516. className: 'replacecolor'
  517. },
  518. {
  519. title: '处理方式',
  520. dataIndex: 'treatmentMethod',
  521. width: 160,
  522. scopedSlots: { customRender: 'treatmentMethod' },
  523. className: 'replacecolor'
  524. },
  525. {
  526. title: '是否手册纱',
  527. dataIndex: 'manualYarnFlag',
  528. width: 100,
  529. scopedSlots: { customRender: 'manualYarnFlag' },
  530. className: 'replacecolor'
  531. },
  532. {
  533. title: '手册纱单价',
  534. dataIndex: 'manualYarnUnitPrice',
  535. width: 160,
  536. scopedSlots: { customRender: 'manualYarnUnitPrice' },
  537. className: 'replacecolor'
  538. },
  539. {
  540. title: '手册纱占比',
  541. dataIndex: 'manualYarnProportion',
  542. width: 120,
  543. scopedSlots: { customRender: 'manualYarnProportion' },
  544. className: 'replacecolor'
  545. },
  546. {
  547. title: '分组ID',
  548. dataIndex: 'groupId',
  549. width: 120,
  550. className: 'replacecolor'
  551. },
  552. {
  553. title: '操作',
  554. dataIndex: 'operation',
  555. scopedSlots: { customRender: 'operationSlot' },
  556. width: 160,
  557. fixed: 'right',
  558. className: 'replacecolor'
  559. }
  560. ],
  561. syShippingDetailsItemList: [], // 子表数据
  562. msgFormSon: 'test', // 子组件传来数据的变量
  563. addShipDet: {}, // 主表信息
  564. visible: false,
  565. confirmLoading: false,
  566. dateFormat: 'YYYY-MM-DD',
  567. state: '0', // 单据状态初始未【仅保存】
  568. pushState: '0' // 推送状态初始未【仅保存】
  569. // validatorRules: {
  570. // documentNo: [{ required: true, message: '单据号不能为空', trigger: 'blur' }], 单据号
  571. }
  572. },
  573. // 接收父组件查询方法
  574. props: {
  575. fatherList: {
  576. type: Function,
  577. default: null
  578. }
  579. },
  580. methods: {
  581. getSon(val) {
  582. var copyValList = JSON.parse(JSON.stringify(val));
  583. this.addShipDet.customer = copyValList[0].customerName;
  584. for (var i in copyValList) {
  585. copyValList[i]['orderQuantity'] = copyValList[i].quantity
  586. copyValList[i]['orderRemainingQuantity'] = copyValList[i].surplusNum
  587. copyValList[i]['salesUnitPrice'] = copyValList[i].unitPriceIncludingTax
  588. copyValList[i]['customerOrder'] = copyValList[i].customerOrderNumber
  589. copyValList[i]['shipmentQuantity'] = copyValList[i].surplusNum // 订单剩余数量 赋值给发货数量
  590. }
  591. this.syShippingDetailsItemList = this.syShippingDetailsItemList.concat(copyValList);
  592. this.msgFormSon = this.syShippingDetailsItemList;
  593. },
  594. // 参照订单数据
  595. referOrderDataOpen() {
  596. this.$refs.referOrderDataModal.referOrderDataModVis = true
  597. // console.log('点击参照订单数据')
  598. },
  599. // 新增 保存
  600. addSave() {
  601. const that = this;
  602. // 触发表单验证
  603. this.$refs.form.validate(valid => {
  604. if (valid) {
  605. var newObj = {} // 新增对象
  606. newObj.documentNo = this.addShipDet.documentNo
  607. newObj.documentDate = this.addShipDet.documentDate.format('YYYY-MM-DD')
  608. newObj.customer = this.addShipDet.customer
  609. //newObj.preDeliveryDate = this.addShipDet.preDeliveryDate.format('YYYY-MM-DD') // 预发货日期
  610. //newObj.preCompletionDate = this.addShipDet.preCompletionDate.format('YYYY-MM-DD') // 预完工日期
  611. newObj.orderType = this.addShipDet.orderType
  612. newObj.garmentFactory = this.addShipDet.garmentFactory
  613. newObj.wholeOrderTotal = this.addShipDet.wholeOrderTotal
  614. newObj.memo = this.addShipDet.memo // U8系统适用
  615. newObj.syShippingDetailsItemList = this.syShippingDetailsItemList // 子表信息赋值
  616. // 必须选择子表 --- 参照订单数据
  617. if (newObj.syShippingDetailsItemList.length == 0) {
  618. this.$message.error('请选择参照订单数据')
  619. } else {
  620. for (var i=0; i<newObj.syShippingDetailsItemList.length; i++){
  621. var rowData = newObj.syShippingDetailsItemList[i];
  622. if (rowData.shipmentQuantity > rowData.orderRemainingQuantity){
  623. this.$message.error('第'+(i+1)+'行超发货数量超过订单剩余数量,无法保存');
  624. return;
  625. }
  626. }
  627. addShipmentList(newObj).then(res => {
  628. if (res.success) {
  629. this.$message.success('新增成功');
  630. this.close();
  631. // 清空信息
  632. this.addShipDet = {};
  633. this.addShipDet.syShippingDetailsItemList = [];
  634. this.fatherList(); // 调用父组件 查询方法
  635. // this.msgFormSon = {} 清空子表信息
  636. }else{
  637. this.$message.error(res.message);
  638. }
  639. })
  640. }
  641. }else{
  642. return false;
  643. }
  644. });
  645. // const that = this
  646. // // 触发表单验证
  647. // this.$refs.form.validate(valid => {
  648. // if (valid) {
  649. // that.confirmLoading = true
  650. // }
  651. // })
  652. },
  653. // 増行
  654. // handleAddColumn() {
  655. // console.log('増行')
  656. // const addrow = {
  657. // accountSet: '',
  658. // documentNo: '',
  659. // itemNumber: '',
  660. // orderDate: '',
  661. // businessType: '',
  662. // customerOrder: '',
  663. // smallPo: '',
  664. // packId: '',
  665. // orderDate: '',
  666. // orderRemaQuantity: '',
  667. // shipQuantity: '',
  668. // isTC: '',
  669. // materialComposition: '',
  670. // saleType: '',
  671. // customerShortName: '',
  672. // customerName: '',
  673. // exchangeRate: '',
  674. // wholeSingleCombined: '',
  675. // salesDepartment: '',
  676. // salesman: '',
  677. // currency: '',
  678. // brand: '',
  679. // thirdParty: '',
  680. // depositRate: '',
  681. // deposit: '',
  682. // collaborativeRoute: '',
  683. // paymentClause: '',
  684. // finalCustomer: '',
  685. // orderNote: '',
  686. // priceNote: '',
  687. // orderChangeDesc: '',
  688. // operation: ''
  689. // }
  690. // this.syShippingDetailsItemList.push(addrow)
  691. // },
  692. // --------------------------------------
  693. // 操作 删除
  694. handleDelete(index) {
  695. return this.syShippingDetailsItemList.splice(index, 1)
  696. },
  697. // 操作 复制 复制一行已有的数据
  698. copy(record) {
  699. var newRecord = JSON.parse(JSON.stringify(record));
  700. this.syShippingDetailsItemList.push(newRecord)
  701. },
  702. handleCancel() {
  703. this.close()
  704. },
  705. close() {
  706. this.$emit('close');
  707. this.visible = false;
  708. this.addShipDet = {};
  709. this.syShippingDetailsItemList = [];
  710. },
  711. // 参照订单数据弹框 ok-------------------------------------
  712. referOrderDataOk() {
  713. // console.log('参照订单数据弹框确定')
  714. this.$refs.referOrderDataModal.referOrderDataModVis = false;
  715. this.$refs.referOrderDataModal.queryParam.orderNumber="";
  716. this.$refs.referOrderDataModal.queryParam.account="";
  717. this.$refs.referOrderDataModal.queryParam.salesman="";
  718. this.$refs.referOrderDataModal.queryParam.customerName="";
  719. this.$refs.referOrderDataModal.queryParam.dateRange=[];
  720. }
  721. }
  722. }
  723. </script>
  724. <style lang="less" scoped>
  725. @import '~@assets/less/common.less';
  726. /deep/ .ant-table-thead > tr > th {
  727. text-align: center;
  728. // font-weight: 700;
  729. }
  730. /deep/ .ant-table-tbody {
  731. text-align: center;
  732. }
  733. // /deep/ th.replacecolor {
  734. // background-color: #ccc;
  735. // }
  736. // 抽屉里的card样式
  737. /deep/ .ant-drawer-content {
  738. background-color: #f0f2f5;
  739. }
  740. /deep/ .ant-drawer-body {
  741. padding: 10px;
  742. }
  743. // 子表下拉显示
  744. /deep/ .ant-card-body {
  745. margin-bottom: 60px;
  746. }
  747. </style>