Browse Source

Merge remote-tracking branch 'origin/dev' into jw_feature_dev

V1.0
战立标 2 years ago
parent
commit
aefec1f42c
  1. 2
      src/views/modules/base/organization/organization.vue
  2. 4
      src/views/modules/home/index.vue
  3. 6
      src/views/modules/satisfaction/communitySelfInsp/followUpDetail.vue
  4. 24
      src/views/modules/satisfaction/communitySelfInsp/index.vue
  5. 2
      src/views/modules/satisfaction/satisfactionProvince/formList.vue
  6. 8
      src/views/modules/satisfaction/satisfactionProvince/index.vue
  7. 8
      src/views/modules/shequ/chaxun.vue
  8. 58
      src/views/modules/shequzhili/event/cpts/event-info.vue
  9. 97
      src/views/modules/shequzhili/event/cpts/process-form-designate.vue
  10. 85
      src/views/modules/shequzhili/event/cpts/process-form-replay-end.vue

2
src/views/modules/base/organization/organization.vue

@ -1131,7 +1131,7 @@ export default {
contacts: "", contacts: "",
mobile: "", mobile: "",
agencyId: "", agencyId: "",
departmentDuty: "123", departmentDuty: "",
}, },
// //
GridForm: { GridForm: {

4
src/views/modules/home/index.vue

@ -274,7 +274,7 @@ export default {
trigger: 'axis' trigger: 'axis'
}, },
legend: { legend: {
data: ['12345不满意数', '省满意调查不满意数', '社区自不满意数'], data: ['12345不满意数', '省满意调查不满意数', '社区自不满意数'],
bottom: '10%', bottom: '10%',
icon: 'rect', icon: 'rect',
itemWidth: 20, itemWidth: 20,
@ -314,7 +314,7 @@ export default {
data: [220, 182, 191, 234, 290, 330, 310] data: [220, 182, 191, 234, 290, 330, 310]
}, },
{ {
name: '社区自不满意数', name: '社区自不满意数',
type: 'line', type: 'line',
stack: 'Total', stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410] data: [150, 232, 201, 154, 190, 330, 410]

6
src/views/modules/satisfaction/communitySelfInsp/followUpDetail.vue

@ -1,5 +1,6 @@
<template> <template>
<div class='g-main dialog-h-content'> <div class='g-main dialog-h-content'>
<h3>{{agencyName}}{{period.substr(5,2)}}月份满意度调查</h3> <h3>{{agencyName}}{{period.substr(5,2)}}月份满意度调查</h3>
<p>尊敬的居民朋友</p> <p>尊敬的居民朋友</p>
@ -20,15 +21,14 @@
</div> </div>
<p>8姓名{{form.reporterName}}</p> <p>8姓名{{form.reporterName}}</p>
<p>9电话{{form.reporterMobile}}</p> <p>9电话{{form.reporterMobile}}</p>
<p>10姓名{{form.reporterName}}</p> <p>10您是否接受回访</p>
<p>11您是否接受回访</p>
<section class="f-hflex"> <section class="f-hflex">
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="-2">未知</el-radio> <el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="-2">未知</el-radio>
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="-1">不接受回访</el-radio> <el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="-1">不接受回访</el-radio>
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="0">接受回访/待回访</el-radio> <el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="0">接受回访/待回访</el-radio>
<el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="1">已回访</el-radio> <el-radio class="f-bot16" v-model="form.followUpStatus" disabled :label="1">已回访</el-radio>
</section> </section>
<p v-if="form.followUpStatus === 0">12请选择合适您的回访方式</p> <p v-if="form.followUpStatus === 0">11请选择合适您的回访方式</p>
<section class="f-hflex" v-if="form.followUpStatus === 0"> <section class="f-hflex" v-if="form.followUpStatus === 0">
<el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="0">未知</el-radio> <el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="0">未知</el-radio>
<el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="1">电话回访</el-radio> <el-radio class="f-bot16" v-model="form.expectFollowUpWay" disabled label="1">电话回访</el-radio>

24
src/views/modules/satisfaction/communitySelfInsp/index.vue

@ -5,7 +5,7 @@
<div class="m-search"> <div class="m-search">
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'"> <el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'">
<el-form-item label="自评周期"> <el-form-item label="自评周期">
<el-date-picker v-model="formData.period" type="date" value-format="yyyy-MM" placeholder="选择日期" <el-date-picker v-model="formData.period" type="month" value-format="yyyy-MM" placeholder="选择日期"
style="width: 202px" clearable> style="width: 202px" clearable>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -230,9 +230,7 @@ export default {
this.agencyId = this.user.agencyId; this.agencyId = this.user.agencyId;
await this.getDicts(); await this.getDicts();
await this.getTableData(); await this.getTableData();
this.$nextTick(() => { await this.initEcharts();
this.initEcharts();
})
}, },
created() { created() {
let date = new Date() let date = new Date()
@ -318,14 +316,19 @@ export default {
// //
async getTableData() { async getTableData() {
try{
const url = "/governance/satisfaction/communitySelfInsp/stats/synthesis"; const url = "/governance/satisfaction/communitySelfInsp/stats/synthesis";
const { formData } = this; const { formData } = this;
const { data, code, msg } = await requestGet(url, { ...formData }); const { data, msg } = await requestGet(url, { ...formData });
this.tableLoading = false;
if (code === 0) {
this.total = data.total || 0; this.total = data.total || 0;
this.score = [] this.score = []
this.tableData = data.categoryDatas; this.option.series[0].data = []
this.option.series[1].data = []
this.option.series[2].data = []
this.option.xAxis.data = []
this.tableData = data.categoryDatas || [];
this.satisfactionCategory = []
this.formData.inspRecordId = data.inspRecordId; this.formData.inspRecordId = data.inspRecordId;
this.synthesisScore = data.synthesisScore; this.synthesisScore = data.synthesisScore;
this.personQty = data.personQty this.personQty = data.personQty
@ -340,8 +343,9 @@ export default {
this.score.push({ score: item.score, satisfactionCategoryName: item.satisfactionCategoryName, imgUrl: require(`../../../../assets/img/satisfaction/${item.satisfactionCategory}.png`) }); this.score.push({ score: item.score, satisfactionCategoryName: item.satisfactionCategoryName, imgUrl: require(`../../../../assets/img/satisfaction/${item.satisfactionCategory}.png`) });
} }
}); });
} else { this.myChart.setOption(this.option);
this.$message.error(msg); }catch(error){
console.log(error);
} }
}, },

2
src/views/modules/satisfaction/satisfactionProvince/formList.vue

@ -62,7 +62,7 @@ export default {
periodStart: '', periodStart: '',
scopeId: '', scopeId: '',
}, },
pageNo: 1, pageNo: 0,
pageSize: 20, pageSize: 20,
total: 0, total: 0,
tableData: [], tableData: [],

8
src/views/modules/satisfaction/satisfactionProvince/index.vue

@ -5,7 +5,7 @@
<div class="m-search"> <div class="m-search">
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'"> <el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'">
<el-form-item label="自评周期"> <el-form-item label="自评周期">
<el-date-picker v-model="formData.periodStart" type="date" value-format="yyyy-MM" placeholder="选择日期" <el-date-picker v-model="formData.periodStart" type="month" value-format="yyyy-MM" placeholder="选择日期"
style="width: 202px" clearable> style="width: 202px" clearable>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -256,6 +256,8 @@ export default {
`/governance/provinceEvaluationRecord/staticPeopleNum`, `/governance/provinceEvaluationRecord/staticPeopleNum`,
{ ...this.formData } { ...this.formData }
); );
this.option.series[0].data = []
this.option.xAxis.data = []
this.tableData = data this.tableData = data
this.tableData.forEach(item => { this.tableData.forEach(item => {
if (allowedCategories.includes(item.scopeId)) { if (allowedCategories.includes(item.scopeId)) {
@ -263,10 +265,10 @@ export default {
this.option.xAxis.data.push(item.scopeName) this.option.xAxis.data.push(item.scopeName)
} }
}); });
this.myChart.setOption(this.option)
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
}, },
async handleExportModule() { async handleExportModule() {
let url = "/governance/provinceEvaluationRecord/provinceStatis/downloadImportTemplate"; let url = "/governance/provinceEvaluationRecord/provinceStatis/downloadImportTemplate";
@ -336,7 +338,7 @@ export default {
const formData = new FormData(); //FormDataappend('key', value) const formData = new FormData(); //FormDataappend('key', value)
formData.append("file", file.file); // formData.append("file", file.file); //
await this.$http await this.$http
.post("/governance/satisfaction/provinceEvaluationRecord/StaticPeopleNum/2023-09", formData) .post(`/governance/provinceEvaluationRecord/importDataByExcel`, formData)
.then((res) => { .then((res) => {
console.log("res-up", res); console.log("res-up", res);
if (res.data.code == 0 && res.data.msg == "success") { if (res.data.code == 0 && res.data.msg == "success") {

8
src/views/modules/shequ/chaxun.vue

@ -539,9 +539,9 @@ export default {
this.searchFangwu.total = 0; this.searchFangwu.total = 0;
this.getSearchFangwu(); this.getSearchFangwu();
} }
if (this.smatrFlag && this.childrenRulesData.length === 0) { // if (this.smatrFlag && this.childrenRulesData.length === 0) {
this.getRulesList(); // this.getRulesList();
} // }
this.searchStatus = "ing"; this.searchStatus = "ing";
}, },
async getRulesList() { async getRulesList() {
@ -629,6 +629,7 @@ export default {
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
this.getRulesList();
}, },
async getSearchFangwu() { async getSearchFangwu() {
@ -676,6 +677,7 @@ export default {
: []; : [];
} else { } else {
} }
this.getRulesList();
}, },
handelClickTab(type) { handelClickTab(type) {
console.log(type); console.log(type);

58
src/views/modules/shequzhili/event/cpts/event-info.vue

@ -99,6 +99,31 @@
<div class="detail-field">办结时限</div> <div class="detail-field">办结时限</div>
<div class="detail-value">{{ formTimeLimit(item.timeLimit) }}</div> <div class="detail-value">{{ formTimeLimit(item.timeLimit) }}</div>
</div> </div>
<template v-if="item.internalFile && item.internalFile.length > 0"
v-for="i in item.internalFile">
<template v-if="i.type === 'image'">
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]">
<span class="u-info-title-2">图片</span>
<img :src="i.url" :key="i.url"
style="width: 150px; height: 150px; padding-right: 10px"
@click="watchImg(i.url)" />
</div>
</template>
<template v-if="i.type === 'voice'">
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]">
<span class="u-info-title-2">语音</span>
<audio controls>
<source :src="i.url" type="" :key="i.url" />
</audio>
</div>
</template>
<template v-if="i.type === 'doc'">
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]">
<span class="u-info-title-2">附件</span>
<a :href="i.url">{{ i.name }}</a>
</div>
</template>
</template>
</template> </template>
<template v-else> <template v-else>
<div class="detail"> <div class="detail">
@ -113,6 +138,33 @@
<div class="detail-field">办结时限</div> <div class="detail-field">办结时限</div>
<div class="detail-value">{{ formTimeLimit(item.timeLimit) }}</div> <div class="detail-value">{{ formTimeLimit(item.timeLimit) }}</div>
</div> </div>
<template v-if="item.internalFile && item.internalFile.length > 0"
v-for="i in item.internalFile">
<template v-if="i.type === 'image'">
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]">
<span class="u-info-title-2">图片</span>
<img :src="i.url" :key="i.url"
style="width: 150px; height: 150px; padding-right: 10px"
@click="watchImg(i.url)" />
</div>
</template>
<template v-if="i.type === 'voice'">
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]">
<span class="u-info-title-2">语音</span>
<audio controls>
<source :src="i.url" type="" :key="i.url" />
</audio>
</div>
</template>
<template v-if="i.type === 'doc'">
<div :class="['m-info-prop', { 'm-info-prop-vis': source === 'visiual' },]">
<span class="u-info-title-2">语音</span>
<audio controls>
<source :src="i.url" type="" :key="i.url" />
</audio>
</div>
</template>
</template>
</template> </template>
</div> </div>
</div> </div>
@ -259,6 +311,9 @@ export default {
changeGridId(val) { changeGridId(val) {
this.gridId = val; this.gridId = val;
}, },
watchImg(src) {
window.open(src);
},
// //
async getProjectProcess() { async getProjectProcess() {
@ -305,6 +360,7 @@ export default {
}, },
async handelAdd() { async handelAdd() {
debugger
this.$refs.ref_add.getEventInfo(); this.$refs.ref_add.getEventInfo();
if (this.$refs.ref_add.okflag) { if (this.$refs.ref_add.okflag) {
this.eventInfoData = this.$refs.ref_add.formData; this.eventInfoData = this.$refs.ref_add.formData;
@ -318,6 +374,7 @@ export default {
this.project = {}; this.project = {};
this.demand = {}; this.demand = {};
this.replayInfo = this.$refs.ref_processinfo_add.replayInfo; this.replayInfo = this.$refs.ref_processinfo_add.replayInfo;
console.log(this.replayInfo);
// //
this.eventInfoData.content = this.replayInfo.content; this.eventInfoData.content = this.replayInfo.content;
this.eventInfoData.status = this.replayInfo.status; this.eventInfoData.status = this.replayInfo.status;
@ -330,6 +387,7 @@ export default {
this.demand = {}; this.demand = {};
console.log(this.$refs.ref_process_form_designate.replayInfo); console.log(this.$refs.ref_process_form_designate.replayInfo);
this.replayInfo = this.$refs.ref_process_form_designate.replayInfo; this.replayInfo = this.$refs.ref_process_form_designate.replayInfo;
console.log(this.replayInfo);
// //
this.eventInfoData.content = this.replayInfo.content; this.eventInfoData.content = this.replayInfo.content;
this.eventInfoData.status = this.replayInfo.status; this.eventInfoData.status = this.replayInfo.status;

97
src/views/modules/shequzhili/event/cpts/process-form-designate.vue

@ -1,8 +1,8 @@
<!-- <!--
* @Author: yanLu xgktv007@163.com * @Author: yanLu xgktv007@163.com
* @Date: 2023-09-05 10:21:34 * @Date: 2023-09-05 10:21:34
* @LastEditors: yanLu xgktv007@163.com * @LastEditors: mk 2403457699@qq.com
* @LastEditTime: 2023-09-05 10:21:34 * @LastEditTime: 2023-09-18 17:16:40
* @Description: 事件转办表单 * @Description: 事件转办表单
* *
--> -->
@ -28,6 +28,15 @@
placeholder="请输入转办意见,不超过500字" v-model="formData.content"></el-input> placeholder="请输入转办意见,不超过500字" v-model="formData.content"></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item style="display: block" label="附件" label-width="150px" prop="attach">
<el-upload :headers="$getElUploadHeaders()" class="upload-demo" :action="uploadUlr"
accept=".doc,.pdf,.xls,.docx,.xlsx,.jpg,.png,.jpeg,.bmp,.mp4,.wma,.m4a,.mp3"
:on-success="handleFileSuccess" :on-remove="handleFileRemove" :on-preview="handleFileDownload"
:limit="3" :before-upload="beforeUpload" :file-list="fileList">
<el-button size="small" :disabled="fileList.length === 3" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">支持图片wordpdf</div>
</el-upload>
</el-form-item>
<el-form-item label="办结时限" prop="timeLimit" label-width="150px" :class="{ 'form-item': source === 'visiual' }" <el-form-item label="办结时限" prop="timeLimit" label-width="150px" :class="{ 'form-item': source === 'visiual' }"
style="display: block"> style="display: block">
<div :class="{ 'visiual-form': source === 'visiual' }"> <div :class="{ 'visiual-form': source === 'visiual' }">
@ -55,7 +64,8 @@ export default {
categoryId: "",// categoryId: "",//
deptId: "", // deptId: "", //
deptName: "", deptName: "",
categoryList: [] categoryList: [],
files: [] //
}, },
orgOptions: [], orgOptions: [],
orgOptionProps: { orgOptionProps: {
@ -71,6 +81,8 @@ export default {
eventDetailCopy: {}, eventDetailCopy: {},
selCategoryArray: [], selCategoryArray: [],
casOptions: [], casOptions: [],
fileList: [],
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile",
iscascaderShow: 0, iscascaderShow: 0,
optionProps: { optionProps: {
multiple: false, multiple: false,
@ -91,7 +103,10 @@ export default {
timeLimit: [ timeLimit: [
{ required: true, message: "办结时限不能为空", trigger: "blur" }, { required: true, message: "办结时限不能为空", trigger: "blur" },
] ]
} },
selCateObj: {
id: ""
},
}; };
}, },
components: {}, components: {},
@ -125,7 +140,7 @@ export default {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
// eventDetailCopy // eventDetailCopy
if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) { if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) {
this.selCateObj = this.eventDetailCopy.selCateObj this.selCateObj.id = this.eventDetailCopy.categoryId
this.formData.categoryId = this.eventDetailCopy.categoryId this.formData.categoryId = this.eventDetailCopy.categoryId
this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId, this.eventDetailCopy.categoryId) this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId, this.eventDetailCopy.categoryId)
} }
@ -177,6 +192,7 @@ export default {
if (this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0]) { if (this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0]) {
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
this.formData.categoryId = this.selCateObj.id this.formData.categoryId = this.selCateObj.id
console.log(this.formData.categoryId, 'this.formData.categoryId');
} else { } else {
this.selCateObj = {} this.selCateObj = {}
} }
@ -205,6 +221,9 @@ export default {
this.$message.error("请选择事件分类"); this.$message.error("请选择事件分类");
return false; return false;
} }
if(this.fileList){
this.formData.files = this.fileList
}
this.formData.status = "processing"; this.formData.status = "processing";
this.formData.categoryId = this.selCateObj.id; this.formData.categoryId = this.selCateObj.id;
this.formData.categoryList = []; this.formData.categoryList = [];
@ -216,6 +235,74 @@ export default {
resetData() { resetData() {
this.agencyIdArray = [] this.agencyIdArray = []
}, },
beforeUpload(file) {
const array = file.name.split(".");
const extension = array[array.length - 1];
const formatarray = [
"jpg",
"png",
"jpeg",
"bmp",
"mp4",
"wma",
"m4a",
"mp3",
"doc",
"docx",
"xls",
"xlsx",
"pdf",
];
if (formatarray.indexOf(extension) === -1) {
this.$message.error("只支持图片、word、pdf");
return false;
}
},
handleFileRemove(file) {
if (file && file.status === "success") {
this.fileList.splice(
this.fileList.findIndex((item) => item.uid === file.uid),
1
);
}
},
handleFileSuccess(res, file) {
if (res.code === 0 && res.msg === "success") {
const array = file.name.split(".");
const fileType = array[array.length - 1];
const picArray = ["jpg", "png", "jpeg", "bmp"];
const videoarray = ["mp4", "wma", "m4a"];
const docArray = ["doc", "docx", "xls", "xlsx", "pdf"];
const mp3Array = ["mp3"];
if (picArray.indexOf(fileType) > -1) {
file.attachmentFormat = "image";
} else if (videoarray.indexOf(fileType) > -1) {
file.attachmentFormat = "video";
} else if (docArray.indexOf(fileType) > -1) {
file.attachmentFormat = "doc";
} else if (mp3Array.indexOf(fileType) > -1) {
file.attachmentFormat = "voice";
}
file.url = res.data.url;
file.type = fileType;
file.attachmentName = file.name;
file.attachmentType = file.type;
file.attachmentUrl = file.url;
this.fileList.push(file);
} else this.$message.error(res.msg);
},
//
handleFileDownload(file) {
var a = document.createElement("a");
var event = new MouseEvent("click");
a.download = file.name;
a.href = file.url;
a.dispatchEvent(event);
},
// //
startLoading() { startLoading() {
loading = Loading.service({ loading = Loading.service({

85
src/views/modules/shequzhili/event/cpts/process-form-replay-end.vue

@ -25,6 +25,15 @@
placeholder="请输入回复内容,不超过500字" v-model="formData.content"></el-input> placeholder="请输入回复内容,不超过500字" v-model="formData.content"></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item style="display: block" label="附件" label-width="150px" prop="attach">
<el-upload :headers="$getElUploadHeaders()" class="upload-demo" :action="uploadUlr"
accept=".doc,.pdf,.xls,.docx,.xlsx,.jpg,.png,.jpeg,.bmp,.mp4,.wma,.m4a,.mp3"
:on-success="handleFileSuccess" :on-remove="handleFileRemove" :on-preview="handleFileDownload"
:limit="3" :before-upload="beforeUpload" :file-list="fileList">
<el-button size="small" :disabled="fileList.length === 3" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">支持图片wordpdf</div>
</el-upload>
</el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
@ -43,12 +52,15 @@ export default {
content: '', content: '',
status: 'closed_case', status: 'closed_case',
categoryList: [], categoryList: [],
files: []
}, },
status: false, status: false,
okflag: false, okflag: false,
eventDetailCopy: {}, eventDetailCopy: {},
selCategoryArray: [], selCategoryArray: [],
casOptions: [], casOptions: [],
fileList: [],
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile",
iscascaderShow: 0, iscascaderShow: 0,
optionProps: { optionProps: {
multiple: false, multiple: false,
@ -87,7 +99,7 @@ export default {
}, },
watch: {}, watch: {},
created() {}, created() { },
async mounted() { async mounted() {
this.getCategoryList(); this.getCategoryList();
@ -152,6 +164,9 @@ export default {
if (!this.formData.categoryId) { if (!this.formData.categoryId) {
this.formData.categoryId = this.selCateObj.id; this.formData.categoryId = this.selCateObj.id;
} }
if(this.fileList){
this.formData.files = this.fileList
}
this.formData.categoryList = []; this.formData.categoryList = [];
this.formData.categoryList.push(this.selCateObj); this.formData.categoryList.push(this.selCateObj);
this.okflag = true; this.okflag = true;
@ -159,6 +174,74 @@ export default {
}); });
}, },
resetData() { }, resetData() { },
beforeUpload(file) {
const array = file.name.split(".");
const extension = array[array.length - 1];
const formatarray = [
"jpg",
"png",
"jpeg",
"bmp",
"mp4",
"wma",
"m4a",
"mp3",
"doc",
"docx",
"xls",
"xlsx",
"pdf",
];
if (formatarray.indexOf(extension) === -1) {
this.$message.error("只支持图片、word、pdf");
return false;
}
},
handleFileRemove(file) {
if (file && file.status === "success") {
this.fileList.splice(
this.fileList.findIndex((item) => item.uid === file.uid),
1
);
}
},
handleFileSuccess(res, file) {
if (res.code === 0 && res.msg === "success") {
const array = file.name.split(".");
const fileType = array[array.length - 1];
const picArray = ["jpg", "png", "jpeg", "bmp"];
const videoarray = ["mp4", "wma", "m4a"];
const docArray = ["doc", "docx", "xls", "xlsx", "pdf"];
const mp3Array = ["mp3"];
if (picArray.indexOf(fileType) > -1) {
file.attachmentFormat = "image";
} else if (videoarray.indexOf(fileType) > -1) {
file.attachmentFormat = "video";
} else if (docArray.indexOf(fileType) > -1) {
file.attachmentFormat = "doc";
} else if (mp3Array.indexOf(fileType) > -1) {
file.attachmentFormat = "voice";
}
file.url = res.data.url;
file.type = fileType;
file.attachmentName = file.name;
file.attachmentType = file.type;
file.attachmentUrl = file.url;
this.fileList.push(file);
} else this.$message.error(res.msg);
},
//
handleFileDownload(file) {
var a = document.createElement("a");
var event = new MouseEvent("click");
a.download = file.name;
a.href = file.url;
a.dispatchEvent(event);
},
// //
startLoading() { startLoading() {
loading = Loading.service({ loading = Loading.service({

Loading…
Cancel
Save