Browse Source

优化下次检验日期的获取

优化使用的主要设备
master
李磊 3 years ago
parent
commit
0f4bae13b1
  1. 45
      src/views/ysjl/1000/common/sz/gyscl.vue
  2. 6
      src/views/ysjl/1000/dj/wb/gywb.vue

45
src/views/ysjl/1000/common/sz/gyscl.vue

@ -278,34 +278,24 @@
<fieldset> <fieldset>
<legend>使用的主要设备</legend> <legend>使用的主要设备</legend>
<el-table ref="yqsbData" :data="yqsbData" border stripe style="width:100%"> <el-table ref="yqsbData" :data="yqsbData" border stripe style="width:100%">
<el-table-column align="center" prop="C1" width="110" label="是否使用"> <el-table-column align="center" prop="C1" label="编号">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox v-model="scope.row.C1" style="width: 100px" true-label="" false-label="" /> <el-input v-model="scope.row.C1" :label="scope.row.C2" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="C2" label="编号"> <el-table-column align="center" prop="C2" label="仪器名称">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.C2" :label="scope.row.C2" disabled /> <el-input v-model="scope.row.C2" type="text" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="C3" label="仪器名称"> <el-table-column align="center" prop="C3" label="编号">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.C3" type="text" disabled /> <el-input v-model="scope.row.C3" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="C4" width="110" label="是否使用"> <el-table-column align="center" prop="C4" label="仪器名称">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox v-model="scope.row.C4" true-label="" false-label="" /> <el-input v-model="scope.row.C4" />
</template>
</el-table-column>
<el-table-column align="center" prop="C5" label="编号">
<template slot-scope="scope">
<el-input v-model="scope.row.C5" disabled />
</template>
</el-table-column>
<el-table-column align="center" prop="C6" label="仪器名称">
<template slot-scope="scope">
<el-input v-model="scope.row.C6" disabled />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -463,10 +453,10 @@ export default {
checkedTab: 'first', checkedTab: 'first',
jyxmData: [], jyxmData: [],
yqsbData: [ yqsbData: [
{ C1: '☑', C2: '05-30-01', C3: '多功能电位滴定仪', C4: '☑', C5: '05-26-01', C6: '锅炉用水多离子测定仪' }, { C1: '05-30-01', C2: '多功能电位滴定仪', C3: '05-26-01', C4: '锅炉用水多离子测定仪' },
{ C1: '☑', C2: '05-07-06', C3: '台式电导率分析仪', C4: '☑', C5: 'JS-25-01', C6: '碱式滴定管' }, { C1: '05-07-06', C2: '台式电导率分析仪', C3: 'JS-25-01', C4: '碱式滴定管' },
{ C1: '☑', C2: '010233100054', C3: 'PH计', C4: '☑', C5: 'SS-25-05', C6: '酸式滴定管' }, { C1: '010233100054', C2: 'PH计', C3: 'SS-25-05', C4: '酸式滴定管' },
{ C1: '☑', C2: '05-13-03', C3: '台式浊度分析仪', C4: '☑', C5: '05-04-04', C6: '电子天平' } { C1: '05-13-03', C2: '台式浊度分析仪', C3: '05-04-04', C4: '电子天平' }
], ],
// //
// //
@ -544,6 +534,7 @@ export default {
}).then(data => { }).then(data => {
this.ysjl = data.ysjl this.ysjl = data.ysjl
this.param = (data.param !== null && data.param !== undefined) ? data.param : {} this.param = (data.param !== null && data.param !== undefined) ? data.param : {}
this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd')
this.getXcjyrq() this.getXcjyrq()
this.ysjl.jilubianhao = this.jilubianhao this.ysjl.jilubianhao = this.jilubianhao
this.ysjl.baogaobianhao = null // this.ysjl.baogaobianhao = null //
@ -563,7 +554,7 @@ export default {
}, },
getYsjl(id) { getYsjl(id) {
this.api({ this.api({
url: '/ysjl/getYsjlById', url: '/ysjl',
method: 'get', method: 'get',
params: { params: {
ysjlId: id ysjlId: id
@ -608,7 +599,7 @@ export default {
url: '/jyxm/getCyJyxm', url: '/jyxm/getCyJyxm',
method: 'get', method: 'get',
params: { params: {
templateId: this.ysjl.modelId, templateId: this.ysjl.templateId,
order: sort order: sort
} }
}).then(data => { }).then(data => {
@ -867,9 +858,9 @@ export default {
}) })
}, },
getXcjyrq() { getXcjyrq() {
var dateTemp = this.ysjl.jianyanjieshuriqi.split('-') const xcjyrq = new Date(this.ysjl.jianyanjieshuriqi)
const xcjyrq = new Date((Number(dateTemp[0]) + 1) + '-' + dateTemp[1] + '-' + dateTemp[2]) xcjyrq.setFullYear(xcjyrq.getFullYear() + 1, xcjyrq.getMonth(), xcjyrq.getDate() - 1)
this.ysjl.xiacijianyanriqi = xcjyrq.setDate(xcjyrq.getDate() - 1) this.ysjl.xiacijianyanriqi = this.formatter.dateFormat('YYYY-MM-dd', xcjyrq)
}, },
setRounding(index) { setRounding(index) {
if (isNaN(this.jyxmData[index].c1) || isNaN(this.jyxmData[index].c2)) { if (isNaN(this.jyxmData[index].c1) || isNaN(this.jyxmData[index].c2)) {

6
src/views/ysjl/1000/dj/wb/gywb.vue

@ -687,9 +687,9 @@ export default {
}) })
}, },
getXcjyrq() { getXcjyrq() {
var dateTemp = this.ysjl.jianyanjieshuriqi.split('-') const xcjyrq = new Date(this.ysjl.jianyanjieshuriqi)
const xcjyrq = new Date((Number(dateTemp[0]) + 1) + '-' + dateTemp[1] + '-' + dateTemp[2]) xcjyrq.setFullYear(xcjyrq.getFullYear() + 1, xcjyrq.getMonth(), xcjyrq.getDate() - 1)
this.ysjl.xiacijianyanriqi = xcjyrq.setDate(xcjyrq.getDate() - 1) this.ysjl.xiacijianyanriqi = this.formatter.dateFormat('YYYY-MM-dd', xcjyrq)
}, },
// F5 // F5
beforeunloadHandler(e) { beforeunloadHandler(e) {

Loading…
Cancel
Save