Commit 550f851aefe5b22860da52d899420ea6e24de30f

Authored by 史婷婷
1 parent 5db05e8f

feat: 开发管理-审核&审核详情

1 -import request from '@/utils/request' 1 +import request from '@/utils/request';
  2 +import { ContentTypeEnum } from '@/utils/httpEnum';
2 3
3 4
4 // 我发起的 查询列表 5 // 我发起的 查询列表
@@ -49,7 +50,8 @@ export function approvePassApi(data) { @@ -49,7 +50,8 @@ export function approvePassApi(data) {
49 return request({ 50 return request({
50 url: '/flow/task/approve/pass', 51 url: '/flow/task/approve/pass',
51 method: 'post', 52 method: 'post',
52 - data: data 53 + data: data,
  54 + contentType: ContentTypeEnum.JSON
53 }) 55 })
54 } 56 }
55 57
@@ -58,6 +60,7 @@ export function approveRefuseApi(data) { @@ -58,6 +60,7 @@ export function approveRefuseApi(data) {
58 return request({ 60 return request({
59 url: '/flow/task/approve/refuse', 61 url: '/flow/task/approve/refuse',
60 method: 'post', 62 method: 'post',
61 - data: data 63 + data: data,
  64 + contentType: ContentTypeEnum.JSON
62 }) 65 })
63 } 66 }
1 <template> 1 <template>
2 - <view class="viewer">  
3 - <view class="title">{{ inner.customerName }}</view>  
4 - <view class="grid">  
5 - <view class="row"><text class="label">企业类型</text><uni-easyinput v-model="inner.enterpriseType" :inputBorder="false" /></view>  
6 - <view class="row"><text class="label">区域</text><uni-easyinput v-model="inner.region" :inputBorder="false" /></view>  
7 - <view class="row"><text class="label">客户分类</text><uni-easyinput v-model="inner.companySuggestedCategory" :inputBorder="false" /></view>  
8 - <view class="row"><text class="label">登记日期</text><uni-datetime-picker type="date" v-model="inner.registerDate" /></view>  
9 - </view>  
10 - </view> 2 + <view class="page">
  3 + <scroll-view class="scroll" scroll-y>
  4 + <view class="detail-page">
  5 + <view class="section">
  6 + <text class="row customer">{{ form.customer.name }}</text>
  7 + <view class="row"><text class="label">生产厂</text><text class="value">{{ form.workshop.name }}</text>
  8 + </view>
  9 + <view class="row"><text class="label">科办</text><text class="value">{{ form.office.name }}</text>
  10 + </view>
  11 + <view class="row"><text class="label">客户类型</text><text
  12 + class="value">{{ getDicName('ENTERPRISE_TYPE', form.customerType, customerTypeOptions) }}</text>
  13 + </view>
  14 + <view class="row"><text class="label">产品品种</text><text
  15 + class="value">{{ form.productVariety.name }}</text></view>
  16 + <view class="row"><text class="label">月用量</text><text class="value">{{ form.monthlyUsage }}</text>
  17 + </view>
  18 + <view class="row"><text class="label">目标量</text><text class="value">{{ form.targetQuantity }}</text>
  19 + </view>
  20 + <view class="row"><text class="label">行业</text><text class="value">{{ form.industry }}</text></view>
  21 + <view class="row"><text class="label">创建日期</text><text class="value">{{ form.createTime }}</text>
  22 + </view>
  23 + </view>
  24 + <view class="section">
  25 + <view class="row"><text class="label">牌号</text><text class="value">{{ form.mark }}</text></view>
  26 + <view class="row"><text class="label">厚度</text><text class="value">{{ form.thickness }}</text>
  27 + </view>
  28 + <view class="row"><text class="label">宽度</text><text class="value">{{ form.width }}</text></view>
  29 + <view class="row"><text class="label">材质要求</text><text
  30 + class="value">{{ form.materialRequire }}</text></view>
  31 + <view class="row"><text class="label">品质要求</text><text
  32 + class="value">{{ form.qualityRequire }}</text></view>
  33 + <view class="row"><text class="label">同行</text><text class="value">{{ form.peer }}</text></view>
  34 + </view>
  35 + <view class="section">
  36 + <view class="row"><text class="label">核价模式</text><text class="value">{{ form.pricingMode }}</text>
  37 + </view>
  38 + <view class="row"><text class="label">结算天数</text><text class="value">{{ form.settleDays }}</text>
  39 + </view>
  40 + </view>
  41 + <view class="section">
  42 + <view class="row"><text class="label">责任人</text><text class="value">{{ form.chargeUserName }}</text>
  43 + </view>
  44 + </view>
  45 + </view>
  46 + </scroll-view>
  47 +
  48 + </view>
11 </template> 49 </template>
  50 +
12 <script> 51 <script>
13 -import { getDetailApi } from '@/api/devManage.js'  
14 -export default {  
15 - name: 'CustomerDevelopViewer',  
16 - props: { id: { type: [String, Number], default: '' } },  
17 - data() {  
18 - return { inner: { customerName: '', enterpriseType: '', region: '', companySuggestedCategory: '', registerDate: '' } }  
19 - },  
20 - watch: {  
21 - id: { immediate: true, handler(v) { if (v) { this.fetch(v) } } }  
22 - },  
23 - methods: {  
24 - fetch(id) {  
25 - getDetailApi(id).then(res => {  
26 - const d = res && res.data ? res.data : {}  
27 - this.inner = {  
28 - customerName: d.customerName || d.name || '',  
29 - enterpriseType: d.enterpriseType || d.type || '',  
30 - region: d.region || d.area || '',  
31 - companySuggestedCategory: d.companySuggestedCategory || d.category || '',  
32 - registerDate: d.registerDate || d.createTime || '' 52 + import {
  53 + getDetailApi
  54 + } from '@/api/devManage.js'
  55 + import {
  56 + getDicName
  57 + } from '@/utils/dic.js'
  58 + import {
  59 + getDicByCodeApi
  60 + } from '@/api/base.js'
  61 +
  62 +
  63 + export default {
  64 + name: 'CustomerDevelopViewer',
  65 + props: { id: { type: [String, Number], default: '' } },
  66 + components: {
  67 + },
  68 + data() {
  69 + return {
  70 + form: {
  71 + workshop: {},
  72 + office: {},
  73 + customer: {},
  74 + customerType: '',
  75 + chargeUserId: '',
  76 + chargeUserIdName: '',
  77 + productVariety: {},
  78 + monthlyUsage: '',
  79 + targetQuantity: '',
  80 + industry: '',
  81 + mark: '',
  82 + thickness: '',
  83 + width: '',
  84 + materialRequire: '',
  85 + qualityRequire: '',
  86 + peer: '',
  87 + pricingMode: '',
  88 + settleDays: '',
  89 + createTime: '',
  90 + status: ''
  91 + },
  92 + customerTypeOptions: []
33 } 93 }
34 - }).catch(() => {}) 94 + },
  95 + computed: {
35 }, 96 },
36 - getFormValues() { return { id: this.id, ...this.inner } } 97 + created() {
  98 + this.loadCustomerTypeOptions()
  99 + },
  100 + watch: {
  101 + id: {
  102 + immediate: true,
  103 + handler(val) {
  104 + const v = (val !== undefined && val !== null) ? String(val) : ''
  105 + if (v) this.loadDetail(v)
  106 + }
  107 + }
  108 + },
  109 + onShow() {
  110 + uni.$on('dev_manage_detail_reload', this.onReload)
  111 + },
  112 + onUnload() {
  113 + uni.$off('dev_manage_detail_reload', this.onReload)
  114 + },
  115 +
  116 + methods: {
  117 + onReload(payload) {
  118 + const id = (payload && (payload.id || payload.code)) || this.form.id || this.form.code || ''
  119 + if (id) this.loadDetail(id)
  120 + },
  121 + async loadDetail(id) {
  122 + try {
  123 + const res = await getDetailApi(id)
  124 + console.log('getDetailApi res', res)
  125 + const data = res.data || {};
  126 + this.form = {
  127 + ...data
  128 + }
  129 + } catch (e) {
  130 + console.error('loadDetail error', e)
  131 + }
  132 + },
  133 + async loadCustomerTypeOptions() {
  134 + try {
  135 + const res = await getDicByCodeApi('ENTERPRISE_TYPE')
  136 + const list = res.data || []
  137 + this.customerTypeOptions = Array.isArray(list) ? list : []
  138 + } catch (e) {
  139 + this.customerTypeOptions = []
  140 + }
  141 + },
  142 + getDicName: getDicName
  143 + ,
  144 + getFormValues() {
  145 + const m = this.form || {}
  146 + return JSON.parse(JSON.stringify(m))
  147 + }
  148 + }
37 } 149 }
38 -}  
39 </script> 150 </script>
  151 +
40 <style lang="scss" scoped> 152 <style lang="scss" scoped>
41 -.viewer { background: #fff; padding: 24rpx }  
42 -.title { font-size: 36rpx; font-weight: 600; color: #323241; margin-bottom: 24rpx }  
43 -.grid { display: flex; flex-direction: column; gap: 20rpx }  
44 -.row { display: flex; align-items: center; justify-content: space-between }  
45 -.label { width: 220rpx; color: rgba(0,0,0,0.6); font-size: 28rpx } 153 + .page {
  154 + display: flex;
  155 + flex-direction: column;
  156 + height: 100%;
  157 + }
  158 +
  159 + .scroll {
  160 + flex: 1;
  161 + }
  162 +
  163 + .detail-page {
  164 + background: #f3f3f3;
  165 + }
  166 +
  167 + .section {
  168 + padding: 32rpx;
  169 + background: #fff;
  170 + margin-bottom: 20rpx;
  171 + position: relative;
  172 +
  173 + .row {
  174 + display: flex;
  175 + margin-bottom: 28rpx;
  176 +
  177 + &:last-child {
  178 + margin-bottom: 0;
  179 + }
  180 +
  181 + &.customer {
  182 + font-size: 36rpx;
  183 + font-weight: 600;
  184 + color: rgba(0, 0, 0, 0.9);
  185 + }
  186 +
  187 + .label {
  188 + width: 120rpx;
  189 + line-height: 32rpx;
  190 + font-size: 28rpx;
  191 + color: rgba(0, 0, 0, 0.6);
  192 + }
  193 +
  194 + .value {
  195 + flex: 1;
  196 + line-height: 32rpx;
  197 + font-size: 28rpx;
  198 + color: rgba(0, 0, 0, 0.9);
  199 + text-align: right;
  200 + }
  201 + }
  202 + }
46 </style> 203 </style>
@@ -37,9 +37,9 @@ @@ -37,9 +37,9 @@
37 </view> 37 </view>
38 <view class="footer"> 38 <view class="footer">
39 <!-- completed true 已办 显示 审核详情按钮 --> 39 <!-- completed true 已办 显示 审核详情按钮 -->
40 - <!-- completed false 待办 显示 去审核按钮 -->  
41 <button v-if="item.completed" class="btn" type="primary" plain 40 <button v-if="item.completed" class="btn" type="primary" plain
42 @click.stop="onGoDetail(item)">审核详情</button> 41 @click.stop="onGoDetail(item)">审核详情</button>
  42 + <!-- completed false 待办 显示 去审核按钮 -->
43 <button v-else class="btn" type="primary" plain @click.stop="onGoAudit(item)">去审核</button> 43 <button v-else class="btn" type="primary" plain @click.stop="onGoAudit(item)">去审核</button>
44 </view> 44 </view>
45 </view> 45 </view>
@@ -56,7 +56,7 @@ export default { @@ -56,7 +56,7 @@ export default {
56 }, 56 },
57 isEnd: false, // 流程是否结束 57 isEnd: false, // 流程是否结束
58 nodeList: [], 58 nodeList: [],
59 - extraBtnText: '客户信息', 59 + extraBtnText: '',
60 approveType: 'PASS', 60 approveType: 'PASS',
61 message: '' 61 message: ''
62 } 62 }
@@ -126,7 +126,6 @@ export default { @@ -126,7 +126,6 @@ export default {
126 const ref = this.$refs.basicRef 126 const ref = this.$refs.basicRef
127 const vals = ref && typeof ref.getFormValues === 'function' ? ref.getFormValues() : {} 127 const vals = ref && typeof ref.getFormValues === 'function' ? ref.getFormValues() : {}
128 return { 128 return {
129 - bizFlag: this.auditCtx.bizFlag,  
130 ...vals 129 ...vals
131 } 130 }
132 }, 131 },