index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
  4. <el-form-item label="诊所名称" prop="companyName">
  5. <el-input
  6. v-model="queryParams.companyName"
  7. placeholder="请输入诊所名称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="充值订单号" prop="rechargeNo">
  14. <el-input
  15. v-model="queryParams.rechargeNo"
  16. placeholder="请输入充值订单号"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="支付类型" prop="payType">
  23. <el-select v-model="queryParams.payType" placeholder="请选择支付类型" clearable size="small">
  24. <el-option
  25. v-for="dict in payTypeOptions"
  26. :key="dict.dictValue"
  27. :label="dict.dictLabel"
  28. :value="dict.dictValue"
  29. />
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="业务类型" prop="businessType">
  33. <el-select v-model="queryParams.businessType" placeholder="请选择支付类型" clearable size="small">
  34. <el-option
  35. v-for="dict in businessTypeOptions"
  36. :key="dict.dictValue"
  37. :label="dict.dictLabel"
  38. :value="dict.dictValue"
  39. />
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="状态" prop="status">
  43. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
  44. <el-option
  45. v-for="dict in statusOptions"
  46. :key="dict.dictValue"
  47. :label="dict.dictLabel"
  48. :value="dict.dictValue"
  49. />
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item label="创建时间" prop="createTime">
  53. <el-date-picker clearable size="small"
  54. v-model="queryParams.createTime"
  55. type="date"
  56. value-format="yyyy-MM-dd"
  57. placeholder="选择创建时间">
  58. </el-date-picker>
  59. </el-form-item>
  60. <el-form-item>
  61. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  62. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  63. </el-form-item>
  64. </el-form>
  65. <el-row :gutter="10" class="mb8">
  66. <el-col :span="1.5">
  67. <el-button
  68. type="warning"
  69. plain
  70. icon="el-icon-download"
  71. size="mini"
  72. :loading="exportLoading"
  73. @click="handleExport"
  74. v-hasPermi="['his:companyRecharge:export']"
  75. >导出</el-button>
  76. </el-col>
  77. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  78. </el-row>
  79. <el-tabs type="card" v-model="queryParams.isAudit" @tab-click="handleClickX">
  80. <el-tab-pane v-for="(item,index) in isAuditOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  81. </el-tabs>
  82. <el-table v-loading="loading" border :data="companyRechargeList" @selection-change="handleSelectionChange">
  83. <el-table-column type="selection" width="55" align="center" />
  84. <el-table-column label="充值订单号" align="center" prop="rechargeNo" width="200px"/>
  85. <el-table-column label="诊所名称" align="center" prop="companyName" />
  86. <el-table-column label="金额" align="center" prop="money" />
  87. <el-table-column label="状态" align="center" prop="status">
  88. <template slot-scope="scope">
  89. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="支付类型" align="center" prop="payType">
  93. <template slot-scope="scope">
  94. <dict-tag :options="payTypeOptions" :value="scope.row.payType"/>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="业务类型" align="center" prop="businessType">
  98. <template slot-scope="scope">
  99. <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="审核状态" align="center" prop="isAudit">
  103. <template slot-scope="scope">
  104. <dict-tag :options="isAuditOptions" :value="scope.row.isAudit"/>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="余额" align="center" prop="balance" />
  108. <el-table-column label="提交人" align="center" prop="createUserNickName" />
  109. <el-table-column label="审核人" align="center" prop="auditUserNickName" />
  110. <el-table-column label="凭证照片" align="center" prop="imgs" >
  111. <template slot-scope="scope">
  112. <div v-if="scope.row.imgs != null && scope.row.imgs != undefined && scope.row.imgs != ''">
  113. <el-image
  114. style="width: 80px; height: 80px"
  115. :src="scope.row.imgs.split(',')[0]"
  116. :preview-src-list="scope.row.imgs.split(',')">
  117. </el-image>
  118. <p style="margin: 0">({{scope.row.imgs.split(',').length}} 张)</p>
  119. </div>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="备注" align="center" prop="remark" />
  123. <el-table-column label="支付时间" align="center" prop="payTime" width="180"/>
  124. <el-table-column label="审核时间" align="center" prop="auditTime" width="180"/>
  125. <el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
  126. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="120px">
  127. <template slot-scope="scope" v-if="scope.row.isAudit==0">
  128. <el-button
  129. size="mini"
  130. type="text"
  131. icon="el-icon-edit"
  132. @click="handleUpdate(scope.row)"
  133. v-hasPermi="['his:companyRecharge:edit']"
  134. >审核</el-button>
  135. </template>
  136. </el-table-column>
  137. </el-table>
  138. <pagination
  139. v-show="total>0"
  140. :total="total"
  141. :page.sync="queryParams.pageNum"
  142. :limit.sync="queryParams.pageSize"
  143. @pagination="getList"
  144. />
  145. <!-- 添加或修改充值管理对话框 -->
  146. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  147. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  148. <el-form-item label="公司" prop="companyName">
  149. <el-input v-model="form.companyName" disabled />
  150. </el-form-item>
  151. <el-form-item label="充值金额" prop="money">
  152. <el-input v-model="form.money" disabled />
  153. </el-form-item>
  154. <el-form-item label="状态" prop="isAudit">
  155. <el-radio-group v-model="form.isAudit">
  156. <el-radio label="1">通过</el-radio>
  157. <el-radio label="-1">驳回</el-radio>
  158. </el-radio-group>
  159. </el-form-item>
  160. <el-form-item label="备注" prop="remark">
  161. <el-input v-model="form.remark" type="textarea" :row="5" />
  162. </el-form-item>
  163. </el-form>
  164. <div slot="footer" class="dialog-footer">
  165. <el-button type="primary" @click="submitForm">确 定</el-button>
  166. <el-button @click="cancel">取 消</el-button>
  167. </div>
  168. </el-dialog>
  169. </div>
  170. </template>
  171. <script>
  172. import { listCompanyRecharge, getCompanyRecharge, delCompanyRecharge, addCompanyRecharge, updateCompanyRecharge, exportCompanyRecharge } from "@/api/his/companyRecharge";
  173. export default {
  174. name: "CompanyRecharge",
  175. data() {
  176. return {
  177. // 遮罩层
  178. loading: true,
  179. // 导出遮罩层
  180. exportLoading: false,
  181. // 选中数组
  182. ids: [],
  183. // 非单个禁用
  184. single: true,
  185. // 非多个禁用
  186. multiple: true,
  187. // 显示搜索条件
  188. showSearch: true,
  189. // 总条数
  190. total: 0,
  191. // 充值管理表格数据
  192. companyRechargeList: [],
  193. // 弹出层标题
  194. title: "",
  195. // 是否显示弹出层
  196. open: false,
  197. // 状态 0未支付 1已支付字典
  198. statusOptions: [],
  199. // 支付类型 1微信 2支付宝 3人工转账字典
  200. payTypeOptions: [],
  201. // 业务类型 0-普通 1-红包充值
  202. businessTypeOptions:[],
  203. // 审核状态 0待审核 1已审核字典
  204. isAuditOptions: [],
  205. // 查询参数
  206. queryParams: {
  207. pageNum: 1,
  208. pageSize: 10,
  209. companyName: null,
  210. rechargeNo: null,
  211. status: null,
  212. payType: null,
  213. isAudit: 0,
  214. businessType:null, // 业务类型
  215. },
  216. // 表单参数
  217. form: {},
  218. // 表单校验
  219. rules: {
  220. isAudit: [
  221. { required: true, message: "状态不能为空", trigger: "blur" }
  222. ],
  223. }
  224. };
  225. },
  226. created() {
  227. this.getList();
  228. this.getDicts("sys_company_recharge_status").then(response => {
  229. this.statusOptions = response.data;
  230. });
  231. this.getDicts("sys_company_pay_type").then(response => {
  232. this.payTypeOptions = response.data;
  233. });
  234. this.getDicts("sys_company_isaudit").then(response => {
  235. this.isAuditOptions = response.data;
  236. });
  237. this.getDicts("sys_company_pay_business_type").then(response => {
  238. this.businessTypeOptions = response.data;
  239. });
  240. },
  241. methods: {
  242. /** 查询充值管理列表 */
  243. getList() {
  244. this.loading = true;
  245. listCompanyRecharge(this.queryParams).then(response => {
  246. this.companyRechargeList = response.rows;
  247. this.total = response.total;
  248. this.loading = false;
  249. });
  250. },
  251. // 取消按钮
  252. cancel() {
  253. this.open = false;
  254. this.reset();
  255. },
  256. handleClickX(){
  257. this.handleQuery()
  258. },
  259. // 表单重置
  260. reset() {
  261. this.form = {
  262. rechargeId: null,
  263. companyId: null,
  264. companyName:null,
  265. rechargeNo: null,
  266. money: null,
  267. createTime: null,
  268. payTime: null,
  269. status: null,
  270. payType: null,
  271. tradeNo: null,
  272. balance: null,
  273. createUserId: null,
  274. isAudit: null,
  275. auditUserId: null,
  276. auditTime: null,
  277. remark: null
  278. };
  279. this.resetForm("form");
  280. },
  281. /** 搜索按钮操作 */
  282. handleQuery() {
  283. this.queryParams.pageNum = 1;
  284. this.getList();
  285. },
  286. /** 重置按钮操作 */
  287. resetQuery() {
  288. this.resetForm("queryForm");
  289. this.queryParams.businessType=null;
  290. this.handleQuery();
  291. },
  292. // 多选框选中数据
  293. handleSelectionChange(selection) {
  294. this.ids = selection.map(item => item.rechargeId)
  295. this.single = selection.length!==1
  296. this.multiple = !selection.length
  297. },
  298. /** 修改按钮操作 */
  299. handleUpdate(row) {
  300. this.reset();
  301. getCompanyRecharge(row.rechargeId).then(response => {
  302. this.form = response.data;
  303. this.open = true;
  304. this.title = "审核";
  305. this.form.companyName=row.companyName;
  306. this.form.isAudit=null;
  307. });
  308. },
  309. /** 提交按钮 */
  310. submitForm() {
  311. this.$refs["form"].validate(valid => {
  312. if (valid) {
  313. if (this.form.rechargeId != null) {
  314. updateCompanyRecharge(this.form).then(response => {
  315. this.msgSuccess("修改成功");
  316. this.open = false;
  317. this.getList();
  318. });
  319. } else {
  320. addCompanyRecharge(this.form).then(response => {
  321. this.msgSuccess("新增成功");
  322. this.open = false;
  323. this.getList();
  324. });
  325. }
  326. }
  327. });
  328. },
  329. /** 删除按钮操作 */
  330. handleDelete(row) {
  331. const rechargeIds = row.rechargeId || this.ids;
  332. this.$confirm('是否确认删除充值管理编号为"' + rechargeIds + '"的数据项?', "警告", {
  333. confirmButtonText: "确定",
  334. cancelButtonText: "取消",
  335. type: "warning"
  336. }).then(function() {
  337. return delCompanyRecharge(rechargeIds);
  338. }).then(() => {
  339. this.getList();
  340. this.msgSuccess("删除成功");
  341. }).catch(() => {});
  342. },
  343. /** 导出按钮操作 */
  344. handleExport() {
  345. const queryParams = this.queryParams;
  346. this.$confirm('是否确认导出所有充值管理数据项?', "警告", {
  347. confirmButtonText: "确定",
  348. cancelButtonText: "取消",
  349. type: "warning"
  350. }).then(() => {
  351. this.exportLoading = true;
  352. return exportCompanyRecharge(queryParams);
  353. }).then(response => {
  354. this.download(response.msg);
  355. this.exportLoading = false;
  356. }).catch(() => {});
  357. }
  358. }
  359. };
  360. </script>