index.vue 11 KB

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