audit.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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="['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">
  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>
  130. <pagination
  131. v-show="total>0"
  132. :total="total"
  133. :page.sync="queryParams.pageNum"
  134. :limit.sync="queryParams.pageSize"
  135. @pagination="getList"
  136. />
  137. <el-drawer
  138. :with-header="false"
  139. size="75%"
  140. :title="show.title" :visible.sync="show.open" >
  141. <storeDetails ref="Details" @fresh="getList" @showClose="this.show.open = false"/>
  142. </el-drawer>
  143. </div>
  144. </template>
  145. <script>
  146. import { audit,listStore, exportStore } from "@/api/hisStore/store";
  147. import storeDetails from '../components/storeDetails.vue';
  148. import {getCitys} from "@/api/store/city";
  149. export default {
  150. name: "adutstore",
  151. components: { storeDetails },
  152. data() {
  153. return {
  154. show:{
  155. title:"店铺详情",
  156. open:false,
  157. },
  158. citys:[],
  159. licenseuploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
  160. uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
  161. baseUrl: process.env.VUE_APP_BASE_API,
  162. shippingTypeOptions: [{
  163. "label": "配送",
  164. "value": "1"
  165. }, {
  166. "label": "自提",
  167. "value": "2"
  168. }, {
  169. "label": "配送自提",
  170. "value": "3"
  171. }],
  172. // 遮罩层
  173. loading: true,
  174. // 导出遮罩层
  175. exportLoading: false,
  176. // 选中数组
  177. ids: [],
  178. // 非单个禁用
  179. single: true,
  180. // 非多个禁用
  181. multiple: true,
  182. // 显示搜索条件
  183. showSearch: true,
  184. // 总条数
  185. total: 0,
  186. // 店铺管理表格数据
  187. storeList: [],
  188. // 弹出层标题
  189. title: "",
  190. // 是否显示弹出层
  191. open: false,
  192. // 状态字典
  193. statusOptions: [],
  194. // 审核状态字典
  195. isAuditOptions: [],
  196. // 查询参数
  197. queryParams: {
  198. pageNum: 1,
  199. pageSize: 10,
  200. storeName: null,
  201. address: null,
  202. phone: null,
  203. status: null,
  204. isAudit: 0,
  205. account: null,
  206. },
  207. // 表单参数
  208. form: {},
  209. // 表单校验
  210. rules: {
  211. storeName: [
  212. { required: true, message: "店铺名称不能为空", trigger: "blur" }
  213. ],
  214. logoUrl: [
  215. { required: true, message: "店铺LOGO不能为空", trigger: "blur" }
  216. ],
  217. cityIds: [
  218. { required: true, message: "所属城市不能为空", trigger: "blur" }
  219. ],
  220. address: [
  221. { required: true, message: "地址不能为空", trigger: "blur" }
  222. ],
  223. licenseImages: [
  224. { required: true, message: "资质证书不能为空", trigger: "blur" }
  225. ],
  226. shippingType: [
  227. { required: true, message: "配送方式不能为空", trigger: "blur" }
  228. ],
  229. phone: [
  230. { required: true, message: "店铺电话不能为空", trigger: "blur" }
  231. ],
  232. }
  233. };
  234. },
  235. created() {
  236. this.getCitys();
  237. this.getList();
  238. this.getDicts("sys_company_status").then(response => {
  239. this.statusOptions = response.data;
  240. });
  241. this.getDicts("sys_company_isaudit").then(response => {
  242. this.isAuditOptions = response.data;
  243. });
  244. },
  245. methods: {
  246. handleUpdate(row){
  247. var that=this;
  248. var the=null;
  249. this.$confirm('是否确认审核?', "审核", {
  250. distinguishCancelAndClose: true,
  251. confirmButtonText: "确定",
  252. cancelButtonText: "驳回",
  253. type: "warning"
  254. }).then(function() {
  255. var data={
  256. storeId:row.storeId,
  257. isAudit:1
  258. }
  259. return audit(data);
  260. }).then(() => {
  261. this.msgSuccess("操作成功");
  262. this.getList();
  263. }).catch(function(action) {
  264. if (action === 'cancel') {
  265. var data={
  266. storeId:row.storeId,
  267. isAudit:-1
  268. }
  269. the='cancel';
  270. return audit(data);
  271. }
  272. }).then(() => {
  273. if(the==='cancel'){
  274. this.msgSuccess("操作成功");
  275. this.getList();
  276. }
  277. });
  278. },
  279. handledetails(row){
  280. this.show.open=true;
  281. setTimeout(() => {
  282. this.$refs.Details.getDetails(row.storeId);
  283. }, 1);
  284. },
  285. handleCityChange(value) {
  286. var nodes=this.$refs.citySelect.getCheckedNodes();
  287. this.form.address=nodes[0].pathLabels[0]+nodes[0].pathLabels[1]+nodes[0].pathLabels[2];
  288. this.form.cityIds=value.toString();
  289. },
  290. getCitys(){
  291. getCitys().then(res => {
  292. this.loading = false;
  293. this.citys=res.data;
  294. })
  295. },
  296. licensehandleAvatarSuccess(res, file) {
  297. if(res.code==200){
  298. this.form.licenseImages=res.url;
  299. this.$forceUpdate()
  300. }
  301. else{
  302. this.msgError(res.msg);
  303. }
  304. },
  305. handleAvatarSuccess(res, file) {
  306. if(res.code==200){
  307. this.form.logoUrl=res.url;
  308. this.$forceUpdate()
  309. }
  310. else{
  311. this.msgError(res.msg);
  312. }
  313. },
  314. beforeAvatarUpload(file) {
  315. const isLt1M = file.size / 1024 / 1024 < 1;
  316. if (!isLt1M) {
  317. this.$message.error('上传图片大小不能超过 1MB!');
  318. }
  319. return isLt1M;
  320. },
  321. handleClickX(){
  322. this.getList()
  323. },
  324. /** 查询店铺管理列表 */
  325. getList() {
  326. this.loading = true;
  327. listStore(this.queryParams).then(response => {
  328. this.storeList = response.rows;
  329. this.total = response.total;
  330. this.loading = false;
  331. });
  332. },
  333. // 取消按钮
  334. cancel() {
  335. this.open = false;
  336. this.reset();
  337. },
  338. // 表单重置
  339. reset() {
  340. this.form = {
  341. storeId: null,
  342. cityIds: null,
  343. storeName: null,
  344. descs: null,
  345. logoUrl: null,
  346. address: null,
  347. lng: null,
  348. lat: null,
  349. phone: null,
  350. licenseImages: null,
  351. productCount: null,
  352. status: 0,
  353. createTime: null,
  354. updateTime: null,
  355. salesCount: null,
  356. balance: null,
  357. totalMoney: null,
  358. isAudit: 0,
  359. account: null,
  360. password: null,
  361. shippingType: ["1"]
  362. };
  363. this.resetForm("form");
  364. },
  365. /** 搜索按钮操作 */
  366. handleQuery() {
  367. this.queryParams.pageNum = 1;
  368. this.getList();
  369. },
  370. /** 重置按钮操作 */
  371. resetQuery() {
  372. this.resetForm("queryForm");
  373. this.handleQuery();
  374. },
  375. // 多选框选中数据
  376. handleSelectionChange(selection) {
  377. this.ids = selection.map(item => item.storeId)
  378. this.single = selection.length!==1
  379. this.multiple = !selection.length
  380. },
  381. /** 导出按钮操作 */
  382. handleExport() {
  383. const queryParams = this.queryParams;
  384. this.$confirm('是否确认导出所有店铺管理数据项?', "警告", {
  385. confirmButtonText: "确定",
  386. cancelButtonText: "取消",
  387. type: "warning"
  388. }).then(() => {
  389. this.exportLoading = true;
  390. return exportStore(queryParams);
  391. }).then(response => {
  392. this.download(response.msg);
  393. this.exportLoading = false;
  394. }).catch(() => {});
  395. }
  396. }
  397. };
  398. </script>
  399. <style>
  400. .avatar-uploader .el-upload {
  401. border: 1px dashed #d9d9d9;
  402. border-radius: 6px;
  403. cursor: pointer;
  404. position: relative;
  405. overflow: hidden;
  406. }
  407. .avatar-uploader .el-upload:hover {
  408. border-color: #409EFF;
  409. }
  410. .avatar-uploader-icon {
  411. font-size: 28px;
  412. color: #8c939d;
  413. width: 150px;
  414. height: 150px;
  415. line-height: 150px;
  416. text-align: center;
  417. }
  418. </style>