This commit is contained in:
liushuai
2020-03-21 17:10:21 +08:00
parent 3c554e5909
commit e314062d42
23 changed files with 473 additions and 793 deletions

View File

@@ -134,34 +134,38 @@ export default {
this.update(row)
},
searchTable() {
this.loading = true
this.tableData = []
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
searchParts(this.pageCurrent, this.pageSize, this.check1, this.contractNumValue).then(response => {
this.loading = false
console.log(response.data.rows)
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].物料型号 === null || response.data.rows[i].物料型号 === '') {
response.data.rows[i].物料型号 = response.data.rows[i].零件图号
}
}
if (response.data.rows.length !== 0) {
if (this.contractNumValue) {
this.loading = true
this.tableData = []
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
searchParts(this.pageCurrent, this.pageSize, this.check1, this.contractNumValue).then(response => {
this.loading = false
console.log(response.data.rows)
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
采购合同编号: response.data.rows[i].采购合同编号,
采购合同明细流水号: response.data.rows[i].采购合同明细流水号,
供应商名称: response.data.rows[i].供应商名称,
物料型号: response.data.rows[i].物料型号,
物料名称: response.data.rows[i].物料名称,
数量: response.data.rows[i].数量,
单价: Number(response.data.rows[i].单价).toFixed(2),
金额: response.data.rows[i].金额
})
if (response.data.rows[i].物料型号 === null || response.data.rows[i].物料型号 === '') {
response.data.rows[i].物料型号 = response.data.rows[i].零件图号
}
}
}
console.log(response, 90)
this.total = response.data.total
})
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
采购合同编号: response.data.rows[i].采购合同编号,
采购合同明细流水号: response.data.rows[i].采购合同明细流水号,
供应商名称: response.data.rows[i].供应商名称,
物料型号: response.data.rows[i].物料型号,
物料名称: response.data.rows[i].物料名称,
数量: response.data.rows[i].数量,
单价: Number(response.data.rows[i].单价).toFixed(2),
金额: response.data.rows[i].金额
})
}
}
console.log(response, 90)
this.total = response.data.total
})
} else {
this.tableData = []
}
},
update(row) {
console.log(row, 12)

View File

@@ -15,7 +15,7 @@
<el-card>
<el-table v-loading="" :data="tableData" stripe border style="width: 100%;max-height: 600px;margin-top: 10px" height="600px" size="mini">
<el-table-column label="采购合同编号" align="center" width="120">
<el-table-column label="采购合同编号" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>

View File

@@ -107,7 +107,7 @@
{{ scope.row.规格或材料 }}
</template>
</el-table-column>
<el-table-column label="订货数量" align="center" width="70">
<el-table-column label="订货数量" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
@@ -146,10 +146,10 @@
<!-- size="small"-->
<!-- style="margin-top:10px"-->
<!-- @click="calculateContractSum">计算合同总额</el-button>-->
<span>合同(未税):</span>
<span>合同(未税):</span>
<el-input v-model="contractSum2" size="small"/>
<span style="margin-left: -10px;"></span>
<span>合同(含税):</span>
<span>合同(含税):</span>
<el-input v-model="contractSum" size="small" />
<span style="margin-left: -10px;"></span>
</el-card>
@@ -480,7 +480,7 @@ export default {
}
console.log(value)
this.tableData4[index][date] = value
this.calculateContractSum(row)
this.calculateContractSum()
},
filterNuber1(val, index, date, row) {
let value = '' + val
@@ -497,12 +497,14 @@ export default {
console.log(value)
this.tableData5[index][date] = value
this.update1(row)
this.calculateContractSum()
},
handleSelectionChange(val) {
this.multipleSelection = val
for (let i = 0; i < this.multipleSelection.length; i++) {
this.Selection.push(Number(this.multipleSelection[i].请购单明细流水号))
}
this.calculateContractSum()
},
submitGroup() {
submitGroup(this.contractNumValue, this.form3.groupNumValue).then(response => {
@@ -637,11 +639,11 @@ export default {
this.costAccount = 0
this.riseFallPoint = 0
// this.tableData4 = []
for (let i = 0; i < this.tableData4.length; i++) {
if (this.tableData4[i].单价 === '') {
this.tableData4[i].单价 = 0.00
for (let i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i].单价 === '') {
this.multipleSelection[i].单价 = 0.00
}
this.tableData4[i].金额 = parseFloat(this.tableData4[i].单价) * parseFloat(this.tableData4[i].零件数量)
this.tableData4[i].金额 = parseFloat(this.multipleSelection[i].单价) * parseFloat(this.multipleSelection[i].零件数量)
this.contractSum1 += parseFloat(this.tableData4[i].金额)
// this.tableData4.push(this.groupNum2[i])
}

View File

@@ -1,115 +1,104 @@
<template>
<div class="app-container">
<el-card>
<!-- <span>发票号:</span>-->
<el-input v-model="invoiceNum" placeholder="发票号\供应商" size="small" clearable/>
<el-button type="primary" size="small" plain icon="el-icon-search" style="margin-left:10px" @click="tableData2=[];total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
<el-button type="distribution" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="createOrder()">到票</el-button>
<span>申请时间:</span>
<el-date-picker v-model="date1" size="small" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始日期"/>&nbsp;~
<el-date-picker v-model="date2" size="small" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择结束日期"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left:10px" @click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<h4 style="margin: 5px">票结算申请单</h4>
<el-table id="expandTable" :data="tableData1" border stripe highlight-current-row style="width: 100%;" height="350px" size="mini" @row-click="searchTable2">
<!--<el-table-column label="详情" type="expand">-->
<!--<template slot-scope="scope">-->
<!--<el-form label-position="left" inline class="demo-table-expand">-->
<!--<el-row>-->
<!--<el-col :span="6">-->
<!--<viewer>-->
<!--<img :src="scope.row.scanSrc" alt="发票扫描件" height="120px">-->
<!--</viewer>-->
<!--</el-col>-->
<!--<el-col :span="6">-->
<!--<el-form-item label="已付款项">-->
<!--<span>{{ scope.row.已付款项 }}</span>-->
<!--</el-form-item><br>-->
<!--<el-form-item label="尚欠金额">-->
<!--<span>{{ scope.row.尚欠金额 }}</span>-->
<!--</el-form-item><br>-->
<!--<el-form-item label="备注">-->
<!--<span>{{ scope.row.备注 }}</span>-->
<!--</el-form-item><br>-->
<!--</el-col>-->
<!--<el-col :span="6">-->
<!--<el-form-item label="是否费用类发票">-->
<!--<span>{{ scope.row.是否费用类 }}</span>-->
<!--</el-form-item><br>-->
<!--<el-form-item label="税额">-->
<!--<span>{{ scope.row.税额 }}</span>-->
<!--</el-form-item>-->
<!--</el-col>-->
<!--</el-row>-->
<!--</el-form>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="供应商" prop="供应商名称" align="center" width="170" show-overflow-tooltip>
<h4 style="margin-top: 5px">票结算申请单</h4>
<el-table id="expandTable" :data="tableData1" border highlight-current-row style="width: 100%" height="330" size="mini" @row-click="searchTable2">
<el-table-column label="展开" align="center" type="expand" >
<template slot-scope="scope">
<el-form label-position="left" inline class="demo-table-expand">
<el-row>
<el-col :span="6">
<viewer>
<img :src="scope.row.scanSrc" alt="发票扫描件" height="120px">
</viewer>
</el-col>
<el-col :span="6">
<el-form-item label="已付款项">
<span>{{ scope.row.已付款项 }}</span>
</el-form-item><br>
<el-form-item label="尚欠金额">
<span>{{ scope.row.尚欠金额 }}</span>
</el-form-item><br>
<el-form-item label="备注">
<span>{{ scope.row.备注 }}</span>
</el-form-item><br>
</el-col>
<el-col :span="6">
<el-form-item label="是否费用类发票">
<span>{{ scope.row.是否费用类 }}</span>
</el-form-item><br>
<el-form-item label="税额">
<span>{{ scope.row.税额 }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="发票号" prop="发票号" align="center" width="120">
<el-table-column label="发票号" align="center" min-width="118">
<template slot-scope="scope">
{{ scope.row.发票号 }}
</template>
</el-table-column>
<el-table-column label="发票金额(元)" align="center" min-width="110">
<el-table-column label="发票金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.发票金额 }}
</template>
</el-table-column>
<el-table-column label="申请人" prop="申请人姓名" align="center" width="90">
<el-table-column label="申请人" align="center" min-width="85">
<template slot-scope="scope">
{{ scope.row.申请人姓名 ? scope.row.申请人姓名 : '未提交' }}
</template>
</el-table-column>
<el-table-column label="申请时间" prop="申请时间" align="center" width="80">
<el-table-column label="申请时间" align="center" min-width="140">
<template slot-scope="scope">
{{ scope.row.申请时间 ? scope.row.申请时间.split(' ')[0] : '—' }}
{{ scope.row.申请时间 ? scope.row.申请时间 : '—' }}
</template>
</el-table-column>
<el-table-column label="采购审批" prop="审批人1姓名" align="center" width="100">
<el-table-column label="采购审批" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.审批人1姓名 ? scope.row.审批人1姓名 : '未审批' }}
</template>
</el-table-column>
<el-table-column label="审批时间" align="center" min-width="80">
<el-table-column label="审批时间" align="center" min-width="110">
<template slot-scope="scope">
{{ scope.row.审批1时间 ? scope.row.审批1时间.split(' ')[0] : '—' }}
{{ scope.row.审批1时间 ? scope.row.审批1时间 : '—' }}
</template>
</el-table-column>
<el-table-column label="财务审批" prop="审批人2姓名" align="center" width="100">
<el-table-column label="财务审批" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.审批人2姓名 ? scope.row.审批人2姓名 : '未审批' }}
</template>
</el-table-column>
<el-table-column label="审批时间" align="center" min-width="80">
<el-table-column label="审批时间" align="center" min-width="110">
<template slot-scope="scope">
{{ scope.row.审批2时间 ? scope.row.审批2时间.split(' ')[0] : '—' }}
{{ scope.row.审批2时间 ? scope.row.审批2时间 : '—' }}
</template>
</el-table-column>
<el-table-column label="总经理审批" prop="审批人3姓名" align="center" width="120">
<el-table-column label="总经理审批" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.审批人3姓名 ? scope.row.审批人3姓名 : '未审批' }}
</template>
</el-table-column>
<el-table-column label="审批时间" align="center" min-width="80">
<el-table-column label="审批时间" align="center" min-width="110">
<template slot-scope="scope">
{{ scope.row.审批3时间 ? scope.row.审批3时间.split(' ')[0] : '—' }}
{{ scope.row.审批3时间 ? scope.row.审批3时间 : '—' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="160" fixed="right">
<el-table-column label="操作" align="center" width="100" fixed="right">
<template slot-scope="scope">
<el-tooltip :open-delay="1000" effect="dark" content="编辑" placement="top">
<div style="display: inline-block">
<el-button :disabled="Number(scope.row.是否提交申请)===1" type="text" icon="el-icon-edit-outline" size="mini" style="margin-left:10px" @click="handleEdit(scope.row)"/>
</div>
</el-tooltip>
<el-tooltip :open-delay="1000" effect="dark" content="删除" placement="top">
<div style="display: inline-block">
<el-button :disabled="Number(scope.row.是否提交申请)===1" type="text" icon="el-icon-delete" size="mini" style="margin-left:10px" @click="handleDelete(scope.row)"/>
</div>
</el-tooltip>
<el-button :disabled="Number(scope.row.是否提交申请)===1" type="text" icon="el-icon-circle-check" size="mini" style="margin-left:10px" @click="submitApply(scope.row)">提交申请</el-button>
<el-button :disabled="false" type="primary" size="mini" plain @click="excuteApprove(scope.row)">审批</el-button>
</template>
</el-table-column>
</el-table>
@@ -127,301 +116,73 @@
</el-card>
<el-card>
<h4 style="margin: 5px;display: inline-block;width: 150px;">票结算申请单明</h4>
<h4 style="margin-top: 5px;display: inline-block;width: 150px;">票结算申请单明</h4>
<span>发票号</span>
<el-input v-model="invoiceNumber" size="small" placeholder="请选择发票结算申请单" readonly/>
<el-button :disabled="disabled" type="distribution" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="addInStoreRecord()">追加入库记录</el-button>
<el-table :data="tableData2" border highlight-current-row style="width: 100%;max-height: 250px;" height="250px" size="mini">
<el-table-column label="名称" align="center" width="150">
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购物料名称 || scope.row.离线物料名称 || scope.row.采购零件名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="100" show-overflow-tooltip>
<el-table-column label="图号或型号" align="center" min-width="180">
<template slot-scope="scope">
{{ scope.row.采购物料型号 || scope.row.离线物料型号 || scope.row.采购零件图号 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="150">
<el-table-column label="规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购物料规格 || scope.row.离线物料规格 || scope.row.采购零件规格 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="150">
<el-table-column label="供应商" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.备注 }}
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="合同编号" align="center" width="120">
<el-table-column label="合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 || scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column label="合同名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同名称 || scope.row.离线合同名称 }}
</template>
</el-table-column>
<el-table-column label="到票数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.到票数量 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-tooltip :open-delay="1000" effect="dark" content="删除" placement="top">
<div style="display: inline-block">
<el-button :disabled="disabled" type="text" size="mini" icon="el-icon-delete" @click="deleteTable2(scope.row)"/>
</div>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog v-el-drag-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 300px" width="680px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="110px">
<el-row>
<el-col :span="12">
<el-form-item label="发票号" prop="invoiceNum">
<el-input v-model="form1.invoiceNum" size="small" placeholder="发票号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发票金额(元)" prop="money">
<el-input v-positive="'float'" v-model="form1.money" type="float" size="small" placeholder="发票金额"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="供应商" prop="supplierValue">
<el-select v-model="form1.supplierValue" :disabled="title1 === '编辑发票结算申请单'" placeholder="供应商" filterable size="small">
<el-option
v-for="item in supplier"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="尚欠金额(元)">
<el-input v-model="form1.unpaid" size="small" placeholder="尚欠金额"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="税额(元)">
<el-input v-model="form1.tax" size="small" placeholder="税额"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="已付款项">
<el-input v-model="form1.paid" size="small" placeholder="已付款项"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否费用类">
<el-input v-model="form1.isCost" size="small" placeholder="是否费用类发票"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注">
<el-input v-model="form1.remark" size="small" placeholder="备注"/>
</el-form-item>
</el-col>
<!--<b v-show="title1 === '创建发票结算申请单'" style="float:left;color: #f56c6c;margin-top: 13px">* </b>-->
<!--<el-form-item v-show="title1 === '创建发票结算申请单'" label="发票扫描件" style="display: inline-block">-->
<!--<el-upload-->
<!--id="invoiceScan"-->
<!--ref="upload"-->
<!--:auto-upload="false"-->
<!--:on-success="uploadSuccess"-->
<!--:before-upload="beforeUpload"-->
<!--:on-exceed="warningExceed"-->
<!--:limit="limit"-->
<!--:action="upload+'?invoiceNum='+form1.invoiceNum+'&money='+form1.money+'&supplierValue='+form1.supplierValue+'&paid='+form1.paid+'&unpaid='+form1.unpaid+'&tax='+form1.tax+'&isCost='+form1.isCost+'&remark='+form1.remark+'&personId='+id"-->
<!--list-type="picture-card">-->
<!--<i class="el-icon-plus"/>-->
<!--</el-upload>-->
<!--</el-form-item>-->
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible1 = false">取消</el-button>
<el-button v-if="title1 === '创建发票结算申请单'" size="small" type="primary" @click="submitAdd1()">确定</el-button>
<el-button v-else size="small" type="primary" @click="submitEdit()">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :title="title2" :visible.sync="dialogVisible2" center style="min-height: 300px" width="900px">
<span>供应商</span>
<el-input v-model="supplierName" size="small" placeholder="请选择供应商发票" style="margin: 0 5px 10px 0;" readonly/>
<el-radio-group v-show="false" v-model="contractType" size="small" @change="searchTable01()">
<el-radio label="采购合同" border/>
<el-radio label="离线合同" border/>
</el-radio-group>
<el-table :data="tableData01" border highlight-current-row style="width: 100%;max-height: 250px;" height="250px" size="mini" @row-click="searchTable02">
<el-table-column label="供应商" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.采购合同编号 : scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column label="合同名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同名称 ? scope.row.采购合同名称 : scope.row.离线合同名称 }}
</template>
</el-table-column>
</el-table>
<el-table v-show="type!==4" ref="multipleTable" :data="tableData03" border style="width: 100%;max-height: 250px;" height="250px" size="mini" @selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" type="selection" align="center" width="45"/>
<el-table-column label="名称" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 ? scope.row.物料名称 : scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料型号 ? scope.row.物料型号 : scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.物料规格 ? scope.row.物料规格 : scope.row.规格 }}
</template>
</el-table-column>
<el-table-column label="采购数量" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="已到货数量" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.已到货数量 }}
</template>
</el-table-column>
<el-table-column label="已到票数量" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.到票数量 }}
</template>
</el-table-column>
<el-table-column label="本次到票数量" align="center" width="100">
<template slot-scope="scope">
<el-input-number v-model="scope.row.本次到票数量" :min="0" :max="(scope.row.已到货数量||scope.row.到货数量)-scope.row.到票数量" size="mini" controls-position="right" style="width: 100%;"/>
</template>
</el-table-column>
</el-table>
<el-table v-show="type===4" ref="multipleTable" :data="tableData03" border style="width: 100%;max-height: 250px;" height="250px" size="mini" @selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" type="selection" align="center" width="45"/>
<el-table-column label="名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.组件名称 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="采购数量" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="已到货数量" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.已到货数量 }}
</template>
</el-table-column>
<el-table-column label="已到票数量" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.到票数量 }}
</template>
</el-table-column>
<el-table-column label="本次到票数量" align="center" width="100">
<template slot-scope="scope">
<el-input-number v-model="scope.row.本次到票数量" :min="0" :max="(scope.row.已到货数量||scope.row.到货数量)-scope.row.到票数量" size="mini" controls-position="right" style="width: 100%;"/>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible2 = false">取消</el-button>
<el-button :disabled="group.length===0" size="small" type="primary" @click="submitAdd2()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { insertInto, searchSupplier, searchTable1, submitEdit, submitDelete, submitApply, searchTable2, searchPurchase, searchOffline, searchPurchaseDetail, searchOfflineDetail, searchPurchaseDetail1,
addTable2, deleteTable2 } from '@/api/WorkshopProcurement/InvoiceSettlementApplication1'
import { searchTable1, searchTable2, excuteApprove } from '@/api/WorkshopProcurement/InvoiceSettlementApprove1'
import { mapGetters } from 'vuex'
import { uploadInvoiceScan1 } from '@/utils/request'
import { readFile } from '@/utils/request'
import request from '@/utils/request'
export default {
name: '', // 发票结算申请
name: '', // 发票结算审批
data() {
return {
disabled: false,
contractType: '采购合同',
invoiceNum: '',
date1: '',
date2: '',
tableData1: [],
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
tableData1: [],
applyOrderNum: '',
invoiceNumber: '',
title2: '',
dialogVisible2: false,
tableData2: [],
dialogVisible1: false,
title1: '',
type: '',
supplier: [],
supplierName: '',
supplierValue: '',
form1: {
invoiceNum: '',
money: '',
supplierValue: '',
paid: '',
unpaid: '',
tax: '',
isCost: '',
remark: '',
applyOrderNum: ''
},
rules1: {
invoiceNum: [
{ required: true, message: '请输入发票号' }
],
money: [
{ required: true, message: '请输入开票金额' }
],
supplierValue: [
{ required: true, message: '请选择供应商' }
]
},
upload: uploadInvoiceScan1,
limit: 1,
tableData01: [],
tableData02: [],
tableData03: [],
inboundCardNumber: '', // 入库单号
group: [] // 发票结算申请单明细流水号组
tableData3: []
}
},
computed: {
...mapGetters([
'token',
'sidebar',
'name',
'id' // 人员编号
@@ -433,35 +194,11 @@ export default {
},
methods: {
fetchData() {
this.supplier = []
searchSupplier().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.supplier.push({
label: response.data[i].供应商名称,
value: response.data[i].供应商流水号
})
}
})
},
createOrder() {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.form1.invoiceNum = ''
this.form1.money = ''
this.form1.supplierValue = ''
this.form1.paid = ''
this.form1.unpaid = ''
this.form1.tax = ''
this.form1.isCost = ''
this.form1.remark = ''
this.title1 = '创建发票结算申请单'
this.dialogVisible1 = true
console.log(this.token)
},
searchTable1() {
let check1
this.invoiceNum ? check1 = 1 : check1 = 0
searchTable1(check1, this.invoiceNum, this.pageCurrent1, this.pageSize1).then(response => {
this.date1 && this.date2 ? this.check1 = 1 : (this.check1 = 0, this.date1 = '', this.date2 = '')
searchTable1(this.check1, this.date1, this.date2, this.pageCurrent1, this.pageSize1).then(response => {
this.tableData1 = response.data.rows
this.tableData1.map(v => {
this.$set(v, 'scanSrc', '')
@@ -473,102 +210,16 @@ export default {
this.total1 = response.data.total
})
},
submitAdd1() { // 提交新增
this.$refs['form1'].validate((valid) => {
if (valid) {
insertInto(this.form1.invoiceNum, this.form1.money, this.form1.supplierValue, this.form1.paid, this.form1.unpaid, this.form1.tax, this.form1.isCost, this.form1.remark).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.dialogVisible1 = false
this.searchTable1()
} else {
this.$message.error('增加失败')
}
})
} else {
return false
}
})
},
submitEdit() { // 提交编辑
this.$refs['form1'].validate((valid) => {
if (valid) {
submitEdit(this.form1.invoiceNum, this.form1.money, this.form1.paid, this.form1.unpaid, this.form1.tax, this.form1.isCost, this.form1.remark, this.form1.applyOrderNum).then(response => {
if (response.data[0].result === '修改成功') {
this.$message.success('编辑成功')
this.dialogVisible1 = false
this.searchTable1()
} else if (response.data[0].result === '修改失败') {
this.$message.error('已提交申请,编辑失败')
} else { this.$message.error('编辑失败') }
})
} else {
return false
}
})
},
handleEdit(row) {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.form1.invoiceNum = row.发票号
this.form1.money = row.发票金额
this.form1.supplierValue = Number(row.供应商流水号)
this.form1.paid = row.已付款项
this.form1.unpaid = row.尚欠金额
this.form1.tax = row.税额
this.form1.isCost = row.是否费用类
this.form1.remark = row.备注
this.form1.applyOrderNum = row.发票结算申请单流水号
this.title1 = '编辑发票结算申请单'
this.dialogVisible1 = true
},
handleDelete(row) {
this.$confirm('确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
submitDelete(row.发票结算申请单流水号).then(response => {
if (response.data[0].result === '删除成功') {
this.$message.success('删除成功')
this.searchTable1()
} else if (response.data[0].result === '删除失败') {
this.$message.error('已提交申请,删除失败')
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
async searchPic(row, i) {
},
warningExceed() {
this.$message.error('仅可上传一张发票')
},
beforeUpload(file) { // 上传前检测
const isJPG = /^image\/.*/.test(file.type)
const isLt4M = file.size / 1024 / 1024 < 4
if (!isJPG) {
this.$message.error('只能上传图片。。')
}
if (!isLt4M) {
this.$message.error('上传头像图片大小不能超过 4MB!')
}
return isJPG && isLt4M
},
uploadSuccess(res) { // 上传成功回调
if (res[0].result === '1') {
this.$message.success('增加成功')
this.dialogVisible1 = false
this.searchTable1()
this.$refs.upload.clearFiles()
} else {
this.$message.error('增加失败')
}
const { data } = await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 车间采购管理_采购发票_附件 where 是否启用 = 1 and 发票交接流水号 = ${row.发票结算申请单流水号}`
}
})
this.tableData1[i].scanSrc = readFile + data[0].文件标识 + '.' + data[0].文件后缀
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
@@ -579,169 +230,41 @@ export default {
this.pageCurrent1 = val
this.searchTable1()
},
submitApply(row) {
if (this.tableData2.length === 0) {
this.$message.warning('发票结算申请明细为空!')
} else {
this.$confirm('确认提交申请吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
submitApply(row.发票结算申请单流水号, this.id).then(response => {
if (response.data[0].result === '1') {
this.$message.success('提交成功')
this.searchTable1()
this.tableData2 = []
} else { this.$message.error('提交失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
},
searchTable2(row) {
this.applyOrderNum = row.发票结算申请单流水号
this.invoiceNumber = row.发票号
this.supplierName = row.供应商名称
this.supplierValue = row.供应商流水号
Number(row.是否提交申请) === 1 ? this.disabled = true : this.disabled = false
searchTable2(row.发票结算申请单流水号).then(response => {
this.tableData2 = response.data
})
},
addInStoreRecord() {
if (this.applyOrderNum) {
this.searchTable01()
this.title2 = '追加入库单'
this.dialogVisible2 = true
} else {
this.$message.error('请选择发票!')
}
},
searchTable01() {
this.tableData01 = []
this.tableData02 = []
this.tableData03 = []
if (this.contractType === '采购合同') {
searchPurchase(this.supplierValue).then(response => {
this.tableData01 = response.data
})
} else if (this.contractType === '离线合同') {
searchOffline(this.supplierValue).then(response => {
response.data.map(data => {
if (Number(data.离线合同状态) === 2) {
this.tableData01.push(data)
}
})
})
this.type = ''
}
},
searchTable02(row) {
this.tableData02 = []
this.tableData03 = []
if (this.contractType === '采购合同') {
if (row.模板类型 === 4) {
this.type = row.模板类型
searchPurchaseDetail1(row.采购合同流水号).then(response => {
response.data.map(data => {
this.$set(data, '本次到票数量', 0)
data.本次到票数量 = data.已到货数量 - data.到票数量
this.tableData03.push(data)
})
})
} else {
searchPurchaseDetail(row.采购合同流水号).then(response => {
response.data.map(data => {
this.$set(data, '本次到票数量', 0)
data.本次到票数量 = data.已到货数量 - data.到票数量
this.tableData02.push(data)
})
})
}
} else if (this.contractType === '离线合同') {
searchOfflineDetail(row.离线合同流水号).then(response => {
response.data.map(data => {
this.$set(data, '本次到票数量', 0)
data.本次到票数量 = data.到货数量 - data.到票数量
this.tableData02.push(data)
})
})
}
},
handleSelectionChange(val) {
this.group = val
},
submitAdd2() { // 追加入库单
if (this.group.length === 0) {
this.$message.warning('请选择零件或物料')
} else {
const group1 = []
const group2 = []
if (this.contractType === '采购合同') {
for (let i = 0; i < this.group.length; i++) {
group1.push(this.group[i].采购合同明细流水号)
group2.push(this.group[i].本次到票数量)
}
addTable2(this.applyOrderNum, group1, group2, 1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('追加成功')
this.dialogVisible2 = false
searchTable2(this.applyOrderNum).then(response => {
this.tableData2 = response.data
})
} else { this.$message.error('追加失败') }
})
} else if (this.contractType === '离线合同') {
for (let i = 0; i < this.group.length; i++) {
group1.push(this.group[i].离线合同明细流水号)
group2.push(this.group[i].本次到票数量)
}
addTable2(this.applyOrderNum, group1, group2, 2).then(response => {
if (response.data[0].result === '1') {
this.$message.success('追加成功')
this.dialogVisible2 = false
searchTable2(this.applyOrderNum).then(response => {
this.tableData2 = response.data
})
} else { this.$message.error('追加失败') }
})
}
}
},
deleteTable2(row) {
this.$confirm('确认删除吗?', '提示', {
excuteApprove(row) {
this.$confirm('确认审批签字?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteTable2(row.发票结算申请单明细流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
searchTable2(this.applyOrderNum).then(response => {
this.tableData2 = response.data
})
} else { this.$message.error('删除失败') }
excuteApprove(row.发票结算申请单流水号, this.id, this.token).then(response => {
if (response.data[0].result === '审批成功') {
this.$message.success('审批成功')
this.searchTable1()
} else if (response.data[0].result === '已完成审批') {
this.$message.warning('已完成审批,不可重复审批')
} else { this.$message.error('审批失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
message: '已取消审批'
})
})
},
selectable(row) {
return Number(row.本次到票数量) > 0
searchTable2(row) {
this.invoiceNumber = row.发票号
searchTable2(row.发票结算申请单流水号).then(response => {
this.tableData2 = response.data
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 0px;
}
.el-select{
width:200px
}
@@ -755,4 +278,3 @@ export default {
margin: 0;
}
</style>

View File

@@ -116,12 +116,12 @@
<template slot-scope="scope">
<el-tooltip :open-delay="1200" effect="dark" content="关联备料材料" placement="top">
<div style="display: inline-block">
<el-button :disabled="disable === '1' || totalWight1 === 数量" type="text" size="mini" icon="el-icon-circle-plus-outline" @click="addArrivalCL(scope.row)">备料材料</el-button>
<el-button :disabled="Number(disable) === 1 || totalWight1 === 数量" type="text" size="mini" icon="el-icon-circle-plus-outline" @click="addArrivalCL(scope.row)">备料材料</el-button>
</div>
</el-tooltip>
<el-tooltip :open-delay="200" effect="dark" content="取消关联" placement="top">
<div style="display: inline-block">
<el-button :disabled="disable === '1'" type="text" size="mini" style="margin-left: 20px" icon="el-icon-top" @click="deleteArrivalMX(scope.row)"/>
<el-button :disabled="Number(disable) === 1" type="text" size="mini" style="margin-left: 20px" icon="el-icon-top" @click="deleteArrivalMX(scope.row)"/>
</div>
</el-tooltip>
</template>
@@ -188,7 +188,7 @@
<template slot-scope="scope">
<el-tooltip effect="dark" content="取消关联" placement="top">
<div style="display: inline-block">
<el-button :disabled="disable === '1'" type="text" icon="el-icon-top" size="mini" @click="deleteMateriel(scope.row)"/>
<el-button :disabled="Number(disable) === 1" type="text" icon="el-icon-top" size="mini" @click="deleteMateriel(scope.row)"/>
</div>
</el-tooltip>
</template>
@@ -431,6 +431,7 @@
<span>零件图号</span>
<el-input v-model="零件图号" style="width: 150px" size="small" clearable/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchTable20()">查询</el-button>
<span style="margin-left: 20px">未绑定重量:{{ 未绑定数量 }}KG</span>
<el-table
ref="multipleTable"
:row-key="getRowKeys"
@@ -1191,6 +1192,9 @@ export default {
if (response.data.length !== 0) {
this.中间变量 = response.data[0].单件重量
this.未绑定数量 = response.data[0].未绑定数量
console.log(this.未绑定数量, 111)
} else {
this.未绑定数量 = row.数量
}
})
},

View File

@@ -3,7 +3,7 @@
<el-card>
<el-row>
<!--<span> &nbsp; &nbsp;:</span>-->
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" style="width: 170px" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
@@ -60,7 +60,7 @@
height="500px"
highlight-current-row
@row-click="searchTable2">
<el-table-column label="采购合同号" align="center">
<el-table-column label="采购合同号" align="center" width="170px">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
@@ -112,8 +112,8 @@
</el-table-column>
<el-table-column label="操作" align="center" min-width="100px">
<template slot-scope="scope">
<el-button type="text" plain size="mini" icon="el-icon-printer" @click="exportTable()">打印</el-button>
<el-button :disabled="scope.row.审批情况内容==='通过审批'" type="text" plain size="mini" icon="el-icon-back" @click="Disable(scope.row)">打回</el-button>
<el-button type="text" size="mini" icon="el-icon-printer" @click="exportTable()">打印</el-button>
<el-button :disabled="scope.row.审批情况内容==='通过审批'" type="text" size="mini" icon="el-icon-back" @click="Disable(scope.row)">打回</el-button>
</template>
</el-table-column>
</el-table>
@@ -543,7 +543,7 @@ export default {
}
},
Disable(row) {
this.$confirm('此操作将永久禁用该行, 是否继续?', '提示', {
this.$confirm('将合同打回到请购单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

View File

@@ -135,14 +135,13 @@
</el-row>
<el-dialog :visible.sync="dialogVisible2" title="采购合同请款" center style="min-height: 300px" width="1200px">
<span>供应商</span>
<el-select v-model="supplierValue" placeholder="供应商" filterable clearable size="small">
<el-select v-model="supplierValue" placeholder="供应商" filterable clearable size="small" @change="searchTable01()">
<el-option
v-for="item in supplier"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin: 0 10px 10px 10px" @click="searchTable01()">查询</el-button>
<el-table v-loading="" :data="tableData01" border style="max-height: 300px;" height="300px" size="mini" @selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" type="selection" align="center" width="50"/>
<el-table-column label="采购合同编号" align="center" min-width="120">
@@ -343,6 +342,7 @@ export default {
this.tableData01 = response.data
})
} else {
this.tableData01 = []
this.$message.error('请选择供应商')
}
},

View File

@@ -136,7 +136,7 @@
{{ scope.row.开票时间 ? scope.row.开票时间.split(' ')[0] : '' }}
</template>
</el-table-column>
<el-table-column align="center" label="票金额" width="100px" prop="到票金额">
<el-table-column align="center" label="票金额" width="100px" prop="到票金额">
<template slot-scope="scope">
{{ scope.row.开票金额.toFixed(2) }}
</template>

View File

@@ -17,7 +17,7 @@
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchContractDetail">查询明细</el-button>
<!--<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchContractDetail">查询明细</el-button>-->
<el-button type="distribution" style="margin: 10px" size="small" icon="el-icon-circle-check" @click="submitInStorage">确认到货</el-button>
</el-card>
<el-card>