index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 订单审核
  7. </h2>
  8. <div class="m-core">
  9. <saveform
  10. ref="searchForm"
  11. :model.sync="searchForm"
  12. inline
  13. style="margin-top: 20px"
  14. >
  15. <el-form-item>
  16. <el-input
  17. v-model.trim="searchForm.transNo"
  18. @keyup.enter.native="transNo"
  19. clearable
  20. placeholder="交易流水号"
  21. ></el-input>
  22. </el-form-item>
  23. <el-form-item prop="organId">
  24. <el-select
  25. class="multiple"
  26. v-model.trim="searchForm.organId"
  27. filterable
  28. clearable
  29. placeholder="请选择分部"
  30. >
  31. <el-option
  32. v-for="(item, index) in selects.branchs"
  33. :key="index"
  34. :label="item.name"
  35. :value="item.id"
  36. ></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-select
  41. class="multiple"
  42. v-model.trim="searchForm.type"
  43. filterable
  44. clearable
  45. placeholder="请选择申请类型"
  46. >
  47. <el-option
  48. v-for="(item, index) in orderServerList"
  49. :key="index"
  50. :label="item.label"
  51. :value="item.value"
  52. ></el-option>
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item>
  56. <el-select
  57. class="multiple"
  58. v-model.trim="searchForm.auditStatus"
  59. placeholder="请选择审核状态"
  60. >
  61. <el-option
  62. v-for="(item, index) in orderAuditTypeList"
  63. :key="index"
  64. :label="item.label"
  65. :value="item.value"
  66. ></el-option>
  67. </el-select>
  68. </el-form-item>
  69. <el-form-item>
  70. <el-button @click="search" type="danger">搜索</el-button>
  71. <el-button @click="onReSet" type="primary">重置</el-button>
  72. </el-form-item>
  73. </saveform>
  74. <div class="tableWrap">
  75. <el-table
  76. style="width: 100%"
  77. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  78. :data="tableList"
  79. >
  80. <el-table-column align="center" prop="transNo" label="交易流水号">
  81. <template slot-scope="scope">
  82. <div>
  83. <copy-text>{{ scope.row.transNo }}</copy-text>
  84. </div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column
  88. align="center"
  89. prop="organ.name"
  90. label="分部"
  91. >
  92. <template slot-scope="scope">
  93. <div>
  94. <copy-text>{{ scope.row.organ.name }}</copy-text>
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column
  99. align="center"
  100. prop="cooperationOrgan.name"
  101. label="学校名称"
  102. ></el-table-column>
  103. <el-table-column align="center" prop="serviceAmount" label="服务收入">
  104. </el-table-column>
  105. <el-table-column
  106. align="center"
  107. prop="saleAmount"
  108. label="销售收入"
  109. ></el-table-column>
  110. <!-- <el-table-column align="center"
  111. prop="memo"
  112. label="备注">
  113. <template slot-scope="scope">
  114. <Tooltip :content="scope.row.memo?scope.row.memo:''" />
  115. </template>
  116. </el-table-column> -->
  117. <el-table-column
  118. align="center"
  119. prop="operator.username"
  120. label="申请人"
  121. ></el-table-column>
  122. <el-table-column align="center" prop="auditStatus" label="状态">
  123. <template slot-scope="scope">
  124. <div>
  125. <p v-if="scope.row.auditStatus">
  126. {{ scope.row.auditStatus | orderAuditType }}
  127. </p>
  128. <p v-else>{{ "审核通过" }}</p>
  129. </div>
  130. </template>
  131. </el-table-column>
  132. <el-table-column align="center" prop="payTime" label="交易日期">
  133. <template slot-scope="scope">
  134. <div>
  135. {{ scope.row.payTime | dateForMinFormat }}
  136. </div>
  137. </template>
  138. </el-table-column>
  139. <el-table-column align="center" prop="createTime" label="申请时间">
  140. <template slot-scope="scope">
  141. <div>
  142. {{ scope.row.createTime | dateForMinFormat }}
  143. </div>
  144. </template>
  145. </el-table-column>
  146. <el-table-column align="center" prop="studentId" label="操作">
  147. <template slot-scope="scope">
  148. <div>
  149. <auth :auths="scope.row.auditStatus == 'ING' ? 'routeOrder/auditOutOrder/shenghe' : 'routeOrder/query/detail'">
  150. <el-button
  151. type="text"
  152. @click="lookDetail(scope.row)"
  153. >{{ scope.row.auditStatus == 'ING' ? '审核' : '查看' }}</el-button>
  154. </auth>
  155. <auth auths="routeOrder/update" v-if="scope.row.auditStatus == 'REJECT'">
  156. <el-button
  157. type="text"
  158. @click="resetDetail(scope.row)"
  159. >修改</el-button>
  160. </auth>
  161. </div>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. <pagination
  166. sync
  167. :total.sync="rules.total"
  168. :page.sync="rules.page"
  169. :limit.sync="rules.limit"
  170. :page-sizes="rules.page_size"
  171. @pagination="getList"
  172. />
  173. </div>
  174. </div>
  175. <el-dialog title="审核详情" :visible.sync="orderVisible" width="600px">
  176. <orderAuditDetail
  177. :orderId="activceId"
  178. :shopList="shopList"
  179. :organList="organList"
  180. :isLook="isLook"
  181. ref="orderAuditDetail"
  182. v-if="orderVisible"
  183. @getList="getList"
  184. />
  185. <span slot="footer" class="dialog-footer">
  186. <el-button
  187. v-if="activeRow && activeRow.auditStatus == 'ING'"
  188. v-permission="'routeOrder/auditOutOrder/REJECT'"
  189. @click="submit('REJECT')"
  190. >驳回</el-button
  191. >
  192. <el-button
  193. v-if="activeRow && activeRow.auditStatus == 'ING'"
  194. v-permission="'routeOrder/auditOutOrder/PASS'"
  195. @click="submit('PASS')"
  196. type="primary"
  197. >审核通过</el-button
  198. >
  199. <el-button
  200. @click="orderVisible = false"
  201. v-if="activeRow && activeRow.auditStatus == 'REJECT' && !isLook"
  202. >取 消</el-button
  203. >
  204. <el-button
  205. v-if="activeRow && activeRow.auditStatus == 'REJECT' && !isLook"
  206. v-permission="'routeOrder/update'"
  207. @click="submitReaet"
  208. type="primary"
  209. >确 定</el-button
  210. >
  211. </span>
  212. </el-dialog>
  213. </div>
  214. </template>
  215. <script>
  216. // import axios from "axios";
  217. // import { getToken } from "@/utils/auth";
  218. import pagination from "@/components/Pagination/index";
  219. // import load from "@/utils/loading";
  220. // import { getEmployeeOrgan, getAddress, getCooperation } from "@/api/buildTeam";
  221. import { orderServerList, orderAuditTypeList } from "@/utils/searchArray";
  222. import orderAuditDetail from "./orderAuditDetail";
  223. import { getRouteOrderList } from "@/api/orderManager";
  224. import { goodsQuery } from "@/api/businessManager";
  225. // import { formatData } from "@/utils/utils";
  226. import Tooltip from "@/components/Tooltip/index";
  227. import saveform from "@/components/save-form";
  228. export default {
  229. components: { pagination, orderAuditDetail, Tooltip, saveform },
  230. data() {
  231. return {
  232. searchForm: {
  233. transNo: null,
  234. organId: null,
  235. auditStatus: "ING",
  236. type: null,
  237. },
  238. tableList: [],
  239. organList: [],
  240. orderServerList,
  241. orderAuditTypeList,
  242. rules: {
  243. // 分页规则
  244. limit: 10, // 限制显示条数
  245. page: 1, // 当前页
  246. total: 0, // 总条数
  247. page_size: [10, 20, 40, 50], // 选择限制显示条数
  248. },
  249. orderVisible: false,
  250. activceId: null,
  251. activeRow: null,
  252. isLook: null,
  253. };
  254. },
  255. //生命周期 - 创建完成(可以访问当前this实例)
  256. created() {},
  257. //生命周期 - 挂载完成(可以访问DOM元素)
  258. mounted() {
  259. // getEmployeeOrgan().then((res) => {
  260. // if (res.code == 200) {
  261. // this.organList = res.data;
  262. // }
  263. // });
  264. // 获取分部
  265. this.$store.dispatch("setBranchs");
  266. goodsQuery({ rows: 99999 }).then((res) => {
  267. if (res.code === 200) {
  268. this.shopList = res.data.rows;
  269. }
  270. });
  271. this.init();
  272. },
  273. activated() {
  274. this.init();
  275. },
  276. methods: {
  277. init() {
  278. this.getList();
  279. },
  280. search() {
  281. this.$refs.searchForm.save(this.searchForm);
  282. this.rules.page = 1;
  283. this.getList();
  284. },
  285. onReSet() {
  286. this.searchForm = {
  287. transNo: null,
  288. organId: null,
  289. auditStatus: "ING",
  290. type: null,
  291. };
  292. this.search();
  293. },
  294. getList() {
  295. let params = this.searchForm;
  296. params.rows = this.rules.limit;
  297. params.page = this.rules.page;
  298. params.noneTqType = 1
  299. getRouteOrderList(params).then((res) => {
  300. if (res.code == 200) {
  301. this.tableList = res.data.rows;
  302. this.rules.total = res.data.total;
  303. this.orderVisible = false;
  304. }
  305. });
  306. },
  307. lookDetail(row) {
  308. this.activceId = row.id;
  309. this.activeRow = row;
  310. this.isLook = true;
  311. this.orderVisible = true;
  312. },
  313. resetDetail(row) {
  314. this.activceId = row.id;
  315. this.activeRow = row;
  316. this.isLook = false;
  317. this.orderVisible = true;
  318. },
  319. submit(str) {
  320. let message;
  321. str == "REJECT" ? (message = "驳回") : (message = "同意");
  322. this.$confirm(`是否${message}审核`, "提示", {
  323. confirmButtonText: "确定",
  324. cancelButtonText: "取消",
  325. type: "warning",
  326. })
  327. .then(() => {
  328. this.$refs.orderAuditDetail.auditOutOrder(str);
  329. })
  330. .catch(() => {});
  331. },
  332. submitReaet() {
  333. this.$confirm(`是否提交修改`, "提示", {
  334. confirmButtonText: "确定",
  335. cancelButtonText: "取消",
  336. type: "warning",
  337. })
  338. .then(() => {
  339. this.$refs.orderAuditDetail.submitReaet();
  340. })
  341. .catch(() => {});
  342. },
  343. },
  344. };
  345. </script>
  346. <style lang='scss' scoped>
  347. </style>