audit.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="店铺名称" prop="storeName">
  5. <el-input
  6. v-model="queryParams.storeName"
  7. placeholder="请输入店铺名称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="地址" prop="address">
  14. <el-input
  15. v-model="queryParams.address"
  16. placeholder="请输入地址"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="店铺电话" prop="phone">
  23. <el-input
  24. v-model="queryParams.phone"
  25. placeholder="请输入店铺电话"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item label="状态" prop="status">
  32. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
  33. <el-option
  34. v-for="dict in statusOptions"
  35. :key="dict.dictValue"
  36. :label="dict.dictLabel"
  37. :value="dict.dictValue"
  38. />
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item label="登录帐号" prop="account">
  42. <el-input
  43. v-model="queryParams.account"
  44. placeholder="请输入登录帐号"
  45. clearable
  46. size="small"
  47. @keyup.enter.native="handleQuery"
  48. />
  49. </el-form-item>
  50. <el-form-item>
  51. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  52. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  53. </el-form-item>
  54. </el-form>
  55. <el-row :gutter="10" class="mb8">
  56. <el-col :span="1.5">
  57. <el-button
  58. type="warning"
  59. plain
  60. icon="el-icon-download"
  61. size="mini"
  62. :loading="exportLoading"
  63. @click="handleExport"
  64. v-hasPermi="['store:his:store:export']"
  65. >导出</el-button>
  66. </el-col>
  67. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  68. </el-row>
  69. <el-tabs type="card" v-model="queryParams.isAudit" @tab-click="handleClickX">
  70. <el-tab-pane v-for="(item,index) in isAuditOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  71. </el-tabs>
  72. <el-table v-loading="loading" border :data="storeList" @selection-change="handleSelectionChange">
  73. <el-table-column type="selection" width="55" align="center" />
  74. <el-table-column label="店铺id" align="center" prop="storeId" width="120px"/>
  75. <el-table-column label="店铺名称" align="center" prop="storeName" width="120px"/>
  76. <el-table-column label="店铺LOGO" align="center" prop="logoUrl" width="100px">
  77. <template slot-scope="scope">
  78. <el-popover
  79. placement="right"
  80. title=""
  81. trigger="hover">
  82. <img slot="reference" :src="scope.row.logoUrl" width="80px">
  83. <img :src="scope.row.logoUrl" style="max-width: 150px;">
  84. </el-popover>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="地址" align="center" prop="address" width="200px"/>
  88. <el-table-column label="店铺电话" align="center" prop="phone" width="120px"/>
  89. <!-- <el-table-column label="资质证书" align="center" prop="licenseImages" width="100px">
  90. <template slot-scope="scope">
  91. <el-popover
  92. placement="right"
  93. title=""
  94. trigger="hover">
  95. <img slot="reference" :src="scope.row.licenseImages" width="80px">
  96. <img :src="scope.row.licenseImages" style="max-width: 150px;">
  97. </el-popover>
  98. </template>
  99. </el-table-column>-->
  100. <el-table-column label="审核状态" align="center" prop="isAudit">
  101. <template slot-scope="scope">
  102. <dict-tag :options="isAuditOptions" :value="scope.row.isAudit"/>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="商品总数" align="center" prop="productCount" />
  106. <el-table-column label="状态" align="center" prop="status">
  107. <template slot-scope="scope">
  108. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="销量" align="center" prop="salesCount" />
  112. <el-table-column label="余额" align="center" prop="balance" />
  113. <el-table-column label="累计金额" align="center" prop="totalMoney" />
  114. <el-table-column label="登录帐号" align="center" prop="account" width="150px" />
  115. <el-table-column label="创建时间" align="center" prop="createTime" width="150px"/>
  116. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="130px" v-if="this.$store.state.user.medicalMallConfig.medicalMall">
  117. <template slot-scope="scope">
  118. <el-button
  119. size="mini"
  120. type="text"
  121. icon="el-icon-s-promotion"
  122. @click="handledetails(scope.row)"
  123. >
  124. <span v-if="scope.row.isAudit===0">审核</span>
  125. <span v-else>详情</span>
  126. </el-button>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="130px" v-else>
  130. <template slot-scope="scope">
  131. <el-button
  132. size="mini"
  133. type="text"
  134. icon="el-icon-s-promotion"
  135. @click="handleUpdate(scope.row)"
  136. >
  137. <span>审核</span>
  138. </el-button>
  139. </template>
  140. </el-table-column>
  141. </el-table>
  142. <pagination
  143. v-show="total>0"
  144. :total="total"
  145. :page.sync="queryParams.pageNum"
  146. :limit.sync="queryParams.pageSize"
  147. @pagination="getList"
  148. />
  149. <el-drawer
  150. :with-header="false"
  151. size="75%"
  152. :title="show.title" :visible.sync="show.open" >
  153. <storeDetails ref="Details" @fresh="getList" @showClose="this.show.open = false"/>
  154. </el-drawer>
  155. </div>
  156. </template>
  157. <script>
  158. import { audit,listStore, exportStore } from "@/api/hisStore/store";
  159. import storeDetails from '../components/storeDetails.vue';
  160. import {getCitys} from "@/api/store/city";
  161. export default {
  162. name: "adutstore",
  163. components: { storeDetails },
  164. data() {
  165. return {
  166. show:{
  167. title:"店铺详情",
  168. open:false,
  169. },
  170. citys:[],
  171. licenseuploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
  172. uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
  173. baseUrl: process.env.VUE_APP_BASE_API,
  174. shippingTypeOptions: [{
  175. "label": "配送",
  176. "value": "1"
  177. }, {
  178. "label": "自提",
  179. "value": "2"
  180. }, {
  181. "label": "配送自提",
  182. "value": "3"
  183. }],
  184. // 遮罩层
  185. loading: true,
  186. // 导出遮罩层
  187. exportLoading: false,
  188. // 选中数组
  189. ids: [],
  190. // 非单个禁用
  191. single: true,
  192. // 非多个禁用
  193. multiple: true,
  194. // 显示搜索条件
  195. showSearch: true,
  196. // 总条数
  197. total: 0,
  198. // 店铺管理表格数据
  199. storeList: [],
  200. // 弹出层标题
  201. title: "",
  202. // 是否显示弹出层
  203. open: false,
  204. // 状态字典
  205. statusOptions: [],
  206. // 审核状态字典
  207. isAuditOptions: [],
  208. // 查询参数
  209. queryParams: {
  210. pageNum: 1,
  211. pageSize: 10,
  212. storeName: null,
  213. address: null,
  214. phone: null,
  215. status: null,
  216. isAudit: 0,
  217. account: null,
  218. },
  219. // 表单参数
  220. form: {},
  221. // 表单校验
  222. rules: {
  223. storeName: [
  224. { required: true, message: "店铺名称不能为空", trigger: "blur" }
  225. ],
  226. logoUrl: [
  227. { required: true, message: "店铺LOGO不能为空", trigger: "blur" }
  228. ],
  229. cityIds: [
  230. { required: true, message: "所属城市不能为空", trigger: "blur" }
  231. ],
  232. address: [
  233. { required: true, message: "地址不能为空", trigger: "blur" }
  234. ],
  235. licenseImages: [
  236. { required: true, message: "资质证书不能为空", trigger: "blur" }
  237. ],
  238. shippingType: [
  239. { required: true, message: "配送方式不能为空", trigger: "blur" }
  240. ],
  241. phone: [
  242. { required: true, message: "店铺电话不能为空", trigger: "blur" }
  243. ],
  244. }
  245. };
  246. },
  247. created() {
  248. this.getCitys();
  249. this.getList();
  250. this.getDicts("sys_company_status").then(response => {
  251. this.statusOptions = response.data;
  252. });
  253. this.getDicts("sys_company_isaudit").then(response => {
  254. this.isAuditOptions = response.data;
  255. });
  256. },
  257. methods: {
  258. handleUpdate(row){
  259. var that=this;
  260. var the=null;
  261. this.$confirm('是否确认审核?', "审核", {
  262. distinguishCancelAndClose: true,
  263. confirmButtonText: "确定",
  264. cancelButtonText: "驳回",
  265. type: "warning"
  266. }).then(function() {
  267. var data={
  268. storeId:row.storeId,
  269. isAudit:1
  270. }
  271. return audit(data);
  272. }).then(() => {
  273. this.msgSuccess("操作成功");
  274. this.getList();
  275. }).catch(function(action) {
  276. if (action === 'cancel') {
  277. var data={
  278. storeId:row.storeId,
  279. isAudit:-1
  280. }
  281. the='cancel';
  282. return audit(data);
  283. }
  284. }).then(() => {
  285. if(the==='cancel'){
  286. this.msgSuccess("操作成功");
  287. this.getList();
  288. }
  289. });
  290. },
  291. handledetails(row){
  292. this.show.open=true;
  293. setTimeout(() => {
  294. this.$refs.Details.getDetails(row.storeId);
  295. }, 1);
  296. },
  297. handleCityChange(value) {
  298. var nodes=this.$refs.citySelect.getCheckedNodes();
  299. this.form.address=nodes[0].pathLabels[0]+nodes[0].pathLabels[1]+nodes[0].pathLabels[2];
  300. this.form.cityIds=value.toString();
  301. },
  302. getCitys(){
  303. getCitys().then(res => {
  304. this.loading = false;
  305. this.citys=res.data;
  306. })
  307. },
  308. licensehandleAvatarSuccess(res, file) {
  309. if(res.code==200){
  310. this.form.licenseImages=res.url;
  311. this.$forceUpdate()
  312. }
  313. else{
  314. this.msgError(res.msg);
  315. }
  316. },
  317. handleAvatarSuccess(res, file) {
  318. if(res.code==200){
  319. this.form.logoUrl=res.url;
  320. this.$forceUpdate()
  321. }
  322. else{
  323. this.msgError(res.msg);
  324. }
  325. },
  326. beforeAvatarUpload(file) {
  327. const isLt1M = file.size / 1024 / 1024 < 1;
  328. if (!isLt1M) {
  329. this.$message.error('上传图片大小不能超过 1MB!');
  330. }
  331. return isLt1M;
  332. },
  333. handleClickX(){
  334. this.getList()
  335. },
  336. /** 查询店铺管理列表 */
  337. getList() {
  338. this.loading = true;
  339. listStore(this.queryParams).then(response => {
  340. this.storeList = response.rows;
  341. this.total = response.total;
  342. this.loading = false;
  343. });
  344. },
  345. // 取消按钮
  346. cancel() {
  347. this.open = false;
  348. this.reset();
  349. },
  350. // 表单重置
  351. reset() {
  352. this.form = {
  353. storeId: null,
  354. cityIds: null,
  355. storeName: null,
  356. descs: null,
  357. logoUrl: null,
  358. address: null,
  359. lng: null,
  360. lat: null,
  361. phone: null,
  362. licenseImages: null,
  363. productCount: null,
  364. status: 0,
  365. createTime: null,
  366. updateTime: null,
  367. salesCount: null,
  368. balance: null,
  369. totalMoney: null,
  370. isAudit: 0,
  371. account: null,
  372. password: null,
  373. shippingType: ["1"]
  374. };
  375. this.resetForm("form");
  376. },
  377. /** 搜索按钮操作 */
  378. handleQuery() {
  379. this.queryParams.pageNum = 1;
  380. this.getList();
  381. },
  382. /** 重置按钮操作 */
  383. resetQuery() {
  384. this.resetForm("queryForm");
  385. this.handleQuery();
  386. },
  387. // 多选框选中数据
  388. handleSelectionChange(selection) {
  389. this.ids = selection.map(item => item.storeId)
  390. this.single = selection.length!==1
  391. this.multiple = !selection.length
  392. },
  393. /** 导出按钮操作 */
  394. handleExport() {
  395. const queryParams = this.queryParams;
  396. this.$confirm('是否确认导出所有店铺管理数据项?', "警告", {
  397. confirmButtonText: "确定",
  398. cancelButtonText: "取消",
  399. type: "warning"
  400. }).then(() => {
  401. this.exportLoading = true;
  402. return exportStore(queryParams);
  403. }).then(response => {
  404. this.download(response.msg);
  405. this.exportLoading = false;
  406. }).catch(() => {});
  407. }
  408. }
  409. };
  410. </script>
  411. <style>
  412. .avatar-uploader .el-upload {
  413. border: 1px dashed #d9d9d9;
  414. border-radius: 6px;
  415. cursor: pointer;
  416. position: relative;
  417. overflow: hidden;
  418. }
  419. .avatar-uploader .el-upload:hover {
  420. border-color: #409EFF;
  421. }
  422. .avatar-uploader-icon {
  423. font-size: 28px;
  424. color: #8c939d;
  425. width: 150px;
  426. height: 150px;
  427. line-height: 150px;
  428. text-align: center;
  429. }
  430. </style>