Commit 7e7f5602 by 许俊杰

feat:同步新功能(评分节点工程类支持移动审批)

parent ce3cbb86
......@@ -9,11 +9,12 @@
</template>
<script>
import { mapMutations, mapState } from 'vuex'
import { mapMutations, mapState, mapActions, mapGetters } from 'vuex'
import { setToken, testFid } from '@/api'
import { Toast } from 'vant'
import '@/assets/css/base.css'
import '@/assets/css/app.css'
import { Coder } from '@/common'
export default {
name: 'app',
......@@ -25,15 +26,15 @@ export default {
// 兼容V+模块
console.log('当前环境:', process.env.NODE_ENV)
this.getVUserData()
this.getExtraData()
} else {
// APP模块(生产环境、开发环境)
console.log('当前环境:', process.env.NODE_ENV)
// 模拟耗时获取数据
setTimeout(() => {
setTimeout(async () => {
setToken()
this.updateFid(testFid)
this.updateCurrentPageType(27)
this.updateCurrentPageType(29)
await this.fetchInspect({billId: Coder.replace(testFid), isGradeNode: true}) // 29 30评分节点放开
this.updateReadyState(true)
}, 1000)
}
......@@ -70,7 +71,10 @@ export default {
...mapState(['loading', 'PageTypes']),
includedComponents () {
return this.cacheRouterNames.join(',')
}
},
...mapGetters('inspect', [
'isGCSupplierType'
])
},
watch: {
loading (newVal, oldVal) {
......@@ -97,6 +101,9 @@ export default {
}
},
methods: {
...mapActions('inspect', [
'fetchInspect'
]),
...mapMutations([
'updateCurrentPageType',
'updateFlowId',
......@@ -114,8 +121,10 @@ export default {
.account
.getUser()
.then(data => {
console.log('getVUserData', data)
this.updateVUserName(data.cn)
setToken(data.ssoToken)
this.getExtraData()
this.fetchUserDataSuccess = true
})
.catch(error => {
......@@ -135,7 +144,8 @@ export default {
this.$nativeApi
.dataInteraction
.getExtra(['com.jffc.supplier'])
.then(result => {
.then(async result => {
console.log('getExtra.result', result)
let params = JSON.parse(result.extra.showWidgetKey)
if (result.result && params) {
// 保存从代办事项传过来的参数
......@@ -144,7 +154,14 @@ export default {
switch (params.page) {
case 'review_grade':
// 评分节点
// this.updateCurrentPageType()
await this.fetchInspect({billId: encodeURIComponent(Coder.replace(params.billId)), isGradeNode: true})
if (this.isGCSupplierType) {
if (recType == 3) {
type = this.PageTypes.Grade_Done
} else {
type = this.PageTypes.Grade_Todo
}
}
break
case 'review_leader':
// 组长审核节点
......
......@@ -2,7 +2,10 @@
<div class="grade-item">
<div class="header flex flex-cross-center flex-space-between">
<span>{{reviewPerson}}</span>
<span @click="handleItemClick(gradeInfo)" class="date">{{date}} <font-icon type="forward_arrow_black_small"/></span>
<span @click="handleItemClick(gradeInfo)" class="date">
{{date}}
<font-icon v-if="!isGCSupplierType" type="forward_arrow_black_small"/>
</span>
</div>
<div class="content">
<div v-if="businessScore">
......@@ -27,6 +30,7 @@
<script>
import FontIcon from '@/components/FontIcon'
import { mapGetters } from 'vuex'
export default {
name: 'grade-item',
......@@ -65,10 +69,16 @@ export default {
},
supplyRankIconType () {
return this.gradeInfo.supplyRank !== 0 ? 'no_red_small' : 'success_green'
}
},
...mapGetters('inspect', [
'isGCSupplierType'
])
},
methods: {
handleItemClick (item) {
if (this.isGCSupplierType) {
return
}
this.$emit('item-click', item)
}
}
......
......@@ -80,6 +80,8 @@ export default {
switch (this.currentPageType) {
case 1:
case 2:
case 29:
case 30:
return 1
case 3:
case 4:
......@@ -92,6 +94,9 @@ export default {
},
disableSubmit () {
return false
},
isGradeNode () {
return !!(this.currentPageType === this.PageTypes.Grade_Todo || this.currentPageType === this.PageTypes.Grade_Done)
}
},
watch: {
......@@ -106,11 +111,18 @@ export default {
}
},
methods: {
...mapMutations('score', [
'updateMemberGradeInfo'
]),
fetchData () {
this.$store.commit('showLoading', true)
this.fetchInspect({billId: Coder.replace(this.currentFid)})
if (!this.isGradeNode) {
this.fetchInspect({billId: encodeURIComponent(Coder.replace(this.currentFid)), isGradeNode: this.isGradeNode})
.then(() => this.$store.commit('showLoading', false))
.catch(() => this.$store.commit('showLoading', false))
} else {
this.$store.commit('showLoading', false)
}
},
init () {
switch (this.currentPageType) {
......@@ -123,6 +135,15 @@ export default {
// 组长已会审
this.title = '考察-组长已会审'
break
case this.PageTypes.Grade_Todo:
// 评分会审
this.title = '考察-评分会审'
this.submitType = 'leader'
break
case this.PageTypes.Grade_Done:
// 评分已会审
this.title = '考察-评分已会审'
break
case this.PageTypes.Sign_Todo:
// 待会审
this.title = '考察-会审'
......@@ -205,6 +226,11 @@ export default {
// 审批
this.$router.push({name: 'approval', params: item})
break
case this.PageTypes.Grade_Todo:
case this.PageTypes.Grade_Done:
this.updateMemberGradeInfo(item)
this.$router.push({name: 'summary', params: item})
break
default:
this.$router.push({name: 'supplier', params: item})
}
......
......@@ -98,6 +98,7 @@ export default {
[Icon.name]: Icon
},
computed: {
...mapGetters(['currentPageType']),
...mapGetters('inspect', [
'currentFid',
'reviewGrpId',
......@@ -107,11 +108,16 @@ export default {
...mapState('inspect', [
'inspectAttachmentInfo',
'inspectHisAttachmentInfo'
])
]),
...mapState(['PageTypes']),
isGradeNode () {
return !!(this.currentPageType === this.PageTypes.Grade_Todo || this.currentPageType === this.PageTypes.Grade_Done)
}
},
mounted () {
this.fetchAttachmentList({ billId: Coder.replace(this.currentFid) })
this.fetchGetHisAttachmentList({ billId: Coder.replace(this.currentFid) })
let fid = this.isGradeNode ? this.reviewGrpId : this.currentFid
this.fetchAttachmentList({ billId: Coder.replace(fid) })
this.fetchGetHisAttachmentList({ billId: Coder.replace(fid) })
},
data () {
return {
......
......@@ -21,6 +21,8 @@ export default {
switch (this.currentPageType) {
case this.PageTypes.Leader_Todo:
case this.PageTypes.Leader_Done:
case this.PageTypes.Grade_Todo:
case this.PageTypes.Grade_Done:
case this.PageTypes.Sign_Todo:
case this.PageTypes.Sign_Done:
case this.PageTypes.Approval_Todo:
......
......@@ -24,7 +24,7 @@
btnTitle="添加适用项目"
@handleAdd="handleChooseProject"
/>
<review-add-item
<!-- <review-add-item
v-if="showProjectType"
:editable="isTodo"
:title="`${projectTypeIndex}.适用项目类型`"
......@@ -38,7 +38,7 @@
:title="`${productGradeIndex}.适用产品档次`"
:defaultValue="productGradeId"
v-model="productGradeId"
/>
/> -->
</div>
<div class="footer flex-v flex-center" slot="footer">
<van-button @click="handleSubmit" v-if="isTodo" type="danger" size="large">确认</van-button>
......
......@@ -7,7 +7,7 @@
<span class="label">{{currentSupplierInfo.supplierTypeName}}</span>
</div>
<div class="project-info margin-top flex flex-space-between">
<span class="name">考察成员评分</span>
<span class="name">考察成员结论</span>
<span @click="gotoMemberGrade"><span class="red_link">查看详情</span> <font-icon type="forward_arrow_black_small"></font-icon></span>
</div>
<div class="project-info margin-top flex flex-space-between">
......
......@@ -12,32 +12,31 @@
</cell>
<div class="margin" ref="mainPage">
<p>对该供方综合评估为</p>
<cell title='进入"合格供方资源库"' class="agree" style="margin-bottom:15px" @click="toggle(3)">
<cell title='进入"合格供方资源库"' class="agree" style="margin-bottom:15px" @click="toggle(0)">
<slot>
<font-icon :type="index == 0 ? backIconType.activated : backIconType.disactivated"></font-icon>
</slot>
</cell>
<cell title='不进入"合格供方资源库"' class="noagree" @click="toggle(0)">
<cell title='不进入"合格供方资源库"' class="noagree" @click="toggle(3)">
<slot>
<font-icon :type="index == 3 ? backIconType.activated : backIconType.disactivated"></font-icon>
</slot>
</cell>
<van-field
type="textarea"
<textarea
class="textarea"
:disabled="!isEditable"
:placeholder="`${isEditable ? '请输入意见' : ''}`"
class="textarea"
rows="3"
:value="memberGradeInfo.conclusion || ''"
@input="handleInput"
>
</van-field>
</textarea>
</div>
<cell>
<slot></slot>
</cell>
</cell-group>
<div class="footer flex-v flex-center" slot="footer">
<van-button class="button-red-round" type="danger" size="large" @click="submit" >确认</van-button>
<van-button class="button-red-round" v-if="isEditable" type="danger" size="large" @click="submit" >确认</van-button>
</div>
</div>
</div>
......@@ -45,10 +44,11 @@
</template>
<script>
import { mapState } from 'vuex'
import { Cell, CellGroup, Field, Button } from 'vant'
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'
import { Cell, CellGroup, Field, Button, Toast } from 'vant'
import BaseLayout from '@/layouts/BaseLayout'
import FontIcon from '@/components/FontIcon'
import { Coder } from '@/common'
export default {
components: {
......@@ -65,6 +65,7 @@ export default {
this.clientHeight = `${document.documentElement.clientHeight}`;
};
this.index = this.memberGradeInfo.supplyRank
// this.fetchScores({billId: Coder.replace(this.memberGradeInfo.id)})
},
watch: {
clientHeight: function () {
......@@ -72,9 +73,22 @@ export default {
}
},
methods: {
...mapMutations('score', [
'updateMemberGradeInfo'
]),
...mapActions('score', [
'fetchScores'
]),
handleInput (e) {
this.updateMemberGradeInfo({ ...this.memberGradeInfo, conclusion: e.target.value })
},
...mapActions('inspect', [
'reviewDistributeSumit'
]),
toggle (index) {
if (this.isEditable) {
this.index = index
this.updateMemberGradeInfo({ ...this.memberGradeInfo, supplyRank: index })
}
},
changeFixed (clientHeight) {
......@@ -83,12 +97,59 @@ export default {
jump () {
this.$router.push({path: '/scoredetails'});
},
checkBeforeSubmit () {
/**
* 校验必填字段
* 提示优先级
* 1、考察组综合结论不能为空
* 2、综合评估不能为空
*/
let isFinished = true
let tipTitle = `【${this.currentSupplierInfo.supplierName}-${this.currentSupplierInfo.supplierTypeName}】`
let tipText = ''
if (!this.memberGradeInfo.conclusion || !this.memberGradeInfo.conclusion.trim()) {
tipText = '综合结论不能为空!'
isFinished = false
} else if (this.memberGradeInfo.supplyRank == '-1') {
tipText = '综合评估不能为空!'
isFinished = false
}
if (!isFinished) {
this.$dialog.alert({
title: tipTitle,
message: tipText
})
}
return isFinished
},
submit () {
if (this.isEditable) {
// TODO
console.log(this.memberGradeInfo)
if (this.checkBeforeSubmit()) {
let params = {
id: encodeURIComponent(this.memberGradeInfo.reviewDis),
assignmentId: this.todoId,
infos: [{
id: encodeURIComponent(this.memberGradeInfo.id),
supplyRank: this.memberGradeInfo.supplyRank,
conclusion: encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(this.memberGradeInfo.conclusion || '')))
}]
}
this.reviewDistributeSumit({params, callback: this.submitCallback})
}
} else {
this.$router.go(-1)
}
},
submitCallback (success, msg) {
if (!success) {
Toast(msg)
}
setTimeout(() => {
if (success) {
this.$router.go(-1)
}
}, 1000)
}
},
data () {
......@@ -104,6 +165,9 @@ export default {
}
},
computed: {
...mapGetters(['currentPageType']),
...mapState(['PageTypes']),
...mapState(['todoId']),
...mapState('inspect', [
'currentSupplierInfo'
]),
......@@ -111,8 +175,14 @@ export default {
'memberGradeInfo'
]),
isEditable () {
// TODO 是否已提交,不可编辑
return false
switch (this.currentPageType) {
case this.PageTypes.Grade_Todo:
return true
case this.PageTypes.Grade_Done:
return false
default:
return false
}
},
defaultSupplyRank () {
return this.memberGradeInfo.supplyRank || 0
......@@ -193,5 +263,17 @@ textarea.van-field__control:disabled {
height: 72px;
padding: 0 15px;
}
.textarea {
height: 80px;
width: 100%;
box-sizing: border-box;
margin-top: 3px;
padding: 12px;
font-size: 14px;
background-color: #fafafa;
border: 1px solid #E1E1E1;
border-radius: 3px;
resize:none;
}
</style>
......@@ -3,9 +3,10 @@ import {
getAuditReviewSummarys,
// getReviewSummaryPersionList,
getReviewSummaryInfo,
// reviewDistributeSumit,
// reviewDistributeSave,
reviewDistributeSumit,
reviewDistributeSave,
// getReviewFormList,
getReviewFormInfo,
getReviewGrpList,
getReviewDistributeInfo,
getProductGradeList,
......@@ -76,6 +77,7 @@ export default {
// CT_SUP_ReviewGrp表的FID
reviewGrpId: state => state.inspectInfo.reviewGrp && state.inspectInfo.reviewGrp.id,
supplierList: state => state.inspectInfo.rows || [],
isGCSupplierType: state => (state.inspectInfo.reviewGrp && state.inspectInfo.reviewGrp.isGCSupplierType) || false,
reviewformList: state => state.reviewFormList.rows || [],
attachmentInfo: state => state.inspectAttachmentInfo.rows || [],
hisattachmentInfo: state => state.inspectHisAttachmentInfo.rows || [],
......@@ -149,11 +151,30 @@ export default {
// 获取所有的供方信息
if (response.data.rows.length > 0) {
let arr = []
response.data.rows.forEach(v => {
arr.push(getReviewSummaryInfo({billId: encodeURIComponent(Coder.replace(v.id))}))
})
Promise.all(arr)
if (isGradeNode) {
let arr = []
response.data.rows.forEach(v => {
arr.push(getReviewFormInfo({billId: Coder.replace(v.id)}))
})
Promise.all(arr)
.then(resultArr => {
let datas = resultArr.map(v => {
if (v.code === 200 && typeof v.data !== 'string') {
return v.data
}
return null
})
commit('updateInspectSupplierSummaryList', datas.filter(v => v !== null))
})
.catch(error => {
commit('networkError', error.msg, { root: true })
})
} else {
let arr = []
response.data.rows.forEach(v => {
arr.push(getReviewSummaryInfo({billId: encodeURIComponent(Coder.replace(v.id))}))
})
Promise.all(arr)
.then(resultArr => {
let datas = resultArr.map(v => {
if (v.code === 200 && typeof v.data !== 'string') {
......@@ -188,6 +209,7 @@ export default {
.catch(error => {
commit('networkError', error.msg, { root: true })
})
}
}
} else {
commit('networkError', response.msg, { root: true })
......@@ -312,23 +334,30 @@ export default {
}
},
// 考察组组员评分提交
// async reviewDistributeSumit ({ commit }, payload) {
// const response = await reviewDistributeSumit(payload)
// if (response.code === 200) {
// // TODO
// } else {
// commit('networkError', response.msg, { root: true })
// }
// },
async reviewDistributeSumit ({ commit }, payload) {
const { callback, params } = payload
commit('showLoading', true, { root: true })
const response = await reviewDistributeSumit(params)
commit('showLoading', false, { root: true })
if (response.code === 200) {
if (response.data.msgType === 'success') {
callback(true, response.data.msg)
} else {
callback(false, response.data.msg)
}
} else {
commit('networkError', response.msg, { root: true })
}
},
// 考察组组员评分保存
// async reviewDistributeSave ({ commit }, payload) {
// const response = await reviewDistributeSave(payload)
// if (response.code === 200) {
// // TODO
// } else {
// commit('networkError', response.msg, { root: true })
// }
// },
async reviewDistributeSave ({ commit }, payload) {
const response = await reviewDistributeSave(payload)
if (response.code === 200) {
// TODO
} else {
commit('networkError', response.msg, { root: true })
}
},
// 按企业评审获取评审分录
// async fetchReviewFormList ({ commit }, payload) {
// const response = await getReviewFormList(payload)
......
......@@ -19,6 +19,8 @@ const state = {
Sign_Done: 4, // 已会签
Approval_Todo: 5, // 待审批
Approval_Done: 6, // 已审批
Grade_Todo: 29, // 评分节点-待审批
Grade_Done: 30, // 评分节点-已审批
Region_Adjust_Sign_Todo: 7, // 供方适用区域调整-会签
Region_Adjust_Sign_Done: 8, // 供方适用区域调整-已会签
Region_Adjust_Approval_Todo: 9, // 供方适用区域调整-审批
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment