123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484 |
- <template>
- <div>
- <div class="sty">
- <el-page-header @back="goBack"> </el-page-header>
- </div>
- <br />
- <span>基本信息</span>
- <el-divider></el-divider>
- <!-- 表头 -->
- <div>
- <el-form ref="searchForm" :model="searchForm" label-width="100px" size="small" label-position="left">
- <el-row :gutter="20">
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="单据类型" prop="">
- <el-input disabled v-model="searchForm.billType" placeholder=""></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="单据编号" prop="">
- <el-input disabled v-model="searchForm.code" placeholder=""></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="单据来源" prop="">
- <el-input disabled v-model="searchForm.source" placeholder=""></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="单据状态" prop="">
- <el-input disabled v-model="searchForm.examineStatus" placeholder=""></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="业务日期" prop="">
- <el-input disabled v-model="searchForm.theTime" placeholder=""></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="到期日" prop="">
- <el-input disabled v-model="searchForm.endTime" placeholder=""></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="总金额" prop="">
- <el-input disabled v-model="searchForm.totalAmount" placeholder=""></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="备注" prop="">
- <el-input disabled v-model="searchForm.remark" placeholder=""></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <span>明细</span>
- <el-divider></el-divider>
- <!-- 列表 -->
- <div class="mymain-container">
- <div class="table" v-if="czType === 'detail'">
- <el-table
- v-loading="listLoading"
- :data="dataList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- >
- <el-table-column label="序号" align="left" type="index" width="100" show-overflow-tooltip></el-table-column>
- <el-table-column align="left" label="经销商编号" prop="customerNumber" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.customerNumber" />
- <span>{{ scope.row.customerNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.customerName" />
- <span>{{ scope.row.customerName }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="*费用项目编码"
- prop="projectCode"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="项目费用名称"
- prop="projectName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="*费用承担部门"
- prop="departmentId"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="*收入部门"
- prop="incomeDept"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="现金钱包"
- prop="customerWalletName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column align="left" label="*发票类型" prop="invoiceType" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-select disabled filterable v-model="scope.row.invoiceType" placeholder="请选择">
- <el-option label="普通发票" value=""> </el-option>
- <el-option label="增值税发票" value="1"> </el-option>
- <el-option label="机票" value="P"> </el-option>
- <el-option label="火车票" value="R"> </el-option>
- <el-option label="其他运输票" value="O"> </el-option>
- <el-option label="其他" value="E"> </el-option>
- </el-select>
- </template>
- </el-table-column>
- <!-- <el-table-column
- align="left"
- label="不含税金额"
- prop="afterTaxAmount"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="税额"
- prop="tax"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column> -->
- <el-table-column
- align="right"
- label="总金额"
- prop="totalAmount"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="备注"
- prop="remark"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- </el-table>
- </div>
- <div class="table" v-if="czType === 'edit'">
- <el-table
- v-loading="listLoading"
- :data="dataList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- :row-class-name="rouClassNameFn"
- @row-click="onRowClick"
- >
- <el-table-column align="left" label="序号">
- <template slot-scope="scope">
- {{ scope.$index + 1 }}
- </template>
- </el-table-column>
- <el-table-column align="left" label="*经销商名称" prop="customerName" min-width="300" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-select
- class="selectClass"
- @change="changeCustomerFn($event, scope.$index)"
- v-model="scope.row.customerId"
- placeholder="请选择"
- filterable
- >
- <el-option v-for="(item, i) in customerList" :key="i" :label="item.name" :value="item.id"> </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column align="left" label="费用项目编码" prop="projectCode" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-input v-model="scope.row.projectCode"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="left" label="*项目费用名称" prop="projectName" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-input v-model="scope.row.projectName"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="left" label="*费用承担部门" prop="departmentId" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-input v-model="scope.row.departmentId"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="left" label="*收入部门" prop="incomeDept" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-input v-model="scope.row.incomeDept"></el-input>
- </template>
- </el-table-column>
- <el-table-column align="left" label="现金钱包" prop="walletId" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-select filterable v-model="scope.row.customerWalletId" placeholder="请选择">
- <el-option
- v-for="item in scope.row.walletList"
- :key="item.customerWalletId"
- :label="item.customerWalletName"
- :value="item.customerWalletId"
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column align="left" label="*发票类型" prop="invoiceType" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <!-- <el-input v-model="scope.row.invoiceType"></el-input> -->
- <el-select filterable v-model="scope.row.invoiceType" placeholder="请选择">
- <el-option label="普通发票" value=""> </el-option>
- <el-option label="增值税发票" value="1"> </el-option>
- <el-option label="机票" value="P"> </el-option>
- <el-option label="火车票" value="R"> </el-option>
- <el-option label="其他运输票" value="O"> </el-option>
- <el-option label="其他" value="E"> </el-option>
- </el-select>
- </template>
- </el-table-column>
- <!-- <el-table-column
- align="center"
- label="不含税金额"
- prop="afterTaxAmount"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.afterTaxAmount"
- type="number" @mousewheel.native.prevent
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="税额"
- prop="tax"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-input type="number" @mousewheel.native.prevent v-model="scope.row.tax"></el-input>
- </template>
- </el-table-column> -->
- <el-table-column align="right" label="*总金额" prop="tax" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-input
- class="mountclass"
- type="number"
- @mousewheel.native.prevent
- v-model="scope.row.totalAmount"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column align="left" label="税率%" prop="" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-input
- type="number"
- @mousewheel.native.prevent
- :min="0"
- oninput="if(value>100)value=100;if(value<0)value=0"
- v-model="scope.row.taxRate"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark"></el-input>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <div v-if="examineStatus === 'FAIL' || examineStatus === 'OK'">
- <span>审批记录</span>
- <el-divider></el-divider>
- <div class="diy-table-1">
- <el-row :gutter="0">
- <el-col :span="8" class="item">
- <div class="label">审批人</div>
- <div class="value">{{ this.examineBy }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">审批结果</div>
- <div class="value">
- <el-radio-group v-model="examineStatus">
- <el-radio disabled label="OK">通过</el-radio>
- <el-radio disabled label="FAIL">驳回</el-radio>
- </el-radio-group>
- </div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">审批时间</div>
- <div class="value">{{ this.examineTime }}</div>
- </el-col>
- <el-col :span="24" class="item">
- <div class="label">审批说明</div>
- <div class="value">
- {{ this.examineRemark }}
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- <!-- 按钮 -->
- <div class="btn-group clearfix">
- <div class="fl">
- <el-button v-if="czType == 'edit'" size="mini" type="primary" @click="saveFn">保存</el-button>
- </div>
- <div class="fr">
- <el-button type="primary" size="small" @click="addRowFn">添加行</el-button>
- <el-button type="primary" size="small" @click="delRowFn">删除行</el-button>
- </div>
- </div>
- <br />
- </div>
- </template>
- <script>
- import {
- getFinanceOtherReceDetail,
- getCustomerList,
- getFinanceCustomerList,
- getFinanceOtherReceUpdate
- } from '@/api/finance/receivable_list'
- export default {
- props: {
- approvalId: {
- type: String,
- required: true
- },
- czType: {
- type: String,
- required: true
- }
- },
- data() {
- return {
- customerList: [], //经销商数据
- dataList: [],
- listLoading: false, // 列表加载loading
- examineBy: '', //审核人
- examineTime: '', //审核时间
- examineStatus: null, //审核状态
- examineRemark: '', //审核备注
- searchForm: {
- billType: '',
- code: '',
- source: '',
- theTime: '',
- endTime: '',
- totalAmount: '',
- examineStatus: '',
- remark: ''
- }
- }
- },
- created() {
- this.getDataList()
- this.getCustomerList()
- },
- methods: {
- //保存
- async saveFn() {
- await getFinanceOtherReceUpdate({
- id: this.approvalId,
- items: this.dataList,
- examineStatus: this.examineStatus,
- code: this.searchForm.code
- })
- this.$message.success('编辑成功')
- this.$parent.showPage = 1
- },
- //选择经销商名称事件
- async changeCustomerFn(v, index) {
- // console.log(v, 322311);
- this.dataList[index].customerWalletId = ''
- const res = await getFinanceCustomerList({
- customerId: v,
- type: 'COMMONLY'
- })
- this.$set(this.dataList[index], 'walletList', res.data)
- console.log(this.dataList, 'kkk')
- // this.walletList = res.data;
- },
- //获取经销商数据
- async getCustomerList() {
- const res = await getCustomerList({ pageNum: 1, pageSize: -1 })
- this.customerList = res.data.records
- },
- rouClassNameFn({ row, rowIndex }) {
- //把每一行的索引放进row
- row.index = rowIndex
- },
- onRowClick(row, event, column) {
- this.delIndex = row.index
- },
- //删除行
- delRowFn() {
- this.dataList.splice(this.delIndex, 1)
- },
- //添加行数据
- addRowFn() {
- this.dataList.push({
- customerId: '',
- projectCode: 'FYXM01_SYS',
- projectName: '材料成本',
- departmentId: '',
- customerWalletId: '',
- invoiceType: '',
- incomeDept: '',
- // afterTaxAmount: "",
- // tax: "",
- totalAmount: '',
- taxRate: 13
- })
- },
- async getDataList() {
- const res = await getFinanceOtherReceDetail({ id: this.approvalId })
- // console.log(res, 123456);
- this.examineBy = res.data.examineBy
- this.examineTime = res.data.examineTime
- this.examineStatus = res.data.examineStatus
- this.examineRemark = res.data.examineRemark
- this.searchForm = {
- billType: res.data.billType,
- code: res.data.code,
- source: res.data.source,
- theTime: res.data.theTime,
- endTime: res.data.endTime,
- totalAmount: res.data.totalAmount,
- examineStatus:
- res.data.examineStatus == 'OK'
- ? '已通过'
- : res.data.examineStatus == 'FAIL'
- ? '不通过'
- : res.data.examineStatus == 'SAVE'
- ? '保存'
- : '待审核',
- remark: res.data.remark
- }
- // res.data.items.forEach((v) => {
- // this.changeCustomerFn(v.customerId, v.index);
- // });
- for (let index = 0; index < res.data.items.length; index++) {
- const a = await getFinanceCustomerList({
- customerId: res.data.items[index].customerId,
- type: 'COMMONLY'
- })
- res.data.items[index]['walletList'] = a.data
- // this.$set(this.dataList[index], "walletList", a.data);
- }
- this.dataList = res.data.items
- },
- goBack() {
- this.$parent.showPage = 1
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .selectClass {
- width: 100%;
- }
- </style>
|