detailsPage.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button type="primary" size="small" :disabled="form.status>0" v-if="detailData.status == 1"
  11. class="el-button--small-yh " @click.stop="openEdit">编辑
  12. </el-button>
  13. <el-button type="primary" @click="editCustomer" :loading="subLoading" v-if="detailData.status != 1"
  14. size="small">保存数据
  15. </el-button>
  16. <el-dropdown style="padding: 0 6px;line-height: 0">
  17. <el-button type="primary" size="small" :loading="subLoading" :disabled="!form.id">
  18. 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
  19. </el-button>
  20. <el-dropdown-menu slot="dropdown">
  21. <el-dropdown-item :disabled="form.status>0" @click.native="auditCheck">提交审核</el-dropdown-item>
  22. <el-dropdown-item :disabled="form.status<1" @click.native="checkScheduleDialog = true">审核进度
  23. </el-dropdown-item>
  24. <el-dropdown-item v-if="$route.query.check" :disabled="form.status==3" @click.native="check">审批数据
  25. </el-dropdown-item>
  26. </el-dropdown-menu>
  27. </el-dropdown>
  28. </div>
  29. </div>
  30. <div class="customer-main" v-loading="subLoading">
  31. <trade-card title="基础信息">
  32. <avue-form ref="form" class="trading-form" v-model="form" :option="option">
  33. <template slot="corpId">
  34. <crop-select v-model="form.corpId" corpType="KH" :refresh="false" @getCorpData="getKHData"
  35. :disabled="form.status > 0"></crop-select>
  36. </template>
  37. <template slot="companyId">
  38. <crop-select v-model="form.companyId" corpType="GS" :refresh="false" @getCorpData="getKHDataTwo"
  39. :disabled="form.status > 0"></crop-select>
  40. </template>
  41. </avue-form>
  42. </trade-card>
  43. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  44. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  45. <check-schedule :checkId="form.id" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun">
  46. </check-schedule>
  47. </el-dialog>
  48. <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
  49. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  50. <check :checkData="checkData" :checkDetail="false" :idList="[]" @choceCheckFun="choceCheckFun">
  51. </check>
  52. </el-dialog>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import { getDetail, submit, checkFinancing } from "@/api/basicData/financing";
  58. import feeInfo from "@/components/fee-info/main";
  59. import checkSchedule from "../../../components/check/checkSchedule";
  60. import uploadFile from "@/components/upload-file/main";
  61. import check from "@/components/check/check";
  62. export default {
  63. name: "detailsPageEdit",
  64. data() {
  65. return {
  66. checkData: {},
  67. checkDialog: false,
  68. form: {},
  69. checkScheduleDialog: false,
  70. option: {
  71. disabled: false,
  72. menuBtn: false,
  73. labelWidth: 100,
  74. column: [
  75. {
  76. label: "系统编号",
  77. prop: "sysNo",
  78. disabled: true,
  79. span: 6
  80. },
  81. {
  82. label: "客户",
  83. prop: "corpId",
  84. rules: [
  85. {
  86. required: true,
  87. message: "",
  88. trigger: "blur"
  89. }
  90. ],
  91. span: 6
  92. },
  93. {
  94. label: "通过公司",
  95. prop: "companyId",
  96. rules: [{
  97. required: false,
  98. message: "",
  99. trigger: "blur"
  100. }],
  101. span: 6
  102. },
  103. {
  104. label: "融资日期",
  105. prop: "financingDate",
  106. type: "date",
  107. format: 'yyyy-MM-dd',
  108. valueFormat: 'yyyy-MM-dd',
  109. rules: [{
  110. required: true,
  111. message: "",
  112. trigger: "blur"
  113. }],
  114. span: 6
  115. },
  116. {
  117. label: "融资类别",
  118. prop: "financingType",
  119. type: "select",
  120. dataType: 'number',
  121. props: {
  122. label: "dictValue",
  123. value: "dictKey"
  124. },
  125. dicData: [],
  126. rules: [{
  127. required: true,
  128. message: "",
  129. trigger: "blur"
  130. }],
  131. span: 6
  132. },
  133. {
  134. label: "融资金额",
  135. prop: "financingAmount",
  136. blur:(data)=>{
  137. if (data.value < 0){
  138. this.form.financingAmount = 0
  139. }
  140. },
  141. controls:false,
  142. type:'number',
  143. rules: [{
  144. required: true,
  145. message: "",
  146. trigger: "blur"
  147. }],
  148. span: 6
  149. },
  150. {
  151. label: "状态",
  152. prop: "status",
  153. type: "select",
  154. dataType: 'number',
  155. props: {
  156. label: "dictValue",
  157. value: "dictKey"
  158. },
  159. dicData: [],
  160. disabled: true,
  161. span: 6
  162. },
  163. {
  164. label: "备注",
  165. prop: "remarks",
  166. type: "textarea",
  167. minRows: 2,
  168. width: 120,
  169. span: 24,
  170. },
  171. ]
  172. },
  173. itemsVOList: [],
  174. orderFilesList: [],
  175. subLoading: false,
  176. pageLoading: false,
  177. batchNo: '',
  178. storagetreeList: []
  179. };
  180. },
  181. props: {
  182. detailData: {
  183. type: Object
  184. }
  185. },
  186. components: {
  187. feeInfo,
  188. checkSchedule,
  189. uploadFile,
  190. check
  191. },
  192. async created() {
  193. if (this.detailData.status == 1) {
  194. this.option.disabled = true;
  195. }
  196. if (this.detailData.id) {
  197. this.getDetail(this.detailData.id);
  198. }
  199. this.getWorkDicts("financing_status").then(res => {
  200. this.findObject(this.option.column, "status").dicData =
  201. res.data.data;
  202. });
  203. this.getWorkDicts("financing_type").then(res => {
  204. this.findObject(this.option.column, "financingType").dicData =
  205. res.data.data;
  206. });
  207. },
  208. methods: {
  209. check() {
  210. this.checkData = this.$route.query.check
  211. this.checkDialog = true
  212. },
  213. //关闭审核
  214. choceCheckFun() {
  215. this.checkDialog = false;
  216. },
  217. cellStyle() {
  218. return "padding:0;height:40px;";
  219. },
  220. getKHData(row) {
  221. this.form.corpName = row.cname
  222. },
  223. getKHDataTwo(row) {
  224. this.form.company = row.cname
  225. },
  226. getDetail(id) {
  227. this.pageLoading = true;
  228. getDetail(id)
  229. .then(res => {
  230. this.form = res.data.data;
  231. })
  232. .finally(() => {
  233. this.pageLoading = false;
  234. });
  235. },
  236. //修改提交触发
  237. editCustomer(status) {
  238. this.$refs["form"].validate((valid, done) => {
  239. done();
  240. if (valid) {
  241. this.subLoading = true;
  242. let data = {
  243. ...this.form
  244. };
  245. submit(data).then(res => {
  246. console.log(res)
  247. this.form = res.data.data.data;
  248. this.$message({
  249. type: "success",
  250. message: "保存成功!"
  251. });
  252. })
  253. .finally(() => {
  254. this.subLoading = false;
  255. });
  256. } else {
  257. return false;
  258. }
  259. });
  260. },
  261. //请核
  262. auditCheck() {
  263. this.$confirm("确定审核此订单?", {
  264. confirmButtonText: "确定",
  265. cancelButtonText: "取消",
  266. type: "warning"
  267. }).then(() => {
  268. this.subLoading = true
  269. const data = {
  270. id: this.form.id,
  271. checkType: 'rzgl',
  272. url: '/financing/financingManagement/index',
  273. pageStatus: "this.$store.getters.entranceXsStatus",
  274. pageLabel: "融资管理",
  275. checkFlag: 1,
  276. }
  277. checkFinancing(data).then(res => {
  278. if (res.data.success) {
  279. this.$message.success("操作成功!")
  280. this.form.status = 3
  281. this.option.disabled = true;
  282. }
  283. }).finally(() => {
  284. this.subLoading = false
  285. })
  286. })
  287. },
  288. //返回列表
  289. backToList() {
  290. this.$emit("goBack");
  291. },
  292. openEdit() {
  293. this.detailData.status = 2;
  294. this.option.disabled = false;
  295. this.$refs.crud.refreshTable();
  296. }
  297. },
  298. watch: {
  299. }
  300. };
  301. </script>
  302. <style lang="scss" scoped>
  303. .trading-form ::v-deep .el-form-item {
  304. margin-bottom: 8px !important;
  305. }
  306. ::v-deep .el-form-item__error {
  307. display: none !important;
  308. }
  309. ::v-deep .select-component {
  310. display: flex !important;
  311. }
  312. </style>