浏览代码

Merge branch 'master' of http://git.ycjcjy.com/state_grid/invoice_fill_h5

张延森 2 年前
父节点
当前提交
d764aa5262

+ 1
- 1
index.html 查看文件

4
     <meta charset="UTF-8" />
4
     <meta charset="UTF-8" />
5
     <link rel="icon" href="/favicon.ico" />
5
     <link rel="icon" href="/favicon.ico" />
6
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
-    <title>电网报销系统</title>
7
+    <title>开票消息收集公示系统</title>
8
   </head>
8
   </head>
9
   <body>
9
   <body>
10
     <div id="app"></div>
10
     <div id="app"></div>

+ 19
- 0
src/components/BackButton/index.vue 查看文件

1
+<template>
2
+  <div class="backIcon">
3
+    <van-icon name="arrow-left" size="32px" color="#6b6c6d" @click="goBack" />
4
+  </div>
5
+</template>
6
+
7
+<script setup>
8
+import { useRouter } from 'vue-router'
9
+const router = useRouter();
10
+const goBack = () => {
11
+  router.back();
12
+}
13
+</script>
14
+<style lang="less" scoped>
15
+.backIcon {
16
+  margin-left: 8px;
17
+  margin-top: 8px;
18
+}
19
+</style>

+ 25
- 8
src/components/OrgPicker/index.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="org-picker">
2
   <div class="org-picker">
3
     <div class="picker-search">
3
     <div class="picker-search">
4
-      <van-search v-model="searchValue" placeholder="请输入公司名称" @search="onSearch" />
4
+      <van-search
5
+        v-model="searchValue"
6
+        placeholder="请输入公司名称"
7
+        @search="onSearch"
8
+      />
5
     </div>
9
     </div>
6
     <div class="picker-list">
10
     <div class="picker-list">
7
-      <van-list v-model:loading="loading" :finished="finished" finished-text="我们是有底线的" @load="onLoad">
8
-        <van-cell v-for="org in orgList" :key="org.invoiceOrgId" :title="org.name" @click="onClick(org)">
9
-          <template #right-icon v-if="org.invoiceOrgId === orgSelected.invoiceOrgId">
11
+      <van-list
12
+        v-model:loading="loading"
13
+        :finished="finished"
14
+        finished-text="我们是有底线的"
15
+        @load="onLoad"
16
+      >
17
+        <van-cell
18
+          v-for="org in orgList"
19
+          :key="org.invoiceOrgId"
20
+          :title="org.name"
21
+          @click="onClick(org)"
22
+        >
23
+          <template
24
+            #right-icon
25
+            v-if="org.invoiceOrgId === orgSelected.invoiceOrgId"
26
+          >
10
             <van-icon name="success" />
27
             <van-icon name="success" />
11
           </template>
28
           </template>
12
         </van-cell>
29
         </van-cell>
32
 
49
 
33
 const props = defineProps({
50
 const props = defineProps({
34
   modelValue: String,
51
   modelValue: String,
35
-  invoiceId:String
52
+  invoiceId: String
36
 })
53
 })
37
 const emit = defineEmits(['update:modelValue', 'change'])
54
 const emit = defineEmits(['update:modelValue', 'change'])
38
 
55
 
41
   orgSelected.value = { invoiceOrgId: val }
58
   orgSelected.value = { invoiceOrgId: val }
42
 })
59
 })
43
 
60
 
44
-const queryData = (params) => {  
61
+const queryData = (params) => {
45
   getOrgList({ ...params })
62
   getOrgList({ ...params })
46
     .then((res) => {
63
     .then((res) => {
47
       //是否为第一页
64
       //是否为第一页
65
 }
82
 }
66
 
83
 
67
 const onSearch = (val) => {
84
 const onSearch = (val) => {
68
-  queryData({ pageNum: 1, pageSize, name: val,invoiceId:props.invoiceId })
85
+  queryData({ pageNum: 1, pageSize, name: val, invoiceId: props.invoiceId })
69
 }
86
 }
70
 
87
 
71
 const onCancel = () => {
88
 const onCancel = () => {
76
 // 所以 onMounted 里面不需要初始化执行了
93
 // 所以 onMounted 里面不需要初始化执行了
77
 const onLoad = () => {
94
 const onLoad = () => {
78
   const pageNum = orgResult.value.current ? orgResult.value.current + 1 : 1
95
   const pageNum = orgResult.value.current ? orgResult.value.current + 1 : 1
79
-  queryData({ pageNum, pageSize, name: searchValue.value,invoiceId:props.invoiceId })
96
+  queryData({ pageNum, pageSize, name: searchValue.value, invoiceId: props.invoiceId })
80
 }
97
 }
81
 
98
 
82
 const onClick = (org) => {
99
 const onClick = (org) => {

+ 19
- 19
src/components/PersonPicker/index.vue 查看文件

3
     <div class="picker-search">
3
     <div class="picker-search">
4
       <van-search
4
       <van-search
5
         v-model="searchValue"
5
         v-model="searchValue"
6
-        placeholder="请输入公司名称"
6
+        placeholder="请输入学员姓名"
7
         @search="onSearch"
7
         @search="onSearch"
8
       />
8
       />
9
     </div>
9
     </div>
15
         @load="onLoad"
15
         @load="onLoad"
16
       >
16
       >
17
         <van-cell
17
         <van-cell
18
-          v-for="org in orgList"
19
-          :key="org.invoiceOrgId"
20
-          :title="org.name"
21
-          @click="onClick(org)"
18
+          v-for="item in personList"
19
+          :key="item.invoicePersonId"
20
+          :title="item.name"
21
+          @click="onClick(item)"
22
         >
22
         >
23
-          <template #right-icon v-if="org.invoiceOrgId === orgSelected.invoiceOrgId">
23
+          <template #right-icon v-if="item.invoicePersonId === personSelected.invoicePersonId">
24
             <van-icon name="success" />
24
             <van-icon name="success" />
25
           </template>
25
           </template>
26
         </van-cell>
26
         </van-cell>
33
 </template>
33
 </template>
34
 
34
 
35
 <script setup>
35
 <script setup>
36
-import { computed, watch, ref, onMounted } from 'vue'
36
+import { computed, watch, ref } from 'vue'
37
 import { getPersonList } from '@/services/person'
37
 import { getPersonList } from '@/services/person'
38
 
38
 
39
 
39
 
40
 const searchValue = ref('')
40
 const searchValue = ref('')
41
-const orgSelected = ref({})
42
-const orgResult = ref({})
41
+const personSelected = ref({})
42
+const personResult = ref({})
43
 const loading = ref(false)
43
 const loading = ref(false)
44
 const finished = ref(false)
44
 const finished = ref(false)
45
 const pageSize = 20
45
 const pageSize = 20
51
 })
51
 })
52
 const emit = defineEmits(['update:modelValue', 'change'])
52
 const emit = defineEmits(['update:modelValue', 'change'])
53
 
53
 
54
-const orgList = computed(() => orgResult.value.records || [])
54
+const personList = computed(() => personResult.value.records || [])
55
 watch(props.modelValue, (val) => {
55
 watch(props.modelValue, (val) => {
56
-  orgSelected.value = { invoiceOrgId: val }
56
+  personSelected.value = { invoicePersonId: val }
57
 })
57
 })
58
 watch(()=>props.orgId,(val)=>{
58
 watch(()=>props.orgId,(val)=>{
59
   const pageNum = 1
59
   const pageNum = 1
65
     .then((res) => {
65
     .then((res) => {
66
       const first = res.current === 1
66
       const first = res.current === 1
67
       if (first) {
67
       if (first) {
68
-        orgResult.value = res
68
+        personResult.value = res
69
       } else {
69
       } else {
70
-        orgResult.value = {
70
+        personResult.value = {
71
           ...res,
71
           ...res,
72
-          records: orgResult.value.records.concat(res.records)
72
+          records: personResult.value.records.concat(res.records)
73
         }
73
         }
74
       }
74
       }
75
       loading.value = false
75
       loading.value = false
92
 // 组件加载, onLoad 就会执行一次
92
 // 组件加载, onLoad 就会执行一次
93
 // 所以 onMounted 里面不需要初始化执行了
93
 // 所以 onMounted 里面不需要初始化执行了
94
 const onLoad = () => {
94
 const onLoad = () => {
95
-  const pageNum = orgResult.value.current ? orgResult.value.current + 1 : 1
95
+  const pageNum = personResult.value.current ? personResult.value.current + 1 : 1
96
   queryData({ pageNum, pageSize, name: searchValue.value, invoiceId: props.invoiceId, invoiceOrgId: props.orgId })
96
   queryData({ pageNum, pageSize, name: searchValue.value, invoiceId: props.invoiceId, invoiceOrgId: props.orgId })
97
 }
97
 }
98
 
98
 
99
 const onClick = (org) => {
99
 const onClick = (org) => {
100
-  orgSelected.value = org
100
+  personSelected.value = org
101
 }
101
 }
102
 
102
 
103
 const onSubmit = () => {
103
 const onSubmit = () => {
104
-  emit('update:modelValue', orgSelected.value.invoicePersonId)
105
-  if (orgSelected.value.invoicePersonId && orgSelected.value.name) {
106
-    emit('change', orgSelected.value)
104
+  emit('update:modelValue', personSelected.value.invoicePersonId)
105
+  if (personSelected.value.invoicePersonId && personSelected.value.name) {
106
+    emit('change', personSelected.value)
107
   } else {
107
   } else {
108
     emit('change')
108
     emit('change')
109
   }
109
   }

+ 2
- 2
src/pages/index.vue 查看文件

36
 </template>
36
 </template>
37
 
37
 
38
 <script setup>
38
 <script setup>
39
-import { computed, onMounted, reactive, ref } from 'vue';
39
+import { computed, onMounted, reactive } from 'vue';
40
 import { useRouter, useRoute } from 'vue-router'
40
 import { useRouter, useRoute } from 'vue-router'
41
 import dayjs from 'dayjs'
41
 import dayjs from 'dayjs'
42
 import { getInvoiceFill } from '@/services/invoice'
42
 import { getInvoiceFill } from '@/services/invoice'
50
 const tipText = computed(() => {
50
 const tipText = computed(() => {
51
   if (!invoiceId) return '请扫码访问此页面';
51
   if (!invoiceId) return '请扫码访问此页面';
52
   const finished = formData.status === 2 || (formData.endDate ? dayjs().isAfter(dayjs(formData.endDate)) : false)
52
   const finished = formData.status === 2 || (formData.endDate ? dayjs().isAfter(dayjs(formData.endDate)) : false)
53
-  return finished ? '该班次已截止如有问题请联系报销助理' : `该班次将于 ${dayjs(formData.endDate).format('YYYY年MM月DD日')} 截止`
53
+  return finished ? '该班次信息收集已截止如有问题请联系报销助理' : `该班次信息收集将于${dayjs(formData.endDate).format('YYYY年MM月DD日 hh时mm分')}截止`
54
 })
54
 })
55
 
55
 
56
 const goForm = () => {
56
 const goForm = () => {

+ 74
- 0
src/pages/invoice/components/InvoiceInfo.vue 查看文件

1
+<template>
2
+  <van-cell-group title="开票单位">
3
+    <van-field
4
+      label="开票单位"
5
+      v-model="props.pdata.orgName"
6
+      name="orgName"
7
+      placeholder="请输入开票单位"
8
+      :rules="[{ required: true, message: '请输入开票单位' }]"
9
+    />
10
+    <van-field
11
+      label="纳 税 号"
12
+      v-model="props.pdata.taxNo"
13
+      name="taxNo"
14
+      placeholder="请输入纳税识别号"
15
+      :rules="[{ required: true, message: '请输入纳税识别号' }]"
16
+    />
17
+    <van-field
18
+      label="单位地址"
19
+      v-model="props.pdata.address"
20
+      name="address"
21
+      placeholder="请输入单位地址"
22
+      :rules="[{ required: true, message: '请输入单位地址' }]"
23
+    />
24
+    <van-field
25
+      label="单位电话"
26
+      v-model="props.pdata.phone"
27
+      name="phone"
28
+      placeholder="请输入单位电话"
29
+      :rules="[{ required: true, message: '请输入单位电话' }]"
30
+    />
31
+    <van-field
32
+      label="开户银行"
33
+      v-model="props.pdata.bankName"
34
+      name="bankName"
35
+      placeholder="请输入开户银行"
36
+      :rules="[{ required: true, message: '请输入开户银行' }]"
37
+    />
38
+    <van-field
39
+      label="开户账户"
40
+      v-model="props.pdata.cardNo"
41
+      name="cardNo"
42
+      placeholder="请输入开户行账号"
43
+      :rules="[{ required: true, message: '请输入开户行账号' }]"
44
+    />
45
+    <van-field
46
+      name="mergeRemark"
47
+      label="是否合开"
48
+      error-message="如有多位同单位学员需要合并开票的情况,请勾选“是”并主动联系班主任"
49
+    >
50
+      <template #input>
51
+        <van-radio-group
52
+          v-model="props.pdata.mergeRemark"
53
+          direction="horizontal"
54
+          :disabled="props.isFinished"
55
+        >
56
+          <van-radio name="是">是</van-radio>
57
+          <van-radio name="否">否</van-radio>
58
+        </van-radio-group>
59
+      </template>
60
+    </van-field>
61
+  </van-cell-group>
62
+</template>
63
+<script setup>
64
+import { ref, reactive, watch } from 'vue';
65
+const props = defineProps({
66
+  isFinished: String,
67
+  pdata: {
68
+    type: Object,
69
+    default: () => ({})
70
+  }
71
+})
72
+</script>
73
+<style>
74
+</style>

+ 42
- 0
src/pages/invoice/components/ItemTpl.vue 查看文件

1
+<template>
2
+  <van-cell-group v-if="props.itemList.length != 0" title="类目信息">
3
+    <div
4
+      class="itembox"
5
+      v-for="item in props.itemList"
6
+      :key="item.invoiceItemId"
7
+    >
8
+      <van-cell title="开票项目">
9
+        <template #value>
10
+          <span style="color: #000">{{ item.name }}</span>
11
+        </template>
12
+      </van-cell>
13
+      <van-cell title="开票金额">
14
+        <template #value>
15
+          <span style="color: #000">{{ item.charge }}</span>
16
+        </template>
17
+      </van-cell>
18
+      <div class="lastLine" />
19
+    </div>
20
+  </van-cell-group>
21
+</template>
22
+<script setup>
23
+const props = defineProps({
24
+  itemList: {
25
+    type: Array,
26
+    default: () => ({})
27
+  }
28
+})
29
+</script>
30
+<style lang="less" scoped>
31
+.lastLine::after {
32
+  position: absolute;
33
+  box-sizing: border-box;
34
+  content: " ";
35
+  pointer-events: none;
36
+  right: var(--van-padding-md);
37
+  bottom: 0;
38
+  left: var(--van-padding-md);
39
+  border-bottom: 1px solid var(--van-cell-border-color);
40
+  transform: scaleY(0.5);
41
+}
42
+</style>

+ 108
- 0
src/pages/invoice/components/PersonInfo.vue 查看文件

1
+<template>
2
+  <van-cell-group title="学员信息">
3
+    <van-field
4
+      label="所属公司"
5
+      v-model="value.invoiceOrgName"
6
+      name="invoiceOrgName"
7
+      readonly
8
+      @click="changeOrg"
9
+      placeholder="请输入所属公司"
10
+      :rules="[{ required: true, message: '请输入所属公司' }]"
11
+    />
12
+    <van-popup
13
+      v-model:show="showOrgPicker"
14
+      position="left"
15
+      :style="{ height: '100%', width: '80%' }"
16
+    >
17
+      <org-picker
18
+        v-model="value.invoiceOrgId"
19
+        :invoiceId="props.invoiceId"
20
+        @change="onOrgConfirm"
21
+      />
22
+    </van-popup>
23
+    <van-field
24
+      label="学员"
25
+      v-model="value.personName"
26
+      name="personName"
27
+      readonly
28
+      @click="showOrgPopup"
29
+      placeholder="请输入学员姓名"
30
+      :rules="[{ required: true, message: '请输入学员姓名' }]"
31
+    />
32
+    <van-popup
33
+      v-model:show="showPersonPicker"
34
+      position="left"
35
+      :style="{ height: '100%', width: '80%' }"
36
+    >
37
+      <person-picker
38
+        v-model="value.personId"
39
+        :invoiceId="props.invoiceId"
40
+        :orgId="value.invoiceOrgId"
41
+        @change="onPersonConfirm"
42
+      />
43
+    </van-popup>
44
+  </van-cell-group>
45
+</template>
46
+<script setup>
47
+import { ref, reactive, watch } from 'vue';
48
+import { Dialog } from 'vant'
49
+
50
+const value = reactive({});
51
+const props = defineProps({
52
+  isFinished: String,
53
+  invoiceId: String,
54
+  pdata: {
55
+    type: Object,
56
+    default: () => ({})
57
+  }
58
+})
59
+const emit = defineEmits(['changeOrgValue', 'changePersonValue'])
60
+watch(() => props.pdata, (val) => {
61
+  Object.assign(value, val)
62
+},
63
+  { immediate: true, deep: true }
64
+)
65
+const showOrgPicker = ref(false)
66
+const showPersonPicker = ref(false)
67
+
68
+//选择企业
69
+const changeOrg = () => {
70
+  if (!props.isFinished) {
71
+    showOrgPicker.value = true
72
+  }
73
+}
74
+//确认企业
75
+const onOrgConfirm = (val) => {
76
+  if (val) {
77
+    value.invoiceOrgId = val.invoiceOrgId
78
+    value.invoiceOrgName = val.name
79
+    value.personName = undefined
80
+    value.invoicePersonId = undefined
81
+    emit('changeOrgValue', value)
82
+  }
83
+  showOrgPicker.value = false;
84
+};
85
+//选择报销人
86
+const showOrgPopup = () => {
87
+  if (!props.isFinished) {
88
+    if (value.invoiceOrgId) {
89
+      showPersonPicker.value = true
90
+    } else {
91
+      Dialog.alert({
92
+        message: '请先选择所属公司'
93
+      }).then(() => { })
94
+    }
95
+  }
96
+}
97
+//确认报销人
98
+const onPersonConfirm = (val) => {
99
+  if (val) {
100
+    value.invoicePersonId = val.invoicePersonId
101
+    value.personName = val.name
102
+    emit('changePersonValue', value)
103
+  }
104
+  showPersonPicker.value = false;
105
+};
106
+</script>
107
+<style>
108
+</style>

+ 52
- 229
src/pages/invoice/fill.vue 查看文件

1
 <template>
1
 <template>
2
-  <van-form
3
-    @failed="onFailed"
4
-    @submit="onSubmit"
5
-    :readonly="formData.isFinished"
6
-  >
7
-    <h2 :style="{ textAlign: 'center' }">{{ formData.invoiceName }}</h2>
8
-    <van-cell-group title="报销人信息">
9
-      <van-field
10
-        label="所属公司"
11
-        v-model="formData.invoiceOrgName"
12
-        name="invoiceOrgName"
13
-        readonly
14
-        @click="changeOrg"
15
-        placeholder="请输入所属公司"
16
-        :rules="[{ required: true, message: '请输入所属公司' }]"
17
-      />
18
-      <van-popup
19
-        v-model:show="showOrgPicker"
20
-        position="left"
21
-        :style="{ height: '100%', width: '80%' }"
22
-      >
23
-        <org-picker
24
-          v-model="formData.orgId"
25
-          :invoiceId="formData.invoiceId"
26
-          @change="onOrgConfirm"
27
-        />
28
-      </van-popup>
29
-      <van-field
30
-        label="报销人"
31
-        v-model="formData.personName"
32
-        name="personName"
33
-        readonly
34
-        @click="showOrgPopup"
35
-        placeholder="请输入报销人"
36
-        :rules="[{ required: true, message: '请输入报销人' }]"
37
-      />
38
-      <van-popup
39
-        v-model:show="showPersonPicker"
40
-        position="left"
41
-        :style="{ height: '100%', width: '80%' }"
42
-      >
43
-        <person-picker
44
-          v-model="formData.personId"
45
-          :invoiceId="formData.invoiceId"
46
-          :orgId="formData.orgId"
47
-          @change="onPersonConfirm"
48
-        />
49
-      </van-popup>
50
-    </van-cell-group>
2
+  <van-form @failed="onFailed" @submit="onSubmit" :readonly="isFinished">
3
+    <back-button />
4
+    <h2 :style="{ textAlign: 'center' }">{{ fillData.name }}</h2>
5
+    <person-info
6
+      :isFinished="isFinished"
7
+      :invoiceId="route.query.invoiceId"
8
+      :pdata="personData"
9
+      @changeOrgValue="changeOrg"
10
+      @changePersonValue="changePerson"
11
+    />
12
+    <invoice-info :isFinished="isFinished" :pdata="formData" />
51
 
13
 
52
-    <van-cell-group title="开票单位">
53
-      <van-field
54
-        label="开票单位"
55
-        v-model="formData.orgName"
56
-        name="orgName"
57
-        placeholder="请输入开票单位"
58
-        :rules="[{ required: true, message: '请输入开票单位' }]"
59
-      />
60
-      <van-field
61
-        label="纳 税 号"
62
-        v-model="formData.taxNo"
63
-        name="taxNo"
64
-        placeholder="请输入纳税识别号"
65
-        :rules="[{ required: true, message: '请输入纳税识别号' }]"
66
-      />
67
-      <van-field
68
-        label="单位地址"
69
-        v-model="formData.address"
70
-        name="address"
71
-        placeholder="请输入单位地址"
72
-        :rules="[{ required: true, message: '请输入单位地址' }]"
73
-      />
74
-      <van-field
75
-        label="单位电话"
76
-        v-model="formData.phone"
77
-        name="phone"
78
-        placeholder="请输入单位电话"
79
-        :rules="[{ required: true, message: '请输入单位电话' }]"
80
-      />
81
-      <van-field
82
-        label="开户银行"
83
-        v-model="formData.bankName"
84
-        name="bankName"
85
-        placeholder="请输入开户银行"
86
-        :rules="[{ required: true, message: '请输入开户银行' }]"
87
-      />
88
-      <van-field
89
-        label="开户账户"
90
-        v-model="formData.cardNo"
91
-        name="cardNo"
92
-        placeholder="请输入开户行账号"
93
-        :rules="[{ required: true, message: '请输入开户行账号' }]"
94
-      />
95
-      <van-field
96
-        name="radio"
97
-        label="是否合开"
98
-        error-message="如果合开请和报销专员联系"
99
-      >
100
-        <template #input>
101
-          <van-radio-group
102
-            v-model="formData.mergeRemark"
103
-            direction="horizontal"
104
-            :disabled="formData.isFinished"
105
-          >
106
-            <van-radio name="是">是</van-radio>
107
-            <van-radio name="否">否</van-radio>
108
-          </van-radio-group>
109
-        </template>
110
-      </van-field>
111
-    </van-cell-group>
14
+    <item-tpl :itemList="itemList" />
112
 
15
 
113
-    <van-cell-group v-if="itemList.length != 0" title="报销信息">
114
-      <div class="itembox" v-for="item in itemList" :key="item.invoiceItemId">
115
-        <van-cell title="报销项目">
116
-          <template #value>
117
-            <span style="color: #000">{{ item.name }}</span>
118
-          </template>
119
-        </van-cell>
120
-        <van-cell title="开票金额">
121
-          <template #value>
122
-            <span style="color: #000">{{ item.charge }}</span>
123
-          </template>
124
-        </van-cell>
125
-        <div class="lastLine" />
126
-      </div>
127
-    </van-cell-group>
128
     <div style="margin: 16px">
16
     <div style="margin: 16px">
129
       <van-button
17
       <van-button
130
-        v-show="!formData.isFinished"
18
+        v-show="!isFinished"
131
         round
19
         round
132
         block
20
         block
133
         type="primary"
21
         type="primary"
146
 import dayjs from 'dayjs'
34
 import dayjs from 'dayjs'
147
 import { getInvoiceModel, setInvoiceDetail, getInvoiceFill } from '@/services/invoice'
35
 import { getInvoiceModel, setInvoiceDetail, getInvoiceFill } from '@/services/invoice'
148
 import { useModel } from '@zjxpcyc/vue-tiny-store'
36
 import { useModel } from '@zjxpcyc/vue-tiny-store'
37
+import PersonInfo from './components/PersonInfo.vue'
38
+import InvoiceInfo from './components/InvoiceInfo.vue'
39
+import ItemTpl from './components/ItemTpl.vue'
149
 
40
 
150
-const formData = reactive({
151
-  //班级名称
152
-  invoiceName: '',
153
-  detailId: undefined,
154
-  invoiceId: undefined,
155
-  invoicePersonId: undefined,
156
-  personId: undefined,
157
-  personName: undefined,
158
-  orgNameId: undefined,
159
-  orgId: undefined,
160
-  invoiceOrgName: undefined,
161
-  orgName: undefined,
162
-  taxNo: undefined,
163
-  address: undefined,
164
-  phone: undefined,
165
-  bankId: undefined,
166
-  bankName: undefined,
167
-  cardNo: undefined,
168
-  invoiceItemTplId: undefined,
169
-  itemName: undefined,
170
-  charge: undefined,
171
-  //是否结束
172
-  isFinished: false,
173
-  mergeRemark: '否',
174
-  status: undefined
175
-})
41
+const formData = reactive({})
42
+//person组件数据
43
+const personData = ref({})
176
 const itemList = ref([])
44
 const itemList = ref([])
177
-const showOrgPicker = ref(false)
178
-const showPersonPicker = ref(false)
45
+const fillData = ref([])
46
+//是否结束
47
+const isFinished = ref(false)
179
 const router = useRouter();
48
 const router = useRouter();
180
 const route = useRoute();
49
 const route = useRoute();
181
 const { user } = useModel('user')
50
 const { user } = useModel('user')
182
 
51
 
183
 const personId = computed(() => route.query.personId || user.personId)
52
 const personId = computed(() => route.query.personId || user.personId)
184
 
53
 
54
+const changeOrg = (val) => {
55
+  personData.value = val
56
+}
57
+const changePerson = (val) => {
58
+  personData.value = val
59
+  formData.invoicePersonId = val.invoicePersonId
60
+  getDetail()
61
+}
62
+
185
 onMounted(() => {
63
 onMounted(() => {
186
   //不是扫码进入
64
   //不是扫码进入
187
   if (!route.query.invoiceId) {
65
   if (!route.query.invoiceId) {
188
     Dialog.alert({
66
     Dialog.alert({
189
       message: '请退出页面重新扫码进入'
67
       message: '请退出页面重新扫码进入'
190
     }).then(() => { })
68
     }).then(() => { })
191
-    formData.isFinished = ture
69
+    isFinished.value = true
192
     return
70
     return
193
   }
71
   }
72
+  if (route.query.isFinished) {
73
+    isFinished.value = true
74
+  }
194
   getInvoiceFill(route.query.invoiceId).then(res => {
75
   getInvoiceFill(route.query.invoiceId).then(res => {
76
+    fillData.value = res
195
     //过期
77
     //过期
196
     if (dayjs().isAfter(dayjs(res.endDate) || res.status == 2)) {
78
     if (dayjs().isAfter(dayjs(res.endDate) || res.status == 2)) {
197
-      formData.isFinished = true
79
+      isFinished.value = true
198
       Dialog.alert({
80
       Dialog.alert({
199
         message: '该班次已截止如有问题请联系报销助理'
81
         message: '该班次已截止如有问题请联系报销助理'
200
       })
82
       })
201
-      formData.invoiceName = res.name
202
-    } else {
203
-      getDetail({ invoiceName: res.name })
204
     }
83
     }
84
+    getDetail()
205
   }).catch(err => {
85
   }).catch(err => {
206
     console.log(err)
86
     console.log(err)
207
   })
87
   })
211
   console.log('failed', formData);
91
   console.log('failed', formData);
212
 };
92
 };
213
 
93
 
214
-//选择企业
215
-const changeOrg = () => {
216
-  if (!formData.isFinished) {
217
-    showOrgPicker.value = true
218
-  }
219
-}
220
-//确认企业
221
-const onOrgConfirm = (value) => {
222
-  if (value) {
223
-    formData.orgId = value.invoiceOrgId
224
-    formData.invoiceOrgName = value.name
225
-    formData.personName = ''
226
-    formData.invoicePersonId = ''
227
-  }
228
-  showOrgPicker.value = false;
229
-};
230
-//选择报销人
231
-const showOrgPopup = () => {
232
-  if (!formData.isFinished) {
233
-    if (formData.orgId) {
234
-      showPersonPicker.value = true
235
-    } else {
236
-      Dialog.alert({
237
-        message: '请先选择所属公司'
238
-      }).then(() => { })
239
-    }
240
-  }
241
-}
242
-//确认报销人
243
-const onPersonConfirm = (value) => {
244
-  if (value) {
245
-    console.log(value);
246
-    formData.personName = value.name
247
-    formData.invoicePersonId = value.invoicePersonId
248
-    getDetail({
249
-      invoiceName: formData.name,
250
-      invoicePersonId: formData.invoicePersonId,
251
-      personName: formData.personName,
252
-      orgId: formData.orgId,
253
-      invoiceOrgName: formData.invoiceOrgName
254
-    })
255
-  }
256
-  showPersonPicker.value = false;
257
-};
94
+
258
 //获取模板详情
95
 //获取模板详情
259
-const getDetail = (data) => {
260
-  getInvoiceModel(route.query.invoiceId, { invoicePersonId: formData.invoicePersonId, personId: personId }).then(res => {
261
-    const info = {
262
-      ...(res.detail || res.tpl),
263
-      ...data
264
-    }
96
+const getDetail = () => {
97
+  getInvoiceModel(route.query.invoiceId, { invoicePersonId: formData.invoicePersonId, personId: personId.value }).then(res => {
98
+    let info = res.detail || res.tpl
99
+    info.mergeRemark = info.mergeRemark || formData.mergeRemark
265
     Object.assign(formData, info)
100
     Object.assign(formData, info)
101
+    if (!personData.value.invoicePersonId) {
102
+      personData.value.invoiceOrgId = info.invoiceOrgId
103
+      personData.value.invoiceOrgName = info.invoiceOrgName
104
+      personData.value.personName = info.personName
105
+      personData.value.invoicePersonId = info.invoicePersonId
106
+    }
266
     itemList.value = info.itemList
107
     itemList.value = info.itemList
267
   }).catch(err => {
108
   }).catch(err => {
268
     console.log(err);
109
     console.log(err);
276
     }).then(() => { })
117
     }).then(() => { })
277
     return;
118
     return;
278
   }
119
   }
279
-  setInvoiceDetail(formData.invoiceId, formData).then(() => {
120
+  //需要调用中间列表的提交事件获取数据
121
+  let value = { ...formData, ...val, ...personData.value }
122
+  setInvoiceDetail(fillData.value.invoiceId, value).then(() => {
280
     Toast.success('提交成功');
123
     Toast.success('提交成功');
281
     setTimeout(() => {
124
     setTimeout(() => {
282
       router.back()
125
       router.back()
285
     console.log(err);
128
     console.log(err);
286
   })
129
   })
287
 }
130
 }
288
-
289
 </script>
131
 </script>
290
-<style lang="less" scoped>
291
-.lastLine::after {
292
-  position: absolute;
293
-  box-sizing: border-box;
294
-  content: " ";
295
-  pointer-events: none;
296
-  right: var(--van-padding-md);
297
-  bottom: 0;
298
-  left: var(--van-padding-md);
299
-  border-bottom: 1px solid var(--van-cell-border-color);
300
-  transform: scaleY(0.5);
301
-}
302
-.cellClassName {
303
-  .van-cell__value {
304
-    min-width: 80% !important; //可根据自己需求设定值
305
-    text-align: left !important;
306
-  }
307
-}
308
-</style>

+ 1
- 1
src/pages/invoice/history.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="history-page">
2
   <div class="history-page">
3
+    <back-button />
3
     <h3>填写记录</h3>
4
     <h3>填写记录</h3>
4
     <van-list
5
     <van-list
5
       class="history-list"
6
       class="history-list"
42
 const finished = computed(() => pagenavi.pageNum * pagenavi.pageSize > pagenavi.total)
43
 const finished = computed(() => pagenavi.pageNum * pagenavi.pageSize > pagenavi.total)
43
 
44
 
44
 const queryData = (params = {}) => {
45
 const queryData = (params = {}) => {
45
-  console.log('-------------', user.personId)
46
   getList(invoiceId, { ...params, personId: user.personId }).then(res => {
46
   getList(invoiceId, { ...params, personId: user.personId }).then(res => {
47
     const { records, ...pageInfo } = res;
47
     const { records, ...pageInfo } = res;
48
     if (pageInfo.current === 1) {
48
     if (pageInfo.current === 1) {

+ 14
- 2
src/pages/publicity/list.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="publicity-page">
2
   <div class="publicity-page">
3
+    <back-button />
3
     <h3>信息公示</h3>
4
     <h3>信息公示</h3>
5
+    <div class="picker-search">
6
+      <van-search v-model="searchValue" placeholder="请输入报销人姓名" @search="onSearch" />
7
+    </div>
4
     <van-list
8
     <van-list
5
       class="publicity-list"
9
       class="publicity-list"
6
       v-model:loading="loading"
10
       v-model:loading="loading"
12
         class="item"
16
         class="item"
13
         v-for="item in list"
17
         v-for="item in list"
14
         :key="item.detailId"
18
         :key="item.detailId"
15
-        :title="item.orgName"
19
+        :title="item.invoiceOrgName"
16
         is-link
20
         is-link
17
-        :to="{ name: 'invoice.fill', query: { invoiceId, personId: item.personId } }"
21
+        :to="{ name: 'invoice.fill', query: { invoiceId, personId: item.personId,isFinished:true } }"
18
       >
22
       >
19
         <template #value>
23
         <template #value>
20
           <span class="pname">{{ item.personName }}</span>
24
           <span class="pname">{{ item.personName }}</span>
33
 const { invoiceId } = route.query;
37
 const { invoiceId } = route.query;
34
 
38
 
35
 const list = ref([])
39
 const list = ref([])
40
+const searchValue = ref()
36
 const error = ref(false);
41
 const error = ref(false);
37
 const loading = ref(false);
42
 const loading = ref(false);
38
 const pagenavi = reactive({ pageNum: 1, pageSize: 10, total: 0 })
43
 const pagenavi = reactive({ pageNum: 1, pageSize: 10, total: 0 })
61
   const params = { pageNum: pagenavi.pageNum + 1, pageSize: pagenavi.pageSize }
66
   const params = { pageNum: pagenavi.pageNum + 1, pageSize: pagenavi.pageSize }
62
   queryData(params)
67
   queryData(params)
63
 }
68
 }
69
+const onSearch=()=>{
70
+  const params = { pageNum: pagenavi.pageNum, pageSize: pagenavi.pageSize,personName:searchValue.value }
71
+  queryData(params)
72
+}
64
 
73
 
65
 onMounted(() => {
74
 onMounted(() => {
66
   //获取提交记录
75
   //获取提交记录
91
   // .item + .item {
100
   // .item + .item {
92
   //   margin-top: 16px;
101
   //   margin-top: 16px;
93
   // }
102
   // }
103
+  .picker-search {
104
+    flex: none;
105
+  }
94
 }
106
 }
95
 </style>
107
 </style>

+ 2
- 0
vite.config.js 查看文件

8
 export default defineConfig({
8
 export default defineConfig({
9
   base: '/state-grid/invoice-filling-h5/',
9
   base: '/state-grid/invoice-filling-h5/',
10
   server: {
10
   server: {
11
+    //让局域网其他同事可以通过ip地址访问项目
12
+    host:'0.0.0.0',
11
     proxy: {
13
     proxy: {
12
       '/api': {
14
       '/api': {
13
         target: 'http://192.168.89.147:7081',
15
         target: 'http://192.168.89.147:7081',