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

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-form-item>
<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
v-for="item in opinionsStand"
:key="item.value"
:value="item.value"
:label="item.label"
:disabled="item.value ==='3'"
></el-option>
</el-select>
<!--<template>-->
@@ -1121,8 +1121,10 @@
data: [], // 标准列表数据
ListForm: {}, // 新增数据
maxStandnSn:"", // 最大順序號
standSort:"",
standCode:""
standSort:"",
standCode:"",
reviseStatus:"",
standNum:""
}
},
watch:{
@@ -1172,18 +1174,68 @@
},
methods: {
reveseStatusChange(val){
if(val === '1'){
this.form.standNum = this.maxStandnSn
}else{
this.form.standNum = this.form.standSn
}
if(val === '3'){
this.form.standSort = this.standSort
if(this.form.reviseStatus === '1'){
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 + 1
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.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){
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) {
this.isSubmit = true
@@ -2820,49 +2872,119 @@
getStandInfoByReviseStatus() {
let date = new Date();
let year = date.getFullYear();
this.reviseStatus = this.form.reviseStatus
if(this.form.reviseStatus === '2'){
this.form.standSn = this.form.standNum
this.form.standNumber = this.form.standNum
this.form.standYear = this.regDate(year)
// 此处因企标编号中带有空格所以此处不再补充添加空格,如果企标编码中没有空格则补充空格 但是产品标准除外
let judgeFn = new RegExp(/\s+/g);
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'){
// 截取企标号中的日期
// 'Q-F 101-2023 X'
// ---
if(this.form.standCode == ''){
this.form.standCode = this.form.DTQBBHBUSS
// this.form.standCode = 'Q/FT A033-2023'
}
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
}
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.$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++
// ---
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 {
this.form.standYear = year
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
let standSn = obj.newStandSn + 1
this.form.standSn = standSn
this.form.standNumber = standSn
this.form.standNum = standSn
this.form.standYear = this.regDate(year) // 待带入立项标准
// this.form.standYear = this.regDate(year) // 待带入立项标准
//此处因企标编号中带有空格所以此处不再补充添加空格,如果企标编码中没有空格则补充空格 但是产品标准除外
let judgeFn = new RegExp(/\s+/g);
if(judgeFn.test(this.form.standSort)){
@@ -2874,6 +2996,8 @@
}
this.standSort = this.form.standSort
this.standCode = this.form.standCode
this.formKey++
}, e => {
})