Merge branch 'master' of http://192.168.0.149:10010/r/高精2.0
This commit is contained in:
@@ -168,7 +168,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="单件重量" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.单件重量" step="1" size="mini" style="width:120px" @change="save(scope.$index, scope.row)"/>
|
||||
<el-input-number v-model="scope.row.单件重量" :step="1" :min="0" size="mini" style="width:120px" @change="save(scope.$index, scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总重量" align="center" prop="总重量">
|
||||
@@ -233,7 +233,7 @@
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitAddArrivalOrder">确定</el-button>
|
||||
@click="submitAddArrivalOrder">保存</el-button>
|
||||
<el-button
|
||||
v-show="title==='编辑到货单'"
|
||||
type="primary"
|
||||
@@ -246,18 +246,24 @@
|
||||
<el-dialog v-el-drag-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 200px" width="430px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="120px">
|
||||
<el-row>
|
||||
<el-form-item label="材料" prop="材料">
|
||||
<el-input v-model="form1.材料" size="small"/>
|
||||
<el-form-item v-show="title1==='添加到货明细'" label="材料" prop="CailiaoValue">
|
||||
<el-select v-model="form1.CailiaoValue" placeholder="材料" size="small" filterable>
|
||||
<el-option
|
||||
v-for="item in Cailiao"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="数量" prop="数量">
|
||||
<el-input-number v-model="form1.数量" :precision="2" :step="1" size="medium" @change="Calculation"/>
|
||||
<el-input-number v-model="form1.数量" :precision="2" :step="1" :min="0" size="medium" @change="Calculation"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="单价" prop="单价">
|
||||
<el-input-number v-model="form1.单价" :precision="2" :step="1" size="medium" @change="Calculation"/>
|
||||
<el-input-number v-model="form1.单价" :precision="2" :step="1" :min="0" size="medium" @change="Calculation"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@@ -272,12 +278,20 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
v-show="title1==='添加到货明细'"
|
||||
type="warning"
|
||||
size="small"
|
||||
plain
|
||||
icon="el-icon-check"
|
||||
@click="submitAddArrivalOrderMX">保存</el-button>
|
||||
<el-button
|
||||
v-show="title1==='添加到货明细'"
|
||||
type="primary"
|
||||
plain
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitAddArrivalOrderMX">确定</el-button>
|
||||
@click="submitAddArrivalOrderMX1">继续添加</el-button>
|
||||
<el-button
|
||||
v-show="title1==='编辑到货明细'"
|
||||
type="primary"
|
||||
@@ -294,6 +308,8 @@
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="查询采购计划单" placement="top">
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>
|
||||
</el-tooltip>
|
||||
<span style="font-size: 15px;margin-left: 10px;font-weight: bold">材料:</span><span>{{ 材料111 }}</span>
|
||||
<span style="font-size: 15px;margin-left: 10px;font-weight: bold">材料数量:</span><span>{{ 材料数量 }}</span>
|
||||
</div>
|
||||
<el-table v-loading="" :data="tableData2" border stripe style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable3">
|
||||
<el-table-column label="采购计划单号" align="center">
|
||||
@@ -384,21 +400,28 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchPurchaseOrder, searchMateriel, addMateriel, searchArriveOrder, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, saveWeight, searchTable5, searchSupplier, deleteArrivalMX, EditArrivalOrderMX, AddArrivalOrderMX, deleteMateriel, searchTable6 } from '@/api/WorkshopProcurement/NewArrivalList.js'
|
||||
import { searchCailiao, searchPurchaseOrder, searchMateriel, addMateriel, searchArriveOrder, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, saveWeight, searchTable5, searchSupplier, deleteArrivalMX, EditArrivalOrderMX, AddArrivalOrderMX, deleteMateriel, searchTable6 } from '@/api/WorkshopProcurement/NewArrivalList.js'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
Cailiao: [],
|
||||
purchasingOrder: '',
|
||||
ArrivalOrderNumber: '',
|
||||
ArrivalOrderMXNumber: '',
|
||||
supplierName0: '',
|
||||
arrest: [],
|
||||
check: 0,
|
||||
材料111: '',
|
||||
Name: '',
|
||||
单价: '',
|
||||
数量: '',
|
||||
SUM: 0,
|
||||
ALLMoney: '',
|
||||
材料数量: '',
|
||||
材料名称: '',
|
||||
未绑定数量: '',
|
||||
tableData2: [],
|
||||
total2: 0,
|
||||
pageCurrent2: 1,
|
||||
@@ -413,12 +436,14 @@ export default {
|
||||
tableData5: [],
|
||||
到货单流水号: '',
|
||||
dateRange: '',
|
||||
中间变量: '',
|
||||
form: {
|
||||
备注: '',
|
||||
日期: '',
|
||||
supplierNameValue: ''
|
||||
},
|
||||
form1: {
|
||||
CailiaoValue: '',
|
||||
材料: '',
|
||||
数量: '',
|
||||
单位: 'KG',
|
||||
@@ -437,7 +462,7 @@ export default {
|
||||
日期: [{ required: true, message: '请选择日期' }]
|
||||
},
|
||||
rules1: {
|
||||
材料: [{ required: true, message: '请填写材料' }],
|
||||
CailiaoValue: [{ required: true, message: '请选择材料' }],
|
||||
数量: [{ required: true, message: '请填写数量' }],
|
||||
单位: [{ required: true, message: '请填写单位' }],
|
||||
单价: [{ required: true, message: '请填写单价' }]
|
||||
@@ -459,10 +484,21 @@ export default {
|
||||
this.searchTable4()
|
||||
},
|
||||
methods: {
|
||||
searchCailiao() {
|
||||
this.Cailiao = []
|
||||
searchCailiao(this.供应商111).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Cailiao.push({
|
||||
value: response.data[i].材料,
|
||||
label: response.data[i].材料
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable2() { // 查询采购单列表
|
||||
this.purchasingOrder ? this.check3 = 1 : this.check3 = 0
|
||||
this.supplierName0 ? this.check4 = 1 : this.check4 = 0
|
||||
searchPurchaseOrder(this.pageCurrent2, this.pageSize2, this.check3, this.purchasingOrder, this.check4, this.supplierName0).then(response => {
|
||||
searchPurchaseOrder(this.pageCurrent2, this.pageSize2, this.check3, this.purchasingOrder, this.check4, this.supplierName0, this.材料111).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
@@ -477,7 +513,7 @@ export default {
|
||||
},
|
||||
searchTable3(row) { // 查询采购计划明细
|
||||
this.采购计划流水号 = row.采购计划流水号
|
||||
searchMateriel(this.采购计划流水号).then(response => {
|
||||
searchMateriel(this.采购计划流水号, this.材料111).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
},
|
||||
@@ -529,7 +565,12 @@ export default {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 5) {
|
||||
if (index === 3) {
|
||||
sums[index] = '未绑定数量:'
|
||||
return
|
||||
} else if (index === 4) {
|
||||
sums[index] = this.未绑定数量
|
||||
} if (index === 5) {
|
||||
sums[index] = '总重量:'
|
||||
return
|
||||
} else if (index === 6) {
|
||||
@@ -579,19 +620,35 @@ export default {
|
||||
})
|
||||
},
|
||||
save(index, row) {
|
||||
this.SUM = 0
|
||||
this.allWeight = parseInt(row.批次数量 * row.单件重量 * 100) / 100
|
||||
this.ALLMoney = parseInt(this.allWeight * this.单价 * 100) / 100
|
||||
saveWeight(row.采购计划明细流水号, row.单件重量, this.allWeight, this.ALLMoney).then(response => {
|
||||
console.log(response)
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('录入成功')
|
||||
searchTable6(this.ArrivalOrderMXNumber).then(response => {
|
||||
this.tableData6 = response.data
|
||||
})
|
||||
} else {
|
||||
this.$message.error('录入失败')
|
||||
}
|
||||
})
|
||||
for (let i = 0; i < this.tableData6.length; i++) {
|
||||
this.SUM += parseFloat(this.tableData6[i].单件重量) * parseFloat(this.tableData6[i].批次数量)
|
||||
}
|
||||
if (this.数量 - this.SUM < 0) {
|
||||
this.$message.warning('总重量已超出上限')
|
||||
searchTable6(this.ArrivalOrderMXNumber).then(response => {
|
||||
this.tableData6 = response.data
|
||||
if (response.data.length !== 0) {
|
||||
this.未绑定数量 = response.data[0].未绑定数量
|
||||
}
|
||||
})
|
||||
} else {
|
||||
saveWeight(row.采购计划明细流水号, row.单件重量, this.allWeight, this.ALLMoney).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('录入成功')
|
||||
searchTable6(this.ArrivalOrderMXNumber).then(response => {
|
||||
this.tableData6 = response.data
|
||||
if (response.data.length !== 0) {
|
||||
this.未绑定数量 = response.data[0].未绑定数量
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error('录入失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
Calculation() {
|
||||
this.form1.金额 = this.form1.单价 * this.form1.数量
|
||||
@@ -692,6 +749,7 @@ export default {
|
||||
searchTable5(row) {
|
||||
this.tableData6 = []
|
||||
this.到货单流水号 = row.到货单流水号
|
||||
this.ArrivalOrderNumber = row.到货单流水号
|
||||
searchTable5(this.到货单流水号).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
@@ -700,8 +758,10 @@ export default {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.供应商111 = row.供应商流水号
|
||||
this.searchCailiao()
|
||||
this.title1 = '添加到货明细'
|
||||
this.form1.材料 = ''
|
||||
this.form1.CailiaoValue = ''
|
||||
this.form1.数量 = ''
|
||||
this.form1.单价 = ''
|
||||
this.form1.金额 = ''
|
||||
@@ -709,29 +769,42 @@ export default {
|
||||
this.dialogVisible1 = true
|
||||
},
|
||||
submitAddArrivalOrderMX() {
|
||||
this.form1.金额 = this.form1.数量 * this.form1.单价
|
||||
this.$refs['form1'].validate((valid) => {
|
||||
if (valid) {
|
||||
AddArrivalOrderMX(this.ArrivalOrderNumber, this.form1.材料, this.form1.数量, this.form1.单位, this.form1.单价, this.form1.金额).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('新增到货材料成功')
|
||||
searchTable5(this.ArrivalOrderNumber).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
this.dialogVisible1 = false
|
||||
} else { this.$message.error('新建到货单失败') }
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
if (this.form1.数量 > 0) {
|
||||
this.form1.金额 = this.form1.数量 * this.form1.单价
|
||||
this.$refs['form1'].validate((valid) => {
|
||||
if (valid) {
|
||||
AddArrivalOrderMX(this.ArrivalOrderNumber, this.form1.CailiaoValue, this.form1.数量, this.form1.单位, this.form1.单价, this.form1.金额).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('新增到货材料成功')
|
||||
searchTable5(this.ArrivalOrderNumber).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
// this.dialogVisible1 = false
|
||||
} else { this.$message.error('新建到货单失败') }
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error('数量不能为0')
|
||||
}
|
||||
},
|
||||
submitAddArrivalOrderMX1() {
|
||||
this.searchCailiao()
|
||||
this.form1.CailiaoValue = ''
|
||||
this.form1.数量 = ''
|
||||
this.form1.单价 = ''
|
||||
this.form1.金额 = ''
|
||||
},
|
||||
editArrivalMX(row) {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.供应商111 = row.供应商流水号
|
||||
this.searchCailiao()
|
||||
this.title1 = '编辑到货明细'
|
||||
this.form1.材料 = row.材料
|
||||
// this.form1.CailiaoValue = row.材料
|
||||
this.form1.数量 = row.数量
|
||||
this.form1.单位 = row.单位
|
||||
this.form1.单价 = row.单价
|
||||
@@ -740,10 +813,11 @@ export default {
|
||||
this.dialogVisible1 = true
|
||||
},
|
||||
submitEditArrivalOrderMX() {
|
||||
this.form1.CailiaoValue = '1'
|
||||
this.form1.金额 = this.form1.数量 * this.form1.单价
|
||||
this.$refs['form1'].validate((valid) => {
|
||||
if (valid) {
|
||||
EditArrivalOrderMX(this.ArrivalOrderMXNumber, this.form1.材料, this.form1.数量, this.form1.单位, this.form1.单价, this.form1.金额).then(response => {
|
||||
EditArrivalOrderMX(this.ArrivalOrderMXNumber, this.form1.数量, this.form1.单位, this.form1.单价, this.form1.金额).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑到货材料成功')
|
||||
searchTable5(this.ArrivalOrderNumber).then(response => {
|
||||
@@ -781,19 +855,26 @@ export default {
|
||||
searchTable6(row) {
|
||||
this.ArrivalOrderMXNumber = row.到货单明细流水号
|
||||
this.单价 = row.单价
|
||||
this.数量 = row.数量
|
||||
searchTable6(this.ArrivalOrderMXNumber).then(response => {
|
||||
this.tableData6 = response.data
|
||||
if (response.data.length !== 0) {
|
||||
this.中间变量 = response.data[0].单件重量
|
||||
this.未绑定数量 = response.data[0].未绑定数量
|
||||
}
|
||||
})
|
||||
},
|
||||
addArrivalCL(row) {
|
||||
this.材料111 = row.材料
|
||||
this.材料数量 = row.数量
|
||||
this.supplierName0 = row.供应商流水号
|
||||
this.ArrivalOrderMXNumber = row.到货单明细流水号
|
||||
this.tableData3 = []
|
||||
this.dialogVisible2 = true
|
||||
this.searchTable2()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.arrest = val
|
||||
console.log(val)
|
||||
},
|
||||
// 选入
|
||||
addMateriel() {
|
||||
@@ -811,12 +892,14 @@ export default {
|
||||
addMateriel(this.ArrivalOrderMXNumber, this.工艺计划流水号组, this.采购计划明细流水号组).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('关联成功')
|
||||
this.dialogVisible2 = false
|
||||
searchMateriel(this.采购计划流水号).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
searchTable6(this.ArrivalOrderMXNumber).then(response => {
|
||||
this.tableData6 = response.data
|
||||
if (response.data.length !== 0) {
|
||||
this.未绑定数量 = response.data[0].未绑定数量
|
||||
}
|
||||
})
|
||||
} else { this.$message.error('关联失败') }
|
||||
})
|
||||
@@ -828,12 +911,14 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log(row)
|
||||
deleteMateriel(row.到货单明细绑定流水号, row.采购计划明细流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('取消成功')
|
||||
searchTable6(this.ArrivalOrderMXNumber).then(response => {
|
||||
this.tableData6 = response.data
|
||||
if (response.data.length !== 0) {
|
||||
this.未绑定数量 = response.data[0].未绑定数量
|
||||
}
|
||||
})
|
||||
} else { this.$message.error('取消失败') }
|
||||
})
|
||||
|
||||
@@ -1,24 +1,41 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>发票号:</span>
|
||||
<el-input v-model="invoiceNum" placeholder="发票号" size="small" style="margin: 3px 0;width: 130px" clearable/>
|
||||
<span style="margin-left: 10px">供应商:</span>
|
||||
<el-input v-model="supplierName0" placeholder="供应商" size="small" style="width:130px" clearable/>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="查询外购备料发票信息" placement="top">
|
||||
<el-button
|
||||
type="success"
|
||||
<el-row>
|
||||
<span>发票号:</span>
|
||||
<el-input v-model="invoiceNum" placeholder="发票号" size="small" style="margin: 3px 0;width: 180px" clearable/>
|
||||
<span>供应商:</span>
|
||||
<el-input v-show="false" v-model="supplierName0" placeholder="供应商" size="small" style="width:130px" clearable @focus="fetchData"/>
|
||||
<el-select v-model="gongyingshangValue" placeholder="供应商" style="width: 180px" size="small" filterable clearable @change="searchTable1">
|
||||
<el-option
|
||||
v-for="item in gongyingshang"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span v-show="false" class="demonstration">时间段:</span>
|
||||
<el-date-picker
|
||||
v-show="false"
|
||||
v-model="startTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left: 10px"
|
||||
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
style="margin-left: 10px"
|
||||
@click="addTable1()">新增发票</el-button>
|
||||
style="width: 180px"
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
<span v-show="false" class="demonstration">~</span>
|
||||
<el-date-picker
|
||||
v-show="false"
|
||||
v-model="endTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
style="width: 180px"
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="查询外购备料发票信息" placement="top">
|
||||
<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-tooltip>
|
||||
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" style="margin-left: 10px" @click="addTable1()">新增发票</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table
|
||||
@@ -97,7 +114,7 @@
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" fixed="right" width="250px">
|
||||
<el-table-column align="center" label="操作" fixed="right" width="300px">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="关联到货单" placement="top">
|
||||
<div style="display: inline-block">
|
||||
@@ -109,6 +126,7 @@
|
||||
@click="aboutArrival(scope.row)">关联到货单</el-button>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px" @click="downloadExcel(scope.row)">导出</el-button>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="编辑" placement="top">
|
||||
<div style="display: inline-block">
|
||||
<el-button
|
||||
@@ -234,12 +252,19 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>import { searchInvoice, addInvoice, editInvoice, deleteInvoice, searchSupplier, searchInvoiceDetail, searchArriveOrder, addMateriel, deleteInvoiceMX } from '@/api/WorkshopProcurement/OutsourcingMaterialsInvoice'
|
||||
<script>
|
||||
import { searchInvoice, addInvoice, editInvoice, deleteInvoice, searchSupplier, searchInvoiceDetail, searchArriveOrder, addMateriel, deleteInvoiceMX, getGongyingshang } from '@/api/WorkshopProcurement/OutsourcingMaterialsInvoice'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { ExcelDownLoad } from '@/utils/request'
|
||||
|
||||
export default {
|
||||
name: '', // 发票交接单
|
||||
data() {
|
||||
return {
|
||||
gongyingshangValue: '',
|
||||
gongyingshang: [],
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
contractNumValue: '',
|
||||
supplierName0: '',
|
||||
contractNums: [],
|
||||
@@ -305,11 +330,23 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
this.gongyingshangValue = ''
|
||||
this.gongyingshang = []
|
||||
getGongyingshang().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.gongyingshang.push({
|
||||
label: response.data[i].供应商名称,
|
||||
value: response.data[i].供应商
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
this.invoiceNum ? this.check1 = 1 : this.check1 = 0
|
||||
this.supplierName0 ? this.check2 = 1 : this.check2 = 0
|
||||
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.invoiceNum, this.check2, this.supplierName0).then(response => {
|
||||
this.gongyingshangValue ? this.check3 = 1 : this.check3 = 0
|
||||
this.startTime && this.endTime ? this.check4 = 1 : this.check4 = 0
|
||||
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.invoiceNum, this.check2, this.supplierName0, this.check3, this.gongyingshangValue, this.check4, this.startTime, this.endTime).then(response => {
|
||||
for (let j = 0; j < response.data.rows.length; j++) {
|
||||
response.data.rows[j].开票金额 = parseInt(response.data.rows[j].开票金额 * 100) / 100
|
||||
if (response.data.rows[j].开票时间 !== null) {
|
||||
@@ -438,7 +475,6 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteTable1(row) {
|
||||
console.log(row)
|
||||
this.$confirm('确认删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
@@ -506,9 +542,56 @@ export default {
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
downloadExcel(row) {
|
||||
const _ExcelDownLoad = ExcelDownLoad
|
||||
this.download(`${_ExcelDownLoad}?Fapiao=${row.发票流水号}&name=${row.供应商名称}`)
|
||||
},
|
||||
/**
|
||||
* 下载
|
||||
* @param {String} url 目标文件地址
|
||||
* @param {String} filename 想要保存的文件名称
|
||||
*/
|
||||
download(url) {
|
||||
this.getBlob(url, function(blob, filename) {
|
||||
saveAs(blob, filename)
|
||||
})
|
||||
},
|
||||
getBlob(url, cb) {
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open('GET', url, true)
|
||||
xhr.responseType = 'blob'
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
const name = xhr.getResponseHeader('content-disposition').split('=')[1]
|
||||
cb(xhr.response, name)
|
||||
}
|
||||
}
|
||||
xhr.send()
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 保存
|
||||
* @param {Blob} blob
|
||||
* @param {String} filename 想要保存的文件名称
|
||||
*/
|
||||
function saveAs(blob, filename = '下载文件.xls') {
|
||||
if (window.navigator.msSaveOrOpenBlob) {
|
||||
navigator.msSaveBlob(blob, filename)
|
||||
} else {
|
||||
var link = document.createElement('a')
|
||||
var body = document.querySelector('body')
|
||||
link.href = window.URL.createObjectURL(blob)
|
||||
link.download = filename
|
||||
// fix Firefox
|
||||
link.style.display = 'none'
|
||||
body.appendChild(link)
|
||||
link.click()
|
||||
body.removeChild(link)
|
||||
window.URL.revokeObjectURL(link.href)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user