artificial_orders.vue 9.5 KB

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