SaleOrderModal.vue 24 KB

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