| | |
| | | <div class="app-container" style="opacity: 1;"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> |
| | | |
| | | <el-form-item label="时间" > |
| | | <el-form-item label="时间" prop="createTime"> |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | style="width: 240px;" |
| | | value-format="yyyy-MM-dd HH-MM" |
| | | style="width: 200px; |
| | | height: 35px; |
| | | border-radius: 16px 16px 16px 16px; |
| | | opacity: 0.5;" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | |
| | | v-model="queryParams.usePeople" |
| | | placeholder="请输入使用人" |
| | | clearable |
| | | style="width: 240px" |
| | | style="width: 200px; |
| | | height: 35px; |
| | | border-radius: 16px 16px 16px 16px; |
| | | opacity: 0.5;" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="基金/台账" prop="type" > |
| | | <el-select |
| | | v-model="queryParams.type" |
| | | placeholder="基金/台账" |
| | | clearable |
| | | style="width: 240px" |
| | | > |
| | | <el-option |
| | | v-for="dict in typeOptions" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | |
| | | <el-form-item label="用途" prop="useFor"> |
| | | <el-input |
| | | v-model="queryParams.useFor" |
| | | placeholder="请输入用途" |
| | | clearable |
| | | style="width: 240px" |
| | | style="width: 200px; |
| | | height: 35px; |
| | | border-radius: 16px 16px 16px 16px; |
| | | opacity: 0.5;" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | |
| | | >导出</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['family:note:export']" |
| | | >导入模板下载</el-button> |
| | | </el-col> |
| | | <el-col :span="1.2"> |
| | | <el-upload |
| | | action="" |
| | | class="upload-demo" |
| | | :show-file-list="false" |
| | | :http-request="handleEnport" |
| | | > |
| | | <el-button size="mini" type="primary" |
| | | plain |
| | | icon="el-icon-plus" >导入</el-button> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['family:note:export']" |
| | | >导入模板下载</el-button> |
| | | </el-col> |
| | | <el-col :span="1.2"> |
| | | <el-upload |
| | | action="" |
| | | class="upload-demo" |
| | | :show-file-list="false" |
| | | :http-request="handleEnport" |
| | | > |
| | | <el-button size="mini" type="primary" |
| | | plain |
| | | icon="el-icon-plus" >导入</el-button> |
| | | |
| | | </el-upload> |
| | | </el-col> |
| | | </el-upload> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | <!-- 序号、基金/台账、时间、收入/支出、用途、使用人、现金/自动扣划、余额、电子文件、备注 操作--> |
| | | <!-- 这里有个familyList数组 是在data()中定义的 --> |
| | | <el-table v-loading="loading" :data="economyList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> |
| | | <el-table v-loading="loading" :data="economyList" @selection-change="handleSelectionChange" @row-click="handleCheck" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/> |
| | | <el-table-column label="基金/台账" prop="type" sortable width="120" > |
| | | <template slot-scope="scope"> |
| | | {{ getSrc1(scope.row.type) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="时间" align="center" sortable prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80"/> |
| | | |
| | | <el-table-column label="收入/支出" prop="price" sortable width="100" /> |
| | | <el-table-column label="发生时间" prop="createTime" sortable width="150" align="center"> |
| | | <template slot-scope="scope">{{scope.row.createTime? scope.row.createTime: '————'}}</template> |
| | | </el-table-column> |
| | | <el-table-column label="台账" prop="type" sortable width="100" /> |
| | | <el-table-column label="收入/支出" prop="price" sortable width="100" > |
| | | |
| | | </el-table-column> |
| | | <el-table-column label="金额" prop="balance" sortable width="100" /> |
| | | <el-table-column label="用途" prop="useFor" sortable width="100" /> |
| | | <!-- <el-table-column label="事项内容" prop="content" sortable :show-overflow-tooltip="true" width="150" /> --> |
| | | |
| | | <el-table-column label="使用人" prop="usePeople" sortable width="100" /> |
| | | <el-table-column label="现金/自动扣划" prop="kind" sortable width="130" > |
| | | <template slot-scope="scope"> |
| | | {{ getSrc2(scope.row.kind) }} |
| | | </template> |
| | | <template slot-scope="scope">{{scope.row.kind? scope.row.kind: '————'}}</template> |
| | | </el-table-column> |
| | | <el-table-column label="余额" prop="balance" sortable width="100" /> |
| | | <el-table-column label="是否是本家庭记录" prop="ownData" sortable width="150px" > |
| | | <template slot-scope="scope">{{scope.row.ownData === 0 ? '否': '是'}}</template> |
| | | </el-table-column> |
| | | <el-table-column label="电子文件" prop="url" align="center" sortable width="110" > |
| | | <template slot-scope="scope" > |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | | src="../../assets/images/deviceLis.png" |
| | | alt="" |
| | | style="width: 35px; height: 35px;" |
| | | fit="cover" |
| | | v-if="scope.row.url !== ','" |
| | | > |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | | src="../../assets/images/deviceA.png" |
| | | alt="" |
| | | style="width: 35px; height: 35px;" |
| | | fit="cover" |
| | | v-if="scope.row.url === ','" |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" prop="remark" sortable width="100" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <div @click="handleCheck(scope.row)"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | | src="../../assets/images/deviceLis.png" |
| | | alt="" |
| | | style="width: 35px; height: 35px;" |
| | | fit="cover" |
| | | v-if="!(scope.row.url === '' || scope.row.url === ',' || scope.row.url === null)" |
| | | > |
| | | <img |
| | | v-else |
| | | class="el-upload-list__item-thumbnail" |
| | | src="../../assets/images/deviceA.png" |
| | | alt="" |
| | | style="width: 35px; height: 35px;" |
| | | fit="cover" |
| | | |
| | | ></div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" prop="remark" sortable width="100" > |
| | | <template slot-scope="scope">{{scope.row.remark? scope.row.remark: '————'}}</template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope" v-if="scope.row.roleId !== 1"> |
| | | <div class="button-container"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:role:edit']" |
| | | v-hasPermi="['familymodel:economy:info']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:role:remove']" |
| | | >删除</el-button> |
| | | <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']"> |
| | | <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['familymodel:economy:info']"> |
| | | <el-button size="mini" type="text" icon="el-icon-d-arrow-right" @click="handleCheck(scope.row)">查看详情</el-button> |
| | | |
| | | </el-dropdown> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <!-- 设备名称、时间、购买人、事项内容、存放地点、备注、电子文件 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> |
| | | <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px"> |
| | | <el-form-item label="基金/台账" prop="type"> |
| | | <el-select v-model="formDat.type" placeholder="请选择基金/台账" clearable :style="{width: '100%'}" > |
| | | <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="时间" prop="createTime"> |
| | | <el-date-picker |
| | | v-model='formDat.createTime' |
| | | type='date' |
| | | placeholder='选择日期' |
| | | <el-form-item label="台账" prop="type"> |
| | | <el-input v-model="formDat.type" placeholder="请输入内容" clearable :style="{width: '100%'}" ></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="发生时间" prop="creatTime"> |
| | | <el-date-picker v-model="formDat.createTime" type="date" placeholder="请选择日期" |
| | | :editable="false" :clearable="false" :style="{width: '100%'}" value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="收入/支出" prop="price"> |
| | | <el-input v-model="formDat.price" placeholder="请输入收入/支出" clearable :style="{width: '100%'}" ></el-input> |
| | | <el-select v-model="formDat.price" placeholder="请选择收入/支出" clearable :style="{width: '100%'}" > |
| | | <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="金额" prop="balance"> |
| | | <el-input v-model="formDat.balance" placeholder="请输入金额" clearable :style="{width: '100%'}" > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="用途" prop="useFor"> |
| | | <el-input v-model="formDat.useFor" placeholder="请输入用途" clearable :style="{width: '100%'}" > |
| | |
| | | <el-input v-model="formDat.usePeople" placeholder="请输入使用人" clearable :style="{width: '100%'}" > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="现金/自动扣划" prop="kind"> |
| | | <el-select v-model="formDat.kind" placeholder="请选择现金/自动扣划" clearable :style="{width: '100%'}" > |
| | | <el-option v-for="(item, index) in typeOptions1" :key="index" :label="item.label" :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="余额" prop="balance"> |
| | | <el-input v-model="formDat.balance" placeholder="请输入余额" clearable :style="{width: '100%'}" > |
| | | <el-form-item label="支付方式" prop="kind"> |
| | | <el-input v-model="formDat.kind" placeholder="请输入支付方式" clearable :style="{width: '100%'}" > |
| | | </el-input> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="家庭号" prop="familyId"> |
| | | <el-input v-model="formDat.familyId" placeholder="请输入家庭号" clearable :style="{width: '100%'}" > |
| | | </el-input> |
| | | </el-form-item> --> |
| | | |
| | | |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="formDat.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" ></el-input> |
| | | </el-form-item> |
| | |
| | | class="upload-demo" |
| | | multiple |
| | | |
| | | :on-remove="handleRemove" |
| | | :on-remove="handleRemoveFile" |
| | | :http-request="requestUpload" |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">上传</el-button> |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | |
| | | |
| | | //在system/note/index.js中导入接口函数 --接好了 |
| | | import {listEconomy,enload,getEconomyInfo,delEconomy, addEconomy, uploadPic} from "@/api/economy/index"; |
| | | import {listEconomy,enload,delEconomy, addEconomy, uploadPic} from "@/api/economy/index"; |
| | | |
| | | export default { |
| | | name: "Role", |
| | |
| | | ], |
| | | dsb:true, |
| | | btn:false, |
| | | uploading: false, |
| | | formDat: { |
| | | type: undefined, |
| | | createTime: undefined, |
| | |
| | | type:undefined, |
| | | useFor:undefined, |
| | | usePeople:undefined, |
| | | createTime:undefined, |
| | | |
| | | createTime:undefined |
| | | |
| | | }, |
| | | // 表单参数 |
| | |
| | | }], |
| | | type: [{ |
| | | required: true, |
| | | message: '请选择基金/台账', |
| | | trigger: 'change' |
| | | message: '请输入台账内容', |
| | | trigger: 'blur' |
| | | }], |
| | | balance: [{ |
| | | required: true, |
| | | message: '请输入余额', |
| | | message: '请输入金额', |
| | | trigger: 'blur' |
| | | }], |
| | | kind: [{ |
| | | required: true, |
| | | message: '请输入家庭号', |
| | | // required: true, |
| | | message: '请输入支付方式', |
| | | trigger: 'blur' |
| | | }], |
| | | createTime: [{ |
| | |
| | | }], |
| | | }, |
| | | typeOptions: [ |
| | | { |
| | | value: '0', |
| | | label: '基金', |
| | | }, |
| | | { |
| | | value: '1', |
| | | label: '台账', |
| | | } |
| | | { |
| | | value: '收入', |
| | | label: '收入', |
| | | }, |
| | | { |
| | | value: '支出', |
| | | label: '支出', |
| | | } |
| | | ], |
| | | typeOptions1: [ |
| | | { |
| | | value: '0', |
| | | label: '现金', |
| | | }, |
| | | { |
| | | value: '1', |
| | | label: '自动扣划', |
| | | } |
| | | { |
| | | value: '0', |
| | | label: '现金', |
| | | }, |
| | | { |
| | | value: '1', |
| | | label: '自动扣划', |
| | | } |
| | | ], |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.getCateInfor() |
| | | this.getCateInfor() |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | //基金/台账的选择 |
| | | getSrc1(type) { |
| | | if (type === 0) { |
| | | return '基金' |
| | | }else { |
| | | return '台账' |
| | | } |
| | | }, |
| | | //基金/台账的选择 |
| | | getSrc1(type) { |
| | | if (type === 0) { |
| | | return '基金' |
| | | }else { |
| | | return '台账' |
| | | } |
| | | }, |
| | | |
| | | getSrc2(kind) { |
| | | if (kind == 0) { |
| | | return '现金' |
| | | }else { |
| | | return '自动扣划' |
| | | } |
| | | }, |
| | | getSrc2(kind) { |
| | | if (kind == 0) { |
| | | return '现金' |
| | | }else { |
| | | return '自动扣划' |
| | | } |
| | | }, |
| | | |
| | | // 取消按钮 |
| | | cancelData() { |
| | |
| | | this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1] |
| | | // console.log(this.queryParams) |
| | | // listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => { |
| | | |
| | | listEconomy(this.queryParams).then(response => { |
| | | |
| | | listEconomy(this.queryParams).then(response => { |
| | | // alert(123) |
| | | // console.log(response.data) |
| | | this.economyList = response.data.data; |
| | |
| | | ); |
| | | }, |
| | | handleRemove(file) { |
| | | for(let i = 0; i < this.fileList.length; i++) |
| | | { |
| | | if(this.fileList[i].url==file.url) |
| | | this.$delete(this.fileList,i); |
| | | } |
| | | }, |
| | | handleRemoveFile(file) { |
| | | for(let i = 0; i < this.fileListOther.length; i++) |
| | | { |
| | | if(this.fileListOther[i].url==file.url) |
| | |
| | | } |
| | | }, |
| | | getCateInfor() |
| | | { |
| | | let _this = this |
| | | getCategory().then(response=>{ |
| | | { |
| | | let _this = this |
| | | getCategory().then(response=>{ |
| | | |
| | | response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ |
| | | _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) |
| | | response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ |
| | | _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | |
| | | }); |
| | | } |
| | | }); |
| | | // 清空formDat对象的数据 |
| | | Object.keys(this.formDat).forEach(key => { |
| | | this.formDat[key] = ''; |
| | | }); |
| | | for(let i = 0; i <= this.fileList.length; i++) |
| | | { |
| | | this.handleRemove(this.fileList[0]); |
| | | } |
| | | for(let i = 0; i < this.fileListOther.length; i++){ |
| | | this.handleRemoveFile(this.fileListOther[0]); |
| | | } |
| | | }, |
| | | requestUpload(params) |
| | | { |
| | |
| | | var formData = new FormData(); |
| | | formData.append('uploadFile', file); |
| | | let _this = this |
| | | |
| | | this.uploading = true; |
| | | uploadPic(formData).then(response => { |
| | | let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) |
| | | |
| | | this.uploading = false; |
| | | this.$modal.msgSuccess("上传成功"); |
| | | if(_this.fot.includes(pth) === true) |
| | | { |
| | | _this.fileList.push({name:response.data.fileName, "url":response.data.url}) |
| | |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const Ids = row.id || this.ids; |
| | | this.$modal.confirm('是否确认删除序号为"' + Ids + '"的数据项?').then(function() { |
| | | this.$modal.confirm('是否确认删除所选数据项?').then(function() { |
| | | return delEconomy(Ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | |
| | | let _this = this |
| | | alert(file) |
| | | enload(formData).then(response => { |
| | | _this.getList(); |
| | | _this.getList(); |
| | | Message({ message: "导入成功", type: 'warning' }) |
| | | |
| | | }).catch(err) |
| | |
| | | Message({ message: "导入失败", type: 'error' }) |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | }; |
| | | </script> |
| | | |
| | |
| | | background: #FFEFF2; |
| | | |
| | | } |
| | | .el-table__cell { |
| | | font-size: 14px; /* 设置字体大小 */ |
| | | } |
| | | .button-container { |
| | | display: inline-flex; /* 设置按钮容器为行内元素 */ |
| | | } |
| | | </style> |