index.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
  3. <template slot-scope="{activeKey, data}">
  4. <template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
  5. :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
  6. :operation="operation()" :exportList="exportList" :operationColumnWidth="110">
  7. <div slot="moreSearch">
  8. <el-radio-group v-model="status" size="mini" @change="changeType">
  9. <el-radio-button label="">全部</el-radio-button>
  10. <el-radio-button label="0">待发放</el-radio-button>
  11. <el-radio-button label="1">已发放</el-radio-button>
  12. </el-radio-group>
  13. <br><br>
  14. </div>
  15. </template-page>
  16. <div v-if="~['detail'].indexOf(activeKey)">
  17. <el-card class="box-card">
  18. <div slot="header" class="clearfix">
  19. <span>提现信息</span>
  20. </div>
  21. <table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
  22. <tr>
  23. <td class="bold" align="center">提现类型</td>
  24. <td>{{ formData.type == 1 ? '销售提现' : '服务提现' }}</td>
  25. <td class="bold" align="center">单据编号</td>
  26. <td>{{ formData.id }}</td>
  27. <td class="bold" align="center">发放状态</td>
  28. <td>{{ formData.status == 0 ? '待发放' : formData.status == 1 ? '已发放' : '' }}</td>
  29. <td class="bold" align="center"></td>
  30. <td></td>
  31. </tr>
  32. <tr>
  33. <td class="bold" align="center">师傅姓名</td>
  34. <td>{{ formData.workerName }}</td>
  35. <td class="bold" align="center">师傅编号</td>
  36. <td>{{ formData.workerId }}</td>
  37. <td class="bold" align="center">师傅身份证号</td>
  38. <td>{{ formData.idcard }}</td>
  39. <td class="bold" align="center">师傅联系电话</td>
  40. <td>{{ formData.workerMobile }}</td>
  41. </tr>
  42. <tr>
  43. <td class="bold" align="center">申请时间</td>
  44. <td>{{ formData.createTime }}</td>
  45. <td class="bold" align="center">账户类型</td>
  46. <td>{{ formData.accountType }}</td>
  47. <td class="bold" align="center">开户银行</td>
  48. <td>{{ formData.bank }}</td>
  49. <td class="bold" align="center">开户支行</td>
  50. <td>{{ formData.subBank }}</td>
  51. </tr>
  52. <tr>
  53. <td class="bold" align="center">持卡人</td>
  54. <td>{{ formData.bankUserName }}</td>
  55. <td class="bold" align="center">银行卡号</td>
  56. <td>{{ formData.bankNo }}</td>
  57. <td class="bold" align="center">提现金额</td>
  58. <td>¥{{ formData.amount }}</td>
  59. <td></td>
  60. <td></td>
  61. </tr>
  62. <tr>
  63. <td class="bold" align="center">备注</td>
  64. <td colspan="7">{{ formData.remark }}</td>
  65. </tr>
  66. <tr>
  67. <td class="bold" align="center"><span style="color: red;">*</span>转账凭证</td>
  68. <td colspan="7" style="width: 80px;height: 80px">
  69. <ImageUpload :fileList="formData.certImg" :limit="1" :isEdit="formData.status == 0" />
  70. </td>
  71. </tr>
  72. </table>
  73. </el-card>
  74. <el-card class="box-card">
  75. <div slot="header" class="clearfix">
  76. <span>订单信息</span>
  77. </div>
  78. <table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
  79. <thead>
  80. <tr>
  81. <th class="bold" align="center">订单单号</th>
  82. <th class="bold" align="center">订单类型</th>
  83. <!-- <th class="bold" align="center">收费类型</th> -->
  84. <th class="bold" align="center">数量</th>
  85. <!-- <th class="bold" align="center">单价</th> -->
  86. <th class="bold" align="center">订单金额</th>
  87. <th class="bold" align="center">销售类型</th>
  88. <th class="bold" align="center">师傅分账金额</th>
  89. <th class="bold" align="center">商户分账金额</th>
  90. </tr>
  91. </thead>
  92. <tbody>
  93. <tr v-for="(item, index) in formData.withdrawalOrderItems" :key="index">
  94. <td align="center">{{ item.id }}</td>
  95. <td align="center">{{ item.goodsType == 'M' ? '辅材' : '配件' }}</td>
  96. <!-- <td align="center">{{item.chargeType=='ACC'?'配件物料':item.chargeType=='SERV'?'服务收费':''}}</td> -->
  97. <td align="center">{{ item.num }}</td>
  98. <!-- <td align="center">{{item.goodsAmount}}</td> -->
  99. <td align="center">{{ item.totalPrice }}</td>
  100. <td align="center">{{ item.settlementType == 'OWN' ? '自有' : item.settlementType == 'OUT' ? '外购' : '' }}</td>
  101. <td align="center">{{ item.workerAmount }}</td>
  102. <td align="center">{{ item.websitAmount }}</td>
  103. </tr>
  104. <!-- <tr>
  105. <td style="color: #ffffff;">隐身</td><td></td><td></td><td></td><td></td><td></td><td></td>
  106. </tr> -->
  107. <tr>
  108. <td align="center">总计</td>
  109. <td></td>
  110. </td>
  111. <td>
  112. <td align="center">{{ totalAmount || 0 }}</td>
  113. <td></td>
  114. <td align="center">{{ workerAmount || 0 }}</td>
  115. <td align="center">{{ websitAmount || 0 }}</td>
  116. </tr>
  117. </tbody>
  118. </table>
  119. </el-card>
  120. <div slot="footer" class="dialog-footer">
  121. <el-button size="mini" @click="formDialog = false; formData = {},data.removeTab()">取 消</el-button>
  122. <el-button size="mini" v-if="formData.status == 0" type="primary" @click="update(formData.id,data.removeTab)">设为已发</el-button>
  123. </div>
  124. </div>
  125. </template>
  126. </zj-tab-page>
  127. </template>
  128. <script>
  129. import TemplatePage from '@/components/template/template-page-1.vue'
  130. import import_mixin from '@/components/template/import_mixin.js'
  131. import ImageUpload from '@/components/file-upload'
  132. import { downloadFiles } from '@/utils/util'
  133. import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
  134. import { listPageV2, pageExport, getDetail, update } from "@/api/auxiliaryFittings/salesWithdraw";
  135. import operation_mixin from '@/components/template/operation_mixin.js'
  136. export default {
  137. components: { TemplatePage, ImageUpload },
  138. mixins: [import_mixin, operation_mixin],
  139. data() {
  140. return {
  141. // 事件组合
  142. optionsEvensGroup: [],
  143. // 表格属性
  144. tableAttributes: {
  145. // 启用勾选列
  146. selectColumn: true
  147. },
  148. // 表格事件
  149. tableEvents: {
  150. 'selection-change': this.selectionChange
  151. },
  152. // 勾选选中行
  153. recordSelected: [],
  154. formDialogType: 0,
  155. formDialogTitles: ["新增", "编辑", "详情"],
  156. formDialog: false,
  157. formData: {},
  158. status: '',
  159. totalAmount: 0,
  160. workerAmount: 0,
  161. websitAmount: 0,
  162. formType: 'add',
  163. formVisible: false,
  164. }
  165. },
  166. computed: {
  167. // 更多参数
  168. moreParameters() {
  169. return []
  170. }
  171. },
  172. methods: {
  173. // 切换状态
  174. changeType(val) {
  175. this.$refs.pageRef.refreshList()
  176. },
  177. // 列表请求函数
  178. getList(p, cb) {
  179. try {
  180. var pam = JSON.parse(JSON.stringify(p))
  181. if (this.status || this.status >= 0) {
  182. pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
  183. }
  184. cb && cb(pam)
  185. return listPageV2(pam)
  186. } catch (error) {
  187. console.log(error)
  188. }
  189. },
  190. // 列表导出函数
  191. exportList: pageExport,
  192. // 表格列解析渲染数据更改
  193. columnParsing(item, defaultData) {
  194. return defaultData
  195. },
  196. // 监听勾选变化
  197. selectionChange(data) {
  198. this.recordSelected = data
  199. },
  200. openForm(type, id) {
  201. this.$refs.tabPage.addTab({
  202. // 对应显示的模块
  203. activeKey: type,
  204. // 唯一标识
  205. key: type,
  206. // 页签名称
  207. label: ({ detail: "详情" })[type],
  208. // 打开时事件
  209. triggerEvent: () => {
  210. this.formCancel()
  211. this.$nextTick(()=>{
  212. this.formType = type
  213. this.formVisible = true
  214. if (type == 'detail') {
  215. this.formDialogType = 1
  216. this.totalAmount = 0
  217. this.workerAmount = 0
  218. this.websitAmount = 0
  219. getDetail({ id }).then(res => {
  220. Object.assign(this.formData, res.data, {
  221. certImg: res.data?.certImg ? res.data?.certImg?.split(",").map(item => ({ url: item })) : []
  222. })
  223. res.data.withdrawalOrderItems.forEach(item => {
  224. this.totalAmount += (item.totalPrice * 100 + this.totalAmount * 100) / 100
  225. this.workerAmount = (item.workerAmount * 100 + this.workerAmount * 100) / 100
  226. this.websitAmount += (item.websitAmount * 100 + this.websitAmount * 100) / 100
  227. })
  228. })
  229. }
  230. })
  231. },
  232. // 关闭时事件
  233. closeEvent: () => {
  234. }
  235. })
  236. },
  237. formCancel() {
  238. this.formVisible = false
  239. this.$refs?.formRef?.resetFields()
  240. this.$data.formData = this.$options.data().formData
  241. },
  242. operation() {
  243. return this.operationBtn({
  244. detail: {
  245. click: ({ row, index, column }) => {
  246. this.openForm('detail',row.id)
  247. }
  248. },
  249. setSent: {
  250. conditions: ({ row, index, column }) => {
  251. return row.status == 0
  252. },
  253. click: ({ row, index, column }) => {
  254. this.openForm('detail',row.id)
  255. }
  256. }
  257. })
  258. },
  259. update(id) {
  260. if (this.formData.certImg.length == 0) {
  261. return this.$message.warning('请先上传转账凭证!');
  262. }
  263. this.$confirm('请确认是否设为已发放, 是否继续?', '提示', {
  264. confirmButtonText: '确定',
  265. cancelButtonText: '取消',
  266. type: 'warning'
  267. }).then(() => {
  268. update({ id, certImg: this.formData.certImg.map(item => item.url).join(",") }).then(res => {
  269. if (res.code == 200) {
  270. this.$message({ type: 'success', message: '设为已发放成功!' })
  271. this.formDialog = false
  272. this.$refs.pageRef.refreshList()
  273. } else {
  274. this.$message.error(res.msg);
  275. }
  276. })
  277. });
  278. },
  279. }
  280. }
  281. </script>
  282. <style lang="scss" scoped>
  283. .tab {
  284. padding: 20px 20px 0 20px;
  285. }
  286. .bold {
  287. width: 160px;
  288. font-weight: bold;
  289. background-color: #f0f0f0;
  290. }
  291. </style>