|
@@ -27,6 +27,13 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
+ <el-form-item label="适用科室" prop="departmentCode">
|
|
|
+ <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.departmentCode">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="1.5">
|
|
|
<el-form-item label="厂家名称" prop="factoryName">
|
|
|
<el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.factoryName">
|
|
|
</el-input>
|
|
@@ -61,7 +68,6 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="文件上传" prop="sysMaterialDeviceOriginFileList">
|
|
|
<el-upload
|
|
|
- class="upload-demo"
|
|
|
:action="url"
|
|
|
:headers="headers"
|
|
|
:on-preview="handlePreview"
|
|
@@ -72,7 +78,7 @@
|
|
|
:limit="1"
|
|
|
:on-exceed="handleExceed"
|
|
|
:file-list="basicForm.sysMaterialDeviceOriginFileList">
|
|
|
- <el-button size="small" type="primary">点击上传</el-button>
|
|
|
+ <el-button size="small" type="primary" :disabled="sonDisable">点击上传</el-button>
|
|
|
<!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
@@ -82,7 +88,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="参数" prop="parameters">
|
|
|
- <el-input type="textarea" style="width: 400px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
|
|
|
+ <el-input type="textarea" rows=4 style="width: 900px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -91,7 +97,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
- <el-input type="textarea" style="width: 400px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.remark">
|
|
|
+ <el-input type="textarea" rows=4 style="width: 400px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.remark">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -135,7 +141,15 @@
|
|
|
<!-- <ux-table-column resizable title="序号" type="index" align="center" width="50px"/> -->
|
|
|
<ux-table-column resizable title="省份" align="center" field="province" edit-render>
|
|
|
<template v-slot:edit="scope">
|
|
|
- <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.province"/>
|
|
|
+ <el-select size="mini" :disabled="sonDisable" v-model="scope.row.province" filterable clearable placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <!-- <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.province"/> -->
|
|
|
</template>
|
|
|
</ux-table-column>
|
|
|
|
|
@@ -183,6 +197,7 @@ export default {
|
|
|
commonName: '',
|
|
|
registrationName: '',
|
|
|
deviceCategory: '',
|
|
|
+ departmentCode: '',
|
|
|
factoryName: '',
|
|
|
model: '',
|
|
|
referencePrice: '',
|
|
@@ -204,7 +219,43 @@ export default {
|
|
|
ids:[],
|
|
|
delDemandItemList:[],
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
- url: process.env.VUE_APP_BASE_API + '/device/origin/upload'
|
|
|
+ url: process.env.VUE_APP_BASE_API + '/device/origin/upload',
|
|
|
+ options: [
|
|
|
+ {value: '黑龙江省', label: '黑龙江省'},
|
|
|
+ {value: '吉林省', label: '吉林省'},
|
|
|
+ {value: '辽宁省', label: '辽宁省'},
|
|
|
+ {value: '河北省', label: '河北省'},
|
|
|
+ {value: '甘肃省', label: '甘肃省'},
|
|
|
+ {value: '青海省', label: '青海省'},
|
|
|
+ {value: '陕西省', label: '陕西省'},
|
|
|
+ {value: '河南省', label: '河南省'},
|
|
|
+ {value: '山东省', label: '山东省'},
|
|
|
+ {value: '山西省', label: '山西省'},
|
|
|
+ {value: '安徽省', label: '安徽省'},
|
|
|
+ {value: '湖北省', label: '湖北省'},
|
|
|
+ {value: '湖南省', label: '湖南省'},
|
|
|
+ {value: '江苏省', label: '江苏省'},
|
|
|
+ {value: '四川省', label: '四川省'},
|
|
|
+ {value: '贵州省', label: '贵州省'},
|
|
|
+ {value: '云南省', label: '云南省'},
|
|
|
+ {value: '浙江省', label: '浙江省'},
|
|
|
+ {value: '广东省', label: '广东省'},
|
|
|
+ {value: '江西省', label: '江西省'},
|
|
|
+ {value: '福建省', label: '福建省'},
|
|
|
+ {value: '台湾省', label: '台湾省'},
|
|
|
+ {value: '海南省', label: '海南省'},
|
|
|
+ {value: '新疆维吾尔自治区', label: '新疆维吾尔自治区'},
|
|
|
+ {value: '内蒙古自治区', label: '内蒙古自治区'},
|
|
|
+ {value: '宁夏回族自治区', label: '宁夏回族自治区'},
|
|
|
+ {value: '广西壮族自治区', label: '广西壮族自治区'},
|
|
|
+ {value: '西藏自治区', label: '西藏自治区'},
|
|
|
+ {value: '北京市', label: '北京市'},
|
|
|
+ {value: '上海市', label: '上海市'},
|
|
|
+ {value: '天津市', label: '天津市'},
|
|
|
+ {value: '重庆市', label: '重庆市'},
|
|
|
+ {value: '香港特别行政区', label: '香港特别行政区'},
|
|
|
+ {value: '澳门特别行政区', label: '澳门特别行政区'},
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -230,30 +281,33 @@ export default {
|
|
|
this.sonDisable = false
|
|
|
},
|
|
|
async save() {
|
|
|
- console.log(this.sonPageStu)
|
|
|
// return false
|
|
|
- if (this.sonPageStu == 'add') {
|
|
|
- await addEquipment(this.basicForm).then(res => {
|
|
|
- if(res.code === 200) {
|
|
|
- this.$modal.notifySuccess("新增保存成功");
|
|
|
- this.back()
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (this.sonPageStu == 'edit') {
|
|
|
- let list = []
|
|
|
- list.push(...this.basicForm.sysMaterialDeviceOriginItemList, ...this.delDemandItemList)
|
|
|
- // 深拷贝一下参数对象
|
|
|
- let param = JSON.parse(JSON.stringify(this.basicForm))
|
|
|
- console.log('深拷贝对象',param);
|
|
|
- param.sysMaterialDeviceOriginItemList = list
|
|
|
- await editEquipment(param).then(res => {
|
|
|
- if(res.code === 200) {
|
|
|
- this.$modal.notifySuccess("编辑保存成功");
|
|
|
- this.sonPageStu = 'check'
|
|
|
- this.sonDisable = true
|
|
|
- this.getDetails(this.row)
|
|
|
- }
|
|
|
- })
|
|
|
+ if(this.basicForm.sysMaterialDeviceOriginItemList.length !== 0) {
|
|
|
+ if (this.sonPageStu == 'add') {
|
|
|
+ await addEquipment(this.basicForm).then(res => {
|
|
|
+ if(res.code === 200) {
|
|
|
+ this.$modal.notifySuccess("新增保存成功");
|
|
|
+ this.back()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (this.sonPageStu == 'edit') {
|
|
|
+ let list = []
|
|
|
+ list.push(...this.basicForm.sysMaterialDeviceOriginItemList, ...this.delDemandItemList)
|
|
|
+ // 深拷贝一下参数对象
|
|
|
+ let param = JSON.parse(JSON.stringify(this.basicForm))
|
|
|
+ console.log('深拷贝对象',param);
|
|
|
+ param.sysMaterialDeviceOriginItemList = list
|
|
|
+ await editEquipment(param).then(res => {
|
|
|
+ if(res.code === 200) {
|
|
|
+ this.$modal.notifySuccess("编辑保存成功");
|
|
|
+ this.sonPageStu = 'check'
|
|
|
+ this.sonDisable = true
|
|
|
+ this.getDetails(this.row)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$modal.notifyWarning("请填写明细信息");
|
|
|
}
|
|
|
},
|
|
|
back() {
|
|
@@ -300,6 +354,11 @@ export default {
|
|
|
},
|
|
|
handlePreview(file) {
|
|
|
console.log(file);
|
|
|
+ let link = document.createElement("a")
|
|
|
+ link.download = file.name
|
|
|
+ link.href = file.url
|
|
|
+ link.click()
|
|
|
+ window.URL.revokeObjectURL(link.href)
|
|
|
},
|
|
|
handleSuccess(response, file, fileList) {
|
|
|
console.log(response)
|
|
@@ -312,7 +371,12 @@ export default {
|
|
|
this.$message.warning(`当前限制选择1个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
|
|
},
|
|
|
beforeRemove(file, fileList) {
|
|
|
- return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
+ if(this.sonPageStu == 'check') {
|
|
|
+ this.$modal.notifyWarning("详情态不允许删除");
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|