saleInvoiceForm.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. <template>
  2. <a-spin :spinning="loading">
  3. <JFormContainer :disabled="disabled">
  4. <template #detail>
  5. <a-form v-bind="formItemLayout" name="saleInvoiceForm" ref="formRef">
  6. <a-row>
  7. <a-col :span="12">
  8. <a-form-item label="发票编号(invoice code)" v-bind="validateInfos.invoiceCode" id="saleInvoiceForm-invoiceCode" name="invoiceCode" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
  9. <a-input v-model:value="formData.invoiceCode" placeholder="自动生成" disabled></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :span="12">
  13. <a-form-item label="发票日期(bill date)" v-bind="validateInfos.billDate" id="saleInvoiceForm-billDate" name="billDate">
  14. <a-date-picker placeholder="请选择发票日期(bill date)" v-model:value="formData.billDate" value-format="YYYY-MM-DD" disabled style="width: 100%" allow-clear />
  15. </a-form-item>
  16. </a-col>
  17. <a-col :span="12">
  18. <a-form-item label="项目(project)" v-bind="validateInfos.projectName" id="saleInvoiceForm-projectName" name="projectName">
  19. <a-input-search v-model:value="formData.projectName" placeholder="请输入项目(project)" readonly allow-clear enter-button="Search" :disabled="notAllowEdit" @search="onSearchProject"></a-input-search>
  20. </a-form-item>
  21. </a-col>
  22. <a-col :span="12">
  23. <a-form-item label="业务类型(busymess type)" v-bind="validateInfos.busynessType" id="saleInvoiceForm-busynessType" name="busynessType">
  24. <JDictSelectTag v-model:value="formData.busynessType" placeholder="请选择" dictCode=" busyness_type" style="width: 100%;" :disabled="notAllowEdit"/>
  25. </a-form-item>
  26. </a-col>
  27. <a-col :span="12">
  28. <a-form-item label="购方(buyer)" v-bind="validateInfos.customer" id="saleInvoiceForm-customer" name="customer" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
  29. <ApiSelect
  30. :api="getCustomerOptions"
  31. showSearch
  32. v-model:value="formData.customer"
  33. optionFilterProp="label"
  34. resultField="records"
  35. labelField="name"
  36. valueField="id"
  37. :params='{pageSize:-1}'
  38. disabled
  39. />
  40. </a-form-item>
  41. </a-col>
  42. <a-col :span="12">
  43. <a-form-item label="购方税号(buyer's tax number)" v-bind="validateInfos.buyerTaxNumber" id="saleInvoiceForm-buyerTaxNumber" name="buyerTaxNumber">
  44. <a-input v-model:value="formData.buyerTaxNumber" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
  45. </a-form-item>
  46. </a-col>
  47. <a-col :span="12">
  48. <a-form-item label="购方电话(buyer's telphone)" v-bind="validateInfos.buyerTelphone" id="saleInvoiceForm-buyerTelphone" name="buyerTelphone">
  49. <a-input v-model:value="formData.buyerTelphone" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
  50. </a-form-item>
  51. </a-col>
  52. <a-col :span="12">
  53. <a-form-item label="购方地址(buyer's address)" v-bind="validateInfos.buyerAddress" id="saleInvoiceForm-buyerAddress" name="buyerAddress">
  54. <a-input v-model:value="formData.buyerAddress" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
  55. </a-form-item>
  56. </a-col>
  57. <a-col :span="12">
  58. <a-form-item label="购方银行(buyer's bank)" v-bind="validateInfos.buyerBank" id="saleInvoiceForm-buyerBank" name="buyerBank">
  59. <a-input v-model:value="formData.buyerBank" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
  60. </a-form-item>
  61. </a-col>
  62. <a-col :span="12">
  63. <a-form-item label="购方银行账户(buyer's bank account)" v-bind="validateInfos.buyerAccount" id="saleInvoiceForm-buyerAccount" name="buyerAccount">
  64. <a-input v-model:value="formData.buyerAccount" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
  65. </a-form-item>
  66. </a-col>
  67. <a-col :span="12">
  68. <a-form-item label="开票抬头(invoice header)" v-bind="validateInfos.invoiceHeader" id="saleInvoiceForm-invoiceHeader" name="invoiceHeader">
  69. <a-input v-model:value="formData.invoiceHeader" placeholder="请输入" allow-clear disabled></a-input>
  70. </a-form-item>
  71. </a-col>
  72. <a-col :span="12">
  73. <a-form-item label="开票地址(invoice address)" v-bind="validateInfos.invoiceAddress" id="saleInvoiceForm-invoiceAddress" name="invoiceAddress">
  74. <a-input v-model:value="formData.invoiceAddress" placeholder="请输入" allow-clear disabled></a-input>
  75. </a-form-item>
  76. </a-col>
  77. <a-col :span="12">
  78. <a-form-item label="销方(seller)" v-bind="validateInfos.seller" id="saleInvoiceForm-seller" name="saller" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
  79. <ApiSelect
  80. :api="listHeard"
  81. showSearch
  82. v-model:value="formData.seller"
  83. optionFilterProp="label"
  84. resultField="records"
  85. labelField="name"
  86. valueField="id"
  87. :params='{pageSize:-1}'
  88. @change="changeSeller"
  89. />
  90. </a-form-item>
  91. </a-col>
  92. <a-col :span="12">
  93. <a-form-item label="销方税号(seller's tax number)" v-bind="validateInfos.sellerTaxNumber" id="saleInvoiceForm-sellerTaxNumber" name="sellerTaxNumber">
  94. <a-input v-model:value="formData.sellerTaxNumber" placeholder="请输入" allow-clear ></a-input>
  95. </a-form-item>
  96. </a-col>
  97. <a-col :span="12">
  98. <a-form-item label="销方电话(seller's telphone)" v-bind="validateInfos.sellerTelphone" id="saleInvoiceForm-sellerTelphone" name="sellerTelphone">
  99. <a-input v-model:value="formData.sellerTelphone" placeholder="请输入" allow-clear ></a-input>
  100. </a-form-item>
  101. </a-col>
  102. <a-col :span="12">
  103. <a-form-item label="销方地址(seller's address)" v-bind="validateInfos.sellerAddress" id="saleInvoiceForm-sellerAddress" name="sellerAddress">
  104. <a-input v-model:value="formData.sellerAddress" placeholder="请输入" allow-clear ></a-input>
  105. </a-form-item>
  106. </a-col>
  107. <a-col :span="12">
  108. <a-form-item label="销方银行(seller's bank)" v-bind="validateInfos.sellerBank" id="saleInvoiceForm-sellerBank" name="sellerBank">
  109. <a-input v-model:value="formData.sellerBank" placeholder="请输入" allow-clear ></a-input>
  110. </a-form-item>
  111. </a-col>
  112. <a-col :span="12">
  113. <a-form-item label="销方银行账户(seller's bank account)" v-bind="validateInfos.sellerBankAccount" id="saleInvoiceForm-sellerBankAccount" name="sellerBankAccount">
  114. <a-input v-model:value="formData.sellerBankAccount" placeholder="请输入" allow-clear ></a-input>
  115. </a-form-item>
  116. </a-col>
  117. <a-col :span="12">
  118. <a-form-item label="F号(F number)" v-bind="validateInfos.fnumber" id="saleInvoiceForm-fnumber" name="fnumber">
  119. <a-input v-model:value="formData.fnumber" placeholder="请输入" allow-clear AutoComplete="off"></a-input>
  120. </a-form-item>
  121. </a-col>
  122. <a-col :span="12">
  123. <a-form-item label="备注(notes)" v-bind="validateInfos.notes" id="saleInvoiceForm-notes" name="notes" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
  124. <a-input v-model:value="formData.notes" placeholder="请输入备注(notes)" allow-clear AutoComplete="off"></a-input>
  125. </a-form-item>
  126. </a-col>
  127. </a-row>
  128. </a-form>
  129. </template>
  130. </JFormContainer>
  131. <!-- 子表单区域 -->
  132. <a-tabs v-model:activeKey="activeKey" animated style=" padding: 24px;padding-top: 0px;">
  133. <a-tab-pane tab="销售发票 - 发票明细(invoice details)" key="saleInvoiceDetails" :forceRender="true">
  134. <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectDeliveryList" > 选择发货通知单(select delevery notice)</a-button>
  135. <a-button type="primary" @click="selectCommissionList"> 选择佣金订单(selete commission order)</a-button>
  136. <j-vxe-table
  137. :keep-source="true"
  138. resizable
  139. ref="saleInvoiceDetailsTableRef"
  140. :loading="saleInvoiceDetailsTable.loading"
  141. :columns="saleInvoiceDetailsTable.columns"
  142. :dataSource="saleInvoiceDetailsTable.dataSource"
  143. :maxHeight="340"
  144. :disabled="disabled"
  145. :rowNumber="true"
  146. :rowSelection="true"
  147. asyncRemove
  148. @valueChange="changeValues"
  149. >
  150. <template #action="props">
  151. <a-popconfirm title="确定删除吗?" @confirm="handleDelete1(props)">
  152. <a>删除(delete)</a>
  153. </a-popconfirm>
  154. </template>
  155. </j-vxe-table>
  156. </a-tab-pane>
  157. <a-tab-pane tab="销售发票 - 船明细(ship details)" key="saleInvoiceFormShip" :forceRender="true">
  158. <j-vxe-table
  159. :keep-source="true"
  160. resizable
  161. ref="saleInvoiceFormShipTableRef"
  162. :loading="saleInvoiceFormShipTable.loading"
  163. :columns="saleInvoiceFormShipTable.columns"
  164. :dataSource="saleInvoiceFormShipTable.dataSource"
  165. :maxHeight="340"
  166. :disabled="disabled"
  167. :rowNumber="true"
  168. :rowSelection="true"
  169. >
  170. <template #action="props" >
  171. <a @click="viewAccessory(props)" >查看配件信息(view accessory information)</a>
  172. </template>
  173. </j-vxe-table>
  174. </a-tab-pane>
  175. </a-tabs>
  176. <SelectDeliveryNoticeModal ref="SelectDeliveryNoticeModalRef" @addDelivery="addSonList"></SelectDeliveryNoticeModal>
  177. <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesListRef"></BaseShipArchiveAccessoriesModal>
  178. <SelectCommissionOrderModal ref="SelectCommissionOrderModalRef"></SelectCommissionOrderModal>
  179. <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
  180. </a-spin>
  181. </template>
  182. <script lang="ts">
  183. import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
  184. import { defHttp } from '/@/utils/http/axios';
  185. import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
  186. import { querysaleInvoiceFormShipListByMainId,querySaleInvoiceDetailListByMainId,queryDataById, saveOrUpdate,listHeard } from '../salesInvoiceForm.api';
  187. import { JVxeTable } from '/@/components/jeecg/JVxeTable';
  188. import {saleInvoiceShipColumns, saleInvoiceDetailColumns} from '../salesInvoiceForm.data';
  189. import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
  190. import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
  191. import SelectDeliveryNoticeModal from './SelectDeliveryNoticeModal.vue';
  192. import SelectCommissionOrderModal from './SelectCommissionOrderModal.vue';
  193. import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
  194. import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
  195. import { JDictSelectTag,JSelectMultiple} from '/@/components/Form';
  196. import { ApiSelect, } from '/@/components/Form/index';
  197. import { Form,message } from 'ant-design-vue';
  198. import { useUserStore } from '/@/store/modules/user';
  199. import moment from 'moment';
  200. const userStore = useUserStore();
  201. const useForm = Form.useForm;
  202. export default defineComponent({
  203. name: "saleInvoiceForm",
  204. components:{
  205. JVxeTable,
  206. JFormContainer,
  207. BaseShipArchiveAccessoriesModal,
  208. JUpload,
  209. SelectProjectModal,
  210. JDictSelectTag,
  211. JSelectMultiple,
  212. SelectDeliveryNoticeModal,
  213. SelectCommissionOrderModal,
  214. ApiSelect
  215. },
  216. props:{
  217. formDisabled:{
  218. type: Boolean,
  219. default: false
  220. },
  221. formData: { type: Object, default: ()=>{} },
  222. formBpm: { type: Boolean, default: true }
  223. },
  224. emits:['success'],
  225. setup(props, {emit}) {
  226. const loading = ref(false);
  227. const formRef = ref();
  228. const SelectDeliveryNoticeModalRef = ref();
  229. const SelectCommissionOrderModalRef = ref();
  230. var SelectProjectModalRef = ref()
  231. const saleInvoiceFormShipTableRef = ref();
  232. const saleInvoiceFormShipTable = reactive<Record<string, any>>({
  233. loading: false,
  234. columns:saleInvoiceShipColumns,
  235. dataSource: []
  236. });
  237. const saleInvoiceDetailsTableRef = ref();
  238. const saleInvoiceDetailsTable = reactive<Record<string, any>>({
  239. loading: false,
  240. columns: saleInvoiceDetailColumns,
  241. dataSource: []
  242. });
  243. var BaseShipArchiveAccessoriesListRef = ref();
  244. const activeKey = ref('saleInvoiceDetails');
  245. var notAllowEdit = ref(false);
  246. var customerOption =ref([]);
  247. const formData = reactive<Record<string, any>>({
  248. id: '',
  249. status: undefined,
  250. delFlag: undefined,
  251. sourceCode:'',
  252. billDate: moment(new Date()).format('YYYY-MM-DD'),
  253. invoiceCode: '',
  254. project: '',
  255. projectName: '',
  256. customer: '',
  257. customerName: '',
  258. buyerTaxNumber: '',
  259. buyerTelphone:'',
  260. buyerAddress: '',
  261. buyerBank: '',
  262. buyerAccount: '',
  263. invoiceHeader: '',
  264. invoiceAddress:"",
  265. seller:'',
  266. sellerName:'',
  267. sellerTaxNumber: '',
  268. sellerTelphone: '',
  269. sellerAddress: '',
  270. sellerBank: '',
  271. sellerBankAccount: '',
  272. fnumber:'',
  273. notes:'',
  274. busynessType:''
  275. });
  276. //表单验证
  277. const validatorRules = reactive({
  278. });
  279. const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
  280. const dbData = {};
  281. const formItemLayout = {
  282. labelCol: {xs: {span: 24}, sm: {span: 8}},
  283. wrapperCol: {xs: {span: 24}, sm: {span: 13}},
  284. labelCol1: {xs: {span: 24}, sm: {span: 8}},
  285. wrapperCol1: {xs: {span: 24}, sm: {span: 13}},
  286. };
  287. // 表单禁用
  288. const disabled = computed(()=>{
  289. if(props.formBpm === true){
  290. if(props.formData.disabled === false){
  291. return false;
  292. }else{
  293. return true;
  294. }
  295. }
  296. return props.formDisabled;
  297. });
  298. //新增方法
  299. function add() {
  300. resetFields();
  301. saleInvoiceFormShipTable.dataSource = [];
  302. saleInvoiceDetailsTable.dataSource = [];
  303. activeKey.value = 'saleInvoiceDetails'
  304. getCustomerOptions()
  305. notAllowEdit.value = false
  306. }
  307. //编辑方法
  308. async function edit(row) {
  309. //主表数据
  310. await queryMainData(row.id);
  311. //子表数据
  312. const saleInvoiceFormShipDataList = await querysaleInvoiceFormShipListByMainId(row['id']);
  313. saleInvoiceFormShipTable.dataSource = [...saleInvoiceFormShipDataList];
  314. const saleInvoiceDetailsDataList = await querySaleInvoiceDetailListByMainId(row['id']);
  315. saleInvoiceDetailsTable.dataSource = [...saleInvoiceDetailsDataList];
  316. getCustomerOptions()
  317. notAllowEdit.value=true
  318. }
  319. //获取主表
  320. async function queryMainData(id) {
  321. const row = await queryDataById(id);
  322. resetFields();
  323. const tmpData = {};
  324. Object.keys(formData).forEach((key) => {
  325. if(row.hasOwnProperty(key)){
  326. tmpData[key] = row[key]
  327. }
  328. })
  329. //赋值
  330. Object.assign(formData,tmpData);
  331. }
  332. const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
  333. 'saleInvoiceShip': saleInvoiceFormShipTableRef,
  334. 'saleInvoiceProduct': saleInvoiceDetailsTableRef,
  335. });
  336. //获取表单信息
  337. async function getFormData() {
  338. try {
  339. // 触发表单验证
  340. await validate();
  341. } catch ({ errorFields }) {
  342. if (errorFields) {
  343. const firstField = errorFields[0];
  344. if (firstField) {
  345. formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
  346. }
  347. }
  348. return Promise.reject(errorFields);
  349. }
  350. return transformData(toRaw(formData))
  351. }
  352. //保存
  353. async function submitForm() {
  354. const mainData = await getFormData();
  355. const subData = await getSubFormAndTableData();
  356. if(!subData.saleInvoiceProductList||subData.saleInvoiceProductList.lenght==0){
  357. message.warning('请添加发票明细')
  358. }else{
  359. const values = Object.assign({}, dbData, mainData, subData);
  360. console.log('表单提交数据', values)
  361. const isUpdate = values.id ? true : false
  362. await saveOrUpdate(values, isUpdate);
  363. //关闭弹窗
  364. emit('success');
  365. }
  366. }
  367. function setFieldsValue(values) {
  368. if(values){
  369. Object.keys(values).map(k=>{
  370. formData[k] = values[k];
  371. });
  372. }
  373. }
  374. /**
  375. * 值改变事件触发-树控件回调
  376. * @param key
  377. * @param value
  378. */
  379. function handleFormChange(key, value) {
  380. formData[key] = value;
  381. }
  382. //产品明细-删除行
  383. async function handleDelete1(prop) {
  384. var newArray = [...saleInvoiceDetailsTable.dataSource]
  385. newArray.splice(prop.rowIndex, 1)
  386. saleInvoiceDetailsTable.dataSource = newArray
  387. if( saleInvoiceDetailsTable.dataSource.length!==0){
  388. notAllowEdit.value=true
  389. }else{
  390. notAllowEdit.value=false
  391. }
  392. }
  393. //选择项目
  394. function addProject(data) {
  395. if(data.length==0){
  396. formData.project =
  397. formData.projectName = ''
  398. }else{
  399. formData.project = data[0].id
  400. formData.projectName = data[0].code
  401. formData.customer =data[0].customerId
  402. formData.customerName =data[0].customerId_dictText
  403. }
  404. }
  405. //获取客户列表
  406. function getCustomerOptions(params){
  407. return defHttp.get({url:'/cuspCode/cuspCustomerProfile/list',params});
  408. }
  409. //查看配件信息
  410. function viewAccessory(prop){
  411. BaseShipArchiveAccessoriesListRef.value.getTable(prop.row)
  412. }
  413. //选择项目
  414. function onSearchProject(){
  415. SelectProjectModalRef.value.getTable()
  416. }
  417. function changeValues(prop){
  418. if(prop.col.key=='taxPrice'||prop.col.key=='quantity'){
  419. prop.row.taxPrice = prop.row.taxPrice&&prop.row.taxPrice!==''?prop.row.taxPrice:0
  420. prop.row.quantity = prop.row.quantity&&prop.row.quantity!==''?prop.row.quantity:0
  421. var num= Number(prop.row.taxPrice)*Number(prop.row.quantity)
  422. prop.row.taxMoney = num.toFixed(2)
  423. prop.row.taxRate = prop.row.taxRate?prop.row.taxRate:0
  424. prop.row.taxAmount = Number(prop.row.taxMoney)* Number(prop.row.taxRate)/100
  425. }
  426. }
  427. function selectDeliveryList(){
  428. if(formData.busynessType=='佣金业务'){
  429. message.warning('佣金业务不能选择发货通知单')
  430. }else if(saleInvoiceDetailsTable.dataSource==0||saleInvoiceDetailsTable.dataSource==undefined){
  431. SelectDeliveryNoticeModalRef.value.getTable(formData)
  432. }else{
  433. message.warning('发票明细只可有一条数据')
  434. }
  435. }
  436. function selectCommissionList(){
  437. if(formData.busynessType=='普通业务'){
  438. message.warning('普通业务不能选择佣金订单')
  439. }else if(saleInvoiceDetailsTable.dataSource==0||saleInvoiceDetailsTable.dataSource==undefined){
  440. SelectCommissionOrderModalRef.value.getTable()
  441. }else{
  442. message.warning('发票明细只可有一条数据')
  443. }
  444. }
  445. function addSonList(data){
  446. data.map(item=>{
  447. item.sourceId = item.childId
  448. item.quantity = item.quantity&& item.quantity!==''?item.quantity:0
  449. item.taxPrice = item.taxPrice&& item.taxPrice!==''?item.taxPrice:0
  450. item.taxMoney = item.money&& item.money!==''?item.money:0
  451. //暂无税率字段,设置默认为1
  452. item.taxRate = item.taxRate?item.taxRate:0
  453. item.taxAmount =item.taxMoney*item.taxRate/100
  454. })
  455. notAllowEdit.value=true
  456. var arrSonFormDelivery = data.concat(saleInvoiceDetailsTable.dataSource)
  457. saleInvoiceDetailsTable.dataSource=arrSonFormDelivery
  458. formData.project = data[0].project
  459. formData.projectName = data[0].projectName
  460. formData.customer = data[0].customer
  461. formData.customerName = data[0].customerName
  462. formData.sourceCode =data[0].billCode
  463. formData.invoiceHeader=data[0].invoiceHeader
  464. formData.invoiceAddress=data[0].invoiceAddress
  465. formData.busynessType = '普通业务'
  466. getCustomerOptions({pageSize:-1,id:data[0].customer}).then(res=>{
  467. formData.buyerTaxNumber = res.records[0].dutyParagraph
  468. formData.buyerTelphone = res.records[0].phone
  469. formData.buyerAddress = res.records[0].invoiceAddress
  470. })
  471. getShipDetail(data[0].headId,'delivery')
  472. }
  473. function getShipDetail(id,status){
  474. let params = {id:id}
  475. let url = status=='delivery'?'/saleCode/saleDelivery/querySaleDeliveryShipByMainId':'/saleCode/saleDelivery/querySaleContractShipByMainId'
  476. defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
  477. if(res){
  478. saleInvoiceFormShipTable.dataSource = res.result
  479. }
  480. })
  481. }
  482. async function changeSeller(value){
  483. var param={id:value}
  484. var result=await listHeard(param)
  485. formData.sellerName =result.records[0].name
  486. formData.sellerTaxNumber =result.records[0].taxcode
  487. formData.sellerTelphone =result.records[0].telphone
  488. formData.sellerAddress =result.records[0].address
  489. formData.sellerBank =result.records[0].bank
  490. formData.sellerBankAccount =result.records[0].bankAccount
  491. }
  492. return {
  493. saleInvoiceFormShipTableRef,
  494. saleInvoiceFormShipTable,
  495. saleInvoiceDetailsTableRef,
  496. saleInvoiceDetailsTable,
  497. validatorRules,
  498. validateInfos,
  499. activeKey,
  500. loading,
  501. formData,
  502. setFieldsValue,
  503. handleFormChange,
  504. formItemLayout,
  505. disabled,
  506. getFormData,
  507. submitForm,
  508. add,
  509. edit,
  510. formRef,
  511. BaseShipArchiveAccessoriesListRef,
  512. viewAccessory,
  513. handleDelete1,
  514. SelectProjectModalRef,
  515. onSearchProject,
  516. addProject,
  517. getCustomerOptions,
  518. customerOption,
  519. notAllowEdit,
  520. changeValues,
  521. SelectDeliveryNoticeModalRef,
  522. selectDeliveryList,
  523. SelectCommissionOrderModalRef,
  524. selectCommissionList,
  525. addSonList,
  526. listHeard,
  527. changeSeller
  528. }
  529. }
  530. });
  531. </script>
  532. <style lang="less" scoped>
  533. /** 时间和数字输入框样式 */
  534. :deep(.ant-input-number) {
  535. width: 100%;
  536. }
  537. :deep(.ant-calendar-picker) {
  538. width: 100%;
  539. }
  540. /deep/.vxe-table--body-wrapper{
  541. height: 100% !important;
  542. }
  543. /deep/.ant-modal-body{
  544. padding: 24px !important;
  545. }
  546. /deep/.ant-form-item{
  547. margin-bottom: 8px !important;
  548. }
  549. </style>