artificial_orders.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <div id="cloud-balance">
  3. <!-- <section class="top"> -->
  4. <!-- <h3>交易订单中心</h3> -->
  5. <!-- <section> -->
  6. <div class="type-boxs">
  7. <div class="clear">
  8. <div class="floatr">
  9. <el-button type="primary" @click="createOrder()">新增订单</el-button>
  10. <el-button @click="downFinanceList">导出报表</el-button>
  11. </div>
  12. </div>
  13. </div>
  14. <!-- </section> -->
  15. <!-- </section> -->
  16. <div class="trcenter" style="height: calc(100%) ">
  17. <!-- height="250" -->
  18. <el-table :data="finaceList" border style="width: 100%;" height="100%">
  19. <el-table-column label="订单名称">
  20. <template slot-scope="scope">
  21. <!-- @click="clickDev(scope.row.uid)" -->
  22. <span class="lblue point">
  23. <nuxt-link
  24. :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
  25. >{{scope.row.product_title}}</nuxt-link>
  26. </span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="用户">
  30. <template slot-scope="scope">{{scope.row.user_info.nickname}}({{scope.row.uid }})</template>
  31. </el-table-column>
  32. <el-table-column label="实际金额">
  33. <template slot-scope="scope">
  34. <span
  35. v-if="parseInt(scope.row.real_amount)>=0"
  36. class="green"
  37. >+{{(scope.row.real_amount/100).toFixed(2)}}</span>
  38. <span v-else class="orange">{{(scope.row.real_amount/100).toFixed(2)}}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="收支类型">
  42. <template slot-scope="scope">
  43. <span>{{parseInt(scope.row.real_amount)>=0?"收入":"支出"}}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column prop="channel" label="支付方式"></el-table-column>
  47. <el-table-column prop="order_state_name" label="交易状态">
  48. <template slot-scope="scope">
  49. <span>{{scope.row.order_type_name}}</span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column prop="order_state_name" width="100" label="订单状态">
  53. <template slot-scope="scope">
  54. {{scope.row.order_state_name}}
  55. <!-- order_type -->
  56. <!-- <span v-if="scope.row.state==1" class="state-success state-border">成功</span>
  57. <span v-if="scope.row.state==2" class="state-wait state-border">待提交</span>
  58. <span v-if="scope.row.state==3" class="state-load state-border">提交中</span>
  59. <span v-if="scope.row.state==4" class="state-faile state-border">失败</span>-->
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="创建时间">
  63. <template slot-scope="scope">
  64. <span>{{formatDate(scope.row.created_at)}}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column prop="operator_uid" label="创建者">
  68. <template slot-scope="scope">
  69. <span>{{scope.row.operator_info.nickname}}</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column prop="order_no" label="订单编号"></el-table-column>
  73. <el-table-column prop="out_order_id" label="支付编号"></el-table-column>
  74. <el-table-column label="关联项目">
  75. <template slot-scope="scope">
  76. <a :href="scope.row.related_project.url?scope.row.related_project.url:'#'">
  77. <span
  78. class="lblue"
  79. >{{scope.row.related_project.name?scope.row.related_project.name:"--"}}</span>
  80. </a>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="编辑">
  84. <template slot-scope="scope">
  85. <!-- 需求是状态等于“待提交的时候显示”给我一个状态_name 或者是待提交的id -->
  86. <nuxt-link :to="{path:'/main/artificial_order/?type=edit&id='+scope.row.order_no}">
  87. <span v-if="scope.row.status==0" class="lblue point">编辑</span>
  88. </nuxt-link>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. </div>
  93. <div class="order-footer">
  94. <el-pagination
  95. background
  96. @current-change="getFinanceList"
  97. @size-change="changePageSize"
  98. :current-page.sync="currentPage"
  99. :page-sizes="[10, 20, 30, 40]"
  100. :page-size="20"
  101. layout="total, sizes, prev, pager, next, jumper"
  102. :total="totalCount"
  103. ></el-pagination>
  104. </div>
  105. </div>
  106. </template>
  107. <script>
  108. const tableHeaders = [
  109. "项目ID",
  110. "核定价格",
  111. "托管费用",
  112. "押金",
  113. "次月托管",
  114. "结算周期",
  115. "结算金额",
  116. "退回金额",
  117. "预计发薪",
  118. "发薪日期",
  119. "状态",
  120. "负责人",
  121. "操作",
  122. "备注",
  123. "项目状态",
  124. "账单ID",
  125. "企业方",
  126. "开发者",
  127. "试用天数"
  128. ];
  129. const tableProps = [
  130. "job_id",
  131. "salary",
  132. "company_pay",
  133. "p_company_deposit",
  134. "next_period_pay",
  135. "payAround",
  136. "pay_to_dev",
  137. "return_money",
  138. "pre_send_salary_timeShow", //
  139. "send_salary_time",
  140. "p_status_name",
  141. "chk_user",
  142. "operate",
  143. "settle_msg",
  144. "j_status_name",
  145. "id",
  146. "company",
  147. "dev_realname",
  148. "probation_days"
  149. ];
  150. const tableWidths = [
  151. "80",
  152. "80",
  153. "100",
  154. "80",
  155. "100",
  156. "120",
  157. "80",
  158. "80",
  159. "90",
  160. "80",
  161. "80",
  162. "100",
  163. "80",
  164. "180",
  165. "80",
  166. "80",
  167. "100",
  168. "100",
  169. "80"
  170. ];
  171. export default {
  172. data() {
  173. return {
  174. tradeList: [
  175. {
  176. id: 0,
  177. type: "全部"
  178. },
  179. {
  180. id: 1,
  181. type: "充值"
  182. },
  183. {
  184. id: 2,
  185. type: "提现"
  186. },
  187. {
  188. id: 3,
  189. type: "购买"
  190. },
  191. {
  192. id: 4,
  193. type: "购买"
  194. }
  195. ],
  196. finaceList: [],
  197. // 下发的总数据
  198. totalData: {},
  199. // 项目ID
  200. jobID: "",
  201. // 审核人
  202. period: "",
  203. status: "",
  204. // 负责人
  205. checkUser: "",
  206. // 审核人列表
  207. periodStatusList: [],
  208. // 数据总条目
  209. totalCount: 1,
  210. currentPage: 1,
  211. currentPageSize: 20,
  212. // 列表宽度
  213. tableWidths,
  214. // 列表头显示内容
  215. tableHeaders,
  216. // 列表头字段
  217. tableProps,
  218. // 列表数据
  219. tableData: [],
  220. localData: {
  221. env: "test"
  222. }
  223. };
  224. },
  225. computed: {
  226. isTest() {
  227. return this.localData.env === "test";
  228. }
  229. },
  230. mounted() {
  231. // this.getTableData();
  232. this.getFinanceList();
  233. },
  234. methods: {
  235. clickDev(uid) {
  236. this.$router.push({ path: "/main/orders_detail", params: { id: uid } });
  237. },
  238. changePageSize(val) {
  239. this.getFinanceList();
  240. },
  241. // 格式化列表数据
  242. formatTableData(data) {
  243. return data.map(i => ({
  244. ...i,
  245. payAround: `${i.start_time}<br>${i.end_time}`,
  246. pre_send_salary_timeShow: new Date(
  247. i.pre_send_salary_time * 1000
  248. ).toLocaleDateString()
  249. }));
  250. },
  251. formatDate(time) {
  252. var now = new Date(time * 1000);
  253. var year = now.getFullYear();
  254. var month = now.getMonth() + 1;
  255. var date = now.getDate();
  256. var hour = now.getHours();
  257. var minute = now.getMinutes();
  258. var second = now.getSeconds();
  259. if (hour < 10) {
  260. hour = "0" + hour;
  261. }
  262. if (minute < 10) {
  263. minute = "0" + minute;
  264. }
  265. if (second < 10) {
  266. second = "0" + second;
  267. }
  268. return (
  269. year +
  270. "-" +
  271. month +
  272. "-" +
  273. date +
  274. " " +
  275. hour +
  276. ":" +
  277. minute +
  278. ":" +
  279. second
  280. );
  281. },
  282. // 获取列表数据
  283. async getFinanceList() {
  284. let body = {
  285. page: this.currentPage,
  286. page_size: this.currentPageSize,
  287. artificial_mark: 1
  288. };
  289. const res = await this.$post("/api/admin/order/get_orders", body);
  290. var data = res.data;
  291. this.finaceList = data.orders;
  292. this.totalCount = Number(data.count);
  293. },
  294. async downFinanceList() {
  295. let body = {
  296. page: this.currentPage,
  297. page_size: this.currentPageSize,
  298. artificial_mark: 1
  299. };
  300. // const res = await this.$get("/api/admin/order/get_orders", body);
  301. // http://local-rooter.proginn.com:20201/api/admin/order/get_orders?page=1&page_size=20&artificial_mark=1
  302. var url =
  303. window.location.host + "/api/admin/order/export?" + "artificial_mark=1";
  304. console.log(url);
  305. window.location.href = "http://" + url;
  306. },
  307. createOrder() {
  308. this.$router.push({
  309. path: "artificial_order/",
  310. query: {
  311. type: "create"
  312. }
  313. });
  314. }
  315. }
  316. };
  317. </script>
  318. <style scoped>
  319. .order-footer {
  320. position: absolute;
  321. bottom: 10px;
  322. left: 10px;
  323. }
  324. #order-wrap {
  325. width: 100%;
  326. }
  327. #cloud-balance {
  328. white-space: nowrap;
  329. overflow-x: scroll;
  330. height: calc(100% - 40px);
  331. }
  332. .top {
  333. display: flex;
  334. flex-direction: column;
  335. justify-content: center;
  336. height: 270px;
  337. }
  338. .selector-box {
  339. /* margin-top: 10px; */
  340. }
  341. .selector-box {
  342. display: flex;
  343. justify-content: space-between;
  344. }
  345. /* .selector-box-left {
  346. } */
  347. .table {
  348. margin-top: 10px;
  349. height: calc(100% - 320px);
  350. }
  351. .order-table {
  352. /* height: calc(100% - 300px); */
  353. }
  354. .end-row {
  355. background: rgba(0, 0, 0, 0.1);
  356. }
  357. .inlineb {
  358. display: inline-block;
  359. }
  360. .vsub {
  361. vertical-align: sub;
  362. }
  363. .type-boxs {
  364. margin-bottom: 10px;
  365. }
  366. .green {
  367. color: rgba(37, 155, 36, 1);
  368. }
  369. .orange {
  370. color: rgba(255, 152, 0, 1);
  371. }
  372. .state-success {
  373. display: inline-block;
  374. padding: 0px 8px;
  375. text-align: center;
  376. border: 1px solid rgb(48, 142, 255);
  377. }
  378. .state-wait {
  379. display: inline-block;
  380. padding: 0px 8px;
  381. text-align: center;
  382. border: 1px solid rgb(134, 130, 130);
  383. }
  384. .state-load {
  385. display: inline-block;
  386. padding: 0px 8px;
  387. text-align: center;
  388. border: 1px solid rgb(37, 155, 36);
  389. }
  390. .state-faile {
  391. display: inline-block;
  392. padding: 0px 8px;
  393. text-align: center;
  394. border: 1px solid rgb(229, 28, 35);
  395. }
  396. </style>