Browse Source

提交

master
xiaobai 3 years ago
parent
commit
b02b155551
  1. 535
      src/views/ysjl/3000/common/index.vue

535
src/views/ysjl/3000/common/index.vue

@ -483,8 +483,12 @@
prop="xianchangjianyantiaojian" prop="xianchangjianyantiaojian"
> >
<el-radio-group v-model="ysjl.xianchangjianyantiaojian"> <el-radio-group v-model="ysjl.xianchangjianyantiaojian">
<el-radio label="符合"> 符合 </el-radio> <el-radio label="符合">
<el-radio label="不符合"> 不符合 </el-radio> 符合
</el-radio>
<el-radio label="不符合">
不符合
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -663,10 +667,18 @@
<el-col :span="18"> <el-col :span="18">
<el-form-item label="检验结论" prop="jianyanjielun"> <el-form-item label="检验结论" prop="jianyanjielun">
<el-radio-group v-model="ysjl.jianyanjielun"> <el-radio-group v-model="ysjl.jianyanjielun">
<el-radio label="合格"> 合格 </el-radio> <el-radio label="合格">
<el-radio label="不合格"> 不合格 </el-radio> 合格
<el-radio label="复检合格"> 复检合格 </el-radio> </el-radio>
<el-radio label="复检不合格"> 复检不合格 </el-radio> <el-radio label="不合格">
不合格
</el-radio>
<el-radio label="复检合格">
复检合格
</el-radio>
<el-radio label="复检不合格">
复检不合格
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -803,23 +815,23 @@
</div> </div>
</template> </template>
<script> <script>
import Sticky from "@/components/Sticky"; import Sticky from '@/components/Sticky'
import SignName from "@/views/common/SignName"; import SignName from '@/views/common/SignName'
import Utils from "@/utils/contact"; import Utils from '@/utils/contact'
import merge from "webpack-merge"; import merge from 'webpack-merge'
import Inspection from "@/views/ysjl/3000/common/inspection-items"; import Inspection from '@/views/ysjl/3000/common/inspection-items'
import Table from "@/views/ysjl/3000/dj/common/table"; import Table from '@/views/ysjl/3000/dj/common/table'
import Phxsb from "@/views/ysjl/3000/dj/common/phxsb"; import Phxsb from '@/views/ysjl/3000/dj/common/phxsb'
import ZdftFb from "@/views/ysjl/3000/dj/common/zdftFb"; import ZdftFb from '@/views/ysjl/3000/dj/common/zdftFb'
import { getDepartmentTreeList } from "@/api/common.js"; import { getDepartmentTreeList } from '@/api/common.js'
export default { export default {
name: "BaseInfo", name: 'BaseInfo',
components: { SignName, Sticky, Inspection, Table, Phxsb, ZdftFb }, components: { SignName, Sticky, Inspection, Table, Phxsb, ZdftFb },
props: { props: {
arrayGroup: { arrayGroup: {
required: true, required: true,
type: Array, type: Array
}, },
// /** // /**
// * [{ index: 0, relationIds: [1, 2] }] // * [{ index: 0, relationIds: [1, 2] }]
@ -830,31 +842,31 @@ export default {
// }, // },
fromType: { fromType: {
required: true, required: true,
type: Number, type: Number
}, },
jlbh1: { jlbh1: {
type: String, type: String,
default: "DT", default: 'DT'
}, }
}, },
data() { data() {
return { return {
ysjl: {}, ysjl: {},
param: {}, param: {},
jlbh2: new Date().getFullYear() , jlbh2: new Date().getFullYear(),
jlbh3: "", jlbh3: '',
jlbh4: "", jlbh4: '',
isRepeat: false, isRepeat: false,
jianyanrenyuan: "", jianyanrenyuan: '',
departmentId: this.$route.query.departmentId, departmentId: this.$route.query.departmentId,
edit: false, edit: false,
state: this.$route.query.state, state: this.$route.query.state,
bgfyData: [], bgfyData: [],
ysjlId: this.$route.query.id, ysjlId: this.$route.query.id,
checkedTab: "first", checkedTab: 'first',
xmlbListAB: ["A", "B"], xmlbListAB: ['A', 'B'],
xmlbListAC: ["A", "C"], xmlbListAC: ['A', 'C'],
xmlbListBC: ["B", "C"], xmlbListBC: ['B', 'C'],
jyxmrqShow: false, jyxmrqShow: false,
querenriqi: null, querenriqi: null,
signShow: false, signShow: false,
@ -867,255 +879,255 @@ export default {
jybgData: [], jybgData: [],
cols: [ cols: [
{ {
name: "jianyanxiang", // el-table-column prop='' name: 'jianyanxiang', // el-table-column prop=''
getValue(row) { getValue(row) {
// //
return row.jianyanxiang; return row.jianyanxiang
}, }
}, },
{ {
name: "jianyanmu", name: 'jianyanmu',
getValue(row) { getValue(row) {
return row.jianyanmu; return row.jianyanmu
}, }
}, }
], ],
rows: [ rows: [
{ {
name: "jianyanxiang", name: 'jianyanxiang',
getValue(row) { getValue(row) {
return row.jianyanxiang; return row.jianyanxiang
}, }
}, },
{ {
name: "jianyanneirong", name: 'jianyanneirong',
getValue(row) { getValue(row) {
return row.jianyanneirong; return row.jianyanneirong
}, }
}, }
], ],
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() > Date.now(); return time.getTime() > Date.now()
}, }
}, },
pic: "", pic: '',
fubiao1: [], fubiao1: [],
fubiao2: [], fubiao2: [],
fubiao3: [], fubiao3: [],
tree: [], tree: [],
jybgTemplateId: "", jybgTemplateId: ''
}; }
}, },
created() { created() {
if (this.state === "create") { if (this.state === 'create') {
this.initYsjl(); this.initYsjl()
this.getMaxBh(); this.getMaxBh()
if (this.fromType === 5 || this.fromType === 6) { if (this.fromType === 5 || this.fromType === 6) {
this.fubiao1 = [ this.fubiao1 = [
{ {
D2: "第一次", D2: '第一次',
D1: "", D1: ''
}, },
{ {
D2: "第二次", D2: '第二次',
D1: "", D1: ''
}, },
{ {
D2: "第三次", D2: '第三次',
D1: "", D1: ''
}, }
]; ]
} }
} else { } else {
this.getYsjl(); this.getYsjl()
this.getParam(); this.getParam()
this.getJyxm(1); this.getJyxm(1)
this.getJyxmInfoByYsjl(); this.getJyxmInfoByYsjl()
} }
this.getDepartment(); this.getDepartment()
// this.getDicJyxm(1) // this.getDicJyxm(1)
this.userList = this.$store.getters.allUser.filter( this.userList = this.$store.getters.allUser.filter(
(user) => user.departmentId === 74 && user.clientType === "System" (user) => user.departmentId === 74 && user.clientType === 'System'
); )
}, },
methods: { methods: {
getDepartment() { getDepartment() {
getDepartmentTreeList().then((res) => { getDepartmentTreeList().then((res) => {
this.tree = res; this.tree = res
}); })
}, },
handleChange(v) { handleChange(v) {
this.ysjl.departmentId = v[1]; this.ysjl.departmentId = v[1]
}, },
initYsjl() { initYsjl() {
this.ysjlService.init(this.$route.query).then((data) => { this.ysjlService.init(this.$route.query).then((data) => {
this.ysjl = data.ysjl; this.ysjl = data.ysjl
this.param = data.param ? data.param : {}; this.param = data.param ? data.param : {}
this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat("YYYY-MM-dd"); this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd')
this.ysjl.bglx = 1; this.ysjl.bglx = 1
this.ysjl.cjState = "ysjl"; this.ysjl.cjState = 'ysjl'
this.ysjl.xianchangjianyantiaojian = "符合"; this.ysjl.xianchangjianyantiaojian = '符合'
this.departmentId = this.ysjl.departmentId; this.departmentId = this.ysjl.departmentId
if (data.ysjl.shebeileibiedaima === "3300") { if (data.ysjl.shebeileibiedaima === '3300') {
this.jlbh4 = "(F)"; this.jlbh4 = '(F)'
} else if (data.ysjl.shebeileibiedaima === "3200") { } else if (data.ysjl.shebeileibiedaima === '3200') {
this.jlbh4 = "(Y)"; this.jlbh4 = '(Y)'
} else if (data.ysjl.shebeileibiedaima === "3400") { } else if (data.ysjl.shebeileibiedaima === '3400') {
if (data.ysjl.shebeipinzhongdaima === "3420") { if (data.ysjl.shebeipinzhongdaima === '3420') {
this.jlbh4 = "(X)"; this.jlbh4 = '(X)'
} else if (data.ysjl.shebeipinzhongdaima === "3430") { } else if (data.ysjl.shebeipinzhongdaima === '3430') {
this.jlbh4 = "(Z)"; this.jlbh4 = '(Z)'
} }
} else { } else {
this.jlbh4 = "(C)"; this.jlbh4 = '(C)'
} }
this.getJyxm(1); this.getJyxm(1)
this.getSbList(); this.getSbList()
this.jybgTemplateId = this.ysjl.jybgTemplateId; this.jybgTemplateId = this.ysjl.jybgTemplateId
console.log(this.ysjl.jybgTemplateId); console.log(this.ysjl.jybgTemplateId)
}); })
}, },
getSbList() { getSbList() {
this.api({ this.api({
url: "/sedirectory/getList", url: '/sedirectory/getList',
method: "get", method: 'get',
params: { params: {
sbzl: this.$route.query.sbzldm, sbzl: this.$route.query.sbzldm,
sblb: this.$route.query.sblbdm, sblb: this.$route.query.sblbdm,
level: 2, level: 2
}, }
}).then((data) => { }).then((data) => {
this.xinghaoList = data; this.xinghaoList = data
}); })
}, },
getJyxmInfoByYsjl() { getJyxmInfoByYsjl() {
this.ysjlService.getJyxmInfoByYsjl(this.ysjlId).then((data) => { this.ysjlService.getJyxmInfoByYsjl(this.ysjlId).then((data) => {
if (!data.fbjyxm) { if (!data.fbjyxm) {
return; return
} }
const fubiao = JSON.parse(data.fbjyxm); const fubiao = JSON.parse(data.fbjyxm)
if (!fubiao.length) { if (!fubiao.length) {
return; return
} }
if (fubiao[0]) { if (fubiao[0]) {
this.fubiao1 = fubiao[0]; this.fubiao1 = fubiao[0]
} }
if (fubiao[1]) { if (fubiao[1]) {
this.fubiao2 = fubiao[1]; this.fubiao2 = fubiao[1]
} }
if (fubiao[2]) { if (fubiao[2]) {
this.fubiao3 = fubiao[2]; this.fubiao3 = fubiao[2]
} }
console.log(this.fubiao1); console.log(this.fubiao1)
}); })
}, },
getYsjl() { getYsjl() {
this.ysjlService.getYsjl(this.ysjlId).then((data) => { this.ysjlService.getYsjl(this.ysjlId).then((data) => {
this.ysjl = data; this.ysjl = data
this.departmentId = this.ysjl.departmentId; this.departmentId = this.ysjl.departmentId
this.jybgTemplateId = this.ysjl.jybgTemplateId; this.jybgTemplateId = this.ysjl.jybgTemplateId
this.ysjl.imagePath = ""; this.ysjl.imagePath = ''
if ( if (
this.ysjl.jianyanrenyuan !== null && this.ysjl.jianyanrenyuan !== null &&
this.ysjl.jianyanrenyuan.length > 0 this.ysjl.jianyanrenyuan.length > 0
) { ) {
this.jianyanrenyuan = this.common.convertCnName( this.jianyanrenyuan = this.common.convertCnName(
this.ysjl.jianyanrenyuan this.ysjl.jianyanrenyuan
); )
} }
this.ysjlService this.ysjlService
.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id) .judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id)
.then((data) => { .then((data) => {
this.isRepeat = data; this.isRepeat = data
}); })
}); })
}, },
getParam() { getParam() {
const id = this.ysjlId || this.$route.query.templateId; const id = this.ysjlId || this.$route.query.templateId
this.ysjlService.getParam(id, this.$route.query.sbzldm).then((data) => { this.ysjlService.getParam(id, this.$route.query.sbzldm).then((data) => {
this.param = data; this.param = data
}); })
}, },
judgeRepeat(bianhao, id) { judgeRepeat(bianhao, id) {
this.api({ this.api({
url: "/ysjl/judgeRepeat", url: '/ysjl/judgeRepeat',
method: "get", method: 'get',
params: { params: {
ysjlId: id, ysjlId: id,
bianhao: bianhao, bianhao: bianhao
}, }
}).then((data) => { }).then((data) => {
if (data > 0) { if (data > 0) {
this.isRepeat = true; this.isRepeat = true
} else { } else {
this.isRepeat = false; this.isRepeat = false
} }
}); })
}, },
getJyxm(sort) { getJyxm(sort) {
console.log(this.jybgTemplateId, this.ysjl.jybgTemplateId); console.log(this.jybgTemplateId, this.ysjl.jybgTemplateId)
if (this.$route.query.state === "update") { if (this.$route.query.state === 'update') {
this.jyxmService this.jyxmService
.getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort, 0) .getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort, 0)
.then((data) => { .then((data) => {
this.bgfyData = data; this.bgfyData = data
this.tableJs.getData(this.cols, this.rows, this.bgfyData); this.tableJs.getData(this.cols, this.rows, this.bgfyData)
}); })
this.jyxmService this.jyxmService
.getJdCyJyxm(this.ysjlId, this.ysjl.jybgTemplateId, sort, 1) .getJdCyJyxm(this.ysjlId, this.ysjl.jybgTemplateId, sort, 1)
.then((data) => { .then((data) => {
this.jybgData = data; this.jybgData = data
}); })
} else { } else {
this.jyxmService this.jyxmService
.getCyJyxm(this.$route.query.templateId, sort) .getCyJyxm(this.$route.query.templateId, sort)
.then((data) => { .then((data) => {
data.forEach((row) => { data.forEach((row) => {
row.dicJyxmId = row.id; row.dicJyxmId = row.id
}); })
this.bgfyData = data; this.bgfyData = data
this.tableJs.getData(this.cols, this.rows, this.bgfyData); this.tableJs.getData(this.cols, this.rows, this.bgfyData)
}); })
this.jyxmService this.jyxmService
.getCyJyxm(this.ysjl.jybgTemplateId, sort) .getCyJyxm(this.ysjl.jybgTemplateId, sort)
.then((data) => { .then((data) => {
data.forEach((row) => { data.forEach((row) => {
row.dicJyxmId = row.id; row.dicJyxmId = row.id
}); })
this.jybgData = data; this.jybgData = data
}); })
} }
}, },
/** /**
* 查询最大记录编号 * 查询最大记录编号
*/ */
getMaxBh() { getMaxBh() {
const aheadPart = this.jlbh1 + this.jlbh2 + "-"; const aheadPart = this.jlbh1 + this.jlbh2 + '-'
this.api({ this.api({
url: "/ysjl/gainCurrentBh", url: '/ysjl/gainCurrentBh',
method: "get", method: 'get',
params: { params: {
aheadPart: aheadPart, aheadPart: aheadPart,
hinderPart: "", hinderPart: ''
}, }
}).then((data) => { }).then((data) => {
this.jlbh3 = data; this.jlbh3 = data
this.ysjlService this.ysjlService
.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id) .judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id)
.then((data) => { .then((data) => {
this.isRepeat = data; this.isRepeat = data
}); })
}); })
}, },
/** /**
* 签名方法 * 签名方法
* @param data * @param data
*/ */
signNameValue(data) { signNameValue(data) {
this.ysjl.jianyanrenyuan = String(data.id); this.ysjl.jianyanrenyuan = String(data.id)
this.jianyanrenyuan = data.name; this.jianyanrenyuan = data.name
this.common.signName(this.ysjl.id, this.ysjl.jianyanrenyuan); this.common.signName(this.ysjl.id, this.ysjl.jianyanrenyuan)
}, },
customClearSign(fieldName) { customClearSign(fieldName) {
const data = { const data = {
@ -1123,192 +1135,191 @@ export default {
this.ysjl.jianyanrenyuan && this.ysjl.jianyanrenyuan &&
this.common this.common
.deleteElement( .deleteElement(
this.ysjl.jianyanrenyuan.split(","), this.ysjl.jianyanrenyuan.split(','),
String(this.$store.getters.userId) String(this.$store.getters.userId)
) )
.join(","), .join(','),
name: name:
this.jianyanrenyuan && this.jianyanrenyuan &&
this.common this.common
.deleteElement( .deleteElement(
this.jianyanrenyuan.split(","), this.jianyanrenyuan.split(','),
this.$store.getters.nickname this.$store.getters.nickname
) )
.join(","), .join(','),
fieldName: fieldName, fieldName: fieldName
}; }
this.signNameValue(data); this.signNameValue(data)
}, },
saveYsjl(operation) { saveYsjl(operation) {
if (operation !== "add" && this.pic) { if (operation !== 'add' && this.pic) {
this.uploadPhxsBase64File(operation); this.uploadPhxsBase64File(operation)
} else { } else {
this.buildSaveData(operation); this.buildSaveData(operation)
} }
}, },
sortClass(sortData) { sortClass(sortData) {
const groupBy = (array, f) => { const groupBy = (array, f) => {
const groups = {}; const groups = {}
array.forEach((o) => { array.forEach((o) => {
const group = JSON.stringify(f(o)); const group = JSON.stringify(f(o))
groups[group] = groups[group] || []; groups[group] = groups[group] || []
groups[group].push(o); groups[group].push(o)
}); })
return Object.keys(groups).map((group) => { return Object.keys(groups).map((group) => {
return groups[group]; return groups[group]
}); })
}; }
const sorted = groupBy(sortData, (item) => { const sorted = groupBy(sortData, (item) => {
return item.jybgJyjlIndex; // return item.jybgJyjlIndex //
}); })
return sorted; return sorted
}, },
buildSaveData(operation) { buildSaveData(operation) {
const tableData = []; const tableData = []
const _this = this; const _this = this
let fubiao; let fubiao
if (this.fromType === 5 || this.fromType === 6) { if (this.fromType === 5 || this.fromType === 6) {
console.log(this.$refs.table4.tableData, 5555); console.log(this.$refs.table4.tableData, 5555)
fubiao = [this.$refs.table4.tableData]; fubiao = [this.$refs.table4.tableData]
} else { } else {
fubiao = [this.fubiao1, this.fubiao2, this.fubiao3]; fubiao = [this.fubiao1, this.fubiao2, this.fubiao3]
} }
let arr = []; let arr = []
const subArr = this.sortClass(this.jybgData); const subArr = this.sortClass(this.jybgData)
subArr.map((item) => { subArr.map((item) => {
if ( if (
item.some( item.some(
(k) => k.jianyanjieguo === "不符合" || k.jianyanjieguo === "X" (k) => k.jianyanjieguo === '不符合' || k.jianyanjieguo === 'X'
) )
) { ) {
_this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = "不合格"; _this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '不合格'
} else if ( } else if (
item.every( item.every(
(k) => k.jianyanjieguo === "符合" || k.jianyanjieguo === "√" (k) => k.jianyanjieguo === '符合' || k.jianyanjieguo === '√'
) )
) { ) {
_this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = "合格"; _this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '合格'
} else if ( } else if (
item.every( item.every(
(k) => k.jianyanjieguo === "无此项" || k.jianyanjieguo === "/" (k) => k.jianyanjieguo === '无此项' || k.jianyanjieguo === '/'
) )
) { ) {
_this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = "无此项"; _this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '无此项'
} }
}); })
arr = arr.concat(this.bgfyData, this.jybgData); arr = arr.concat(this.bgfyData, this.jybgData)
arr.forEach((row) => { arr.forEach((row) => {
tableData.push({ tableData.push({
ysjlId: this.ysjlId, ysjlId: this.ysjlId,
beizhu: row.beizhu, beizhu: row.beizhu,
dicJyxmId: row.dicJyxmId, dicJyxmId: row.dicJyxmId,
jianyanjieguo: row.jianyanjieguo ? row.jianyanjieguo : "", jianyanjieguo: row.jianyanjieguo ? row.jianyanjieguo : '',
jianyanjielun: row.jianyanjielun ? row.jianyanjielun : "", jianyanjielun: row.jianyanjielun ? row.jianyanjielun : '',
jyxmMode: 0, jyxmMode: 0,
sort: row.sort, sort: row.sort,
orders: row.orders, orders: row.orders,
cjState: 0, cjState: 0
}); })
}); })
if (operation === "add") { if (operation === 'add') {
this.ysjl.jilubianhao = this.jlbh1 + this.jlbh2 + "-" + this.jlbh3; this.ysjl.jilubianhao = this.jlbh1 + this.jlbh2 + '-' + this.jlbh3
this.save(operation, "post", tableData, fubiao); this.save(operation, 'post', tableData, fubiao)
} else if (operation === "build") { } else if (operation === 'build') {
this.ysjl.baogaobianhao = this.ysjl.jilubianhao; this.ysjl.baogaobianhao = this.ysjl.jilubianhao
if ( if (
this.ysjl.jilubianhao && this.ysjl.jilubianhao &&
this.ysjl.jilubianhao.indexOf("COPY") > -1 this.ysjl.jilubianhao.indexOf('COPY') > -1
) { ) {
this.$message({ this.$message({
type: "error", type: 'error',
message: "请先修改报告编号,不允许携带COPY标志生成报告!", message: '请先修改报告编号,不允许携带COPY标志生成报告!'
}); })
return false; return false
} }
if ( if (
this.ysjl.jianyanrenyuan === null || this.ysjl.jianyanrenyuan === null ||
this.ysjl.jianyanrenyuan === "" this.ysjl.jianyanrenyuan === ''
) { ) {
this.$message({ this.$message({
type: "error", type: 'error',
message: "请先签名再生成报告!", message: '请先签名再生成报告!'
}); })
return false; return false
} }
for (let i = 0; i < this.bgfyData.length; i++) { for (let i = 0; i < this.bgfyData.length; i++) {
if (!this.bgfyData[i].jianjianyuan || !this.bgfyData[i].querenriqi) { if (!this.bgfyData[i].jianjianyuan || !this.bgfyData[i].querenriqi) {
this.$message.error( this.$message.error(
"请将检验项目中的监检人员及监检日期填写完毕,再生成报告!" '请将检验项目中的监检人员及监检日期填写完毕,再生成报告!'
); )
return false; return false
} }
} }
this.save(operation, "put", tableData, fubiao); this.save(operation, 'put', tableData, fubiao)
} else if (operation === "upd") { } else if (operation === 'upd') {
this.save(operation, "put", tableData, fubiao); this.save(operation, 'put', tableData, fubiao)
} }
}, },
save(operation, type, jyxm, fubiao) { save(operation, type, jyxm, fubiao) {
console.log(this.jybgData, 2222); console.log(this.jybgData, 2222)
if (this.fromType !== 5 && this.fromType !== 6) if (this.fromType !== 5 && this.fromType !== 6) { this.ysjl.imagePath = this.$refs.table1.imgPath }
this.ysjl.imagePath = this.$refs.table1.imgPath;
// //
if (this.isRepeat) { if (this.isRepeat) {
this.$message({ this.$message({
message: "记录编号重复,请先修改记录编号再保存", message: '记录编号重复,请先修改记录编号再保存',
type: "error", type: 'error'
}); })
return false; return false
} else { } else {
this.$refs["ysjl"].validate((valid) => { this.$refs['ysjl'].validate((valid) => {
if (valid) { if (valid) {
this.api({ this.api({
url: "/ysjl", url: '/ysjl',
method: type, method: type,
data: { data: {
ysjl: this.ysjl, ysjl: this.ysjl,
param: this.param, param: this.param,
cyJyxm: { cyJyxm: {
ysjlId: this.ysjl.id, ysjlId: this.ysjl.id,
fbjyxm: JSON.stringify(fubiao), fbjyxm: JSON.stringify(fubiao)
}, },
jdJyxm: jyxm, jdJyxm: jyxm,
flag: operation, flag: operation
}, }
}).then((data) => { }).then((data) => {
Utils.$emit("ysjl-db-list"); Utils.$emit('ysjl-db-list')
// //
if (operation === "add") { if (operation === 'add') {
Utils.$emit("task-list"); Utils.$emit('task-list')
this.ysjl.id = data; this.ysjl.id = data
this.param.ysjlId = data; this.param.ysjlId = data
this.$message({ message: "保存成功", type: "success" }); this.$message({ message: '保存成功', type: 'success' })
this.uploadPhxsBase64File(); this.uploadPhxsBase64File()
// //
this.common.reloadViewToUpdateYsjl(this.ysjl); this.common.reloadViewToUpdateYsjl(this.ysjl)
} else if (operation === "upd") { } else if (operation === 'upd') {
this.dialogRoleVisible = false; this.dialogRoleVisible = false
this.$message({ message: "更新成功", type: "success" }); this.$message({ message: '更新成功', type: 'success' })
// //
this.$router.push({ this.$router.push({
query: merge(this.$route.query, { query: merge(this.$route.query, {
jianyanrenyuan: this.ysjl.jianyanrenyuan, jianyanrenyuan: this.ysjl.jianyanrenyuan
}), })
}); })
} else { } else {
// pdf // pdf
this.common.viewYsjlNoOpen(this.ysjl.id, "YSJL"); this.common.viewYsjlNoOpen(this.ysjl.id, 'YSJL')
Utils.$emit("ysjl-list"); Utils.$emit('ysjl-list')
Utils.$emit("ysjl-yb-list"); Utils.$emit('ysjl-yb-list')
Utils.$emit("bggl-daiban-list"); Utils.$emit('bggl-daiban-list')
this.$message({ message: "生成报告成功", type: "success" }); this.$message({ message: '生成报告成功', type: 'success' })
this.common.delCurrentViews(); this.common.delCurrentViews()
} }
this.state = "update"; this.state = 'update'
}); })
} }
}); })
} }
}, },
@ -1317,33 +1328,33 @@ export default {
*/ */
uploadPhxsBase64File(operation) { uploadPhxsBase64File(operation) {
if (!this.pic) { if (!this.pic) {
return false; return false
} }
this.uploadService this.uploadService
.uploadPhxsBase64File({ .uploadPhxsBase64File({
ysjlId: this.ysjl.id, ysjlId: this.ysjl.id,
base64File: this.pic, base64File: this.pic,
shebeizhongleidaima: this.ysjl.shebeizhongleidaima, shebeizhongleidaima: this.ysjl.shebeizhongleidaima
}) })
.then(() => { .then(() => {
if (operation !== "add") { if (operation !== 'add') {
this.buildSaveData(operation); this.buildSaveData(operation)
} }
}); })
}, },
changXh: function (val) { changXh: function(val) {
const xinghao = this.xinghaoList.filter((xh) => xh.xinghao === val)[0]; const xinghao = this.xinghaoList.filter((xh) => xh.xinghao === val)[0]
this.$set( this.$set(
this.param, this.param,
"jiandingbaogaobianhao", 'jiandingbaogaobianhao',
(xinghao && xinghao.jiandingbaogaobianhao) || "" (xinghao && xinghao.jiandingbaogaobianhao) || ''
); )
}, },
loadPhxsImage(data) { loadPhxsImage(data) {
this.pic = data; this.pic = data
}, }
}, }
}; }
</script> </script>
<style scoped> <style scoped>
.el-tag { .el-tag {

Loading…
Cancel
Save