| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList(0)">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="info" size="small"
- :disabled="isSave || form.status != 1" @click="inRevoke">撤 销
- </el-button>
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="success" size="small"
- :disabled="isSave || form.status != 0 || !form.id" @click="inConfirm">确 认
- </el-button>
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
- v-if="isSave" @click="inEdit">编 辑
- </el-button>
- <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
- :disabled="isSave" @click="submit">保 存
- </el-button>
- </div>
- </div>
- <div style="margin-top: 50px">
- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form">
- </avue-form>
- </trade-card>
- </div>
- </div>
- </template>
- <script>
- import {
- getDetails,
- submit, confirming, revoke
- } from "@/api/tirePartsMall/financingManagement/balanceRecharge";
- import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
- import dicSelect from "@/components/dicSelect/main";
- import _ from "lodash";
- export default {
- name: "detailsPage",
- data() {
- return {
- isSave: false,
- editButton: false,
- loading: false,
- // 商品列表数据合计
- tableData: [],
- // tabs切换
- data: [],
- isStatus: 1,
- goodsIdoptions: [],
- dataList: [],
- key: 0,
- form: {
- status: 0
- },
- customerData: [], // 客户数据
- optionForm: {
- menuBtn: false,
- span: 8,
- disabled: false,
- column: [
- {
- label: '金额',
- prop: "amount",
- overHidden: true,
- },
- {
- label: '单号',
- prop: "sysNo",
- disabled: true,
- },
- {
- label: '状态',
- prop: "status",
- type: 'select',
- dicData: [{
- label: '已确认',
- value: 1
- }, {
- label: '录入',
- value: 0
- }],
- disabled: true
- },
- {
- label: '确认人',
- prop: "confirmingPersonName",
- search: true,
- overHidden: true,
- type: 'select',
- filterable: true,
- remote: true,
- props: {
- label: 'cname',
- value: 'cname',
- res: 'data.records'
- },
- dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&corpType=GYS&cname={{key}}',
- disabled: true,
- },
- {
- label: "确认时间",
- prop: "confirmingPersonDate",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- disabled: true,
- },
- {
- label: "制单人",
- prop: "createUserName",
- disabled: true
- },
- {
- label: "制单日期",
- prop: "createTime",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- disabled: true
- },
- {
- label: "更新人",
- prop: "updateUserName",
- disabled: true
- },
- {
- label: "更新日期",
- prop: "updateTime",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- disabled: true
- },
- {
- label: '备注',
- prop: "remarks",
- type: 'textarea',
- disabled: false,
- span: 24,
- minRows: 2
- }]
- },
- optionContacts: {},
- optionContactsBack: {
- disabled: false,
- border: true,
- align: 'center',
- index: true,
- height: 500,
- addRowBtn: false,
- addBtn: false,
- editBtn: false,
- delBtn: false,
- column: [
- {
- label: '来源类型',
- prop: 'type',
- overHidden: true,
- },
- {
- label: '来源单号',
- prop: 'srcNo',
- overHidden: true,
- },
- {
- label: '金额',
- prop: 'amount',
- overHidden: true,
- },
- {
- label: '配资比例',
- prop: 'proportion',
- overHidden: true,
- },
- {
- label: "制单人",
- prop: "createUserName",
- overHidden: true,
- },
- {
- label: "制单日期",
- prop: "createTime",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- overHidden: true,
- },
- {
- label: "更新人",
- prop: "updateUserName",
- overHidden: true,
- },
- {
- label: "更新日期",
- prop: "updateTime",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- overHidden: true,
- },
- {
- label: "备注",
- prop: "remarks",
- overHidden: true,
- }
- ]
- }
- }
- },
- components: { SearchQuery, dicSelect },
- props: {
- onLoad: Object,
- detailData: Object
- },
- async created() {
- this.optionContacts = await this.getColumnData(this.getColumnName(404), this.optionContactsBack);
- if (this.detailData.id) {
- this.editButton = true
- this.optionForm.disabled = true
- this.isSave = true
- this.getDetail(this.detailData.id)
- }
- if (this.$route.query.srcId) {
- this.editButton = true
- this.optionForm.disabled = true
- this.isSave = true
- this.getDetail(this.$route.query.srcId)
- }
- },
- methods: {
- inEdit() {
- this.editButton = false
- if (this.form.status == 1) {
- this.optionForm.disabled = true
- } else {
- this.optionForm.disabled = false
- }
- this.isSave = false
- },
- dicChange(name, row) {
- if (name == 'confirmingPersonName') {
- if (row) {
- this.form.confirmingPersonId = row.id
- } else {
- this.form.confirmingPersonId = null
- }
- }
- },
- //修改提交触发
- submit() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- this.mingxibaocun = true
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit({ ...this.form }).then(res => {
- this.$message.success("保存成功");
- this.getDetail(res.data.data.id)
- }).finally(() => {
- loading.close();
- })
- } else {
- return false;
- }
- });
- },
- getDetail(id, type) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- })
- getDetails({ id: id }).then(res => {
- this.form = res.data.data
- if (res.data.data.status == 1) {
- this.optionForm.disabled = true
- } else {
- this.optionForm.disabled = false
- }
- }).finally(() => {
- loading.close();
- })
- },
- inRevoke() {
- revoke(this.form).then(res => {
- this.editButton = false
- this.optionForm.disabled = false
- this.$message.success("撤销成功");
- this.getDetail(this.form.id)
- })
- },
- inConfirm() {
- confirming(this.form).then(res => {
- this.editButton = true
- this.optionForm.disabled = true
- this.$message.success("确认成功");
- this.getDetail(this.form.id)
- })
- },
- //自定义列保存
- async saveColumnTwo(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- backToList(type) {
- this.$emit("backToList", type);
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- </style>
|