|
|
@@ -87,6 +87,8 @@
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="设备编号:" prop="sheBeiShiBieH">
|
|
|
+ <el-tooltip effect="dark" content="设备编号由系统自动生成。" placement="top">
|
|
|
+ <i class="el-icon-question question-icon" /></el-tooltip>
|
|
|
<span>{{ form.sheBeiShiBieH }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -174,7 +176,7 @@
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-row>
|
|
|
+ <el-row v-if="photos.length>0">
|
|
|
<el-col>
|
|
|
<el-carousel trigger="click" height="250px" indicator-position="none">
|
|
|
<el-carousel-item v-if="photos.length==0">
|
|
|
@@ -186,6 +188,7 @@
|
|
|
style="width: 100%; height: 100%"
|
|
|
:src="item.url"
|
|
|
fit="contain"
|
|
|
+ :preview-src-list="photos.map(item=>item.url)"
|
|
|
/>
|
|
|
</el-carousel-item>
|
|
|
</template>
|
|
|
@@ -229,6 +232,9 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="出厂日期:">
|
|
|
+ <template slot="label">
|
|
|
+ <span class="required">出厂日期</span>
|
|
|
+ </template>
|
|
|
<el-date-picker
|
|
|
v-model="form.chuChangRiQi"
|
|
|
style="width:100%"
|
|
|
@@ -308,8 +314,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col v-if="form.shiFouXiaoZhun==='是'" :span="8">
|
|
|
- <el-form-item label="检定/校准周期(月):">
|
|
|
- <el-input v-model="form.xiaoZhunZQ" size="mini" type="number" />
|
|
|
+ <el-form-item label="检定/校准周期(月):" label-width="140">
|
|
|
+ <el-input v-model="form.xiaoZhunZQ" size="mini" type="number" style="width:74%" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -604,7 +610,6 @@ export default {
|
|
|
data () {
|
|
|
const { userId, position, level } = this.$store.getters
|
|
|
return {
|
|
|
- photos: [],
|
|
|
readonly: false,
|
|
|
activeName: 'one',
|
|
|
dialogVisible: true,
|
|
|
@@ -727,6 +732,18 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ photos () {
|
|
|
+ if (this.form.beiZhu) {
|
|
|
+ const photos = JSON.parse(this.form.beiZhu)
|
|
|
+ photos.forEach(item => {
|
|
|
+ item.url = getImage(item.id)
|
|
|
+ })
|
|
|
+ return photos
|
|
|
+ }
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
watch: {
|
|
|
'form.xiaoZhunWuCha': {
|
|
|
handler (val, old) {
|
|
|
@@ -859,6 +876,9 @@ export default {
|
|
|
if (this.form.xiaoZhunWuCha === '是' && !this.form.caiGouHeTong) {
|
|
|
throw new Error('请填写限用范围!')
|
|
|
}
|
|
|
+ if (!this.form.chuChangRiQi) {
|
|
|
+ throw new Error('请填写出厂日期!')
|
|
|
+ }
|
|
|
if (this.form.accessoriesDevicePoList.length > 0) {
|
|
|
for (let i = 0; i < this.form.accessoriesDevicePoList.length; i++) {
|
|
|
const item = this.form.accessoriesDevicePoList[i]
|
|
|
@@ -1115,11 +1135,6 @@ export default {
|
|
|
if (this.isEdit) {
|
|
|
const { data } = await getequipmentCard({ id: this.params.id })
|
|
|
this.form = data
|
|
|
- this.photos = this.form.beiZhu ? JSON.parse(this.form.beiZhu) : []
|
|
|
- this.photos.forEach(item => {
|
|
|
- item.url = getImage(item.id)
|
|
|
- })
|
|
|
- console.log('photos', this.photos)
|
|
|
} else {
|
|
|
// 随机生成一个不重复的设备编号
|
|
|
this.form.sheBeiShiBieH = this.generateRandomString()
|
|
|
@@ -1131,7 +1146,8 @@ export default {
|
|
|
this.form.xiaoZhunWuCha = '否'
|
|
|
this.form.jieShouZhuangTai = '新设备'
|
|
|
this.form.bianZhiRen = this.userId
|
|
|
- this.form.bianZhiBuMen = this.position
|
|
|
+ const pos = this.position.split(',')
|
|
|
+ this.form.bianZhiBuMen = pos[pos.length - 1]
|
|
|
this.form.bianZhiShiJian = dayjs().format('YYYY-MM-DD HH:mm')
|
|
|
this.form.shiFouGuoShen = '已完成'
|
|
|
this.form.sheBeiLeiXing = '检验系统'
|
|
|
@@ -1202,13 +1218,20 @@ export default {
|
|
|
.tabs{
|
|
|
margin-top: 40px;
|
|
|
}
|
|
|
+ .question-icon{
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
::v-deep {
|
|
|
.el-form-item__label{
|
|
|
- text-align: left
|
|
|
+ text-align: left;
|
|
|
+ font-size: 12px !important;
|
|
|
+ }
|
|
|
+ .el-tabs__item{
|
|
|
+ background-color: #f5f7fa;
|
|
|
}
|
|
|
}
|
|
|
|