Переглянути джерело

change: 货款 国内运费 申请. 补充调整项.

peter 4 місяців тому
батько
коміт
87131ce232

+ 4 - 4
src/pages/payment-record/components/nav.vue

@@ -39,10 +39,10 @@ const list = ref([
     label: '国际运费',
     link: 'payment-record3',
   },
-  {
-    label: 'AU本地运费',
-    link: 'payment-record4',
-  },
+  // {
+  //   label: 'AU本地运费',
+  //   link: 'payment-record4',
+  // },
 ])
 const route = useRoute()
 const pageLink = computed(() => {

+ 8 - 3
src/pages/payment-record/index.vue

@@ -415,9 +415,13 @@ const onEditRow = function (data: IPoItem | IPoItem2) {
 }
 const tryCreateStatement = function () {
   if (
-    !['Finance Manager', 'CEO', 'Account Payable'].includes(
-      userInfo.value.role.name,
-    )
+    ![
+      'Finance Manager',
+      'CEO',
+      'Account Payable',
+      'Logistics Operator',
+      'Cashier',
+    ].includes(userInfo.value.role.name)
   ) {
     ElMessage.error('当前用户没有处理的权限')
     return
@@ -434,6 +438,7 @@ const createStatement = function () {
     .post('/payment_request/createStatementData', [
       {
         Total_Amount: computedSum.value,
+        Payment_Type: tableData.value[0].payment_type,
         Currency: tableData.value[0].currency,
         Name: tableData.value[0].statement_name,
         Owner: {

+ 3 - 33
src/pages/payment-record2/components/upload.vue

@@ -179,7 +179,7 @@ import {
 import { UploadFilled } from '@element-plus/icons-vue'
 import * as XLSX from 'xlsx'
 import type { FormInstance, FormRules } from 'element-plus'
-import { IPoItem, IOptionItem, IPoItem2 } from '../inteface'
+import { IPoItem, IOptionItem } from '../inteface'
 // import request from '@/utils/axios'
 import utils from '@/utils/index'
 
@@ -333,41 +333,11 @@ const next = (formEl: FormInstance | undefined) => {
         fileReader.onload = (e: any) => {
           const data = XLSX.read(e.target.result, { type: 'binary' })
           // 重命名列名
-          if (form.value.paymentType === '货款') {
-            data.Sheets[data.SheetNames[0]].A1.w = 'po_number'
-            data.Sheets[data.SheetNames[0]].B1.w = 'sku'
-            data.Sheets[data.SheetNames[0]].C1.w = 'description'
-            data.Sheets[data.SheetNames[0]].D1.w = 'unit_price'
-            data.Sheets[data.SheetNames[0]].E1.w = 'quantity'
-            data.Sheets[data.SheetNames[0]].F1.w = 'sample_fee'
-            data.Sheets[data.SheetNames[0]].G1.w = 'setup_service_fee'
-            data.Sheets[data.SheetNames[0]].H1.w = 'total'
-
-            const jsonData = XLSX.utils.sheet_to_json(
-              data.Sheets[data.SheetNames[0]],
-            ) as IPoItem[]
-            jsonData.forEach((i) => {
-              i.unit_price = utils.toFixed(Number(i.unit_price || 0), 1000)
-              i.quantity = utils.toFixed(Number(i.quantity || 0), 1000)
-              i.sample_fee = utils.toFixed(Number(i.sample_fee || 0), 1000)
-              i.setup_service_fee = utils.toFixed(
-                Number(i.setup_service_fee || 0),
-                1000,
-              )
-              i.total = utils.toFixed(Number(i.total || 0), 1000)
-              tableData.value.push({
-                ...i,
-                po_number: i.po_number.toUpperCase(),
-                payment_type: form.value.paymentType,
-                statement_name: form.value.statement_name,
-                currency: form.value.currency,
-              })
-            })
-          } else if (form.value.paymentType === '国内运费') {
+          if (form.value.paymentType === '国内运费') {
             // todo
             const jsonData = XLSX.utils.sheet_to_json(
               data.Sheets[data.SheetNames[0]],
-            ) as IPoItem2[]
+            ) as IPoItem[]
             jsonData.forEach((i) => {
               tableData.value.push({
                 ...i,

+ 9 - 3
src/pages/payment-record2/index.vue

@@ -117,6 +117,7 @@
             label="Tracking Number"
             align="center"
             width="150"
+            label-class-name="red-font"
           />
           <el-table-column
             prop="Sender"
@@ -471,9 +472,13 @@ const onEditRow = function (data: IPoItem) {
 }
 const tryCreateStatement = function () {
   if (
-    !['Finance Manager', 'CEO', 'Account Payable'].includes(
-      userInfo.value.role.name,
-    )
+    ![
+      'Finance Manager',
+      'CEO',
+      'Account Payable',
+      'Logistics Operator',
+      'Cashier',
+    ].includes(userInfo.value.role.name)
   ) {
     ElMessage.error('当前用户没有处理的权限')
     return
@@ -514,6 +519,7 @@ const createStatement = function () {
     .post('/payment_request/createStatementData', [
       {
         Total_Amount: computedSum.value,
+        Payment_Type: tableData.value[0].payment_type,
         Currency: tableData.value[0].Currency,
         Name: tableData.value[0].statement_name,
         Owner: {