Browse Source

change: indent导出pdf表单项.saleperson默认为当前用户.

peter 2 months ago
parent
commit
adb42dc9c1

+ 5 - 1
src/pages/indent-manage/indent/components/calcPrice/index.vue

@@ -509,6 +509,7 @@ import step1 from './components/step1.vue'
 import CompExportForm from '../exportForm.vue'
 import exportQuota from '../exportQuota2.vue'
 import mathjs, { savePrecision } from '@/utils/math.js'
+import Cookies from 'js-cookie'
 import { getCalcParams, saveCalcData } from '@/api/indent'
 import { $t } from '@/i18n/index'
 defineComponent({
@@ -1018,6 +1019,8 @@ let initForm = (switchStatus = [] as any[], useOldFormData = false) => {
 
       formList.value.push(t)
     })
+    const indentUser = Cookies.get('indent-user')
+    let r = creatorOptions.filter((i) => i.label === indentUser)
     exportForm.value = {
       pdf_city: productInfo.value.save_cal.pdf_city || cityList.value[0],
       exchange: productInfo.value.save_cal.exchange || '',
@@ -1025,7 +1028,8 @@ let initForm = (switchStatus = [] as any[], useOldFormData = false) => {
       gst_name: productInfo.value.save_cal.gst_name || '+GST',
       notes: productInfo.value.save_cal.notes || '',
       other_notes: productInfo.value.save_cal.other_notes || '',
-      saleperson: productInfo.value.save_cal.saleperson || '',
+      saleperson:
+        productInfo.value.save_cal.saleperson || (r.length ? r[0].value : ''),
     }
   }
 

+ 1 - 0
src/pages/indent-manage/login.vue

@@ -106,6 +106,7 @@ const tryLogin = () => {
 
       //set token cookie
       Cookie.set('indent-token', res.result.token)
+      Cookie.set('indent-user', res.result.username)
       // 登录成功, 有来源的跳转回来源路径, 没有的去indent列表
       if ($route.query.origin?.length) {
         $router.replace(decodeURIComponent($route.query.origin as string))