index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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="companyId">
  5. <el-select filterable v-model="queryParams.companyId" placeholder="请选择公司名" @change="companyChange" clearable size="small">
  6. <el-option
  7. v-for="item in companys"
  8. :key="item.companyId"
  9. :label="item.companyName"
  10. :value="item.companyId"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="所属员工" prop="companyUserName">
  15. <el-input
  16. v-model="queryParams.companyUserName"
  17. placeholder="请输入所属员工昵称"
  18. clearable
  19. size="small"
  20. @keyup.enter.native="handleQuery"
  21. />
  22. </el-form-item>
  23. <el-form-item>
  24. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  25. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  26. </el-form-item>
  27. </el-form>
  28. <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
  29. <el-tab-pane label="全部" name="00"></el-tab-pane>
  30. <el-tab-pane label="待销售审批" name="0"></el-tab-pane>
  31. <el-tab-pane label="销售审批拒绝" name="1"></el-tab-pane>
  32. <el-tab-pane label="待总后台审核" name="2"></el-tab-pane>
  33. <el-tab-pane label="总后台审核拒绝" name="3"></el-tab-pane>
  34. <el-tab-pane label="审核通过" name="4"></el-tab-pane>
  35. </el-tabs>
  36. <el-table height="500" border v-loading="loading" :data="storeOrderAuditList" :key="tableKey">
  37. <el-table-column label="订单号" align="center" prop="orderCode" width="200" />
  38. <el-table-column label="所属公司" align="center" prop="companyName" />
  39. <el-table-column label="所属员工" align="center" prop="companyUserName" />
  40. <el-table-column label="审核状态" align="center" prop="status" >
  41. <template slot-scope="scope">
  42. <el-tag prop="status" v-for="item in statusOptions"
  43. :type="item.type"
  44. v-if="scope.row.auditStatus === item.dictValue">
  45. {{item.dictLabel}}
  46. </el-tag>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="销售审核时间" align="center" prop="companyAuditTime" />
  50. <el-table-column label="销售审核人" align="center" prop="companyAuditUserName" />
  51. <el-table-column label="总后台审核时间" align="center" prop="adminAuditTime" />
  52. <el-table-column label="总后台审核人" align="center" prop="adminAuditUserName" />
  53. <el-table-column label="被拒原因" align="center" prop="reason" show-overflow-tooltip />
  54. <el-table-column label="提交时间" align="center" prop="createTime" />
  55. <el-table-column label="操作" fixed="right" align="center" width="80" class-name="small-padding fixed-width">
  56. <template slot-scope="scope">
  57. <el-popover
  58. v-if="scope.row.auditStatus === 2"
  59. placement="right"
  60. trigger="click"
  61. :ref="'popover_' + scope.row.id">
  62. <el-button size="mini" type="success" @click="handlePass(scope.row)">通过</el-button>
  63. <el-button size="mini" type="danger" @click="handleAudit(scope.row)">拒绝</el-button>
  64. <el-button
  65. slot="reference"
  66. size="mini"
  67. type="text"
  68. v-hasPermi="['store:storeOrderAudit:audit']"
  69. >审核订单</el-button>
  70. </el-popover>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <pagination
  75. v-show="total>0"
  76. :total="total"
  77. :page.sync="queryParams.pageNum"
  78. :limit.sync="queryParams.pageSize"
  79. @pagination="getList"
  80. />
  81. <el-dialog :title="show.title" :visible.sync="show.open" width="500px" append-to-body>
  82. <el-form ref="auditForm" :model="auditForm" :rules="auditRules" label-width="80px">
  83. <el-form-item label="拒绝原因" prop="reviewContent">
  84. <el-input
  85. type="textarea"
  86. v-model="auditForm.reviewContent"
  87. placeholder="请输入拒绝原因"
  88. />
  89. </el-form-item>
  90. </el-form>
  91. <div slot="footer" class="dialog-footer">
  92. <el-button type="primary" @click="handleReject">确定</el-button>
  93. <el-button @click="cancelAudit">关闭</el-button>
  94. </div>
  95. </el-dialog>
  96. </div>
  97. </template>
  98. <script>
  99. import { getCompanyList } from "@/api/company/company";
  100. import {list, audit} from "@/api/store/storeOrderAudit";
  101. export default {
  102. name: "StoreOrderAudit",
  103. data() {
  104. const statusOptions = [
  105. {
  106. dictLabel: "待销售审批",
  107. dictValue: 0,
  108. type: ''
  109. },
  110. {
  111. dictLabel: "销售审批拒绝",
  112. dictValue: 1,
  113. type: 'danger'
  114. },
  115. {
  116. dictLabel: "待总后台审核",
  117. dictValue: 2,
  118. type: ''
  119. },
  120. {
  121. dictLabel: "总后台审核拒绝",
  122. dictValue: 3,
  123. type: 'danger'
  124. },
  125. {
  126. dictLabel: "审核通过",
  127. dictValue: 4,
  128. type: 'success'
  129. }
  130. ]
  131. return {
  132. tableKey: 0,
  133. showSearch: true,
  134. companys: [],
  135. total: 0,
  136. queryParams: {
  137. pageNum: 1,
  138. pageSize: 10,
  139. companyId: null,
  140. companyUserName: null,
  141. auditStatus: null
  142. },
  143. activeName: '00',
  144. loading: false,
  145. storeOrderAuditList: [],
  146. statusOptions: statusOptions,
  147. show: {
  148. open: false,
  149. title: "审核订单"
  150. },
  151. auditForm: {
  152. auditId: null,
  153. reviewType: null,
  154. reviewContent: ''
  155. },
  156. auditRules: {
  157. reviewContent: [
  158. { required: true, message: "请输入拒绝原因", trigger: "blur" }
  159. ]
  160. },
  161. currentRowId: null,
  162. }
  163. },
  164. created() {
  165. this.getCompanyOptions()
  166. this.handleQuery()
  167. },
  168. activated() {
  169. this.tableKey = Date.now()
  170. },
  171. methods: {
  172. getCompanyOptions() {
  173. getCompanyList().then(response => {
  174. this.companys = response.data
  175. })
  176. },
  177. handleQuery() {
  178. this.queryParams.pageNum = 1
  179. this.getList()
  180. },
  181. resetQuery() {
  182. this.resetForm("queryForm");
  183. this.handleQuery();
  184. },
  185. getList() {
  186. this.loading = true
  187. list(this.queryParams).then(response => {
  188. const {rows, total} = response
  189. this.storeOrderAuditList = rows
  190. this.total = total
  191. this.loading = false
  192. })
  193. },
  194. handleClick(tab) {
  195. this.queryParams.auditStatus = tab.name === '00' ? null : tab.name
  196. this.handleQuery()
  197. },
  198. companyChange(val) {
  199. this.queryParams.companyId = val
  200. },
  201. handleAudit(row) {
  202. this.currentRowId = row.id
  203. this.auditForm.auditId = row.id;
  204. this.auditForm.reviewType = 0;
  205. this.show.open = true;
  206. },
  207. handlePass(row) {
  208. this.currentRowId = row.id
  209. this.auditForm.auditId = row.id;
  210. this.auditForm.reviewType = 1;
  211. this.submitAudit();
  212. },
  213. handleReject() {
  214. this.$refs["auditForm"].validate(valid => {
  215. if (valid) {
  216. this.submitAudit();
  217. }
  218. });
  219. },
  220. submitAudit() {
  221. audit(this.auditForm).then(response => {
  222. const {msg} = response
  223. this.msgSuccess(msg);
  224. this.show.open = false;
  225. this.$refs['popover_' + this.currentRowId].doClose();
  226. this.getList();
  227. this.resetAuditForm();
  228. });
  229. },
  230. cancelAudit() {
  231. this.show.open = false;
  232. this.resetAuditForm();
  233. },
  234. resetAuditForm() {
  235. this.auditForm = {
  236. auditId: null,
  237. reviewType: null,
  238. reviewContent: ''
  239. };
  240. this.$refs["auditForm"]?.resetFields();
  241. }
  242. }
  243. }
  244. </script>
  245. <style scoped>
  246. </style>