Commit 0d09d791f3bc724890adf714139d21c24227f220

Authored by gesilong
1 parent 17224cd0

commit:合同管理审核功能

@@ -152,8 +152,28 @@ export default { @@ -152,8 +152,28 @@ export default {
152 if (e === 'cancel') return this.onCancel() 152 if (e === 'cancel') return this.onCancel()
153 if (e === 'submitAudit') return this.onSubmitAudit() 153 if (e === 'submitAudit') return this.onSubmitAudit()
154 if (e === 'edit') return this.onEdit() 154 if (e === 'edit') return this.onEdit()
  155 + if (e === 'audit') return this.onAudit()
  156 + if (e === 'auditDetail') return this.onAuditDetail()
155 uni.showToast({ title: (btn.text || '操作') + '待实现', icon: 'none' }) 157 uni.showToast({ title: (btn.text || '操作') + '待实现', icon: 'none' })
156 }, 158 },
  159 + onAudit() {
  160 + const id = this.id || (this.form && this.form.id) || ''
  161 + if (!id) return
  162 + const CACHE_KEY = 'sourceBusinessId'
  163 + const TYPE = 'contractType'
  164 + uni.setStorageSync(TYPE, 'PROCUREMENT_CONTRACT')
  165 + uni.setStorageSync(CACHE_KEY, id)
  166 + uni.navigateTo({ url: '/pages/flow/audit' })
  167 + },
  168 + onAuditDetail() {
  169 + const id = this.id || (this.form && this.form.id) || ''
  170 + if (!id) return
  171 + const CACHE_KEY = 'sourceBusinessId'
  172 + const TYPE = 'contractType'
  173 + uni.setStorageSync(TYPE, 'PROCUREMENT_CONTRACT')
  174 + uni.setStorageSync(CACHE_KEY, id)
  175 + uni.navigateTo({ url: '/pages/flow/audit_detail' })
  176 + },
157 onEdit() { 177 onEdit() {
158 uni.navigateTo({ 178 uni.navigateTo({
159 url: '/pages/domestic-agreement/modify?id=' + this.id 179 url: '/pages/domestic-agreement/modify?id=' + this.id
  1 +<template>
  2 + <view class="detail-page">
  3 + <scroll-view class="scroll" scroll-y>
  4 + <view class="section">
  5 + <text class="row company">{{ safeText(form.procurementPlanCode) }}</text>
  6 + <view class="row">
  7 + <text class="label">供方</text>
  8 + <text class="value">{{ safeText(form.supplierName) }}</text>
  9 + </view>
  10 + <view class="row">
  11 + <text class="label">需方</text>
  12 + <text class="value">{{ safeText(form.companyFullName) }}</text>
  13 + </view>
  14 + <view class="row">
  15 + <text class="label">签订地点</text>
  16 + <text class="value">{{ safeText(form.signPlace, '芜湖市') }}</text>
  17 + </view>
  18 + <view class="row">
  19 + <text class="label">签订时间</text>
  20 + <text class="value">{{ formatDateOnly(form.signTime) }}</text>
  21 + </view>
  22 + <view class="row">
  23 + <text class="label">投诉编码</text>
  24 + <text class="value">{{ safeText(form.procurementPlanCode) }}</text>
  25 + </view>
  26 + <view class="row">
  27 + <text class="label">结算比例</text>
  28 + <text class="value">{{ formatPercent(form.settlementRatio) }}</text>
  29 + </view>
  30 + <view v-if="form.createUserName" class="row">
  31 + <text class="label">发起人</text>
  32 + <text class="value">{{ safeText(form.createUserName) }}</text>
  33 + </view>
  34 + <view v-if="approvalStatusVisible" class="row">
  35 + <text class="label">审核状态</text>
  36 + <text class="value">{{ getAuditStatusText(form.approvalStatus) }}</text>
  37 + </view>
  38 + <view v-if="attachmentList.length" class="row">
  39 + <text class="label">附件</text>
  40 + <view class="attach-list">
  41 + <view v-for="(at, idx) in attachmentList" :key="idx" class="attach-item">
  42 + <text class="attach-name">{{ at.name }}</text>
  43 + <text class="attach-view" @click.stop="onPreviewAttachment(at)">查看</text>
  44 + </view>
  45 + </view>
  46 + </view>
  47 + </view>
  48 +
  49 + <ProductRel mode="view" :list="lineList" />
  50 +
  51 + <view v-if="form.specialAgreement" class="title-header">
  52 + <image class="title-header_icon" src="/static/images/title.png" />
  53 + <span>特殊约定</span>
  54 + </view>
  55 + <view v-if="form.specialAgreement" class="section">
  56 + <text class="remark-text">{{ safeText(form.specialAgreement) }}</text>
  57 + </view>
  58 + </scroll-view>
  59 + </view>
  60 +</template>
  61 +
  62 +<script>
  63 +import ProductRel from './productRel.vue'
  64 +import { domesticAgreementDetailApi } from '@/api/procure-manage/domesticAgreement.js'
  65 +import { getDicByCodes, getDicName } from '@/utils/dic.js'
  66 +
  67 +export default {
  68 + name: 'DomesticAgreementViewer',
  69 + components: { ProductRel },
  70 + props: {
  71 + id: { type: [String, Number], default: '' }
  72 + },
  73 + data() {
  74 + return {
  75 + form: {},
  76 + lineList: [],
  77 + attachmentList: [],
  78 + dicOptions: {
  79 + AUDIT_STATUS: []
  80 + }
  81 + }
  82 + },
  83 + computed: {
  84 + approvalStatusVisible() {
  85 + return !!(this.form && this.form.approvalStatus)
  86 + }
  87 + },
  88 + created() {
  89 + this.loadDicData()
  90 + },
  91 + watch: {
  92 + id: {
  93 + immediate: true,
  94 + handler(val) {
  95 + const v = (val !== undefined && val !== null) ? String(val) : ''
  96 + if (v) this.loadDetail(v)
  97 + }
  98 + }
  99 + },
  100 + methods: {
  101 + async loadDicData() {
  102 + try {
  103 + const results = await getDicByCodes(['AUDIT_STATUS'])
  104 + this.dicOptions.AUDIT_STATUS = (results.AUDIT_STATUS && results.AUDIT_STATUS.data) || []
  105 + } catch (e) {
  106 + this.dicOptions.AUDIT_STATUS = []
  107 + }
  108 + },
  109 + getAuditStatusText(status) {
  110 + const v = status == null ? '' : String(status)
  111 + if (!v) return '-'
  112 + return getDicName('AUDIT_STATUS', v, this.dicOptions.AUDIT_STATUS) || v
  113 + },
  114 + safeText(v, def) {
  115 + const s = v == null ? '' : String(v)
  116 + if (s.trim()) return s
  117 + return def != null ? def : '-'
  118 + },
  119 + formatDateOnly(v) {
  120 + const s = v == null ? '' : String(v).trim()
  121 + if (!s) return '-'
  122 + if (s.length >= 10) return s.slice(0, 10)
  123 + return s
  124 + },
  125 + formatPercent(v) {
  126 + if (v === null || v === undefined || v === '') return '-'
  127 + const n = Number(v)
  128 + if (isNaN(n)) return String(v)
  129 + return n + '%'
  130 + },
  131 + buildAttachmentList() {
  132 + const ids = this.form.attachmentFileIds
  133 + const names = this.form.attachmentFileNames
  134 + const idArr = (typeof ids === 'string' && ids) ? ids.split(',').filter(Boolean) : (Array.isArray(ids) ? ids : [])
  135 + const nameArr = (typeof names === 'string' && names) ? names.split(',').filter(Boolean) : (Array.isArray(names) ? names : [])
  136 + const len = Math.max(idArr.length, nameArr.length)
  137 + const list = []
  138 + for (let i = 0; i < len; i++) {
  139 + list.push({ id: idArr[i] || '', name: nameArr[i] || ('附件' + (i + 1)) })
  140 + }
  141 + this.attachmentList = list
  142 + },
  143 + getFormValues() {
  144 + return JSON.parse(JSON.stringify(this.form || {}))
  145 + },
  146 + checkForm() {
  147 + return true
  148 + },
  149 + async loadDetail(id) {
  150 + try {
  151 + const res = await domesticAgreementDetailApi({ id: id })
  152 + const data = res && res.data ? (res.data.data || res.data) : {}
  153 + this.form = Object.assign({}, data)
  154 + const lines = data && Array.isArray(data.procurementContractLineList) ? data.procurementContractLineList : []
  155 + this.lineList = lines.map(l => Object.assign({}, l))
  156 + this.buildAttachmentList()
  157 + } catch (e) {
  158 + this.form = {}
  159 + this.lineList = []
  160 + this.attachmentList = []
  161 + }
  162 + },
  163 + onPreviewAttachment(at) {
  164 + if (!at || !at.id) {
  165 + uni.showToast({ title: '无法查看', icon: 'none' })
  166 + return
  167 + }
  168 + uni.showToast({ title: '查看附件 ' + at.name, icon: 'none' })
  169 + }
  170 + }
  171 +}
  172 +</script>
  173 +
  174 +<style lang="scss" scoped>
  175 +.detail-page {
  176 + background: #f3f3f3;
  177 +}
  178 +.scroll {
  179 + flex: 1;
  180 + padding: 8rpx 0 144rpx;
  181 +}
  182 +.title-header {
  183 + display: flex;
  184 + align-items: center;
  185 + padding: 24rpx 32rpx 12rpx;
  186 + background-color: #ffffff;
  187 + .title-header_icon {
  188 + width: 36rpx;
  189 + height: 36rpx;
  190 + margin-right: 12rpx;
  191 + }
  192 + span {
  193 + font-size: 34rpx;
  194 + font-weight: 600;
  195 + color: rgba(0, 0, 0, 0.9);
  196 + }
  197 +}
  198 +.section {
  199 + padding: 32rpx;
  200 + background: #fff;
  201 + margin-bottom: 20rpx;
  202 +}
  203 +.row {
  204 + display: flex;
  205 + margin-bottom: 28rpx;
  206 + &:last-child { margin-bottom: 0; }
  207 + &.company {
  208 + font-size: 36rpx;
  209 + font-weight: 600;
  210 + color: rgba(0, 0, 0, 0.9);
  211 + padding-top: 8rpx;
  212 + line-height: 50rpx;
  213 + }
  214 + .label {
  215 + max-width: 420rpx;
  216 + margin-right: 20rpx;
  217 + line-height: 32rpx;
  218 + font-size: 28rpx;
  219 + color: rgba(0, 0, 0, 0.6);
  220 + }
  221 + .value {
  222 + flex: 1;
  223 + line-height: 32rpx;
  224 + font-size: 28rpx;
  225 + color: rgba(0, 0, 0, 0.9);
  226 + text-align: right;
  227 + word-break: break-all;
  228 + }
  229 +}
  230 +.attach-list {
  231 + flex: 1;
  232 + display: flex;
  233 + flex-direction: column;
  234 + align-items: flex-end;
  235 + gap: 8rpx;
  236 +}
  237 +.attach-item {
  238 + display: flex;
  239 + align-items: center;
  240 + gap: 16rpx;
  241 + .attach-name {
  242 + font-size: 26rpx;
  243 + color: rgba(0, 0, 0, 0.9);
  244 + }
  245 + .attach-view {
  246 + font-size: 26rpx;
  247 + color: $theme-primary;
  248 + }
  249 +}
  250 +.remark-text {
  251 + font-size: 28rpx;
  252 + color: rgba(0, 0, 0, 0.9);
  253 + line-height: 1.6;
  254 + white-space: pre-wrap;
  255 +}
  256 +</style>
@@ -181,11 +181,15 @@ export default { @@ -181,11 +181,15 @@ export default {
181 Name = _contractType 181 Name = _contractType
182 }else if(_contractType === 'PROCESS_STD_AGMT'){ 182 }else if(_contractType === 'PROCESS_STD_AGMT'){
183 Name = 'AGMT_VIEW' 183 Name = 'AGMT_VIEW'
  184 + }else if(_contractType === 'PROCUREMENT_CONTRACT'){
  185 + Name = 'PROCUREMENT_CONTRACT'
184 }else{ 186 }else{
185 Name = this.auditCtx.bizFlag || '' 187 Name = this.auditCtx.bizFlag || ''
186 } 188 }
187 }else if (_contractType === 'PROCESS_STD_AGMT') { 189 }else if (_contractType === 'PROCESS_STD_AGMT') {
188 Name = 'PROCESS_STD_AGMT' 190 Name = 'PROCESS_STD_AGMT'
  191 + }else if (_contractType === 'PROCUREMENT_CONTRACT') {
  192 + Name = 'PROCUREMENT_CONTRACT'
189 }else{ 193 }else{
190 Name = this.auditCtx.bizFlag || '' 194 Name = this.auditCtx.bizFlag || ''
191 } 195 }
@@ -44,6 +44,8 @@ export default { @@ -44,6 +44,8 @@ export default {
44 let Name = '' 44 let Name = ''
45 if (_contractType === 'PROCESS_STD_AGMT') { 45 if (_contractType === 'PROCESS_STD_AGMT') {
46 Name = 'PROCESS_STD_AGMT' 46 Name = 'PROCESS_STD_AGMT'
  47 + }else if (_contractType === 'PROCUREMENT_CONTRACT') {
  48 + Name = 'PROCUREMENT_CONTRACT'
47 }else{ 49 }else{
48 Name = this.auditCtx.bizFlag || '' 50 Name = this.auditCtx.bizFlag || ''
49 } 51 }
@@ -27,6 +27,7 @@ import ConfirmationFormViewer from '@/pages/confirmation_form/viewer.vue' @@ -27,6 +27,7 @@ import ConfirmationFormViewer from '@/pages/confirmation_form/viewer.vue'
27 import ConfirmationFormApprove from '@/pages/confirmation_form/approve.vue' 27 import ConfirmationFormApprove from '@/pages/confirmation_form/approve.vue'
28 import FollowUpFormViewer from '@/pages/follow_up_form/viewer.vue' 28 import FollowUpFormViewer from '@/pages/follow_up_form/viewer.vue'
29 import DomesticPlanViewer from '@/pages/domestic-plan/domesticPlanViewer.vue' 29 import DomesticPlanViewer from '@/pages/domestic-plan/domesticPlanViewer.vue'
  30 +import DomesticAgreementViewer from '@/pages/domestic-agreement/domesticAgreementViewer.vue'
30 31
31 export default function registerComponents(Vue) { 32 export default function registerComponents(Vue) {
32 Vue.component('CustomerDevelopViewer', CustomerDevelopViewer) 33 Vue.component('CustomerDevelopViewer', CustomerDevelopViewer)
@@ -58,4 +59,5 @@ export default function registerComponents(Vue) { @@ -58,4 +59,5 @@ export default function registerComponents(Vue) {
58 Vue.component('ForeignDraftDistAgmtViewer', ForeignDraftDistAgmtViewer) 59 Vue.component('ForeignDraftDistAgmtViewer', ForeignDraftDistAgmtViewer)
59 Vue.component('AgmtViewer', AgmtViewer) 60 Vue.component('AgmtViewer', AgmtViewer)
60 Vue.component('DomesticPlanViewer', DomesticPlanViewer) 61 Vue.component('DomesticPlanViewer', DomesticPlanViewer)
  62 + Vue.component('DomesticAgreementViewer', DomesticAgreementViewer)
61 } 63 }
@@ -142,6 +142,12 @@ export const getSysFlowComponentPath = (bizFlag) => { @@ -142,6 +142,12 @@ export const getSysFlowComponentPath = (bizFlag) => {
142 case 'PROCUREMENT_PLAN_EDIT': // 采购计划 142 case 'PROCUREMENT_PLAN_EDIT': // 采购计划
143 componentPath = 'DomesticPlanViewer'; // 采购计划-审批 143 componentPath = 'DomesticPlanViewer'; // 采购计划-审批
144 break; 144 break;
  145 + case 'PROCUREMENT_CONTRACT': // 内贸协议
  146 + componentPath = 'DomesticAgreementViewer'; // 内贸协议-审批详情
  147 + break;
  148 + case 'PROCUREMENT_CONTRACT_EDIT': // 内贸协议
  149 + componentPath = 'DomesticAgreementViewer'; // 内贸协议-审批
  150 + break;
145 } 151 }
146 return componentPath; 152 return componentPath;
147 }; 153 };