index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  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. :isLook="isLook"
  180. ref="orderAuditDetail"
  181. v-if="orderVisible"
  182. @getList="getList"
  183. />
  184. <span slot="footer" class="dialog-footer">
  185. <el-button
  186. v-if="activeRow && activeRow.auditStatus == 'ING'"
  187. v-permission="'routeOrder/auditOutOrder/REJECT'"
  188. @click="submit('REJECT')"
  189. >驳回</el-button
  190. >
  191. <el-button
  192. v-if="activeRow && activeRow.auditStatus == 'ING'"
  193. v-permission="'routeOrder/auditOutOrder/PASS'"
  194. @click="submit('PASS')"
  195. type="primary"
  196. >审核通过</el-button
  197. >
  198. <el-button
  199. @click="orderVisible = false"
  200. v-if="activeRow && activeRow.auditStatus == 'REJECT' && !isLook"
  201. >取 消</el-button
  202. >
  203. <el-button
  204. v-if="activeRow && activeRow.auditStatus == 'REJECT' && !isLook"
  205. v-permission="'routeOrder/update'"
  206. @click="submitReaet"
  207. type="primary"
  208. >确 定</el-button
  209. >
  210. </span>
  211. </el-dialog>
  212. </div>
  213. </template>
  214. <script>
  215. // import axios from "axios";
  216. // import { getToken } from "@/utils/auth";
  217. import pagination from "@/components/Pagination/index";
  218. // import load from "@/utils/loading";
  219. // import { getEmployeeOrgan, getAddress, getCooperation } from "@/api/buildTeam";
  220. import { orderServerList, orderAuditTypeList } from "@/utils/searchArray";
  221. import orderAuditDetail from "./orderAuditDetail";
  222. import { getRouteOrderList } from "@/api/orderManager";
  223. import { goodsQuery } from "@/api/businessManager";
  224. // import { formatData } from "@/utils/utils";
  225. import Tooltip from "@/components/Tooltip/index";
  226. import saveform from "@/components/save-form";
  227. export default {
  228. components: { pagination, orderAuditDetail, Tooltip, saveform },
  229. data() {
  230. return {
  231. searchForm: {
  232. transNo: null,
  233. organId: null,
  234. auditStatus: "ING",
  235. type: null,
  236. },
  237. tableList: [],
  238. // organList: [],
  239. orderServerList,
  240. orderAuditTypeList,
  241. rules: {
  242. // 分页规则
  243. limit: 10, // 限制显示条数
  244. page: 1, // 当前页
  245. total: 0, // 总条数
  246. page_size: [10, 20, 40, 50], // 选择限制显示条数
  247. },
  248. orderVisible: false,
  249. activceId: null,
  250. activeRow: null,
  251. isLook: null,
  252. };
  253. },
  254. //生命周期 - 创建完成(可以访问当前this实例)
  255. created() {},
  256. //生命周期 - 挂载完成(可以访问DOM元素)
  257. mounted() {
  258. // getEmployeeOrgan().then((res) => {
  259. // if (res.code == 200) {
  260. // this.organList = res.data;
  261. // }
  262. // });
  263. // 获取分部
  264. this.$store.dispatch("setBranchs");
  265. goodsQuery({ rows: 99999 }).then((res) => {
  266. if (res.code === 200) {
  267. this.shopList = res.data.rows;
  268. }
  269. });
  270. this.init();
  271. },
  272. activated() {
  273. this.init();
  274. },
  275. methods: {
  276. init() {
  277. this.getList();
  278. },
  279. search() {
  280. this.$refs.searchForm.save(this.searchForm);
  281. this.rules.page = 1;
  282. this.getList();
  283. },
  284. onReSet() {
  285. this.searchForm = {
  286. transNo: null,
  287. organId: null,
  288. auditStatus: "ING",
  289. type: null,
  290. };
  291. this.search();
  292. },
  293. getList() {
  294. let params = this.searchForm;
  295. params.rows = this.rules.limit;
  296. params.page = this.rules.page;
  297. params.noneTqType = 1
  298. getRouteOrderList(params).then((res) => {
  299. if (res.code == 200) {
  300. this.tableList = res.data.rows;
  301. this.rules.total = res.data.total;
  302. this.orderVisible = false;
  303. }
  304. });
  305. },
  306. lookDetail(row) {
  307. this.activceId = row.id;
  308. this.activeRow = row;
  309. this.isLook = true;
  310. this.orderVisible = true;
  311. },
  312. resetDetail(row) {
  313. this.activceId = row.id;
  314. this.activeRow = row;
  315. this.isLook = false;
  316. this.orderVisible = true;
  317. },
  318. submit(str) {
  319. let message;
  320. str == "REJECT" ? (message = "驳回") : (message = "同意");
  321. this.$confirm(`是否${message}审核`, "提示", {
  322. confirmButtonText: "确定",
  323. cancelButtonText: "取消",
  324. type: "warning",
  325. })
  326. .then(() => {
  327. this.$refs.orderAuditDetail.auditOutOrder(str);
  328. })
  329. .catch(() => {});
  330. },
  331. submitReaet() {
  332. this.$confirm(`是否提交修改`, "提示", {
  333. confirmButtonText: "确定",
  334. cancelButtonText: "取消",
  335. type: "warning",
  336. })
  337. .then(() => {
  338. this.$refs.orderAuditDetail.submitReaet();
  339. })
  340. .catch(() => {});
  341. },
  342. },
  343. };
  344. </script>
  345. <style lang='scss' scoped>
  346. </style>