[update] 企标制修订流程到评分人打分节点
This commit is contained in:
+167
@@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<div>
|
||||
<base-info-form ref="baseInfoForm" v-bind="$attrs" disabled></base-info-form>
|
||||
<div>
|
||||
<j-table
|
||||
:can-drag="true"
|
||||
:scroll="{x: '100%'}"
|
||||
ref="table"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="false"
|
||||
:loading="loading">
|
||||
|
||||
<!-- 操作栏 -->
|
||||
<div slot="action" slot-scope="{record, index}" class="action-span-cell">
|
||||
<!-- 上传企标 只能上传分配给自己的上传企标,到期未上传跳过该起草人,操作列表显示- -->
|
||||
<a v-if="record.drafter === userInfo.id && record.expirationDate < currentDate"
|
||||
@click="handleUploadStandard(record, index)"
|
||||
class="table-ope-btn"
|
||||
:disabled="disabled"
|
||||
>
|
||||
{{ $t('workCenter.enStandardRevision.uploadStandard') }}
|
||||
</a>
|
||||
<div v-else class="table-text">{{ global.emptyLine }}</div>
|
||||
</div>
|
||||
|
||||
</j-table>
|
||||
</div>
|
||||
<!-- 上传文件弹框 -->
|
||||
<upload-file ref="uploadFile" @change="uploadFileChange" :multiple="false" :number="1" :return-url="false" :disabled="disabled"></upload-file>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JTable from '@/components/jero/JTable'
|
||||
import BaseInfoForm from './BaseInfoForm'
|
||||
import UploadFile from '@/components/UploadFile'
|
||||
import Vue from 'vue'
|
||||
import { USER_INFO } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: 'OtherDrafterUploadStandardBaseInfo',
|
||||
components: { BaseInfoForm, JTable, UploadFile },
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
columns: [
|
||||
{ // 起草单位
|
||||
title: this.$t('workCenter.enStandardRevision.draftingUnit'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'draftingUnit_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 起草人
|
||||
title: this.$t('workCenter.enStandardRevision.drafter'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'drafter_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 起草范围
|
||||
title: this.$t('workCenter.enStandardRevision.draftingScope'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'draftingScope',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 截止日期
|
||||
title: this.$t('expirationDate'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'expirationDate',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 操作
|
||||
title: this.$t('operation'),
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 200
|
||||
}
|
||||
],
|
||||
dataSource: [
|
||||
{
|
||||
id: 1,
|
||||
expirationDate: '2023-10-08',
|
||||
drafter: 'e9ca23d68d884d4ebb19d07889727dae'
|
||||
}
|
||||
],
|
||||
loading: false,
|
||||
data: {}, // 初始化获取的数据
|
||||
userInfo: {}, // 当前登录人信息
|
||||
currentDate: '',
|
||||
uploadIndex: undefined // 正在上传企标的下标
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.userInfo = Vue.ls.get(USER_INFO)
|
||||
this.currentDate = new Date().getFullYear() + '-' + new Date().getMonth() + '-' + new Date().getDate()
|
||||
},
|
||||
methods: {
|
||||
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
|
||||
initData (data) {
|
||||
this.data = data
|
||||
// 给表格赋值,在线编辑不知道要怎么赋值?
|
||||
// this.dataSource =
|
||||
// 给表单赋值
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.baseInfoForm.formInline =
|
||||
// })
|
||||
},
|
||||
// 外层要获取数据
|
||||
getData () {
|
||||
// 把数据抛出
|
||||
return this.dataSource
|
||||
},
|
||||
// 外层获取数据要过校验,返回false表示没有通过校验
|
||||
getDataValidate () {
|
||||
if (this.dataSource && this.dataSource.length > 0) {
|
||||
// 看能上传企标的行是否都上传了
|
||||
let hasErr = false
|
||||
for (const item of this.dataSource) {
|
||||
if (item.drafter === this.userInfo.id && item.expirationDate < this.currentDate && !item.standardFile) {
|
||||
// 需要上传企标,但是没有企标文件
|
||||
hasErr = true
|
||||
}
|
||||
}
|
||||
// 根据hasErr看有没有通过校验
|
||||
if (hasErr) {
|
||||
this.$message.warning(this.$t('workCenter.enStandardRevision.pleaseUploadStandard'))
|
||||
return false
|
||||
} else {
|
||||
return this.dataSource
|
||||
}
|
||||
}
|
||||
},
|
||||
// 上传企标
|
||||
handleUploadStandard (record, index) {
|
||||
this.$refs.uploadFile.open(record.standardFile)
|
||||
this.uploadIndex = index
|
||||
},
|
||||
// 上传企标后的回调
|
||||
uploadFileChange (data) {
|
||||
const attIdList = []
|
||||
if (data && data.length > 0) {
|
||||
data.map(item => {
|
||||
attIdList.push(item.id)
|
||||
})
|
||||
}
|
||||
/** 赋值给对应行的企标 */
|
||||
this.dataSource[this.uploadIndex].standardFile = attIdList.join(',')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user