| | |
| | | import request from '@/router/axios'; |
| | | import qs from 'qs' // axios自带的工具不需要安装npm依赖 |
| | | |
| | | export const getList = (current, size, params) => { |
| | | return request({ |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | export const adds = (row) => { |
| | | return request({ |
| | | url: '/api/feedback/feedback/saves', |
| | | method: 'post', |
| | | headers: { |
| | | 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8' |
| | | }, |
| | | data: qs.stringify(row) |
| | | }) |
| | | } |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/feedback/feedback/submit', |
| | |
| | | }) |
| | | } |
| | | |
| | | export const updates = (row) => { |
| | | return request({ |
| | | url: '/api/feedback/feedback/updates', |
| | | method: 'post', |
| | | headers: { |
| | | 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8' |
| | | }, |
| | | data: qs.stringify(row) |
| | | }) |
| | | } |
| | | |
| | |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getListReport, getDetails, add, update, remove} from "@/api/feedback/feedback"; |
| | | import {getListReport, getDetails, adds, updates, remove} from "@/api/feedback/feedback"; |
| | | import {getBaTree} from "@/api/client/client"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | labelWidth: '125', |
| | | dialogWidth: 1150, |
| | | border: false, |
| | | stripe:true, |
| | | index: true, |
| | |
| | | { |
| | | label: "上报人姓名", |
| | | prop: "sname", |
| | | search:true, |
| | | searchLabelWidth:100, |
| | | searchSpan: 5, |
| | | addDisplay:false, |
| | | editDisplay:false |
| | | }, |
| | | { |
| | | label: "上报人姓名", |
| | | prop: "snumber", |
| | | type: "tree", |
| | | dicUrl: "/api/catalogs/catalogs/getBigTree", |
| | | props: { |
| | | label: "title" |
| | | }, |
| | | width: 72, |
| | | hide: true, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: false, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入上报人姓名", |
| | | message: "请选择上报人", |
| | | trigger: "blur" |
| | | }] |
| | | }], |
| | | }, |
| | | { |
| | | label: "上报地址", |
| | |
| | | hide:true, |
| | | viewDisplay:true, |
| | | listType: 'picture-card', |
| | | action: '/imgupload' |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | url: "link", |
| | | } |
| | | }, |
| | | { |
| | | label: '视频', |
| | |
| | | viewDisplay:true, |
| | | listType: 'picture-img', |
| | | span: 24, |
| | | action: '/imgupload' |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | url: "link", |
| | | } |
| | | }, |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | }, |
| | | watch:{ |
| | | handler(val) { |
| | | var that = this; |
| | | if (val != null && val !=""){ |
| | | getBaTree(val).then(res => { |
| | | if (res) { |
| | | that.form.sname = res.data.data.records[0].name; |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.feedback_add, false), |
| | | addBtn: this.vaildData(this.permission.feedback_add, true), |
| | | viewBtn: this.vaildData(this.permission.feedback_view, true), |
| | | delBtn: this.vaildData(this.permission.feedback_delete, false), |
| | | editBtn: this.vaildData(this.permission.feedback_edit, false) |
| | | delBtn: this.vaildData(this.permission.feedback_delete, true), |
| | | editBtn: this.vaildData(this.permission.feedback_edit, true) |
| | | }; |
| | | }, |
| | | ids() { |
| | |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | var data = { |
| | | status:1, |
| | | tpaddress:"", |
| | | spaddress:"", |
| | | sname: row.$snumber, |
| | | snumber: row.snumber, |
| | | stime:row.stime, |
| | | result:row.result, |
| | | place:row.place |
| | | } |
| | | if (row.images.length > 0) { |
| | | var imageArr = row.images; |
| | | imageArr.forEach( image =>{ |
| | | data.tpaddress += image + ","; |
| | | }) |
| | | data.tpaddress = data.tpaddress.substring(0,data.tpaddress.length-1); |
| | | } |
| | | if (row.videos.length > 0) { |
| | | //var videoArr = row.videos; |
| | | //videoArr.forEach( video =>{ |
| | | //data.spaddress += video + ","; |
| | | //}) |
| | | //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1); |
| | | data.spaddress = row.videos; |
| | | } |
| | | adds(data).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | var data = { |
| | | id:row.id, |
| | | status:1, |
| | | tpaddress:"", |
| | | spaddress:"", |
| | | sname: row.$snumber, |
| | | snumber: row.snumber, |
| | | stime:row.stime, |
| | | result:row.result, |
| | | place:row.place |
| | | } |
| | | if (row.images.length > 0) { |
| | | var imageArr = row.images; |
| | | imageArr.forEach( image =>{ |
| | | data.tpaddress += image + ","; |
| | | }) |
| | | data.tpaddress = data.tpaddress.substring(0,data.tpaddress.length-1); |
| | | } |
| | | if (row.videos.length > 0) { |
| | | //var videoArr = row.videos; |
| | | //videoArr.forEach( video =>{ |
| | | //data.spaddress += video + ","; |
| | | //}) |
| | | //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1); |
| | | data.spaddress = row.videos; |
| | | } |
| | | updates(data).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |