index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789
  1. <template>
  2. <div class="pageIndexClass">
  3. <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
  4. :row-class-name="getRowClass" highlight-current-row @get-list="getList">
  5. <template #code="{ item }">
  6. <div v-if="Number(item.sumPayMoney) > Number(item.amount)" style="cursor: pointer; color: #f54a45" @click="handleClickCode(item)">
  7. {{ item.code }}
  8. </div>
  9. <div v-else style="cursor: pointer; color: #409eff" @click="handleClickCode(item)">
  10. {{ item.code }}
  11. </div>
  12. </template>
  13. <template #amount="{ item }">
  14. <div>
  15. <!-- <span style="padding-right: 4px">{{ item.currency }}</span> -->
  16. <span>¥ {{ moneyFormat(item.amount, 2) }}</span>
  17. </div>
  18. </template>
  19. <template #sumPayMoney="{ item }">
  20. <div>
  21. <!-- <span style="padding-right: 4px">{{ item.currency }}</span> -->
  22. <span>¥ {{ moneyFormat(item.sumPayMoney, 2) }}</span>
  23. </div>
  24. </template>
  25. <template #payStatus="{ item }">
  26. <div style="width:100%">
  27. <span :class="{'tag-active':item.payStatus==20,'tag-active-1':item.payStatus==10}">{{dictValueLabel(item.payStatus, payStatus)}}</span>
  28. </div>
  29. </template>
  30. </byTable>
  31. <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="920px">
  32. <PurchasePDF :rowData="rowData"></PurchasePDF>
  33. <!-- <PurchasePDFOne :rowData="rowData"></PurchasePDFOne> -->
  34. <!-- <PurchasePDFOneNew :rowData="rowData" ref="PdfDom"></PurchasePDFOneNew> -->
  35. <!-- <template #footer ref="printBtn">
  36. <el-button @click="openPdf = false" size="default">关闭</el-button>
  37. <el-button type="primary" v-print="printObj" size="default">打印</el-button>
  38. <el-button type="primary" @click="clickDownload()" size="default">下载PDF</el-button>
  39. <el-button type="primary" @click="exportExcel()" size="default">导出Excel</el-button>
  40. </template> -->
  41. </el-dialog>
  42. <el-dialog title="到货登记" v-model="arrivalDialog" width="80%" destroy-on-close>
  43. <el-tabs v-model="activeName" class="demo-tabs" type="card" @tab-change="handleTabChange">
  44. <el-tab-pane label="到货登记" name="1">
  45. <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
  46. <template #details>
  47. <div style="width:100%;padding:0 15px">
  48. <el-table :data="formData.data.arrivalDetailList">
  49. <el-table-column label="商品图片" width="80">
  50. <template #default="{ row }">
  51. <div v-if="row.fileUrl">
  52. <img :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column prop="productCode" label="商品编码" width="200" />
  57. <el-table-column prop="productName" label="商品名称" min-width="130" />
  58. <el-table-column label="规格尺寸 (cm)" width="140">
  59. <template #default="{ row, $index }">
  60. <div style="width: 100%">
  61. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="采购数量" prop="purchaseQuantity" width="100" />
  66. <el-table-column label="可登记最大数量(105%)" prop="maxQuantity" width="190" />
  67. <el-table-column label="已到货数量" prop="arrivalQuantity" width="100" />
  68. <el-table-column prop="quantity" label="到货数量" width="130">
  69. <template #default="{ row, $index }">
  70. <el-form-item :prop="'arrivalDetailList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
  71. class="margin-b-0">
  72. <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
  73. :controls="false" :min="0" />
  74. </el-form-item>
  75. </template>
  76. </el-table-column>
  77. </el-table>
  78. </div>
  79. </template>
  80. <template #details1>
  81. <div style="width:100%;padding:0 15px">
  82. <el-table :data="formData.data.arrivalDetailListOne">
  83. <el-table-column label="到货日期" prop="arrivalTime" width="150" />
  84. <el-table-column label="商品图片" width="80">
  85. <template #default="{ row }">
  86. <div v-if="row.fileUrl">
  87. <img :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
  88. </div>
  89. </template>
  90. </el-table-column>
  91. <el-table-column prop="productCode" label="商品编码" width="200" />
  92. <el-table-column prop="productName" label="商品名称" min-width="130" />
  93. <el-table-column label="规格尺寸 (cm)" width="140">
  94. <template #default="{ row, $index }">
  95. <div style="width: 100%">
  96. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  97. </div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="采购数量" prop="purchaseQuantity" width="100" />
  101. <el-table-column label="到货数量" prop="quantity" width="100" />
  102. </el-table>
  103. </div>
  104. </template>
  105. </byForm>
  106. </el-tab-pane>
  107. <el-tab-pane label="历史到货登记" name="2">
  108. <div style="margin:10px 0">
  109. <TitleInfo :content="'历史到货登记'"></TitleInfo>
  110. </div>
  111. <div style="width:100%;padding:0 15px">
  112. <el-table :data="formData.data.arrivalDetailListOne">
  113. <el-table-column label="到货日期" prop="arrivalTime" width="110" :formatter="(row)=>row.arrivalTime.slice(0,10)" />
  114. <el-table-column label="商品图片" width="80">
  115. <template #default="{ row }">
  116. <div v-if="row.fileUrl">
  117. <img :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
  118. </div>
  119. </template>
  120. </el-table-column>
  121. <el-table-column prop="productCode" label="商品编码" width="200" />
  122. <el-table-column prop="productName" label="商品名称" min-width="130" />
  123. <el-table-column label="规格尺寸 (cm)" width="140">
  124. <template #default="{ row, $index }">
  125. <div style="width: 100%">
  126. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  127. </div>
  128. </template>
  129. </el-table-column>
  130. <!-- <el-table-column label="采购数量" prop="purchaseQuantity" width="100" /> -->
  131. <el-table-column label="到货数量" prop="quantity" width="100" />
  132. <el-table-column label="实际入库数量" prop="receiptQuantity" width="110" />
  133. <el-table-column label="入库状态" prop="receiptStatus" width="100" :formatter="(row)=>dictValueLabel(row.receiptStatus,inBoundStatus)" />
  134. <el-table-column label="账期" width="150">
  135. <template #default="{ row, $index }">
  136. <div style="width: 100%">
  137. <el-form-item :prop="'arrivalDetailListOne.' + $index + '.accountPeriod'" :rules="rules.accountPeriod" :inline-message="true"
  138. class="margin-b-0">
  139. <el-date-picker v-model="row.accountPeriod" type="month" placeholder="请选择" style="width: 100%" value-format="YYYY-MM"
  140. :disabled-date="disabledFn" :clearable="false" @change="(val)=>handleChangeAccountPeriod(val,row)" />
  141. </el-form-item>
  142. </div>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. </div>
  147. </el-tab-pane>
  148. </el-tabs>
  149. <template #footer>
  150. <el-button @click="arrivalDialog = false" size="defualt" v-debounce>取 消</el-button>
  151. <el-button type="primary" @click="submitForm()" size="defualt" v-debounce>
  152. 确 定
  153. </el-button>
  154. </template>
  155. </el-dialog>
  156. </div>
  157. </template>
  158. <script setup>
  159. import { computed, ref } from "vue";
  160. import byTable from "@/components/byTable/index";
  161. import byForm from "@/components/byForm/index";
  162. import { ElMessage, ElMessageBox } from "element-plus";
  163. import PurchasePDF from "@/components/PDF/purchasePDF.vue";
  164. // import PurchasePDFOne from "@/components/PDF/purchasePDFOne.vue";
  165. // import PurchasePDFOneNew from "@/components/PDF/purchasePDFOneNew.vue";
  166. const route = useRoute();
  167. const { proxy } = getCurrentInstance();
  168. const activeName = ref("1");
  169. const supplierList = ref([]);
  170. const status = ref([
  171. {
  172. label: "草稿",
  173. value: 0,
  174. },
  175. {
  176. label: "审批中",
  177. value: 10,
  178. },
  179. {
  180. label: "驳回",
  181. value: 20,
  182. },
  183. {
  184. label: "已采购",
  185. value: 30,
  186. },
  187. {
  188. label: "变更中",
  189. value: 60,
  190. },
  191. {
  192. label: "已变更",
  193. value: 70,
  194. },
  195. {
  196. label: "作废",
  197. value: 88,
  198. },
  199. {
  200. label: "终止",
  201. value: 99,
  202. },
  203. ]);
  204. const inBoundStatus = ref([
  205. {
  206. label: "待入库",
  207. value: 0,
  208. },
  209. {
  210. label: "部分入库",
  211. value: 1,
  212. },
  213. {
  214. label: "入库完成",
  215. value: 2,
  216. },
  217. ]);
  218. const payStatus = ref([
  219. {
  220. label: "未付款",
  221. value: 0,
  222. },
  223. {
  224. label: "部分付款",
  225. value: 10,
  226. },
  227. {
  228. label: "已付款",
  229. value: 20,
  230. },
  231. ]);
  232. const sourceList = ref({
  233. data: [],
  234. pagination: {
  235. total: 0,
  236. pageNum: 1,
  237. pageSize: 10,
  238. keyword: "",
  239. status: "",
  240. payStatus: "",
  241. },
  242. });
  243. const loading = ref(false);
  244. const companyData = ref([]);
  245. const selectConfig = computed(() => {
  246. return [
  247. {
  248. label: "业务公司",
  249. prop: "companyId",
  250. data: proxy.useUserStore().allDict["list_company_data"],
  251. },
  252. {
  253. label: "采购状态",
  254. prop: "status",
  255. data: status.value,
  256. },
  257. {
  258. label: "付款状态",
  259. prop: "payStatus",
  260. data: payStatus.value,
  261. },
  262. ];
  263. });
  264. const config = computed(() => {
  265. return [
  266. {
  267. attrs: {
  268. label: "业务公司",
  269. prop: "companyName",
  270. width: 130,
  271. },
  272. },
  273. {
  274. attrs: {
  275. label: "采购单号",
  276. slot: "code",
  277. width: 180,
  278. },
  279. },
  280. {
  281. attrs: {
  282. label: "供应商",
  283. prop: "supplyName",
  284. "min-width": 220,
  285. },
  286. // render(type) {
  287. // return proxy.dictValueLabel(type, supplierList.value);
  288. // },
  289. },
  290. {
  291. attrs: {
  292. label: "采购金额",
  293. prop: "amount",
  294. width: 110,
  295. },
  296. render(val) {
  297. return proxy.moneyFormat(val, 2);
  298. },
  299. },
  300. {
  301. attrs: {
  302. label: "退货金额",
  303. prop: "backAmount",
  304. width: 110,
  305. },
  306. render(val) {
  307. return proxy.moneyFormat(val, 2);
  308. },
  309. },
  310. {
  311. attrs: {
  312. label: "应付金额",
  313. prop: "payableAmount",
  314. width: 110,
  315. },
  316. render(val) {
  317. return proxy.moneyFormat(val, 2);
  318. },
  319. },
  320. {
  321. attrs: {
  322. label: "已付款金额",
  323. prop: "sumPayMoney",
  324. width: 110,
  325. },
  326. render(val) {
  327. return proxy.moneyFormat(val, 2);
  328. },
  329. },
  330. {
  331. attrs: {
  332. label: "采购状态",
  333. prop: "status",
  334. width: 140,
  335. },
  336. render(type) {
  337. return proxy.dictValueLabel(type, status.value);
  338. },
  339. },
  340. {
  341. attrs: {
  342. label: "付款状态",
  343. prop: "payStatus",
  344. slot: "payStatus",
  345. width: 140,
  346. },
  347. // render(type) {
  348. // return proxy.dictValueLabel(type, payStatus.value);
  349. // },
  350. },
  351. {
  352. attrs: {
  353. label: "采购人",
  354. prop: "userName",
  355. width: 140,
  356. },
  357. },
  358. {
  359. attrs: {
  360. label: "采购时间",
  361. prop: "createTime",
  362. width: 160,
  363. },
  364. },
  365. {
  366. attrs: {
  367. label: "操作",
  368. width: 200,
  369. align: "right",
  370. fixed: "right",
  371. },
  372. renderHTML(row) {
  373. return [
  374. row.status == 30 && row.arrivalStatus == 0
  375. ? {
  376. attrs: {
  377. label: "变更",
  378. type: "primary",
  379. text: true,
  380. },
  381. el: "button",
  382. click() {
  383. handleChange(row);
  384. },
  385. }
  386. : {},
  387. row.status == 30
  388. ? {
  389. attrs: {
  390. label: "到货登记",
  391. type: "primary",
  392. text: true,
  393. },
  394. el: "button",
  395. click() {
  396. handleArrival(row);
  397. },
  398. }
  399. : {},
  400. {
  401. attrs: {
  402. label: "打印",
  403. type: "primary",
  404. text: true,
  405. },
  406. el: "button",
  407. click() {
  408. handlePrintPdf(row);
  409. },
  410. },
  411. // && Number(row.amount) > Number(row.sumPayMoney)
  412. row.status == 10 || (row.status == 30 && Number(row.sumPayMoney) == 0)
  413. ? {
  414. attrs: {
  415. label: "作废",
  416. type: "danger",
  417. text: true,
  418. },
  419. el: "button",
  420. click() {
  421. ElMessageBox.confirm(
  422. "此操作将作废该数据, 是否继续?",
  423. "提示",
  424. {
  425. confirmButtonText: "确定",
  426. cancelButtonText: "取消",
  427. type: "warning",
  428. }
  429. ).then(() => {
  430. proxy
  431. .post("/ehsdPurchase/cancellation", {
  432. id: row.id,
  433. status: 88,
  434. })
  435. .then(() => {
  436. ElMessage({
  437. message: "作废成功",
  438. type: "success",
  439. });
  440. getList();
  441. });
  442. });
  443. },
  444. }
  445. : {},
  446. row.status == 30 && Number(row.amount) > Number(row.sumPayMoney)
  447. ? {
  448. attrs: {
  449. label: "终止",
  450. type: "primary",
  451. text: true,
  452. },
  453. el: "button",
  454. click() {
  455. ElMessageBox.confirm(
  456. "此操作将终止该数据, 是否继续?",
  457. "提示",
  458. {
  459. confirmButtonText: "确定",
  460. cancelButtonText: "取消",
  461. type: "warning",
  462. }
  463. ).then(() => {
  464. proxy
  465. .post("/ehsdPurchase/edit", {
  466. id: row.id,
  467. status: 99,
  468. })
  469. .then(() => {
  470. ElMessage({
  471. message: "终止",
  472. type: "success",
  473. });
  474. getList();
  475. });
  476. });
  477. },
  478. }
  479. : {},
  480. ];
  481. },
  482. },
  483. ];
  484. });
  485. const getDict = () => {
  486. proxy
  487. .post("/supplierInfo/page", { pageNum: 1, pageSize: 999 })
  488. .then((res) => {
  489. supplierList.value = res.rows.map((item) => {
  490. return {
  491. ...item,
  492. label: item.name,
  493. value: item.id,
  494. };
  495. });
  496. });
  497. };
  498. const getList = async (req) => {
  499. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  500. loading.value = true;
  501. proxy.post("/ehsdPurchase/page", sourceList.value.pagination).then((res) => {
  502. console.log(res);
  503. sourceList.value.data = res.rows;
  504. sourceList.value.pagination.total = res.total;
  505. setTimeout(() => {
  506. loading.value = false;
  507. }, 200);
  508. });
  509. };
  510. getDict();
  511. if (route.query.code) {
  512. sourceList.value.pagination.keyword = route.query.code;
  513. }
  514. getList();
  515. const openPdf = ref(false);
  516. const pdfData = ref({});
  517. const rowData = ref({});
  518. const handlePrintPdf = (row) => {
  519. rowData.value = {
  520. id: row.id,
  521. code: row.code,
  522. };
  523. rowData.value = row;
  524. openPdf.value = true;
  525. };
  526. const clickDownload = () => {
  527. proxy.getPdf("购销合同" + rowData.value.code);
  528. };
  529. const pdfDom = ref(null);
  530. const printObj = ref({
  531. id: "pdfDom",
  532. popTitle: "",
  533. extraCss:
  534. "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
  535. extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
  536. });
  537. const handleClickCode = (row) => {
  538. // let submitType = row.dataResource > 0 ? "10" : "20";
  539. proxy.$router.push({
  540. path: "/platform_manage/process/processApproval",
  541. query: {
  542. flowKey: "purchase_flow",
  543. id: row.flowId,
  544. processType: 20,
  545. businessId: row.id,
  546. // submitType,
  547. },
  548. });
  549. };
  550. const getRowClass = ({ row }) => {
  551. if (Number(row.sumPayMoney) > Number(row.amount)) {
  552. return "redClass";
  553. }
  554. return "";
  555. };
  556. const handleChange = (row) => {
  557. let submitType = row.dataResource > 0 ? "10" : "20";
  558. let type = "";
  559. if (row.dataResource == 1) {
  560. type = 1;
  561. } else if (row.dataResource == 2) {
  562. type = 2;
  563. }
  564. proxy.$router.push({
  565. path: "/platform_manage/process/processApproval",
  566. query: {
  567. flowKey: "purchase_update_flow",
  568. flowName: "采购订单变更",
  569. random: proxy.random(),
  570. businessId: row.id,
  571. submitType,
  572. type,
  573. },
  574. });
  575. };
  576. const formData = reactive({
  577. data: {},
  578. });
  579. const formOption = reactive({
  580. inline: true,
  581. labelWidth: 110,
  582. itemWidth: 100,
  583. rules: [],
  584. });
  585. const formConfig = computed(() => {
  586. return [
  587. {
  588. type: "title1",
  589. title: "基本信息",
  590. },
  591. {
  592. type: "input",
  593. prop: "code",
  594. label: "采购单号",
  595. itemWidth: 50,
  596. disabled: true,
  597. },
  598. {
  599. type: "input",
  600. prop: "sellCorporationName",
  601. label: "供应商",
  602. itemWidth: 50,
  603. disabled: true,
  604. },
  605. {
  606. type: "date",
  607. prop: "arrivalTime",
  608. label: "到货日期",
  609. itemType: "date",
  610. itemWidth: 50,
  611. },
  612. {
  613. type: "title1",
  614. title: "到货明细",
  615. },
  616. {
  617. type: "slot",
  618. slotName: "details",
  619. label: "",
  620. },
  621. // {
  622. // type: "title1",
  623. // title: "历史到货登记",
  624. // },
  625. // {
  626. // type: "slot",
  627. // slotName: "details1",
  628. // label: "",
  629. // },
  630. ];
  631. });
  632. const rules = ref({
  633. arrivalTime: [
  634. { required: true, message: "请选择到货日期", trigger: "change" },
  635. ],
  636. quantity: [{ required: true, message: "请输入到货数量", trigger: "blur" }],
  637. });
  638. const formDom = ref(null);
  639. const arrivalDialog = ref(false);
  640. const submitLoading = ref(false);
  641. const handleArrival = (row) => {
  642. proxy.post("/ehsdPurchase/detail", { id: row.id }).then((res) => {
  643. formData.data = {
  644. purchaseId: row.id,
  645. code: row.code,
  646. sellCorporationName: res.sellCorporationName,
  647. arrivalDetailList: res.purchaseProductList.map((x) => ({
  648. // ...x,
  649. productId: x.productId,
  650. productCode: x.productCode,
  651. productName: x.productName,
  652. productLength: x.productLength,
  653. productWidth: x.productWidth,
  654. productHeight: x.productHeight,
  655. purchaseDetailId: x.id,
  656. purchaseQuantity: x.quantity,
  657. maxQuantity: parseFloat(x.quantity * 1.05).toFixed(0),
  658. arrivalQuantity: x.arrivalQuantity,
  659. quantity: null,
  660. })),
  661. arrivalDetailListOne: res.arrivalDetailList,
  662. };
  663. if (
  664. formData.data.arrivalDetailList &&
  665. formData.data.arrivalDetailList.length > 0
  666. ) {
  667. let productIds = formData.data.arrivalDetailList.map((x) => x.productId);
  668. proxy.getFileData({
  669. businessIdList: productIds,
  670. data: formData.data.arrivalDetailList,
  671. att: "productId",
  672. businessType: "0",
  673. fileAtt: "fileList",
  674. filePathAtt: "fileUrl",
  675. });
  676. }
  677. if (
  678. formData.data.arrivalDetailListOne &&
  679. formData.data.arrivalDetailListOne.length > 0
  680. ) {
  681. let productIds = formData.data.arrivalDetailListOne.map(
  682. (x) => x.productId
  683. );
  684. setTimeout(() => {
  685. proxy.getFileData({
  686. businessIdList: productIds,
  687. data: formData.data.arrivalDetailListOne,
  688. att: "productId",
  689. businessType: "0",
  690. fileAtt: "fileList",
  691. filePathAtt: "fileUrl",
  692. });
  693. }, 500);
  694. }
  695. });
  696. arrivalDialog.value = true;
  697. };
  698. const submitForm = () => {
  699. formDom.value.handleSubmit(() => {
  700. let allQuantity = 0;
  701. for (let i = 0; i < formData.data.arrivalDetailList.length; i++) {
  702. const ele = formData.data.arrivalDetailList[i];
  703. allQuantity += ele.quantity;
  704. if (
  705. ele.quantity + ele.arrivalQuantity >
  706. Number(parseFloat(Number(ele.purchaseQuantity * 1.05)).toFixed(2))
  707. ) {
  708. return proxy.msgTip("到货量超出上限,若要接收,请另发申购单", 2);
  709. }
  710. }
  711. if (!(allQuantity > 0)) {
  712. return proxy.msgTip("到货总量不能为0", 2);
  713. }
  714. submitLoading.value = true;
  715. proxy.post("/arrival/add", formData.data).then(
  716. (res) => {
  717. ElMessage({
  718. message: "操作成功",
  719. type: "success",
  720. });
  721. arrivalDialog.value = false;
  722. submitLoading.value = false;
  723. // getList();
  724. },
  725. (err) => {
  726. submitLoading.value = false;
  727. }
  728. );
  729. });
  730. };
  731. const PdfDom = ref(null);
  732. const exportExcel = () => {
  733. PdfDom.value.exportExcel();
  734. };
  735. const handleChangeAccountPeriod = (val, row) => {
  736. proxy
  737. .post("/arrivalDetail/editAccountPeriods", {
  738. id: row.id,
  739. accountPeriod: val,
  740. })
  741. .then(
  742. (res) => {
  743. return proxy.msgTip("操作成功");
  744. },
  745. (err) => {}
  746. );
  747. };
  748. </script>
  749. <style lang="scss" scoped>
  750. .tenant {
  751. padding: 20px;
  752. }
  753. ::v-deep(.el-input-number .el-input__inner) {
  754. text-align: left;
  755. }
  756. .baseRow {
  757. min-height: 24px;
  758. border-top: 1px solid black;
  759. border-left: 1px solid black;
  760. }
  761. .contentRow {
  762. border-right: 1px solid black;
  763. line-height: 24px;
  764. padding-left: 4px;
  765. }
  766. </style>
  767. <style>
  768. .redClass {
  769. color: #f54a45 !important;
  770. }
  771. </style>