|
@@ -158,6 +158,10 @@
|
|
|
:noResultsText="'空'" :noOptionsText="'空'"
|
|
|
placeholder="请选择部门" @select="hx"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="附件" prop="fileUrl">
|
|
|
+ <fileUpload :value="[form.fileUrl,form.fileName]" v-model="form.fileUrl" :setFileName="setFileName"
|
|
|
+ :removeFileName="removeFileName" :limit="1"></fileUpload>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -173,10 +177,11 @@ import {treeselect} from "@/api/system/dept";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
import {format_date} from "@/views/data/common/dateExport";
|
|
|
+import fileUpload from '@/views/components/FileUpload/index.vue'
|
|
|
|
|
|
export default {
|
|
|
name: "Inspect",
|
|
|
- components: {Treeselect},
|
|
|
+ components: {Treeselect,fileUpload},
|
|
|
data() {
|
|
|
return {
|
|
|
deptOptions: undefined,
|
|
@@ -194,6 +199,7 @@ export default {
|
|
|
total: 0,
|
|
|
// 钢瓶年检表格数据
|
|
|
inspectList: [],
|
|
|
+ fileNames: [],
|
|
|
steelcylinderList:[],
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
@@ -215,7 +221,12 @@ export default {
|
|
|
nextInspectTime: null
|
|
|
},
|
|
|
// 表单参数
|
|
|
- form: {},
|
|
|
+ form: {
|
|
|
+ fileUrl: '',
|
|
|
+ fileName: '',
|
|
|
+ //fileUrlList: [],
|
|
|
+ //fileNameList: []
|
|
|
+ },
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
steelcylinderId: [
|
|
@@ -236,6 +247,17 @@ export default {
|
|
|
this.getSteelcylinderList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ setFileName(fileName) {
|
|
|
+ let that = this
|
|
|
+ that.fileNames.push(fileName)
|
|
|
+ },
|
|
|
+ removeFileName(index) {
|
|
|
+ let that = this
|
|
|
+ that.fileNames.splice(index, 1);
|
|
|
+ let fileurls = that.form.fileUrl.split(",")
|
|
|
+ fileurls.splice(index, 1)
|
|
|
+ that.form.fileUrl = fileurls.toString()
|
|
|
+ },
|
|
|
//钢瓶列表
|
|
|
getSteelcylinderList() {
|
|
|
getSteelcylinderList().then(response => {
|
|
@@ -287,6 +309,7 @@ export default {
|
|
|
address: null,
|
|
|
nextInspectTime: null
|
|
|
};
|
|
|
+ this.fileNames = []
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
@@ -317,6 +340,13 @@ export default {
|
|
|
this.reset();
|
|
|
const id = row.id || this.ids
|
|
|
getInspect(id).then(response => {
|
|
|
+ if (response.data.fileUrl !== ""&& response.data.fileUrl!=null) {
|
|
|
+ const list = response.data.fileUrl.split(',');
|
|
|
+ for (var a = 0; a < list.length; a++) {
|
|
|
+ let listurl = list[a].split('+')
|
|
|
+ this.fileNames.push(listurl[1])
|
|
|
+ }
|
|
|
+ }
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改钢瓶年检";
|
|
@@ -329,6 +359,9 @@ export default {
|
|
|
this.form.steelcylinderName = this.steelcylinderList.filter((item) => {
|
|
|
return this.form.steelcylinderId == item.id;
|
|
|
})[0].name;
|
|
|
+ this.form.fileName = this.fileNames.toString()
|
|
|
+ //this.form.fileUrlList = Array.from(document.querySelectorAll('.el-upload-list__item')).map(item => item.querySelector('a').getAttribute('href'))
|
|
|
+ //this.form.fileNameList = this.fileNames;
|
|
|
if (this.form.id != null) {
|
|
|
updateInspect(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|