detailsPage.vue 7.5 KB

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