companyProfit.vue 9.3 KB

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