kaifabao.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. <template>
  2. <div>
  3. <div style="margin-bottom: 4px">
  4. <span class="left-title">历史数据:</span>
  5. <el-radio-group v-model="tabUrl" size="small" @change="onToUrl">
  6. <el-radio-button label="gongmao">工猫提现记录</el-radio-button>
  7. <el-radio-button label="qingtuanbao">青团宝提现记录</el-radio-button>
  8. </el-radio-group>
  9. </div>
  10. <div>
  11. <span class="left-title">领薪宝配置:</span>
  12. <el-radio-group v-model="tab" size="small" @change="getList">
  13. <el-radio-button label="service">领薪宝服务配置</el-radio-button>
  14. <el-radio-button label="salary">领薪宝结薪订单</el-radio-button>
  15. <el-radio-button label="withdrawal">领薪宝提现订单</el-radio-button>
  16. <el-radio-button label="verify">发票审核</el-radio-button>
  17. </el-radio-group>
  18. </div>
  19. <div class="t-content">
  20. <template v-if="tab ==='service'">
  21. <div class="t-title">
  22. <span class="left-title">基本服务配置</span>
  23. </div>
  24. <el-table border :data="basicConfigData" style="width: 100%">
  25. <el-table-column prop="config_key" label="键" width="180"></el-table-column>
  26. <el-table-column prop="description" label="描述" width="180">
  27. <template slot-scope="scope">
  28. <span v-html="scope.row.description?scope.row.description.substring(0,9):''"></span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column prop="value" label="值">
  32. <template slot-scope="scope">
  33. <span v-html="scope.row.value?scope.row.value.substring(0,20):''"></span>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="操作">
  37. <template slot-scope="scope">
  38. <el-link icon="el-icon-edit" @click="onBasicEdit(scope.row)">编辑</el-link>
  39. </template>
  40. </el-table-column>
  41. </el-table>
  42. <div class="t-title">
  43. <span class="left-title">
  44. 扣费方式配置
  45. <el-button size="medium" @click="onAddService">添加扣税方式</el-button>
  46. </span>
  47. </div>
  48. <el-table border :data="serviceData" style="width: 100%">
  49. <el-table-column prop="config_key" label="扣税方式" width="180">
  50. <template slot-scope="scope">
  51. <span>{{ scope.row.config_key }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column prop="status" label="状态" width="180">
  55. <template slot-scope="scope">
  56. <div v-if="scope.row.status =='1'">支持</div>
  57. <div v-else>不支持</div>
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="value" label="服务协议">
  61. <template slot-scope="scope">
  62. <span v-html="scope.row.value?scope.row.value.substring(0,20):''"></span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column prop="original_rate" label="服务商原始费率">
  66. <template slot-scope="scope">
  67. <span>{{ scope.row.original_rate }}%</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="kaifabao_rate" label="领薪宝费率">
  71. <template slot-scope="scope">
  72. <span>{{ scope.row.kaifabao_rate }}%</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="操作">
  76. <template slot-scope="scope">
  77. <el-link icon="el-icon-edit" @click="onServiceEdit(scope.row)">编辑</el-link>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. </template>
  82. <template v-if="tab ==='salary'">
  83. <div class="t-title">
  84. <span>选择子账户</span>
  85. </div>
  86. <div class="account-type">
  87. <el-radio-group v-model="accountType" size="small">
  88. <el-radio-button label="1">程序员客栈</el-radio-button>
  89. <!-- <el-radio-button label="2" disabled>阿里妈妈</el-radio-button>-->
  90. </el-radio-group>
  91. </div>
  92. <div class="t-title">
  93. <span>项目结算记录</span>
  94. </div>
  95. <div class="title">
  96. <el-form label-width="180px" label-position="left">
  97. <el-form-item label="已结算总金额(税前):">{{ serviceCountData.totalSuccessPay }}元</el-form-item>
  98. <el-form-item label="已提现总金额(税前):">{{ serviceCountData.totalDraw }}元</el-form-item>
  99. <el-form-item label="待提现总额(税前):">{{ serviceCountData.totalWaitDraw }}元</el-form-item>
  100. </el-form>
  101. </div>
  102. <el-table border :data="salaryData" style="width: 100%">
  103. <el-table-column prop="pro_name" label="项目名称">
  104. <template slot-scope="scope">
  105. <span class="lblue point" @click="projectLink(scope.row)">{{ scope.row.pro_name }}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column prop="pay_type" label="付款类型" width="180">
  109. <template slot-scope="scope">
  110. <span v-if="scope.row.pay_type == '1'">首付款</span>
  111. <span v-else>解冻款</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column prop="nickname" label="用户昵称">
  115. <template slot-scope="scope">
  116. <span class="lblue point" @click="goRooterUser(scope.row)">{{ scope.row.nickname }}</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="amount" label="结算金额">
  120. <template slot-scope="scope">
  121. <span>{{ scope.row.amount }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column prop="pay_time" label="结算时间">
  125. <template slot-scope="scope">
  126. <span>{{ formatDate(scope.row.pay_time, 'Y-m-d H:i') }}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column prop="order_no" label="订单号">
  130. <span class="lblue point" slot-scope="scope">
  131. <nuxt-link
  132. :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
  133. >{{ scope.row.order_no }}</nuxt-link>
  134. </span>
  135. </el-table-column>
  136. </el-table>
  137. </template>
  138. <template v-if="tab ==='withdrawal'">
  139. <div class="t-title">
  140. <span>选择子账户</span>
  141. </div>
  142. <div class="account-type">
  143. <el-radio-group v-model="accountType" size="small">
  144. <el-radio-button label="1">程序员客栈</el-radio-button>
  145. <!-- <el-radio-button label="2" disabled>天猫兼职</el-radio-button>-->
  146. </el-radio-group>
  147. </div>
  148. <div class="t-title">
  149. <span>项目结算记录</span>
  150. </div>
  151. <div class="title">
  152. <el-form label-width="250px" label-position="left">
  153. <el-form-item label="领薪宝账户可用余额:">
  154. <span
  155. >{{ withdrawalCountData.accountBalance.balance / 100 }}元</span>
  156. </el-form-item>
  157. <el-form-item
  158. label="待管理员确认付款金额(应充值金额):"
  159. >{{ withdrawalCountData.totalWaitConfirmTax / 100 }}元
  160. </el-form-item>
  161. <el-form-item
  162. label="待管理员确认付款金额(开发者实得):"
  163. >{{ withdrawalCountData.totalWaitConfirmDeveloperMayGet / 100 }}元
  164. </el-form-item>
  165. <el-form-item label="领薪宝正在支付中金额(应充值金额):">{{ withdrawalCountData.totalPayingTax / 100 }}元</el-form-item>
  166. <el-form-item label="用户成功提现金额(税后):">{{ withdrawalCountData.totalSuccess / 100 }}元</el-form-item>
  167. <el-form-item
  168. label="用户成功提现金额(应充值金额):"
  169. >{{ withdrawalCountData.totalSuccessTax / 100 }}元
  170. </el-form-item>
  171. <el-form-item
  172. label="用户成功提现金额(开发者实得):"
  173. >{{ withdrawalCountData.totalSuccessDeveloperMayGet / 100 }}元
  174. </el-form-item>
  175. </el-form>
  176. </div>
  177. <div style="text-align: right;margin-bottom: 10px">
  178. <el-button @click="downFinanceList" class="export-excel" type="primary">导出报表</el-button>
  179. <el-button @click="downWithdrawalList" style="display: none" class="export-excel" type="primary">导出提现报表</el-button>
  180. </div>
  181. <el-table border :data="withdrawalData">
  182. <el-table-column prop="order_no" label="订单号" show-overflow-tooltip>
  183. <template slot-scope="scope">
  184. <span class="lblue point">
  185. <nuxt-link
  186. target="_blank"
  187. :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
  188. >{{ scope.row.order_no }}</nuxt-link>
  189. </span>
  190. </template>
  191. </el-table-column>
  192. <el-table-column label="用户ID" width="66">
  193. <template slot-scope="scope">
  194. <span class="lblue point" @click="clickDev(scope.row.uid)">{{ scope.row.uid }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="真实姓名" width="70">
  198. <template slot-scope="scope">
  199. <span
  200. class="lblue point"
  201. @click="clickDev(scope.row.uid)"
  202. >{{ scope.row.userInfo.realname }}</span>
  203. </template>
  204. </el-table-column>
  205. <el-table-column prop="order_type_name" label="支付方式">
  206. <template slot-scope="scope">
  207. <span>{{ scope.row.order_type_name }}</span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column prop="original_rate" label="服务商税率">
  211. <template slot-scope="scope">
  212. <span>{{ scope.row.original_rate }}%</span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column prop="kaifabao_rate" label="领薪宝费率">
  216. <template slot-scope="scope">
  217. <span>{{ scope.row.kaifabao_rate }}%</span>
  218. </template>
  219. </el-table-column>
  220. <el-table-column prop="origin_amount" label="应充值金额" width="70"></el-table-column>
  221. <el-table-column prop="tax" label="综合扣税"></el-table-column>
  222. <el-table-column prop="real_amount" label="提现金额" width="70"></el-table-column>
  223. <el-table-column prop="true_amount" label="应到实得金额" width="70"></el-table-column>
  224. <el-table-column prop="after_amount" label="薪资余额(不含冻结)"></el-table-column>
  225. <el-table-column prop="account" label="到账账户" show-overflow-tooltip></el-table-column>
  226. <el-table-column label="提现时间" width="120">
  227. <template slot-scope="scope">
  228. <span>{{ scope.row.taken_at }}</span>
  229. </template>
  230. </el-table-column>
  231. <el-table-column label="到账时间" width="120">
  232. <template slot-scope="scope">
  233. <span>{{ scope.row.paid_at }}</span>
  234. </template>
  235. </el-table-column>
  236. <el-table-column prop="extra" label="系统备注" show-overflow-tooltip></el-table-column>
  237. <el-table-column label="内部提现状态">
  238. <template slot-scope="scope">
  239. <span v-if="scope.row.status==1">待确认</span>
  240. <span v-else-if="scope.row.status==2">支付中</span>
  241. <span v-else-if="scope.row.status==4">支付中</span>
  242. <span v-else-if="scope.row.status==8">支付成功</span>
  243. <span v-else-if="scope.row.status==16">支付失败</span>
  244. <span v-else>--</span>
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="操作" width="120">
  248. <template slot-scope="scope">
  249. <span v-if="scope.row.status==1" @click="confirmPay(scope.row)">
  250. <el-button type="primary" size="mini">确认付款</el-button>
  251. </span>
  252. <span v-else-if="scope.row.status==16" @click="confirmPay(scope.row)">
  253. <el-button type="primary" size="mini">失败重试</el-button>
  254. </span>
  255. <span v-else></span>
  256. </template>
  257. </el-table-column>
  258. <el-table-column label="外部备注" show-overflow-tooltip>
  259. <template slot-scope="scope">
  260. <span>{{ scope.row.orderInfo.public_comment }}</span>
  261. </template>
  262. </el-table-column>
  263. </el-table>
  264. </template>
  265. <template v-if="tab ==='verify'">
  266. <div class="t-title">
  267. <span>发票审核列表</span>
  268. </div>
  269. <div class="t-head">
  270. <span>全部:{{ verifyCountData.totalNum }}</span>
  271. <span>审核通过:{{ verifyCountData.auditAdoptNum }}</span>
  272. <span>审核中:{{ verifyCountData.auditInNum }}</span>
  273. <span>审核失败:{{ verifyCountData.auditFailNum }}</span>
  274. </div>
  275. <el-table border :data="verifyData" style="width: 100%">
  276. <el-table-column label="用户ID" width="100">
  277. <template slot-scope="scope">
  278. <span class="lblue point" @click="clickDev(scope.row.uid)">{{ scope.row.uid }}</span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column prop="amount" label="申请提现金额">
  282. <template slot-scope="scope">
  283. <span>{{ scope.row.amount }}</span>
  284. </template>
  285. </el-table-column>
  286. <el-table-column prop="create_time" label="申请时间">
  287. <template slot-scope="scope">
  288. <span>{{ formatDate(scope.row.create_time, 'Y-m-d H:i') }}</span>
  289. </template>
  290. </el-table-column>
  291. <el-table-column label="发票图片审核">
  292. <template slot-scope="scope">
  293. <span v-if="scope.row.picture_verify_status == '0'">待审核</span>
  294. <span v-else-if="scope.row.picture_verify_status == '1'">审核通过</span>
  295. <span v-else-if="scope.row.picture_verify_status == '2'">审核失败</span>
  296. <span v-else>--</span>
  297. </template>
  298. </el-table-column>
  299. <el-table-column label="纸质发票审核">
  300. <template slot-scope="scope">
  301. <span v-if="scope.row.paper_verify_status == '0'">待审核</span>
  302. <span v-else-if="scope.row.paper_verify_status == '1'">审核通过</span>
  303. <span v-else-if="scope.row.paper_verify_status == '2'">审核失败</span>
  304. <span v-else>--</span>
  305. </template>
  306. </el-table-column>
  307. <el-table-column label="操作" width="120">
  308. <template slot-scope="scope">
  309. <span class="lblue point">
  310. <nuxt-link target="_blank" :to="{path:'/main/invoice_audit?id='+scope.row.id}">去审核</nuxt-link>
  311. </span>
  312. </template>
  313. </el-table-column>
  314. </el-table>
  315. </template>
  316. </div>
  317. <div class="page" v-if="tab === 'salary' || tab === 'withdrawal' || tab === 'verify'">
  318. <el-pagination
  319. class="order-footer"
  320. background
  321. layout="total, prev, pager, next"
  322. :page-size="20"
  323. :total="pageInfo.total"
  324. @current-change="onPage"
  325. />
  326. </div>
  327. <el-dialog
  328. title="编辑配置"
  329. :visible.sync="basicFormVisible"
  330. :closeOnClickModal="false"
  331. :closeOnPressEscape="false"
  332. >
  333. <div>
  334. <quill-editor ref="myTextEditor" v-model="basicForm.content" :config="editorOption"></quill-editor>
  335. </div>
  336. <div slot="footer" class="dialog-footer">
  337. <el-button @click="basicFormVisible = false">取 消</el-button>
  338. <el-button type="primary" @click="onBasicSave">确 定</el-button>
  339. </div>
  340. </el-dialog>
  341. <el-dialog
  342. title="扣税方式"
  343. :visible.sync="serviceFormVisible"
  344. width="60%"
  345. :closeOnClickModal="false"
  346. :closeOnPressEscape="false"
  347. >
  348. <el-form
  349. :model="serviceForm"
  350. :rules="serviceRules"
  351. ref="serviceForm"
  352. label-width="120px"
  353. class="demo-ruleForm"
  354. >
  355. <el-form-item label="扣税方式" prop="config_key">
  356. <el-input v-model="serviceForm.config_key"></el-input>
  357. </el-form-item>
  358. <el-form-item label="服务商原始费率" prop="original_rate">
  359. <el-input
  360. min="1"
  361. max="100"
  362. minlength="1"
  363. maxlength="100"
  364. type="number"
  365. style="width: 50%"
  366. v-model="serviceForm.original_rate"
  367. ></el-input>
  368. %
  369. </el-form-item>
  370. <el-form-item label="领薪宝费率" prop="kaifabao_rate">
  371. <el-input
  372. type="number"
  373. min="1"
  374. max="100"
  375. minlength="1"
  376. maxlength="100"
  377. style="width: 50%"
  378. v-model="serviceForm.kaifabao_rate"
  379. ></el-input>
  380. %
  381. </el-form-item>
  382. <el-form-item label="服务协议" prop="content">
  383. <quill-editor
  384. v-model="serviceForm.content"
  385. ref="myTextEditor"
  386. class="editer"
  387. :options="editorOption"
  388. @ready="onEditorReady($event)"
  389. ></quill-editor>
  390. </el-form-item>
  391. <el-form-item label="状态" prop="status">
  392. <el-radio-group v-model="serviceForm.status">
  393. <el-radio :label="1">支持</el-radio>
  394. <el-radio :label="0">不支持</el-radio>
  395. </el-radio-group>
  396. </el-form-item>
  397. </el-form>
  398. <div slot="footer" class="dialog-footer">
  399. <el-button @click="serviceFormVisible = false">取 消</el-button>
  400. <el-button type="primary" @click="onServiceSave">确 定</el-button>
  401. </div>
  402. </el-dialog>
  403. </div>
  404. </template>
  405. <script>
  406. import {quillEditor} from "vue-quill-editor";
  407. export default {
  408. name: "kaifabao",
  409. components: {
  410. quillEditor,
  411. },
  412. data() {
  413. return {
  414. tab: "service",
  415. tabUrl: "",
  416. accountType: "1",
  417. editorOption: {
  418. modules: {
  419. toolbar: [
  420. ["bold", "italic", "underline", "strike"], // toggled buttons
  421. ["blockquote", "code-block"],
  422. [{header: 1}, {header: 2}], // custom button values
  423. [{list: "ordered"}, {list: "bullet"}],
  424. [{script: "sub"}, {script: "super"}], // superscript/subscript
  425. [{indent: "-1"}, {indent: "+1"}], // outdent/indent
  426. [{direction: "rtl"}], // text direction
  427. [{size: ["small", false, "large", "huge"]}], // custom dropdown
  428. [{header: [1, 2, 3, 4, 5, 6, false]}],
  429. [{font: []}],
  430. ["clean"], // remove formatting button
  431. ["link", "image"],
  432. ],
  433. imageResize: {},
  434. },
  435. },
  436. pageInfo: {
  437. page: 1,
  438. size: 20,
  439. total: 0,
  440. },
  441. serviceRules: {},
  442. basicFormVisible: false,
  443. serviceFormVisible: false,
  444. basicForm: {id: 0, content: ""},
  445. serviceForm: {id: 0, status: 1},
  446. basicConfigData: [],
  447. serviceData: [], //服务配置
  448. salaryData: [], //结薪订单
  449. withdrawalData: [], //提现订单
  450. verifyData: [], //发票审核
  451. serviceCountData: {}, //接薪头部统计
  452. withdrawalCountData: {accountBalance: {}}, //提现头部统计
  453. verifyCountData: {}, //发票审核头部统计
  454. };
  455. },
  456. mounted() {
  457. this.getList();
  458. },
  459. methods: {
  460. async getList() {
  461. const page = this.pageInfo.page;
  462. const size = this.pageInfo.size;
  463. const data = {
  464. page,
  465. size,
  466. };
  467. let res;
  468. switch (this.tab) {
  469. case "service":
  470. res = await this.$post("/api/admin/kaifabao/getConfigList");
  471. if (res && res.status === 1) {
  472. this.serviceData = res.data.buckleList || [];
  473. this.basicConfigData = res.data.basicList || [];
  474. }
  475. break;
  476. case "salary":
  477. res = await this.$post(
  478. "/api/admin/kaifabao/getKaifabaoOrderList",
  479. data
  480. );
  481. if (res && res.status === 1) {
  482. this.salaryData = res.data.list || [];
  483. this.serviceCountData.totalDraw = this.formatPrice(
  484. res.data.totalDraw
  485. );
  486. this.serviceCountData.totalWaitDraw = this.formatPrice(
  487. res.data.totalWaitDraw
  488. );
  489. this.serviceCountData.totalSuccessPay = this.formatPrice(
  490. res.data.totalSuccessPay
  491. );
  492. this.pageInfo.page = res.data.page * 1;
  493. this.pageInfo.total = res.data.total * 1;
  494. }
  495. break;
  496. case "withdrawal":
  497. res = await this.$post(
  498. "/api/admin/kaifabao/getKaifabaoSalaryList",
  499. data
  500. );
  501. if (res && res.status === 1) {
  502. this.withdrawalData = res.data.list || [];
  503. this.withdrawalCountData.accountBalance =
  504. res.data.accountBalance || {};
  505. this.withdrawalCountData.totalWaitConfirmTax =
  506. res.data.totalWaitConfirmTax || 0;
  507. this.withdrawalCountData.totalPayingTax =
  508. res.data.totalPayingTax || 0;
  509. this.withdrawalCountData.totalSuccessTax =
  510. res.data.totalSuccessTax || 0;
  511. this.withdrawalCountData.totalSuccess = res.data.totalSuccess || 0;
  512. this.withdrawalCountData.totalSuccessMayRecharge =
  513. res.data.totalSuccessMayRecharge || 0;
  514. this.withdrawalCountData.totalSuccessDeveloperMayGet =
  515. res.data.totalSuccessDeveloperMayGet || 0;
  516. this.withdrawalCountData.totalWaitConfirmMayRecharge =
  517. res.data.totalWaitConfirmMayRecharge || 0;
  518. this.withdrawalCountData.totalWaitConfirmDeveloperMayGet =
  519. res.data.totalWaitConfirmDeveloperMayGet || 0;
  520. this.pageInfo.page = res.data.page * 1;
  521. this.pageInfo.total = res.data.total * 1;
  522. }
  523. break;
  524. case "verify":
  525. res = await this.$post(
  526. "/api/admin/kaifabao/invoiceWithdrawalApplyList",
  527. data
  528. );
  529. if (res && res.status === 1) {
  530. this.verifyData = res.data.list || [];
  531. this.pageInfo.page = res.data.page * 1;
  532. this.pageInfo.total = res.data.total * 1;
  533. this.verifyCountData.totalNum = res.data.totalNum || 0;
  534. this.verifyCountData.auditAdoptNum = res.data.auditAdoptNum || 0;
  535. this.verifyCountData.auditInNum = res.data.auditInNum || 0;
  536. this.verifyCountData.auditFailNum = res.data.auditFailNum || 0;
  537. this.pageInfo.page = res.data.page * 1;
  538. this.pageInfo.total = res.data.total * 1;
  539. }
  540. break;
  541. }
  542. },
  543. onAddService() {
  544. this.serviceForm = {id: 0, status: 1};
  545. this.serviceFormVisible = true;
  546. },
  547. onServiceEdit(row) {
  548. this.serviceForm = row;
  549. this.serviceForm.content = row.value;
  550. this.serviceForm.status = row.status * 1;
  551. this.serviceFormVisible = true;
  552. },
  553. async onServiceSave() {
  554. let data = this.serviceForm;
  555. data.content = data.content.replace(/&nbsp;/gi, "");
  556. let res = await this.$post("/api/admin/kaifabao/saveBuckleConfig", data);
  557. if (res && res.status === 1) {
  558. this.$message({
  559. type: "success",
  560. message: "操作成功!",
  561. });
  562. this.clear();
  563. }
  564. },
  565. onBasicEdit(row) {
  566. this.basicForm.id = row.id;
  567. this.basicForm.content = row.value;
  568. this.basicFormVisible = true;
  569. },
  570. async onBasicSave() {
  571. let data = this.basicForm;
  572. let res = await this.$post("/api/admin/kaifabao/editBasicConfig", data);
  573. if (res && res.status === 1) {
  574. this.$message({
  575. type: "success",
  576. message: "操作成功!",
  577. });
  578. this.clear();
  579. }
  580. },
  581. onPage(val) {
  582. this.pageInfo.page = val;
  583. this.getList();
  584. },
  585. clear() {
  586. this.basicFormVisible = false;
  587. this.serviceFormVisible = false;
  588. this.serviceForm = {id: 0, status: 1};
  589. this.getList();
  590. },
  591. goTopic(topic) {
  592. console.log(topic);
  593. window.open(
  594. this.$store.state.domainConfig.jishuinUrl + "/p/" + topic.id + ".html"
  595. );
  596. },
  597. goRooterUser(row) {
  598. window.open(
  599. this.$store.state.domainConfig.siteUrl + "/rooter/user/" + row.uid
  600. );
  601. },
  602. // 点击开发者
  603. clickDev(uid) {
  604. window.open(
  605. this.$store.state.domainConfig.siteUrl + `/rooter/user/${uid}`
  606. );
  607. },
  608. formatPrice(price) {
  609. return price ? price / 100 : 0;
  610. },
  611. confirmPay(i) {
  612. this.rePay(i);
  613. },
  614. // 重新支付
  615. async rePay(i) {
  616. const res = await this.$post("/api/admin/kaifabao/redoSalaryDraw", {
  617. id: i.id,
  618. });
  619. if (res) {
  620. this.getList();
  621. }
  622. },
  623. onToUrl(){
  624. let la = this.tabUrl;
  625. let url = '';
  626. switch (la) {
  627. case "gongmao":
  628. url = '/main/gongmall';
  629. break;
  630. case "qingtuanbao":
  631. url = '/main/qingtuanbao';
  632. break;
  633. }
  634. if(url === '') return;
  635. this.$router.push({ path:url});
  636. // window.location.href = url;
  637. },
  638. projectLink(row) {
  639. const type = row.entity_type;
  640. if (type === "2") {
  641. window.open(
  642. this.$store.state.domainConfig.siteUrl +
  643. `/rooter/outsourceitem/${row.entity_id}`
  644. );
  645. } else if (type === "3") {
  646. window.open(
  647. this.$store.state.domainConfig.siteUrl +
  648. `/rooter/wagedetails?job_id=${row.entity_id}`
  649. );
  650. } else if (type === "9") {
  651. window.open(
  652. this.$store.state.domainConfig.siteUrl +
  653. `/rooter/cloudjobitem/${row.entity_id}`
  654. );
  655. } else {
  656. return false;
  657. }
  658. },
  659. onEditorReady(editor) {
  660. },
  661. async downFinanceList() {
  662. if (this.tab !== "withdrawal") {
  663. return false;
  664. }
  665. let url = window.location.host + "/api/admin/kaifabao/export";
  666. window.location.href = "https://" + url;
  667. },
  668. async downWithdrawalList() {
  669. if (this.tab !== "withdrawal") {
  670. return false;
  671. }
  672. let url = window.location.host + "/api/admin/kaifabao/exportWithdrawal";
  673. window.location.href = "https://" + url;
  674. },
  675. formatDate(time, format = "") {
  676. if (time === "0") {
  677. return "--";
  678. }
  679. let now = new Date(time * 1000);
  680. let year = now.getFullYear();
  681. let month = now.getMonth() + 1;
  682. let date = now.getDate();
  683. let hour = now.getHours();
  684. let minute = now.getMinutes();
  685. let second = now.getSeconds();
  686. if (hour < 10) {
  687. hour = "0" + hour;
  688. }
  689. if (minute < 10) {
  690. minute = "0" + minute;
  691. }
  692. if (second < 10) {
  693. second = "0" + second;
  694. }
  695. return format == ""
  696. ? year +
  697. "-" +
  698. month +
  699. "-" +
  700. date +
  701. " " +
  702. hour +
  703. ":" +
  704. minute +
  705. ":" +
  706. second
  707. : year + "-" + month + "-" + date + " " + hour + ":" + minute;
  708. },
  709. },
  710. };
  711. </script>
  712. <style>
  713. .t-content {
  714. width: 98%;
  715. margin-top: 5px;
  716. }
  717. .t-title {
  718. font-size: 20px;
  719. font-weight: 500;
  720. margin: 10px 0 5px 0;
  721. }
  722. .account-type {
  723. margin: 10px;
  724. }
  725. .page {
  726. margin: 10px;
  727. }
  728. .title .el-form-item {
  729. margin-bottom: 0;
  730. }
  731. .t-head {
  732. margin-bottom: 10px;
  733. }
  734. .t-head span {
  735. margin-right: 40px;
  736. }
  737. .edit_container {
  738. font-family: "Avenir", Helvetica, Arial, sans-serif;
  739. -webkit-font-smoothing: antialiased;
  740. -moz-osx-font-smoothing: grayscale;
  741. text-align: center;
  742. color: #2c3e50;
  743. margin-top: 60px;
  744. }
  745. .ql-editor {
  746. height: 200px;
  747. }
  748. .left-title{
  749. font-size: 22px;
  750. font-weight: 500;
  751. }
  752. </style>