技术标准-发布-企业标准号功能

This commit is contained in:
zyn
2023-04-05 23:41:49 +08:00
parent fa85c4a03a
commit bb57bd74d9
2 changed files with 168 additions and 42 deletions
@@ -18,12 +18,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="制修订类型" prop="reviseStatus" class="add-form-item form-item-disabled" > <el-form-item label="制修订类型" prop="reviseStatus" class="add-form-item form-item-disabled" >
<el-select v-model="form.reviseStatus" filterable @change="reveseStatusChange"> <el-select v-model="form.reviseStatus" filterable @change="reveseStatusChange"
:disabled="form.reviseStatus === '3'">
<el-option <el-option
v-for="item in opinionsStand" v-for="item in opinionsStand"
:key="item.value" :key="item.value"
:value="item.value" :value="item.value"
:label="item.label" :label="item.label"
:disabled="item.value ==='3'"
></el-option> ></el-option>
</el-select> </el-select>
<!--<template>--> <!--<template>-->
@@ -1121,8 +1121,10 @@
data: [], // 标准列表数据 data: [], // 标准列表数据
ListForm: {}, // 新增数据 ListForm: {}, // 新增数据
maxStandnSn:"", // 最大順序號 maxStandnSn:"", // 最大順序號
standSort:"", standSort:"",
standCode:"" standCode:"",
reviseStatus:"",
standNum:""
} }
}, },
watch:{ watch:{
@@ -1172,18 +1174,68 @@
}, },
methods: { methods: {
reveseStatusChange(val){ reveseStatusChange(val){
if(val === '1'){ if(this.form.reviseStatus === '1'){
this.form.standNum = this.maxStandnSn this.$http.get('lawss/sarBussionessStand/getStandInfoByReviseStatus',{reviseStatus:'buss1_'+this.form.reviseStatus,standSort:this.form.standSort,taskId: this.taskIds}, {
}else{ _this: this
this.form.standNum = this.form.standSn }, res => {
} const obj = res.data
if(val === '3'){ let standSn = obj.newStandSn + 1
this.form.standSort = this.standSort this.form.standSn = standSn
this.form.standNumber = standSn
this.form.standNum = standSn
}, e => {
})
// this.form.standYear = this.standYear.slice(0,4)
let year = new Date().getFullYear()
if(this.standYear !== year){
// if(this.standYear.slice(0,4) == this.form.standYear){
// this.form.standYear = year + ' X'
// }else{
this.form.standYear = year
// }
}else{
if(this.standYear.slice(0,4) == this.form.standYear){
this.form.standYear = this.standYear + ' X'
}else{
this.form.standYear = this.standYear
}
}
}else if(this.form.reviseStatus === '2'){
this.form.standNum = this.standNum === undefined ? '' : this.standNum
let year = new Date().getFullYear()
if(this.standYear.slice(0,4) != year){
if((this.form.standYear+'').slice(0,4) === year){
this.form.standYear = year + ' X'
}else{
this.form.standYear = year
}
}else{
if(this.standYear.slice(0,4) == (this.form.standYear + '').slice(0,4)){
this.form.standYear = this.standYear + ' X'
}else{
this.form.standYear = this.standYear
}
}
}else if(this.form.reviseStatus === '3'){
// this.form.standSort = this.standSort
this.form.standCode = this.standCode this.form.standCode = this.standCode
this.form.standNum = this.standNum
if(this.standYear.slice(0,4) == this.form.standYear){
this.form.standYear = this.standYear + ' X'
}else{
this.form.standYear = this.standYear
}
this.form.standSort = this.standSort
} }
}, },
standSortChange(val){ standSortChange(val){
this.form.standCode = val + ' ' + this.form.standNum + ( this.form.standYear === '' ? '' : '-' + this.form.standYear ) this.reveseStatusChange();
// this.form.standCode = val + ' ' + this.form.standNum + ( this.form.standYear === '' ? '' : '-' + this.form.standYear )
}, },
checkedRoleTransfer (data) { checkedRoleTransfer (data) {
this.isSubmit = true this.isSubmit = true
@@ -2820,49 +2872,119 @@
getStandInfoByReviseStatus() { getStandInfoByReviseStatus() {
let date = new Date(); let date = new Date();
let year = date.getFullYear(); let year = date.getFullYear();
this.reviseStatus = this.form.reviseStatus
if(this.form.reviseStatus === '2'){ if(this.form.reviseStatus === '2'){
this.form.standSn = this.form.standNum
this.form.standNumber = this.form.standNum // 截取企标号中的日期
this.form.standYear = this.regDate(year) // 'Q-F 101-2023 X'
// 此处因企标编号中带有空格所以此处不再补充添加空格,如果企标编码中没有空格则补充空格 但是产品标准除外 // ---
let judgeFn = new RegExp(/\s+/g); if(this.form.standCode == ''){
if(judgeFn.test(this.form.standSort)){ this.form.standCode = this.form.DTQBBHBUSS
this.form.standCode = this.form.standSort + '' + this.form.standNum + ( this.form.standYear === '' ? '' : '-' + this.form.standYear ) // this.form.standCode = 'Q/FT A033-2023'
}else if(this.form.standSort === 'Q/QCBFC'){ }
this.form.standCode = this.form.standSort + '' + this.form.standNum + ( this.form.standYear === '' ? '' : '-' + this.form.standYear ) let index1 = this.form.standCode.lastIndexOf('-') // 7
}else { this.standYear = this.form.standCode.slice(index1 + 1) // 2023 x
this.form.standCode = this.form.standSort + ' ' + this.form.standNum + ( this.form.standYear === '' ? '' : '-' + this.form.standYear ) if(this.standYear.indexOf(' ')>0){
} const _index = this.standYear.indexOf(' ')
this.standCode = this.form.standCode this.standYear = this.standYear.slice(0,_index)
this.standSort = this.form.standSort }else if(this.standYear.indexOf(' X')>0){
this.formKey++ const _index = this.standYear.indexOf(' X') // 4
} else if(this.form.reviseStatus === '3'){ this.standYear = this.standYear.slice(0,_index) // 2023
}
let noYearStand = this.form.standCode.slice(0, index1) // 'Q-F 101'
let index2 = noYearStand.lastIndexOf(' ') // 3
this.standNum = noYearStand.slice(index2 + 1) // '101'
this.standSort = noYearStand.slice(0, index2) // 'Q-F'
this.form.standSort = this.standSort
this.form.standNum = this.standNum
// ---
this.form.standSn = this.form.standNum
this.form.standNumber = this.form.standNum
// this.form.standYear = this.regDate(year)
this.form.standYear = year
if(this.form.standYear == this.standYear){
this.form.standYear = this.form.standYear + ' X'
}
// 此处因企标编号中带有空格所以此处不再补充添加空格,如果企标编码中没有空格则补充空格 但是产品标准除外
let judgeFn = new RegExp(/\s+/g);
console.log(judgeFn.test(this.form.standSort))
if(judgeFn.test(this.form.standSort)){
this.form.standCode = this.form.standSort + '' + this.form.standNum + ( this.form.standYear === '' ? '' : '-' + this.form.standYear )
}else if(this.form.standSort === 'Q/QCBFC'){
this.form.standCode = this.form.standSort + '' + this.form.standNum + ( this.form.standYear === '' ? '' : '-' + this.form.standYear )
}else {
this.form.standCode = this.form.standSort + ' ' + this.form.standNum + ( this.form.standYear === '' ? '' : '-' + this.form.standYear )
}
this.standCode = this.form.standCode
// this.standSort = this.form.standSort
this.formKey++
} else if (this.form.reviseStatus === '3'){
this.form.standCode = this.form.standCode this.form.standCode = this.form.standCode
this.$http.get('lawss/sarBussionessStand/getStandInfoByReviseStatus',{reviseStatus:'buss1_'+this.form.reviseStatus,standSort:this.form.standSort,taskId: this.taskIds}, {
_this: this
}, res => {
const obj = res.data
let standSn = obj.newStandSn
this.form.standSn = standSn
this.form.standNumber = standSn
this.form.standNum = standSn
}, e => {
})
this.form.standYear = this.regDate(year)
this.standSort = this.form.standSort
this.standCode = this.form.standCode this.standCode = this.form.standCode
this.formKey++ // ---
let index1 = this.form.standCode.lastIndexOf('-') // 7
this.standYear = this.form.standCode.slice(index1 + 1) // 2023 x
if(this.standYear.indexOf(' ')>0){
const _index = this.standYear.indexOf(' ')
this.standYear = this.standYear.slice(0,_index)
}else if(this.standYear.indexOf(' X')>0){
const _index = this.standYear.indexOf(' X') // 4
this.standYear = this.standYear.slice(0,_index) // 2023
}
console.log(this.standYear)
let noYearStand = this.form.standCode.slice(0, index1) // 'Q-F 101'
let index2 = noYearStand.lastIndexOf(' ') // 3
this.standNum = noYearStand.slice(index2 + 1) // '101'
this.standSort = noYearStand.slice(0, index2) // 'Q-F'
this.form.standSort = this.standSort
this.form.standNum = this.standNum
// ---
this.form.standYear = year
// if(this.form.standYear == this.standYear){
// this.form.standYear = this.form.standYear + ' X'
// }
// this.$http.get('lawss/sarBussionessStand/getStandInfoByReviseStatus',{reviseStatus:'buss1_'+this.form.reviseStatus,standSort:this.form.standSort,taskId: this.taskIds}, {
// _this: this
// }, res => {
// const obj = res.data
// let standSn = obj.newStandSn
// this.form.standSn = standSn
// this.form.standNumber = standSn
// this.form.standNum = standSn
// }, e => {
// })
// this.form.standYear = this.regDate(year)
// this.standSort = this.form.standSort
// this.standCode = this.form.standCode
// this.formKey++
} else { } else {
this.form.standYear = year
this.$http.get('lawss/sarBussionessStand/getStandInfoByReviseStatus',{reviseStatus:'buss1_'+this.form.reviseStatus,standSort:this.form.standSort,taskId: this.taskIds}, { this.$http.get('lawss/sarBussionessStand/getStandInfoByReviseStatus',{reviseStatus:'buss1_'+this.form.reviseStatus,standSort:this.form.standSort,taskId: this.taskIds}, {
_this: this _this: this
}, res => { }, res => {
const obj = res.data const obj = res.data
let standSn = obj.newStandSn let standSn = obj.newStandSn + 1
this.form.standSn = standSn this.form.standSn = standSn
this.form.standNumber = standSn this.form.standNumber = standSn
this.form.standNum = standSn this.form.standNum = standSn
this.form.standYear = this.regDate(year) // 待带入立项标准 // this.form.standYear = this.regDate(year) // 待带入立项标准
//此处因企标编号中带有空格所以此处不再补充添加空格,如果企标编码中没有空格则补充空格 但是产品标准除外 //此处因企标编号中带有空格所以此处不再补充添加空格,如果企标编码中没有空格则补充空格 但是产品标准除外
let judgeFn = new RegExp(/\s+/g); let judgeFn = new RegExp(/\s+/g);
if(judgeFn.test(this.form.standSort)){ if(judgeFn.test(this.form.standSort)){
@@ -2874,6 +2996,8 @@
} }
this.standSort = this.form.standSort this.standSort = this.form.standSort
this.standCode = this.form.standCode this.standCode = this.form.standCode
this.formKey++ this.formKey++
}, e => { }, e => {
}) })