SaleOrderModal.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  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']" :readOnly="true" />
  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']" :readOnly="true" />
  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
  298. style="width: 80%"
  299. placeholder="请输入收货地址"
  300. v-decorator.trim="['receiverAddress']"
  301. :readOnly="true"
  302. />
  303. </a-form-item>
  304. </a-col>
  305. </a-row>
  306. <a-row class="form-row" :gutter="24">
  307. <a-col :lg="6" :md="12" :sm="24">
  308. <a-form-item
  309. :labelCol="labelCol"
  310. :wrapperCol="wrapperCol"
  311. label="附件"
  312. data-step="10"
  313. data-title="附件"
  314. data-intro="可以上传与单据相关的图片、文档,支持多个文件"
  315. >
  316. <j-upload v-model="fileList" bizPath="bill"></j-upload>
  317. </a-form-item>
  318. </a-col>
  319. </a-row>
  320. </a-form>
  321. </a-spin>
  322. <many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
  323. <import-item-modal ref="importItemModalForm" @ok="importItemModalFormOk"></import-item-modal>
  324. <customer-modal ref="customerModalForm" @ok="customerModalFormOk"></customer-modal>
  325. <account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
  326. <history-bill-list ref="historyBillListModalForm"></history-bill-list>
  327. <workflow-iframe ref="modalWorkflow" @ok="workflowModalFormOk"></workflow-iframe>
  328. <bill-print-iframe ref="modalPrint"></bill-print-iframe>
  329. </j-modal>
  330. </template>
  331. <script>
  332. import pick from 'lodash.pick'
  333. import ManyAccountModal from '../dialog/ManyAccountModal'
  334. import ImportItemModal from '../dialog/ImportItemModal'
  335. import CustomerModal from '../../system/modules/CustomerModal'
  336. import AccountModal from '../../system/modules/AccountModal'
  337. import HistoryBillList from '../dialog/HistoryBillList'
  338. import WorkflowIframe from '@/components/tools/WorkflowIframe'
  339. import BillPrintIframe from '../dialog/BillPrintIframe'
  340. import { FormTypes } from '@/utils/JEditableTableUtil'
  341. import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
  342. import { BillModalMixin } from '../mixins/BillModalMixin'
  343. import { getMpListShort, handleIntroJs } from '@/utils/util'
  344. import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
  345. import JUpload from '@/components/jeecg/JUpload'
  346. import JDate from '@/components/jeecg/JDate'
  347. import Vue from 'vue'
  348. export default {
  349. name: 'SaleOrderModal',
  350. mixins: [JEditableTableMixin, BillModalMixin],
  351. components: {
  352. ManyAccountModal,
  353. ImportItemModal,
  354. CustomerModal,
  355. AccountModal,
  356. HistoryBillList,
  357. WorkflowIframe,
  358. BillPrintIframe,
  359. JUpload,
  360. JDate,
  361. JSelectMultiple,
  362. VNodes: {
  363. functional: true,
  364. render: (h, ctx) => ctx.props.vnodes,
  365. },
  366. },
  367. data() {
  368. return {
  369. title: '操作',
  370. width: '1600px',
  371. moreStatus: false,
  372. // 新增时子表默认添加几行空数据
  373. addDefaultRowNum: 1,
  374. visible: false,
  375. operTimeStr: '',
  376. prefixNo: 'XSDD',
  377. fileList: [],
  378. model: {},
  379. labelCol: {
  380. xs: { span: 24 },
  381. sm: { span: 8 },
  382. },
  383. wrapperCol: {
  384. xs: { span: 24 },
  385. sm: { span: 16 },
  386. },
  387. refKeys: ['materialDataTable'],
  388. activeKey: 'materialDataTable',
  389. materialTable: {
  390. loading: false,
  391. dataSource: [],
  392. columns: [
  393. { title: '', key: 'hiddenKey', width: '1%', type: FormTypes.hidden },
  394. {
  395. title: '批次号',
  396. key: 'batchNumber',
  397. width: '12%',
  398. type: FormTypes.popupJsh,
  399. kind: 'material',
  400. multi: true,
  401. validateRules: [{ required: true, message: '${title}不能为空' }],
  402. },
  403. { title: '名称', key: 'name', width: '9%', type: FormTypes.normal },
  404. { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
  405. { title: '生产日期', key: 'productionDate', width: '6%', type: FormTypes.normal },
  406. { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
  407. { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
  408. { title: '仓库名', key: 'depotName', width: '6%', type: FormTypes.normal },
  409. { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
  410. { title: '包装规格', key: 'unitName', width: '6%', type: FormTypes.normal },
  411. { title: '型号', key: 'model', width: '9%', type: FormTypes.normal },
  412. { title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
  413. { title: '品牌', key: 'brand', width: '6%', type: FormTypes.normal },
  414. { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
  415. { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
  416. { title: '库存', key: 'stock', width: '5%', type: FormTypes.normal },
  417. {
  418. title: '单位',
  419. key: 'unit',
  420. width: '6%',
  421. type: FormTypes.slot,
  422. options: [],
  423. allowClear: false,
  424. slotName: 'unit',
  425. },
  426. { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
  427. { title: '单位列表', key: 'unitList', width: '5%', type: FormTypes.hidden },
  428. { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
  429. { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
  430. { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
  431. { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
  432. { title: '已出库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
  433. {
  434. title: '出库数量',
  435. key: 'operNumber',
  436. width: '5%',
  437. type: FormTypes.inputNumber,
  438. statistics: true,
  439. validateRules: [{ required: true, message: '${title}不能为空' }],
  440. },
  441. { title: '单价', key: 'unitPrice', width: '4%', type: FormTypes.inputNumber },
  442. { title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
  443. { title: '税率', key: 'taxRate', width: '4%', type: FormTypes.inputNumber, placeholder: '%' },
  444. {
  445. title: '税额',
  446. key: 'taxMoney',
  447. width: '5%',
  448. type: FormTypes.inputNumber,
  449. readonly: true,
  450. statistics: true,
  451. },
  452. { title: '价税合计', key: 'taxLastMoney', width: '7%', type: FormTypes.inputNumber, statistics: true },
  453. // {
  454. // title: '实际出库数量',
  455. // key: 'actualQuantityInStorage',
  456. // width: '9%',
  457. // type: FormTypes.inputNumber,
  458. // validateRules: [{ required: true, message: '实际入库数量不能为空' }],
  459. // },
  460. // { title: '出库差异', key: 'warehousingVariance', width: '9%', type: FormTypes.input },
  461. // { title: '出库差异原因', key: 'reasonOfDifference', width: '9%', type: FormTypes.input },
  462. // {
  463. // title: '出库人',
  464. // key: 'warehousingUser',
  465. // width: '9%',
  466. // type: FormTypes.input,
  467. // validateRules: [{ required: true, message: '出库人不能为空' }],
  468. // },
  469. // { title: '出库时间', key: 'warehousingTime', width: '9%', type: FormTypes.date },
  470. { title: '备注', key: 'remark', width: '6%', type: FormTypes.input },
  471. { title: '关联id', key: 'linkId', width: '5%', type: FormTypes.hidden },
  472. ],
  473. },
  474. confirmLoading: false,
  475. validatorRules: {
  476. operTime: {
  477. rules: [{ required: true, message: '请输入单据日期!' }],
  478. },
  479. organId: {
  480. rules: [{ required: true, message: '请选择客户!' }],
  481. },
  482. },
  483. url: {
  484. add: '/depotHead/addDepotHeadAndDetail',
  485. edit: '/depotHead/updateDepotHeadAndDetail',
  486. detailList: '/depotItem/getDetailList',
  487. },
  488. unitList: [],
  489. }
  490. },
  491. created() {},
  492. methods: {
  493. //调用完edit()方法之后会自动调用此方法
  494. editAfter() {
  495. this.billStatus = '0'
  496. this.currentSelectDepotId = ''
  497. this.changeColumnHide()
  498. if (this.action === 'add') {
  499. this.addInit(this.prefixNo)
  500. this.personList.value = ''
  501. this.fileList = []
  502. this.$nextTick(() => {
  503. handleIntroJs(this.prefixNo, 1)
  504. })
  505. } else {
  506. this.model.operTime = this.model.operTimeStr
  507. if (this.model.accountId == null && this.model.accountIdList) {
  508. this.model.accountId = 0
  509. this.manyAccountBtnStatus = true
  510. this.accountIdList = this.model.accountIdList
  511. this.accountMoneyList = this.model.accountMoneyList
  512. } else {
  513. this.manyAccountBtnStatus = false
  514. }
  515. this.personList.value = this.model.salesMan
  516. this.fileList = this.model.fileName
  517. this.$nextTick(() => {
  518. this.form.setFieldsValue(
  519. pick(
  520. this.model,
  521. 'organId',
  522. 'operTime',
  523. 'number',
  524. 'remark',
  525. 'discount',
  526. 'discountMoney',
  527. 'discountLastMoney',
  528. 'accountId',
  529. 'changeAmount',
  530. 'salesMan',
  531. 'receiverName',
  532. 'receiverPhone',
  533. 'receiverAddress'
  534. )
  535. )
  536. })
  537. // 加载子表数据
  538. let params = {
  539. headerId: this.model.id,
  540. mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
  541. linkType: 'basic',
  542. }
  543. let url = this.readOnly ? this.url.detailList : this.url.detailList
  544. this.requestSubTableData(url, params, this.materialTable)
  545. }
  546. //复制新增单据-初始化单号和日期
  547. if (this.action === 'copyAdd') {
  548. this.model.id = ''
  549. this.model.tenantId = ''
  550. this.copyAddInit(this.prefixNo)
  551. }
  552. this.initSystemConfig()
  553. this.initCustomer(0)
  554. this.initSalesman()
  555. this.initAccount(0)
  556. this.initPlatform()
  557. this.initQuickBtn()
  558. },
  559. //提交单据时整理成formData
  560. classifyIntoFormData(allValues) {
  561. let totalPrice = 0
  562. let billMain = Object.assign(this.model, allValues.formValue)
  563. let detailArr = allValues.tablesValue[0].values
  564. billMain.type = '其它'
  565. billMain.subType = '销售订单'
  566. for (let item of detailArr) {
  567. item.depotId = '' //订单不需要仓库
  568. totalPrice += item.allPrice - 0
  569. }
  570. billMain.totalPrice = totalPrice
  571. if (billMain.accountId === 0) {
  572. billMain.accountId = ''
  573. }
  574. billMain.accountIdList = this.accountIdList.length > 0 ? JSON.stringify(this.accountIdList) : ''
  575. billMain.accountMoneyList = this.accountMoneyList.length > 0 ? JSON.stringify(this.accountMoneyList) : ''
  576. if (this.fileList && this.fileList.length > 0) {
  577. billMain.fileName = this.fileList
  578. } else {
  579. billMain.fileName = ''
  580. }
  581. if (this.model.id) {
  582. billMain.id = this.model.id
  583. }
  584. billMain.salesMan = this.personList.value
  585. billMain.status = this.billStatus
  586. return {
  587. info: JSON.stringify(billMain),
  588. rows: JSON.stringify(detailArr),
  589. }
  590. },
  591. handleHistoryBillList() {
  592. let organId = this.form.getFieldValue('organId')
  593. this.$refs.historyBillListModalForm.show('其它', '销售订单', '客户', organId)
  594. this.$refs.historyBillListModalForm.disableSubmit = false
  595. },
  596. getUnitInfo(val) {
  597. this.unitList = val
  598. },
  599. },
  600. }
  601. </script>
  602. <style scoped></style>