|
@@ -684,7 +684,8 @@ export default {
|
|
|
wenJianXiLei: '', // 附件细类
|
|
wenJianXiLei: '', // 附件细类
|
|
|
xiLeiId: '',
|
|
xiLeiId: '',
|
|
|
quanXianLeiXing: '',
|
|
quanXianLeiXing: '',
|
|
|
- diDian: ''
|
|
|
|
|
|
|
+ diDian: '',
|
|
|
|
|
+ buMen: '' // 图片id
|
|
|
// ceLiangGongZuo: '', // 测量/工作范围
|
|
// ceLiangGongZuo: '', // 测量/工作范围
|
|
|
// jianDingXiao: '', // 检定/校准参数
|
|
// jianDingXiao: '', // 检定/校准参数
|
|
|
|
|
|
|
@@ -749,6 +750,11 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
|
|
+ photos: {
|
|
|
|
|
+ handler (val) {
|
|
|
|
|
+ this.form.buMen = val.map(item => item.id).join(',')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
'form.xiaoZhunWuCha': {
|
|
'form.xiaoZhunWuCha': {
|
|
|
handler (val, old) {
|
|
handler (val, old) {
|
|
|
if (!old) return
|
|
if (!old) return
|
|
@@ -936,15 +942,6 @@ export default {
|
|
|
try {
|
|
try {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
await saveEquipmentCard(this.form)
|
|
await saveEquipmentCard(this.form)
|
|
|
- // const paramsRecord = await this.formatForm()
|
|
|
|
|
- // console.log(paramsRecord)
|
|
|
|
|
- // const { variables: { cont }} = await this.$common.request('add', paramsRecord)
|
|
|
|
|
- // if (cont.length > 0) {
|
|
|
|
|
- // this.$message.success('添加成功')
|
|
|
|
|
- // this.closeDialog(true)
|
|
|
|
|
- // } else {
|
|
|
|
|
- // this.$message.warning('添加失败')
|
|
|
|
|
- // }
|
|
|
|
|
this.$message.success('添加成功')
|
|
this.$message.success('添加成功')
|
|
|
this.closeDialog(true)
|
|
this.closeDialog(true)
|
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -954,78 +951,6 @@ export default {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- async formatForm () {
|
|
|
|
|
- const resultForm = {
|
|
|
|
|
- chang_shang_: this.form.changShang,
|
|
|
|
|
- gui_ge_xing_hao_: this.form.guiGeXingHao,
|
|
|
|
|
- jie_shou_ri_qi_: this.form.jieShouRiQi,
|
|
|
|
|
- qi_yong_ri_qi_: this.form.qiYongRiQi,
|
|
|
|
|
- cun_fang_di_dian_: this.form.cunFangDiDian, // 中文
|
|
|
|
|
- cun_fang_wei_zhi_: this.form.cunFangWeiZhi, // id
|
|
|
|
|
- jie_shou_zhuang_tai: this.form.jieShouZhuangTai,
|
|
|
|
|
- guan_li_ren_: this.form.guanLiRen,
|
|
|
|
|
- wei_hu_fang_shi_: this.form.weiHuFangShi,
|
|
|
|
|
- bian_zhi_ren_: this.form.bianZhiRen,
|
|
|
|
|
- bian_zhi_bu_men_: this.form.bianZhiBuMen,
|
|
|
|
|
- bian_zhi_shi_jian: this.form.bianZhiShiJian,
|
|
|
|
|
- shi_fou_guo_shen_: '已完成',
|
|
|
|
|
- she_bei_lei_xing_: this.form.sheBeiLeiXing,
|
|
|
|
|
- she_bei_zhuang_ta: this.form.sheBeiZhuangTa,
|
|
|
|
|
- she_bei_shi_bie_h: this.form.sheBeiShiBieH,
|
|
|
|
|
- shi_fou_xiao_zhun: this.form.shiFouXiaoZhun,
|
|
|
|
|
- gong_ying_shang_: this.form.gongYingShang, // 中文
|
|
|
|
|
- shi_fou_qi_jian_h: this.form.shiFouQiJianH, // id
|
|
|
|
|
- lian_xi_fang_shi_: this.form.lianXiFangShi,
|
|
|
|
|
- xiao_zhun_you_xia: this.form.xiaoZhunYouXia,
|
|
|
|
|
- chu_chang_ri_qi_: this.form.chuChangRiQi,
|
|
|
|
|
- she_bei_ming_cheng_: this.form.sheBeiMingCheng, // 中文
|
|
|
|
|
- she_bei_ming_chen: this.form.sheBeiMingChen, // id
|
|
|
|
|
- yi_xiao_ri_qi_: this.form.yiXiaoRiQi,
|
|
|
|
|
- he_cha_xiao_zhun_: this.form.heChaXiaoZhun,
|
|
|
|
|
- shi_ji_shi_yong_f: this.form.shiJiShiYongF,
|
|
|
|
|
- kai_shi_shi_yong_: this.form.kaiShiShiYong,
|
|
|
|
|
- zheng_shu_bian_ha: this.form.zhengShuBianHa,
|
|
|
|
|
- xiao_zhun_wu_cha_: this.form.xiaoZhunWuCha,
|
|
|
|
|
- xiao_zhun_z_q_: this.form.xiaoZhunZQ,
|
|
|
|
|
- yuan_she_bei_bian: this.form.yuanSheBeiBian,
|
|
|
|
|
- jian_kong_yi_ju_: this.form.jianKongYiJu,
|
|
|
|
|
- bi_xu_de_huan_jin: this.form.biXuDeHuanJin,
|
|
|
|
|
- bi_xu_she_shi_: this.form.biXuSheShi,
|
|
|
|
|
- zi_chan_yuan_zhi_: this.form.ziChanYuanZhi,
|
|
|
|
|
- zi_chan_bian_hao_: this.form.ziChanBianHao,
|
|
|
|
|
- shi_fou_wei_hu_: this.form.shiFouWeiHu,
|
|
|
|
|
- ji_shen_xu_hao_: this.form.jiShenXuHao,
|
|
|
|
|
- yan_shou_ri_qi_: this.form.yanShouRiQi,
|
|
|
|
|
- huan_jing_yao_qiu: this.form.huanJingYaoQiu,
|
|
|
|
|
- dian_yuan_yao_qiu: this.form.dianYuanYaoQiu,
|
|
|
|
|
- zhu_ce_zheng_hao_: this.form.zhuCeZhengHao,
|
|
|
|
|
- yqzp: this.form.yqzp,
|
|
|
|
|
- fa_piao_: this.form.faPiao,
|
|
|
|
|
- fu_jian_shang: this.form.fuJianShang,
|
|
|
|
|
- bei_zhu_: this.form.beiZhu,
|
|
|
|
|
- cai_gou_he_tong_: this.form.caiGouHeTong,
|
|
|
|
|
-
|
|
|
|
|
- zhuan_ye_bu_men_: this.form.zhuanYeBuMen,
|
|
|
|
|
- wen_jian_xi_lei_: this.form.wenJianXiLei,
|
|
|
|
|
- xi_lei_id_: this.form.xiLeiId,
|
|
|
|
|
- quan_xian_lei_xin: this.form.quanXianLeiXing
|
|
|
|
|
- }
|
|
|
|
|
- const paramsRecord = { tableName: 't_sbdj' }
|
|
|
|
|
- if (this.isEdit) {
|
|
|
|
|
- paramsRecord.updList = [{
|
|
|
|
|
- where: {
|
|
|
|
|
- id_: this.params.id
|
|
|
|
|
- },
|
|
|
|
|
- param: resultForm
|
|
|
|
|
- }]
|
|
|
|
|
- } else {
|
|
|
|
|
- paramsRecord.paramWhere = [{
|
|
|
|
|
- ...resultForm,
|
|
|
|
|
- di_dian_: this.level
|
|
|
|
|
- }]
|
|
|
|
|
- }
|
|
|
|
|
- return paramsRecord
|
|
|
|
|
- },
|
|
|
|
|
async subForm (id, table, parentData) {
|
|
async subForm (id, table, parentData) {
|
|
|
const sql1 = `select id_ from ${table} where parent_id_='${id}'`
|
|
const sql1 = `select id_ from ${table} where parent_id_='${id}'`
|
|
|
const { variables: { data }} = await this.$common.request('sql', sql1)
|
|
const { variables: { data }} = await this.$common.request('sql', sql1)
|
|
@@ -1050,41 +975,9 @@ export default {
|
|
|
try {
|
|
try {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
await saveEquipmentCard(this.form)
|
|
await saveEquipmentCard(this.form)
|
|
|
- // const paramsRecord = await this.formatForm()
|
|
|
|
|
- // console.log(paramsRecord)
|
|
|
|
|
- // const list1 = await this.subForm(this.params.id, 't_whzqjxm', this.$refs.MaintenanceRef.listDataCopy)
|
|
|
|
|
- // const list2 = await this.subForm(this.params.id, 't_fssbjpjb', this.$refs.MoreDevicesRef.listDataCopy)
|
|
|
|
|
- // console.log('维护项目', list1)
|
|
|
|
|
- // console.log('附属设备', list2)
|
|
|
|
|
- // 1.更新主表
|
|
|
|
|
-
|
|
|
|
|
- // await this.$common.request('update', paramsRecord)
|
|
|
|
|
this.$message.success('修改成功')
|
|
this.$message.success('修改成功')
|
|
|
this.closeDialog(true)
|
|
this.closeDialog(true)
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
- // 2.更改维护项目表
|
|
|
|
|
- // if (list1.add_list.length > 0) {
|
|
|
|
|
- // const addParams = {
|
|
|
|
|
- // tableName: 't_whzqjxm',
|
|
|
|
|
- // paramWhere: list1.add_list.map(item => {
|
|
|
|
|
- // return {
|
|
|
|
|
- // parent_id_: this.params.id,
|
|
|
|
|
- // wei_hu_xiang_mu_c: item.weiHuXiangMuC,
|
|
|
|
|
- // wei_hu_ri_qi_: item.weiHuRiQi,
|
|
|
|
|
- // wei_hu_lei_xing_: item.weiHuLeiXing,
|
|
|
|
|
- // ri_qi_shu_zi_: item.riQiShuZi
|
|
|
|
|
- // }
|
|
|
|
|
- // })
|
|
|
|
|
- // }
|
|
|
|
|
- // await this.$common.request('add', addParams)
|
|
|
|
|
- // console.log('维护项目新增成功')
|
|
|
|
|
- // }
|
|
|
|
|
- // if (list1.update_list.length > 0) {
|
|
|
|
|
- // const updateParamsRecord = {
|
|
|
|
|
- // tableName: 't_whzqjxm',
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.$message.warning(error.message)
|
|
this.$message.warning(error.message)
|
|
|
this.loading = false
|
|
this.loading = false
|