|
@@ -6,107 +6,67 @@
|
|
</div>
|
|
</div>
|
|
<div class="page-content">
|
|
<div class="page-content">
|
|
<div class="page-title">设备认证</div>
|
|
<div class="page-title">设备认证</div>
|
|
- <el-form :model="formData" :rules="rules">
|
|
|
|
- <el-form-item label="设备名称:">
|
|
|
|
- <el-select
|
|
|
|
- v-model="formData.deviceName"
|
|
|
|
- filterable
|
|
|
|
- allow-create
|
|
|
|
- placeholder="请输入新设备名称或选择已有设备"
|
|
|
|
- >
|
|
|
|
- <el-option label="中国" :value="1"> </el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item prop="mobile" label="设备图片:">
|
|
|
|
- <br />
|
|
|
|
- <el-input v-show="false"></el-input>
|
|
|
|
- <SimpleUploadImage :limit="1" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="所属品牌:">
|
|
|
|
- <el-select v-model="formData.deviceName" placeholder="请选择品牌">
|
|
|
|
- <el-option label="中国" :value="1"> </el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item prop="mobile" label="购买渠道:">
|
|
|
|
- <el-input placeholder="请输入购买渠道"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item prop="mobile" label="发票:">
|
|
|
|
- <br />
|
|
|
|
- <el-input v-show="false"></el-input>
|
|
|
|
- <SimpleUploadImage :limit="1" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item prop="mobile" label="设备SN码:">
|
|
|
|
- <el-input placeholder="请输入设备SN码"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item prop="mobile" label="设备参数:">
|
|
|
|
- <br />
|
|
|
|
- <div class="device-param-list">
|
|
|
|
- <span class="add-param">添加参数</span>
|
|
|
|
- <template v-for="i in 3">
|
|
|
|
- <div :key="i">
|
|
|
|
- <div class="param flex justify-between mb-4">
|
|
|
|
- <el-input placeholder="例如:品牌" class="mr-2"></el-input>
|
|
|
|
- <el-input placeholder="请输入参数信息"></el-input>
|
|
|
|
- <span class="remove el-icon-close"></span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </div>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
|
|
+ <FormClubDevice ref="formClubDevice" :formType="formType" @step="onClubDeviceFormStep" />
|
|
<div class="control flex flex-col items-center">
|
|
<div class="control flex flex-col items-center">
|
|
- <div class="button submit flex justify-center items-center">提交</div>
|
|
|
|
|
|
+ <div class="button submit flex justify-center items-center" @click="onSubmit">提交</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import SimpleUploadImage from '@/components/SimpleUploadImage'
|
|
|
|
|
|
+import FormClubDevice from '../../form/components/form-club-device.vue'
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
export default {
|
|
export default {
|
|
layout: 'app',
|
|
layout: 'app',
|
|
components: {
|
|
components: {
|
|
- SimpleUploadImage,
|
|
|
|
|
|
+ FormClubDevice
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- formData: {
|
|
|
|
- deviceName: '',
|
|
|
|
- },
|
|
|
|
- rules: {},
|
|
|
|
|
|
+ productInfo: {},
|
|
|
|
+ formData: {},
|
|
|
|
+ productId:0,
|
|
|
|
+ formType:'',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix']),
|
|
|
|
|
|
+ ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix','authId']),
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.initData()
|
|
|
|
|
|
+ this.formType = this.$route.query.type
|
|
|
|
+ this.getProductDetails()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- initData() {
|
|
|
|
- this.productId = this.$route.query.id
|
|
|
|
- console.log('productId',this.productId)
|
|
|
|
- this.getProductDetails()
|
|
|
|
|
|
+ async onSubmit() {
|
|
|
|
+ try {
|
|
|
|
+ await this.$refs.formClubDevice.validate()
|
|
|
|
+ if(this.formType === 'edit'){
|
|
|
|
+ this.formData.authId = this.authId
|
|
|
|
+ }
|
|
|
|
+ await this.$http.api.authProducSave(this.formData)
|
|
|
|
+ this.$toast('保存成功')
|
|
|
|
+ this.$router.push(`${this.routePrefix}/record/device/detail?id=${this.productId}`)
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 获取认证机构信息
|
|
// 获取认证机构信息
|
|
async getProductDetails() {
|
|
async getProductDetails() {
|
|
try {
|
|
try {
|
|
|
|
+ this.productId = this.$route.query.id
|
|
const res = await this.$http.api.getProductDetails({
|
|
const res = await this.$http.api.getProductDetails({
|
|
productId: this.productId,
|
|
productId: this.productId,
|
|
})
|
|
})
|
|
this.productInfo = res.data
|
|
this.productInfo = res.data
|
|
- console.log('res',this.productInfo)
|
|
|
|
|
|
+ console.log('productInfo',this.productInfo)
|
|
|
|
+ this.$refs.formClubDevice.init(this.productInfo)
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
},
|
|
},
|
|
- auditStatusColor(value) {// 认证状态:0 danger,1 success,2 warning
|
|
|
|
- const map = {
|
|
|
|
- 0: 'danger',
|
|
|
|
- 1: 'success',
|
|
|
|
- 2: 'warning',
|
|
|
|
- }
|
|
|
|
- return map[value]
|
|
|
|
- },
|
|
|
|
|
|
+ onClubDeviceFormStep(data) {
|
|
|
|
+ console.log(data)
|
|
|
|
+ this.formData = data[0]
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|