index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="110"
  3. :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
  4. :operation="operation" :exportList="exportList">
  5. <div slot="moreSearch">
  6. <el-radio-group v-model="status" size="mini" @change="changeType">
  7. <el-radio-button label="">全部</el-radio-button>
  8. <el-radio-button :label="0">待发放</el-radio-button>
  9. <el-radio-button :label="1">已发放</el-radio-button>
  10. </el-radio-group>
  11. <br><br>
  12. </div>
  13. <el-dialog title="详情" width="80%" :modal="true" :visible.sync="formDialog" :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" @close="formDialog = false;formData = {}">
  14. <el-card class="box-card">
  15. <div slot="header" class="clearfix">
  16. <span>提现信息</span>
  17. </div>
  18. <table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
  19. <tr>
  20. <td class="bold" align="center">提现类型</td>
  21. <td>{{formData.type == 1?'销售提现':'服务提现'}}</td>
  22. <td class="bold" align="center">单据编号</td>
  23. <td>{{formData.id}}</td>
  24. <td class="bold" align="center">所属商户</td>
  25. <td>{{formData.companyWechatName}}</td>
  26. </tr>
  27. <tr>
  28. <td class="bold" align="center">网点名称</td>
  29. <td colspan="3">{{formData.websitName}}</td>
  30. <td class="bold" align="center">师傅姓名</td>
  31. <td>{{formData.workerName}}</td>
  32. </tr>
  33. <tr>
  34. <td class="bold" align="center">师傅身份证号</td>
  35. <td>{{formData.idcard}}</td>
  36. <td class="bold" align="center">师傅联系电话</td>
  37. <td>{{formData.workerMobile}}</td>
  38. <td class="bold" align="center">申请时间</td>
  39. <td>{{formData.createTime}}</td>
  40. </tr>
  41. <tr>
  42. <td class="bold" align="center">账户类型</td>
  43. <td>{{formData.accountType}}</td>
  44. <td class="bold" align="center">开户银行</td>
  45. <td>{{formData.bank}}</td>
  46. <td class="bold" align="center">开户支行</td>
  47. <td>{{formData.bankRow}}</td>
  48. </tr>
  49. <tr>
  50. <td class="bold" align="center">持卡人</td>
  51. <td>{{formData.bankUserName}}</td>
  52. <td class="bold" align="center">银行卡号</td>
  53. <td>{{formData.bankNo}}</td>
  54. <td class="bold" align="center">提现金额</td>
  55. <td>¥{{formData.amount}}</td>
  56. </tr>
  57. <tr>
  58. <td class="bold" align="center">备注</td>
  59. <td colspan="5">{{formData.remark}}</td>
  60. </tr>
  61. <tr>
  62. <td class="bold" align="center">转账凭证</td>
  63. <td colspan="5">
  64. <el-image v-if="formData.certImg" style="width: 80px;height: 80px" :preview-src-list="[formData.certImg]" :src="formData.certImg" fit="fit"></el-image>
  65. </td>
  66. </tr>
  67. </table>
  68. </el-card>
  69. <el-card class="box-card">
  70. <div slot="header" class="clearfix">
  71. <span>订单信息</span>
  72. </div>
  73. <table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
  74. <thead>
  75. <tr>
  76. <th class="bold" align="center">订单单号</th>
  77. <th class="bold" align="center">订单类型</th>
  78. <th class="bold" align="center">收费类型</th>
  79. <th class="bold" align="center">数量</th>
  80. <th class="bold" align="center">单价</th>
  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. </tr>
  86. </thead>
  87. <tbody>
  88. <tr v-for="(item,index) in formData.withdrawalOrderItems" :key="index">
  89. <td align="center">{{item.id}}</td>
  90. <td align="center">{{item.goodsType == 'M'?'辅材':'配件'}}</td>
  91. <td align="center">{{item.chargeType=='ACC'?'配件物料':item.chargeType=='SERV'?'服务收费':''}}</td>
  92. <td align="center">{{item.num}}</td>
  93. <td align="center">{{item.goodsAmount}}</td>
  94. <td align="center">{{item.totalAmount}}</td>
  95. <td align="center">{{item.settlementType == 'OWN'?'自由':item.settlementType == 'OUT'?'外购':''}}</td>
  96. <td align="center">{{item.workerAmount}}</td>
  97. <td align="center">{{item.websitAmount}}</td>
  98. </tr>
  99. <tr>
  100. <td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
  101. </tr>
  102. <tr>
  103. <td align="center">总计</td><td></td><td></td><td></td></td><td>
  104. <td align="center">{{totalAmount || 0}}</td><td></td>
  105. <td align="center">{{workerAmount || 0}}</td>
  106. <td align="center">{{websitAmount || 0}}</td>
  107. </tr>
  108. </tbody>
  109. </table>
  110. </el-card>
  111. <div slot="footer" class="dialog-footer">
  112. <el-button size="mini" @click="formDialog = false;formData = {}">取 消</el-button>
  113. <el-button size="mini" v-if="formData.status == 0" type="primary" @click="update(formData.id)">设为已发</el-button>
  114. </div>
  115. </el-dialog>
  116. </template-page>
  117. </template>
  118. <script>
  119. import TemplatePage from '@/components/template/template-page-1.vue'
  120. import import_mixin from '@/components/template/import_mixin.js'
  121. import ImageUpload from '@/components/file-upload'
  122. import { downloadFiles } from '@/utils/util'
  123. import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
  124. import { listPageV2,pageExport, getDetail, update } from "@/api/auxiliaryFittings/salesWithdraw";
  125. export default {
  126. components: { TemplatePage, ImageUpload },
  127. mixins: [import_mixin],
  128. data() {
  129. return {
  130. // 事件组合
  131. optionsEvensGroup: [],
  132. // 表格属性
  133. tableAttributes: {
  134. // 启用勾选列
  135. selectColumn: true
  136. },
  137. // 表格事件
  138. tableEvents: {
  139. 'selection-change': this.selectionChange
  140. },
  141. // 勾选选中行
  142. recordSelected: [],
  143. formDialogType: 0,
  144. formDialogTitles: ["新增","编辑", "详情"],
  145. formDialog: false,
  146. formData: {},
  147. status: '',
  148. totalAmount: 0,
  149. workerAmount: 0,
  150. websitAmount: 0,
  151. }
  152. },
  153. computed: {
  154. // 更多参数
  155. moreParameters() {
  156. return []
  157. }
  158. },
  159. methods: {
  160. // 切换状态
  161. changeType(val) {
  162. this.$refs.pageRef.refreshList()
  163. },
  164. // 列表请求函数
  165. getList(p) {
  166. try {
  167. var pam = JSON.parse(JSON.stringify(p))
  168. if (this.status) {
  169. pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
  170. }
  171. return listPageV2(pam)
  172. } catch (error) {
  173. console.log(error)
  174. }
  175. },
  176. // 列表导出函数
  177. exportList: pageExport,
  178. // 表格列解析渲染数据更改
  179. columnParsing(item, defaultData) {
  180. return defaultData
  181. },
  182. // 监听勾选变化
  183. selectionChange(data) {
  184. this.recordSelected = data
  185. },
  186. openForm() {
  187. this.formDialog = true;
  188. },
  189. formCancel() {
  190. this.$refs.formRef.$refs.inlineForm.clearValidate()
  191. this.$data.formData = this.$options.data().formData
  192. this.formDialog = false
  193. },
  194. // 表格操作列
  195. operation(h, { row, index, column }) {
  196. return (
  197. <div class='operation-btns'>
  198. <el-button type="text" onClick={() => {
  199. this.totalAmount = 0
  200. this.workerAmount = 0
  201. this.websitAmount = 0
  202. getDetail({ id: row.id }).then(res => {
  203. Object.assign(this.formData, res.data)
  204. res.data.withdrawalOrderItems.forEach(item=>{
  205. this.totalAmount += item.totalAmount
  206. this.workerAmount += item.workerAmount
  207. this.websitAmount += item.websitAmount
  208. })
  209. this.formDialogType = 1
  210. this.openForm()
  211. })
  212. }}>查看</el-button>
  213. {row.status == 0? <el-button type="text" onClick={() => {
  214. this.update(row.id)
  215. }}>设为已发</el-button>:null}
  216. </div>
  217. )
  218. },
  219. update(id){
  220. this.$confirm('请确认是否设为已发放, 是否继续?', '提示', {
  221. confirmButtonText: '确定',
  222. cancelButtonText: '取消',
  223. type: 'warning'
  224. }).then(() => {
  225. refund({ id }).then(res => {
  226. if (res.code == 200) {
  227. this.$message({ type: 'success', message: '设为已发放成功!' })
  228. this.$refs.pageRef.refreshList()
  229. } else {
  230. this.$message.error(res.msg);
  231. }
  232. })
  233. });
  234. },
  235. }
  236. }
  237. </script>
  238. <style lang="scss" scoped>
  239. .tab{
  240. padding: 20px 20px 0 20px;
  241. }
  242. .bold{
  243. width: 160px;
  244. font-weight: bold;
  245. background-color: #f0f0f0;
  246. }
  247. </style>