| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393 |
- <template>
- <div class="borderless">
- <div class="main-head">
- <div class="main-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- <el-button type="success"
- class="el-button--small-yh add-customer-btn-two"
- :disabled="true"
- @click.stop="">复制新单
- </el-button>
- <el-button class="el-button--small-yh add-customer-btn" type="primary"
- @click.stop="editFinance "
- >{{this.id?"确认修改" :"确认新增"}}
- </el-button>
- </div>
- </div>
- <div style="margin-top: 60px">
- <containerTitle title="基础信息"></containerTitle>
- <basic-container>
- <el-form :model="form" ref="form" label-width="130px">
- <el-row>
- <el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:8" :key="index">
- <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
- <el-date-picker v-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" type="date" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
- <el-select v-else-if="item.type === 'select'" style="width: 100%" size="small" placeholder="请选择" clearable filterable></el-select>
- <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
- <el-select v-else-if="item.prop === 'currency'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
- <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
- </el-select>
- <el-select v-else-if="item.prop === 'financeStatus'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
- <el-option
- v-for="item in financeStatusDic"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <el-input type="age" v-else-if="item.prop === 'exchangeRate'" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入">
- <template slot="append">%</template>
- </el-input>
- <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
- <el-input type="age" v-else v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" autocomplete="off" placeholder="请输入"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </basic-container>
- <basic-container>
- <avue-crud :option="option"
- :data="dataList"
- ref="crud"
- v-model="form"
- :page.sync="page"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange">
- <template slot="menuLeft">
- <el-button type="primary"
- size="small"
- icon="el-icon-shopping-cart-2"
- @click="">选择销售合同
- </el-button>
- <el-button
- icon="el-icon-printer"
- size="small"
- type="primary"
- @click.stop="openReport()"
- >报 表
- </el-button>
- </template>
- <template slot="menuRight">
- <el-button type="info"
- size="small"
- @click="">发送收款信息
- </el-button>
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button
- type="text"
- icon="el-icon-view"
- size="small"
- @click.stop=""
- >费用确认
- </el-button>
- <el-button
- type="text"
- icon="el-icon-edit"
- size="small"
- @click.stop=""
- >移除数据
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </div>
- </div>
- </template>
- <script>
- import option from "./configuration/detailsPage.json";
- import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
- import {getSysNo} from "@/api/importTrade/purchase";
- import { getUserInfo } from "@/api/system/user";
- export default {
- data() {
- return {
- form: {},
- option: option,
- id:'',
- dataList: [],
- currencyDic:[],
- page: {
- pageSize: 10,
- pagerCount: 5,
- total: 0,
- },
- query:{},
- //客户组件配置控制
- configuration:{
- multipleChoices:false,
- multiple:false,
- disabled:false,
- searchShow:false,
- collapseTags:false,
- placeholder:'请点击右边按钮选择',
- dicData:[]
- },
- financeStatusDic:[{
- value: '正常',
- label: '正常'
- },
- {
- value: '停用',
- label: '停用'
- }],
- basicData: {
- column: [
- {
- label: '系统号',
- prop: 'sysNo',
- disabled:true,
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '合同号',
- prop: 'srcOrderno',
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },{
- label: '客户名称',
- prop: 'corpId',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '金额',
- prop: 'amount',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '币别',
- prop: 'currency',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '汇率',
- prop: 'exchangeRate',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '银行名称',
- prop: 'accountBank',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '银行户头',
- prop: 'accountName',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '银行账号',
- prop: 'accountNo',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '收款日期',
- prop: 'settlementDate',
- type:'date',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '制单人',
- prop: 'createUserName',
- disabled:true,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },{
- label: '制单日期',
- prop: 'createTime',
- disabled:true,
- type:'date',
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '单据状态',
- prop: 'financeStatus',
- },
- {
- label: '备注',
- prop: 'remark',
- span:24,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- ],
- },
- }
- },
- created() {
- //币别
- this.getWorkDicts("currency").then(res =>{
- this.currencyDic = res.data.data
- })
- if (this.$route.query.id) {
- this.id = BigInt(this.$route.query.id);//字符串转数字 超长用BigInt
- getDetail(this.id).then(res => {
- this.form = res.data.data;
- this.configuration.dicData = res.data.data.customerModel;
- this.dataList = res.data.data.itemsList
- })
- }else{
- getSysNo("CW-SK").then(res =>{
- this.$set(this.form,"sysNo", res.data.data)
- let date = new Date();
- let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
- this.$set(this.form,"createTime",strDate)
- })
- getUserInfo().then(res =>{
- this.$set(this.form,"createUserName", res.data.data.name)
- })
- }
- },
- mounted() {
- option.height = window.innerHeight - 640 ;
- },
- methods: {
- searchReset() {
- console.log('1')
- },
- selectionChange() {
- console.log('1')
- },
- currentChange() {
- console.log('1')
- },
- sizeChange() {
- console.log('1')
- },
- refreshChange() {
- console.log('1')
- },
- editFinance(){
- this.$refs["form"].validate((valid) => {
- if(valid){
- const params = {
- ...this.form,
- billType:"收费",
- itemsList: this.dataList,
- }
- editFinance(params).then(res =>{
- if(res.data.success){
- this.$message.success("操作成功!")
- }
- })
- }
- })
- },
- backToList(){
- this.$router.$avueRouter.closeTag();
- this.$router.push({
- path: '/financialManagement/receipt',
- query: {}
- });
- }
- }
- }
- </script>
- <style scoped>
- ::v-deep .el-form-item {
- margin-bottom: 0;
- }
- .main-head {
- position: fixed;
- top: 105px;
- width: 100%;
- margin-left: -10px;
- height: 62px;
- background: #ffffff;
- box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
- z-index: 999;
- }
- .main-back {
- cursor: pointer;
- line-height: 62px;
- font-size: 16px;
- color: #323233;
- font-weight: 400;
- }
- .add-customer-btn-two {
- position: fixed;
- right: 150px;
- top: 115px;
- }
- .add-customer-btn {
- position: fixed;
- right: 36px;
- top: 115px;
- }
- </style>
|