SaleBackModal.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. :keyboard="false"
  8. :forceRender="true"
  9. v-bind:prefixNo="prefixNo"
  10. fullscreen
  11. switchFullscreen
  12. @cancel="handleCancel"
  13. :id="prefixNo"
  14. style="top: 20px; height: 95%"
  15. >
  16. <template slot="footer">
  17. <a-button @click="handleCancel">取消</a-button>
  18. <a-button v-if="billPrintFlag && isShowPrintBtn" @click="handlePrint('销售退货入库')">三联打印预览</a-button>
  19. <a-button v-if="checkFlag && isCanCheck" :loading="confirmLoading" @click="handleOkAndCheck">保存并审核</a-button>
  20. <a-button type="primary" :loading="confirmLoading" @click="handleOk">保存(Ctrl+S)</a-button>
  21. <!--发起多级审核-->
  22. <a-button v-if="!checkFlag" @click="handleWorkflow()" type="primary">提交流程</a-button>
  23. </template>
  24. <a-spin :spinning="confirmLoading">
  25. <a-form :form="form">
  26. <a-row class="form-row" :gutter="24">
  27. <a-col :lg="6" :md="12" :sm="24">
  28. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
  29. <a-select
  30. placeholder="请选择客户"
  31. v-decorator="['organId', validatorRules.organId]"
  32. :disabled="!rowCanEdit"
  33. :dropdownMatchSelectWidth="false"
  34. showSearch
  35. optionFilterProp="children"
  36. @change="handleOrganChange"
  37. >
  38. <div slot="dropdownRender" slot-scope="menu">
  39. <v-nodes :vnodes="menu" />
  40. <a-divider style="margin: 4px 0" />
  41. <div
  42. v-if="quickBtn.customer"
  43. style="padding: 4px 8px; cursor: pointer"
  44. @mousedown="(e) => e.preventDefault()"
  45. @click="addCustomer"
  46. >
  47. <a-icon type="plus" /> 新增客户
  48. </div>
  49. </div>
  50. <a-select-option v-for="(item, index) in cusList" :key="index" :value="item.id">
  51. {{ item.supplier }}
  52. </a-select-option>
  53. </a-select>
  54. </a-form-item>
  55. </a-col>
  56. <a-col :lg="6" :md="12" :sm="24">
  57. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
  58. <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true" />
  59. </a-form-item>
  60. </a-col>
  61. <a-col :lg="6" :md="12" :sm="24">
  62. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
  63. <a-input placeholder="请输入单据编号" v-decorator.trim="['number']" />
  64. </a-form-item>
  65. </a-col>
  66. <a-col :lg="6" :md="12" :sm="24">
  67. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
  68. <a-input-search
  69. placeholder="请选择关联单据"
  70. v-decorator="['linkNumber']"
  71. @search="onSearchLinkNumber"
  72. :readOnly="true"
  73. />
  74. </a-form-item>
  75. </a-col>
  76. </a-row>
  77. <j-editable-table
  78. id="billModal"
  79. :ref="refKeys[0]"
  80. :loading="materialTable.loading"
  81. :columns="materialTable.columns"
  82. :dataSource="materialTable.dataSource"
  83. :minWidth="minWidth"
  84. :maxHeight="300"
  85. :rowNumber="false"
  86. :rowSelection="rowCanEdit"
  87. :actionButton="rowCanEdit"
  88. :dragSortAndNumber="rowCanEdit"
  89. @valueChange="onValueChange"
  90. @added="onAdded"
  91. @deleted="onDeleted"
  92. >
  93. <template #buttonAfter>
  94. <a-row
  95. v-if="rowCanEdit"
  96. :gutter="24"
  97. style="float: left; padding-bottom: 5px"
  98. data-step="4"
  99. data-title="扫码录入"
  100. data-intro="此功能支持扫码枪扫描商品条码进行录入"
  101. >
  102. <a-col v-if="scanStatus" :md="6" :sm="24">
  103. <a-button @click="scanEnter" style="margin-right: 8px">扫码录入</a-button>
  104. </a-col>
  105. <a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 8px 0 12px">
  106. <a-input
  107. placeholder="请扫描商品条码并回车"
  108. v-model="scanBarCode"
  109. @pressEnter="scanPressEnter"
  110. ref="scanBarCode"
  111. />
  112. </a-col>
  113. <a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px 24px 0 0">
  114. <a-button @click="stopScan" style="margin-right: 8px">收起扫码</a-button>
  115. </a-col>
  116. </a-row>
  117. </template>
  118. <template #depotBatchSet>
  119. <a-icon type="down" @click="handleBatchSetDepot" />
  120. </template>
  121. <template #depotAdd>
  122. <a-divider v-if="quickBtn.depot" style="margin: 4px 0" />
  123. <div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer" @click="addDepot">
  124. <a-icon type="plus" /> 新增仓库
  125. </div>
  126. </template>
  127. </j-editable-table>
  128. <a-row class="form-row" :gutter="24">
  129. <a-col :lg="24" :md="24" :sm="24">
  130. <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }" label="">
  131. <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
  132. </a-form-item>
  133. </a-col>
  134. </a-row>
  135. <a-row class="form-row" :gutter="24">
  136. <a-col :lg="6" :md="12" :sm="24">
  137. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠率">
  138. <a-input
  139. style="width: 80%"
  140. placeholder="请输入优惠率"
  141. v-decorator.trim="['discount']"
  142. suffix="%"
  143. @change="onChangeDiscount"
  144. />
  145. </a-form-item>
  146. </a-col>
  147. <a-col :lg="6" :md="12" :sm="24">
  148. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="退款优惠">
  149. <a-input
  150. placeholder="请输入付款优惠"
  151. v-decorator.trim="['discountMoney']"
  152. @change="onChangeDiscountMoney"
  153. />
  154. </a-form-item>
  155. </a-col>
  156. <a-col :lg="6" :md="12" :sm="24">
  157. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠后金额">
  158. <a-input placeholder="请输入优惠后金额" v-decorator.trim="['discountLastMoney']" :readOnly="true" />
  159. </a-form-item>
  160. </a-col>
  161. <a-col :lg="6" :md="12" :sm="24">
  162. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="其它费用">
  163. <a-input placeholder="请输入其它费用" v-decorator.trim="['otherMoney']" @change="onChangeOtherMoney" />
  164. </a-form-item>
  165. </a-col>
  166. </a-row>
  167. <a-row class="form-row" :gutter="24">
  168. <a-col :lg="6" :md="12" :sm="24">
  169. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户">
  170. <a-select
  171. style="width: 80%"
  172. placeholder="请选择结算账户"
  173. v-decorator="['accountId', validatorRules.accountId]"
  174. :dropdownMatchSelectWidth="false"
  175. allowClear
  176. @select="selectAccount"
  177. >
  178. <div slot="dropdownRender" slot-scope="menu">
  179. <v-nodes :vnodes="menu" />
  180. <a-divider style="margin: 4px 0" />
  181. <div
  182. v-if="quickBtn.account"
  183. style="padding: 4px 8px; cursor: pointer"
  184. @mousedown="(e) => e.preventDefault()"
  185. @click="addAccount"
  186. >
  187. <a-icon type="plus" /> 新增结算账户
  188. </div>
  189. </div>
  190. <a-select-option v-for="(item, index) in accountList" :key="index" :value="item.id">
  191. {{ item.name }}
  192. </a-select-option>
  193. </a-select>
  194. <a-tooltip title="多账户明细">
  195. <a-button
  196. type="default"
  197. icon="folder"
  198. style="margin-left: 8px"
  199. size="small"
  200. v-show="manyAccountBtnStatus"
  201. @click="handleManyAccount"
  202. />
  203. </a-tooltip>
  204. </a-form-item>
  205. </a-col>
  206. <a-col :lg="6" :md="12" :sm="24">
  207. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次退款">
  208. <a-input
  209. placeholder="请输入本次退款"
  210. v-decorator.trim="['changeAmount']"
  211. @change="onChangeChangeAmount"
  212. />
  213. </a-form-item>
  214. </a-col>
  215. <a-col :lg="6" :md="12" :sm="24">
  216. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次欠款">
  217. <a-input placeholder="请输入本次欠款" v-decorator.trim="['debt']" :readOnly="true" />
  218. </a-form-item>
  219. </a-col>
  220. <a-col :lg="6" :md="12" :sm="24">
  221. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售人员">
  222. <j-select-multiple
  223. placeholder="请选择销售人员"
  224. v-model="personList.value"
  225. :options="personList.options"
  226. />
  227. </a-form-item>
  228. </a-col>
  229. </a-row>
  230. <a-row class="form-row" :gutter="24">
  231. <a-col :lg="6" :md="12" :sm="24">
  232. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件">
  233. <j-upload v-model="fileList" bizPath="bill"></j-upload>
  234. </a-form-item>
  235. </a-col>
  236. </a-row>
  237. </a-form>
  238. </a-spin>
  239. <many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
  240. <link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
  241. <customer-modal ref="customerModalForm" @ok="customerModalFormOk"></customer-modal>
  242. <depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
  243. <account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
  244. <batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
  245. <workflow-iframe ref="modalWorkflow" @ok="workflowModalFormOk"></workflow-iframe>
  246. <bill-print-iframe ref="modalPrint"></bill-print-iframe>
  247. </j-modal>
  248. </template>
  249. <script>
  250. import pick from 'lodash.pick'
  251. import ManyAccountModal from '../dialog/ManyAccountModal'
  252. import LinkBillList from '../dialog/LinkBillList'
  253. import CustomerModal from '../../system/modules/CustomerModal'
  254. import DepotModal from '../../system/modules/DepotModal'
  255. import AccountModal from '../../system/modules/AccountModal'
  256. import BatchSetDepot from '../dialog/BatchSetDepot'
  257. import WorkflowIframe from '@/components/tools/WorkflowIframe'
  258. import BillPrintIframe from '../dialog/BillPrintIframe'
  259. import { FormTypes } from '@/utils/JEditableTableUtil'
  260. import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
  261. import { BillModalMixin } from '../mixins/BillModalMixin'
  262. import { getMpListShort, changeListFmtMinus } from '@/utils/util'
  263. import { getAction } from '@/api/manage'
  264. import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
  265. import JUpload from '@/components/jeecg/JUpload'
  266. import JDate from '@/components/jeecg/JDate'
  267. import Vue from 'vue'
  268. export default {
  269. name: 'SaleBackModal',
  270. mixins: [JEditableTableMixin, BillModalMixin],
  271. components: {
  272. ManyAccountModal,
  273. LinkBillList,
  274. CustomerModal,
  275. DepotModal,
  276. AccountModal,
  277. BatchSetDepot,
  278. WorkflowIframe,
  279. BillPrintIframe,
  280. JUpload,
  281. JDate,
  282. JSelectMultiple,
  283. VNodes: {
  284. functional: true,
  285. render: (h, ctx) => ctx.props.vnodes,
  286. },
  287. },
  288. data() {
  289. return {
  290. title: '操作',
  291. width: '1600px',
  292. moreStatus: false,
  293. // 新增时子表默认添加几行空数据
  294. addDefaultRowNum: 1,
  295. visible: false,
  296. operTimeStr: '',
  297. prefixNo: 'XSTH',
  298. fileList: [],
  299. rowCanEdit: true,
  300. model: {},
  301. labelCol: {
  302. xs: { span: 24 },
  303. sm: { span: 8 },
  304. },
  305. wrapperCol: {
  306. xs: { span: 24 },
  307. sm: { span: 16 },
  308. },
  309. refKeys: ['materialDataTable'],
  310. activeKey: 'materialDataTable',
  311. materialTable: {
  312. loading: false,
  313. dataSource: [],
  314. columns: [
  315. {
  316. title: '仓库名称',
  317. key: 'depotId',
  318. width: '8%',
  319. type: FormTypes.select,
  320. placeholder: '请选择${title}',
  321. options: [],
  322. allowSearch: true,
  323. validateRules: [{ required: true, message: '${title}不能为空' }],
  324. },
  325. {
  326. title: '条码',
  327. key: 'barCode',
  328. width: '12%',
  329. type: FormTypes.popupJsh,
  330. kind: 'material',
  331. multi: true,
  332. validateRules: [{ required: true, message: '${title}不能为空' }],
  333. },
  334. { title: '名称', key: 'name', width: '10%', type: FormTypes.normal },
  335. { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
  336. { title: '型号', key: 'model', width: '9%', type: FormTypes.normal },
  337. { title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
  338. { title: '品牌', key: 'brand', width: '6%', type: FormTypes.normal },
  339. { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
  340. { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
  341. { title: '库存', key: 'stock', width: '5%', type: FormTypes.normal },
  342. { title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
  343. { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'snAdd', multi: true },
  344. { title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.input },
  345. { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.date },
  346. { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
  347. { title: '原数量', key: 'preNumber', width: '5%', type: FormTypes.normal },
  348. { title: '已退货', key: 'finishNumber', width: '5%', type: FormTypes.normal },
  349. {
  350. title: '数量',
  351. key: 'operNumber',
  352. width: '5%',
  353. type: FormTypes.inputNumber,
  354. statistics: true,
  355. validateRules: [{ required: true, message: '${title}不能为空' }],
  356. },
  357. { title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber },
  358. { title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
  359. { title: '税率', key: 'taxRate', width: '4%', type: FormTypes.inputNumber, placeholder: '%' },
  360. {
  361. title: '税额',
  362. key: 'taxMoney',
  363. width: '5%',
  364. type: FormTypes.inputNumber,
  365. readonly: true,
  366. statistics: true,
  367. },
  368. { title: '价税合计', key: 'taxLastMoney', width: '7%', type: FormTypes.inputNumber, statistics: true },
  369. { title: '备注', key: 'remark', width: '6%', type: FormTypes.input },
  370. { title: '关联id', key: 'linkId', width: '5%', type: FormTypes.hidden },
  371. ],
  372. },
  373. confirmLoading: false,
  374. validatorRules: {
  375. operTime: {
  376. rules: [{ required: true, message: '请输入单据日期!' }],
  377. },
  378. organId: {
  379. rules: [{ required: true, message: '请选择客户!' }],
  380. },
  381. accountId: {
  382. rules: [{ required: true, message: '请选择结算账户!' }],
  383. },
  384. },
  385. url: {
  386. add: '/depotHead/addDepotHeadAndDetail',
  387. edit: '/depotHead/updateDepotHeadAndDetail',
  388. detailList: '/depotItem/getDetailList',
  389. },
  390. }
  391. },
  392. created() {},
  393. methods: {
  394. //调用完edit()方法之后会自动调用此方法
  395. editAfter() {
  396. this.billStatus = '0'
  397. this.currentSelectDepotId = ''
  398. this.rowCanEdit = true
  399. this.materialTable.columns[1].type = FormTypes.popupJsh
  400. this.changeColumnHide()
  401. this.changeFormTypes(this.materialTable.columns, 'snList', 0)
  402. this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
  403. this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
  404. this.changeFormTypes(this.materialTable.columns, 'preNumber', 0)
  405. this.changeFormTypes(this.materialTable.columns, 'finishNumber', 0)
  406. if (this.action === 'add') {
  407. this.addInit(this.prefixNo)
  408. this.personList.value = ''
  409. this.fileList = []
  410. } else {
  411. if (this.model.linkNumber) {
  412. this.rowCanEdit = false
  413. this.materialTable.columns[1].type = FormTypes.normal
  414. }
  415. this.model.operTime = this.model.operTimeStr
  416. this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - this.model.changeAmount).toFixed(2)
  417. if (this.model.accountId == null || this.model.accountId == 0) {
  418. this.model.accountId = 0
  419. this.manyAccountBtnStatus = true
  420. this.accountIdList = this.model.accountIdList
  421. this.accountMoneyList = this.model.accountMoneyList
  422. } else {
  423. this.manyAccountBtnStatus = false
  424. }
  425. this.personList.value = this.model.salesMan
  426. this.fileList = this.model.fileName
  427. this.$nextTick(() => {
  428. this.form.setFieldsValue(
  429. pick(
  430. this.model,
  431. 'organId',
  432. 'operTime',
  433. 'number',
  434. 'linkNumber',
  435. 'remark',
  436. 'discount',
  437. 'discountMoney',
  438. 'discountLastMoney',
  439. 'otherMoney',
  440. 'accountId',
  441. 'changeAmount',
  442. 'debt',
  443. 'salesMan'
  444. )
  445. )
  446. })
  447. // 加载子表数据
  448. let params = {
  449. headerId: this.model.id,
  450. mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
  451. linkType: 'basic',
  452. }
  453. let url = this.readOnly ? this.url.detailList : this.url.detailList
  454. this.requestSubTableData(url, params, this.materialTable)
  455. }
  456. //复制新增单据-初始化单号和日期
  457. if (this.action === 'copyAdd') {
  458. this.model.id = ''
  459. this.model.tenantId = ''
  460. this.copyAddInit(this.prefixNo)
  461. }
  462. this.initSystemConfig()
  463. this.initCustomer(0)
  464. this.initSalesman()
  465. this.initDepot()
  466. this.initAccount(0)
  467. this.initPlatform()
  468. this.initQuickBtn()
  469. },
  470. //提交单据时整理成formData
  471. classifyIntoFormData(allValues) {
  472. let totalPrice = 0
  473. let billMain = Object.assign(this.model, allValues.formValue)
  474. let detailArr = allValues.tablesValue[0].values
  475. billMain.type = '入库'
  476. billMain.subType = '销售退货'
  477. for (let item of detailArr) {
  478. totalPrice += item.allPrice - 0
  479. }
  480. billMain.totalPrice = 0 - totalPrice
  481. billMain.changeAmount = 0 - billMain.changeAmount
  482. if (billMain.accountId === 0) {
  483. billMain.accountId = ''
  484. }
  485. this.accountMoneyList = changeListFmtMinus(this.accountMoneyList)
  486. billMain.accountIdList = this.accountIdList.length > 0 ? JSON.stringify(this.accountIdList) : ''
  487. billMain.accountMoneyList = this.accountMoneyList.length > 0 ? JSON.stringify(this.accountMoneyList) : ''
  488. if (this.fileList && this.fileList.length > 0) {
  489. billMain.fileName = this.fileList
  490. } else {
  491. billMain.fileName = ''
  492. }
  493. if (this.model.id) {
  494. billMain.id = this.model.id
  495. }
  496. billMain.salesMan = this.personList.value
  497. billMain.status = this.billStatus
  498. return {
  499. info: JSON.stringify(billMain),
  500. rows: JSON.stringify(detailArr),
  501. }
  502. },
  503. onSearchLinkNumber() {
  504. this.$refs.linkBillList.show('出库', '销售', '客户', '1,2,3')
  505. this.$refs.linkBillList.title = '请选择销售出库'
  506. },
  507. linkBillListOk(
  508. selectBillDetailRows,
  509. linkNumber,
  510. organId,
  511. discountMoney,
  512. deposit,
  513. remark,
  514. depotId,
  515. accountId,
  516. salesMan
  517. ) {
  518. this.rowCanEdit = false
  519. this.materialTable.columns[1].type = FormTypes.normal
  520. this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
  521. this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
  522. if (selectBillDetailRows && selectBillDetailRows.length > 0) {
  523. let listEx = []
  524. let allTaxLastMoney = 0
  525. for (let j = 0; j < selectBillDetailRows.length; j++) {
  526. let info = selectBillDetailRows[j]
  527. if (info.finishNumber > 0) {
  528. info.operNumber = info.preNumber - info.finishNumber
  529. info.allPrice = info.operNumber * info.unitPrice - 0
  530. let taxRate = info.taxRate - 0
  531. info.taxMoney = ((info.allPrice * taxRate) / 100).toFixed(2) - 0
  532. info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2) - 0
  533. }
  534. info.linkId = info.id
  535. allTaxLastMoney += info.taxLastMoney
  536. listEx.push(info)
  537. this.changeColumnShow(info)
  538. }
  539. this.materialTable.dataSource = listEx
  540. ///给优惠后金额重新赋值
  541. allTaxLastMoney = allTaxLastMoney ? allTaxLastMoney : 0
  542. let discount = 0
  543. if (allTaxLastMoney !== 0) {
  544. discount = ((discountMoney / allTaxLastMoney) * 100).toFixed(2) - 0
  545. }
  546. let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
  547. this.$nextTick(() => {
  548. this.form.setFieldsValue({
  549. organId: organId,
  550. linkNumber: linkNumber,
  551. discount: discount,
  552. discountMoney: discountMoney,
  553. discountLastMoney: discountLastMoney,
  554. changeAmount: discountLastMoney,
  555. accountId: accountId,
  556. remark: remark,
  557. })
  558. this.personList.value = salesMan
  559. })
  560. }
  561. },
  562. },
  563. }
  564. </script>
  565. <style scoped></style>