companyProfit.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <div class="order-content">
  3. <div class="order-status" v-if="profit!=null" >
  4. <el-steps :active="profit.profitStatus==4?profit.profitStatus:profit.profitStatus-1" align-center>
  5. <el-step title="待商务审核"></el-step>
  6. <el-step title="待财务审核"></el-step>
  7. <el-step title="待支付"></el-step>
  8. <el-step title="已完成"></el-step>
  9. </el-steps>
  10. </div>
  11. <div>
  12. <el-card shadow="never" style="margin-top: 15px">
  13. <div class="operate-container" v-if="profit!=null">
  14. <i class="el-icon-warning color-danger" style="margin-left: 20px"></i>
  15. <span class="color-danger">当前状态:
  16. <el-tag prop="status" v-for="(item, index) in statusOptions" v-if="profit.profitStatus==item.dictValue">{{item.dictLabel}}</el-tag>
  17. </span>
  18. <div class="operate-button-container" >
  19. <el-button size="mini" @click="handleAudit(1)" v-if="profit.profitStatus==1" v-hasPermi="['company:companyProfit:audit1']" >商务审核</el-button>
  20. </div>
  21. <div class="operate-button-container" >
  22. <el-button size="mini" @click="handleAudit(2)" v-if="profit.profitStatus==2" v-hasPermi="['company:companyProfit:audit2']" >财务审核</el-button>
  23. </div>
  24. <div class="operate-button-container" >
  25. <el-button size="mini" @click="handleAudit(3)" v-if="profit.profitStatus==3" v-hasPermi="['company:companyProfit:audit3']" >付款</el-button>
  26. </div>
  27. </div>
  28. <div style="margin-top: 20px" v-if="profit!=null">
  29. <svg-icon icon-class="marker" style="color: #606266"></svg-icon>
  30. <span class="font-small">基本信息
  31. </span>
  32. </div>
  33. <div class="table-layout" v-if="profit!=null">
  34. <el-row>
  35. <el-col :span="6" class="table-cell-title">公司名称</el-col>
  36. <el-col :span="6" class="table-cell-title">提现金额</el-col>
  37. <el-col :span="6" class="table-cell-title">余额</el-col>
  38. <el-col :span="6" class="table-cell-title">银行名称</el-col>
  39. </el-row>
  40. <el-row>
  41. <el-col :span="6" class="table-cell">{{companyName}}</el-col>
  42. <el-col :span="6" class="table-cell">{{profit.money}}</el-col>
  43. <el-col :span="6" class="table-cell">{{profit.balances}}</el-col>
  44. <el-col :span="6" class="table-cell">{{profit.bankName}}</el-col>
  45. </el-row>
  46. <el-row>
  47. <el-col :span="6" class="table-cell-title">支行名称</el-col>
  48. <el-col :span="6" class="table-cell-title">银行卡号</el-col>
  49. <el-col :span="6" class="table-cell-title">银行开户名</el-col>
  50. <el-col :span="6" class="table-cell-title">提交时间</el-col>
  51. </el-row>
  52. <el-row>
  53. <el-col :span="6" class="table-cell">{{profit.bankBranchName}}</el-col>
  54. <el-col :span="6" class="table-cell">{{profit.bankCardNo}}</el-col>
  55. <el-col :span="6" class="table-cell">{{profit.bankUserName}}</el-col>
  56. <el-col :span="6" class="table-cell">{{profit.createTime}}</el-col>
  57. </el-row>
  58. <el-row>
  59. <el-col :span="12" class="table-cell-title">备注</el-col>
  60. <el-col :span="12" class="table-cell-title">凭证</el-col>
  61. </el-row>
  62. <el-row>
  63. <el-col :span="12" class="table-cell">{{profit.remark}}</el-col>
  64. <el-col :span="12" class="table-cell">
  65. <el-popover
  66. placement="right"
  67. title=""
  68. trigger="hover"
  69. >
  70. <img slot="reference" :src="profit.imgUrl" width="100">
  71. <img :src="profit.imgUrl" style="max-width: 500px;">
  72. </el-popover></el-col>
  73. </el-row>
  74. </div>
  75. <div style="margin-top: 20px">
  76. <svg-icon icon-class="marker" style="color: #606266"></svg-icon>
  77. <span class="font-small">操作信息</span>
  78. </div>
  79. <el-table style="margin-top: 20px;width: 100%"
  80. ref="orderHistoryTable"
  81. :data="logs" border>
  82. <el-table-column label="标题" align="center">
  83. <template slot-scope="scope">
  84. {{scope.row.title}}
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="审核记录" align="center">
  88. <template slot-scope="scope">
  89. {{scope.row.reason}}
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="操作时间" width="160" align="center">
  93. <template slot-scope="scope">
  94. {{scope.row.createTime}}
  95. </template>
  96. </el-table-column>
  97. </el-table>
  98. </el-card>
  99. </div>
  100. <!-- 添加或修改提现对话框 -->
  101. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  102. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  103. <el-form-item label="提现状态" prop="status">
  104. <el-radio-group v-model="form.status">
  105. <el-radio :label="1">通过</el-radio>
  106. <el-radio :label="0">驳回</el-radio>
  107. </el-radio-group>
  108. </el-form-item>
  109. <el-form-item label="凭证" prop="profitStatus" v-if="profit.profitStatus==3">
  110. <el-upload
  111. v-model="form.imgUrl"
  112. class="avatar-uploader"
  113. :action="uploadUrl"
  114. :show-file-list="false"
  115. :on-success="handleSuccess"
  116. :before-upload="beforeUpload"
  117. :headers="uploadHeaders"
  118. >
  119. <img v-if="form.imgUrl" :src="form.imgUrl" class="avatar">
  120. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  121. </el-upload>
  122. </el-form-item>
  123. <el-form-item label="备注" prop="remark">
  124. <el-input v-model="form.remark" placeholder="请输入备注" />
  125. </el-form-item>
  126. </el-form>
  127. <div slot="footer" class="dialog-footer">
  128. <el-button type="primary" @click="submitForm">确 定</el-button>
  129. </div>
  130. </el-dialog>
  131. </div>
  132. </template>
  133. <script>
  134. import { getToken } from '@/utils/auth'
  135. import { audit1,audit2,audit3, getCompanyProfit, delCompanyProfit, addCompanyProfit, updateCompanyProfit, exportCompanyProfit } from "@/api/company/companyProfit";
  136. export default {
  137. name: "profit",
  138. data() {
  139. return {
  140. uploadHeaders: { Authorization: "Bearer " + getToken() },
  141. type:null,
  142. uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
  143. baseUrl: process.env.VUE_APP_BASE_API,
  144. // 弹出层标题
  145. title: "",
  146. // 是否显示弹出层
  147. open: false,
  148. companyName:null,
  149. statusOptions:[],
  150. profitId:null,
  151. profit:null,
  152. logs:[],
  153. rules:{},
  154. form:{
  155. status:1,
  156. imgUrl:null,
  157. }
  158. };
  159. },
  160. created() {
  161. this.getDicts("sys_company_profit_status").then((response) => {
  162. this.statusOptions = response.data;
  163. });
  164. },
  165. methods: {
  166. handleSuccess(res, file) {
  167. if(res.code==200){
  168. this.form.imgUrl=res.url;
  169. }
  170. else{
  171. this.msgError(res.msg);
  172. }
  173. },
  174. beforeUpload(file) {
  175. const isLt1M = file.size / 1024 / 1024 < 1;
  176. if (!isLt1M) {
  177. this.$message.error('上传图片大小不能超过 1MB!');
  178. }
  179. return isLt1M;
  180. },
  181. handleAudit(auditType) {
  182. this.type=auditType;
  183. this.open = true;
  184. this.title = "审核提现";
  185. },
  186. /** 提交按钮 */
  187. submitForm() {
  188. this.$refs["form"].validate(valid => {
  189. if (valid) {
  190. this.form.profitId=this.profitId
  191. console.log(this.type)
  192. if(this.type==1){
  193. audit1(this.form).then(response => {
  194. if (response.code === 200) {
  195. this.msgSuccess("审核成功");
  196. this.open = false;
  197. this.getData(this.companyName,this.profitId);
  198. }
  199. });
  200. }
  201. if(this.type==2){
  202. audit2(this.form).then(response => {
  203. if (response.code === 200) {
  204. this.msgSuccess("审核成功");
  205. this.open = false;
  206. this.getData(this.companyName,this.profitId);
  207. }
  208. });
  209. }
  210. if(this.type==3){
  211. audit3(this.form).then(response => {
  212. if (response.code === 200) {
  213. this.msgSuccess("审核成功");
  214. this.open = false;
  215. this.getData(this.companyName,this.profitId);
  216. }
  217. });
  218. }
  219. }
  220. });
  221. },
  222. getData(companyName,profitId) {
  223. this.companyName=companyName;
  224. this.profitId=profitId;
  225. getCompanyProfit(profitId).then(response => {
  226. this.profit = response.profit;
  227. this.logs = response.logs;
  228. });
  229. },
  230. }
  231. };
  232. </script>
  233. <style scoped>
  234. .order-content{
  235. margin: 10px;
  236. }
  237. .detail-container {
  238. width: 80%;
  239. padding: 20px 20px 20px 20px;
  240. margin: 20px auto;
  241. }
  242. .operate-container {
  243. background: #F2F6FC;
  244. height: 80px;
  245. margin: -20px -20px 0;
  246. line-height: 80px;
  247. }
  248. .operate-button-container {
  249. float: right;
  250. margin-right: 20px
  251. }
  252. .table-layout {
  253. margin-top: 20px;
  254. border-left: 1px solid #DCDFE6;
  255. border-top: 1px solid #DCDFE6;
  256. }
  257. .table-cell {
  258. height: 60px;
  259. line-height: 40px;
  260. border-right: 1px solid #DCDFE6;
  261. border-bottom: 1px solid #DCDFE6;
  262. padding: 10px;
  263. font-size: 14px;
  264. color: #606266;
  265. text-align: center;
  266. overflow: hidden;
  267. }
  268. .table-cell-title {
  269. border-right: 1px solid #DCDFE6;
  270. border-bottom: 1px solid #DCDFE6;
  271. padding: 10px;
  272. background: #F2F6FC;
  273. text-align: center;
  274. font-size: 14px;
  275. color: #303133;
  276. }
  277. </style>