mirror of
https://github.com/shawncai/ERP.git
synced 2024-11-10 09:13:08 +08:00
转移代码
转移代码
This commit is contained in:
parent
af9091e86c
commit
33a160051c
8 changed files with 103 additions and 28 deletions
|
@ -21,6 +21,9 @@ service.interceptors.request.use(
|
||||||
if (store.getters.useCountry === 1 || store.getters.useCountry === '1') {
|
if (store.getters.useCountry === 1 || store.getters.useCountry === '1') {
|
||||||
config.baseURL = process.env.BASE_API + '8888/erp'
|
config.baseURL = process.env.BASE_API + '8888/erp'
|
||||||
}
|
}
|
||||||
|
// if (store.getters.useCountry === 1 || store.getters.useCountry === '1') {
|
||||||
|
// config.baseURL = process.env.BASE_API + '8787/nanjing'
|
||||||
|
// }
|
||||||
if (store.getters.useCountry === 2 || store.getters.useCountry === '2') {
|
if (store.getters.useCountry === 2 || store.getters.useCountry === '2') {
|
||||||
config.baseURL = process.env.BASE_API + '9999/philippines'
|
config.baseURL = process.env.BASE_API + '9999/philippines'
|
||||||
}
|
}
|
||||||
|
|
|
@ -484,28 +484,20 @@ export default {
|
||||||
}
|
}
|
||||||
const validatePass2 = (rule, value, callback) => {
|
const validatePass2 = (rule, value, callback) => {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
value = Number(value)
|
// value = Number(value)
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
callback(new Error('请输入'))
|
callback(new Error('请输入'))
|
||||||
} else {
|
} else {
|
||||||
if (!Number(value)) {
|
callback()
|
||||||
console.log('successful', Number(value))
|
|
||||||
callback(new Error('请输入正确数字'))
|
|
||||||
} else {
|
|
||||||
console.log('失败', Number(value))
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const validatePass3 = (rule, value, callback) => {
|
const validatePass3 = (rule, value, callback) => {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
value = Number(value)
|
value = Number(value)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!Number(value)) {
|
if (value === null || value === undefined || value === '') {
|
||||||
callback(new Error('请输入正确数字'))
|
callback(new Error('请输入'))
|
||||||
console.log('successful', Number(value))
|
|
||||||
} else {
|
} else {
|
||||||
console.log('失败', Number(value))
|
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
|
@ -35,44 +35,44 @@
|
||||||
type="index"
|
type="index"
|
||||||
sortable
|
sortable
|
||||||
fixed
|
fixed
|
||||||
width="60"
|
|
||||||
align="center"/>
|
align="center"/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="first"
|
:label="first"
|
||||||
prop="name"
|
prop="name"
|
||||||
sortable
|
sortable
|
||||||
fixed
|
fixed
|
||||||
width="150"
|
|
||||||
align="center"/>
|
align="center"/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="$t('searchSaleOrderReport.money')"
|
:label="$t('searchSaleOrderReport.money')"
|
||||||
prop="money"
|
prop="money"
|
||||||
sortable
|
sortable
|
||||||
width="240"
|
|
||||||
align="center"/>
|
align="center"/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="$t('searchSaleOrderReport.discountMoney')"
|
:label="$t('searchSaleOrderReport.discountMoney')"
|
||||||
prop="discountMoney"
|
prop="discountMoney"
|
||||||
sortable
|
sortable
|
||||||
width="240"
|
|
||||||
align="center"/>
|
align="center"/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="$t('searchSaleOrderReport.taxMoney')"
|
:label="$t('searchSaleOrderReport.taxMoney')"
|
||||||
prop="taxMoney"
|
prop="taxMoney"
|
||||||
sortable
|
sortable
|
||||||
width="240"
|
|
||||||
align="center"/>
|
align="center"/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="$t('searchSaleOrderReport.otherMoney')"
|
:label="$t('searchSaleOrderReport.otherMoney')"
|
||||||
prop="otherMoney"
|
prop="otherMoney"
|
||||||
sortable
|
sortable
|
||||||
width="240"
|
|
||||||
align="center"/>
|
align="center"/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="$t('searchSaleOrderReport.actualMoney')"
|
:label="$t('searchSaleOrderReport.actualMoney')"
|
||||||
prop="actualMoney"
|
prop="actualMoney"
|
||||||
sortable
|
sortable
|
||||||
width="240"
|
|
||||||
align="center"/>
|
align="center"/>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 列表结束 -->
|
<!-- 列表结束 -->
|
||||||
|
|
|
@ -19,14 +19,23 @@
|
||||||
<el-button v-waves size="small" class="filter-item" type="primary" icon="el-icon-search" style="width: 86px;margin-top: 10px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
|
<el-button v-waves size="small" class="filter-item" type="primary" icon="el-icon-search" style="width: 86px;margin-top: 10px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-card :body-style=" { padding: '6px'}" class="box-card" shadow="never">
|
||||||
|
|
||||||
|
<!-- 表格导出操作 -->
|
||||||
|
<el-button v-waves :loading="downloadLoading" size="small" class="filter-item2" style="width: 86px" @click="handleExport"> <svg-icon icon-class="daochu"/>{{ $t('public.export') }}</el-button>
|
||||||
|
<!-- 打印操作 -->
|
||||||
|
<!-- <el-button v-permission="['131-153-7']" v-waves size="small" class="filter-item2" icon="el-icon-printer" style="width: 86px" @click="handlePrint">{{ $t('public.print') }}</el-button>
|
||||||
|
<my-repository2 :repositorycontrol.sync="repositorycontrol2" @repositoryname="repositoryname2"/> -->
|
||||||
|
</el-card>
|
||||||
<el-card :body-style=" { padding: '10px' }" class="box-card" shadow="never">
|
<el-card :body-style=" { padding: '10px' }" class="box-card" shadow="never">
|
||||||
<!-- 列表开始 -->
|
<!-- 列表开始 -->
|
||||||
<el-table
|
<el-table
|
||||||
ref="table"
|
ref="table"
|
||||||
:height="tableHeight"
|
:height="tableHeight"
|
||||||
:data="list"
|
:data="list"
|
||||||
|
:summary-method="getSummaries2"
|
||||||
size="small"
|
size="small"
|
||||||
|
show-summary
|
||||||
|
|
||||||
border
|
border
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@ -321,6 +330,65 @@ export default {
|
||||||
_that = this
|
_that = this
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatJson(filterVal, jsonData) {
|
||||||
|
return jsonData.map(v => filterVal.map(j => {
|
||||||
|
return v[j]
|
||||||
|
}))
|
||||||
|
},
|
||||||
|
// 导出
|
||||||
|
handleExport() {
|
||||||
|
this.downloadLoading = true
|
||||||
|
import('@/vendor/Export2Excel').then(excel => {
|
||||||
|
const tHeader = ['供应商名称', '单据日期', '单据编号', '物品编号', '到货时间', '到货单号', '入库单号', '交货日期', '物品名称', '单位', '数量', '含税价', '含税金额', '到货数量', '到货金额', '已入库', '未入库', '已开票数', '未开票数', '已开票额', '未开票额']
|
||||||
|
const filterVal = ['supplierName', 'receiptDate', 'orderNumber', 'productCode', 'arrivalDate', 'arrivalNumber', 'delayNum', 'deliveryDate', 'productName', 'unit', 'quantity', 'price', 'money', 'arrivalQuantity', 'arrivalMoney', 'enterQuantity', 'notenterQuantity', 'invoiceQuantity', 'notinvoiceQuantity', 'invoiceMoney', 'notinvoiceMoney']
|
||||||
|
const data = this.formatJson(filterVal, this.list)
|
||||||
|
excel.export_json_to_excel({
|
||||||
|
header: tHeader,
|
||||||
|
data,
|
||||||
|
filename: '采购订单全程跟踪表'
|
||||||
|
})
|
||||||
|
this.downloadLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
numFormat(num) {
|
||||||
|
var res = num.toString().replace(/\d+/, function(n) { // 先提取整数部分
|
||||||
|
return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
|
||||||
|
return $1 + ','
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return res
|
||||||
|
},
|
||||||
|
// 总计
|
||||||
|
getSummaries2(param) {
|
||||||
|
const { columns, data } = param
|
||||||
|
const sums = []
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
sums[index] = '总计'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (index === 3) {
|
||||||
|
sums[index] = ' '
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const values = data.map(item => Number(item[column.property]))
|
||||||
|
if (!values.every(value => isNaN(value))) {
|
||||||
|
sums[index] = this.numFormat(values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return (Number(prev) + Number(curr)).toFixed(6)
|
||||||
|
} else {
|
||||||
|
return (Number(prev)).toFixed(6)
|
||||||
|
}
|
||||||
|
}, 0))
|
||||||
|
// console.log('sums[index]', sums[index])
|
||||||
|
sums[index] += ''
|
||||||
|
} else {
|
||||||
|
sums[index] = ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
},
|
||||||
handleDetail4(row) {
|
handleDetail4(row) {
|
||||||
const query_params = {
|
const query_params = {
|
||||||
id: 784836221,
|
id: 784836221,
|
||||||
|
@ -412,7 +480,13 @@ export default {
|
||||||
this.list[i].notenterQuantity = (this.list[i].quantity - this.list[i].enterQuantity).toFixed(6)
|
this.list[i].notenterQuantity = (this.list[i].quantity - this.list[i].enterQuantity).toFixed(6)
|
||||||
this.list[i].notinvoiceQuantity = (this.list[i].quantity - this.list[i].invoiceQuantity).toFixed(6)
|
this.list[i].notinvoiceQuantity = (this.list[i].quantity - this.list[i].invoiceQuantity).toFixed(6)
|
||||||
this.list[i].notinvoiceMoney = (this.list[i].money - this.list[i].invoiceMoney).toFixed(6)
|
this.list[i].notinvoiceMoney = (this.list[i].money - this.list[i].invoiceMoney).toFixed(6)
|
||||||
|
this.list[i].arrivalDate = this.list[i].orderArrivalVos[0].arrivalDate
|
||||||
|
this.list[i].arrivalNumber = this.list[i].orderArrivalVos[0].arrivalNumber
|
||||||
|
|
||||||
|
this.list[i].enterDate = this.list[i].orderEnterVos[0].enterDate
|
||||||
|
this.list[i].enterNumber = this.list[i].orderEnterVos[0].enterNumber
|
||||||
}
|
}
|
||||||
|
console.log('this.list', this.list)
|
||||||
this.total = res.data.data.content.totalCount
|
this.total = res.data.data.content.totalCount
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
@ -943,7 +943,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getdiscountreduceMoney(row) {
|
getdiscountreduceMoney(row) {
|
||||||
row.discountreduceMoney = (Number(row.money) - Number(row.discountMoney)).toFixed(2)
|
// row.discountreduceMoney = (Number(row.money) - Number(row.discountMoney)).toFixed(2)
|
||||||
|
row.discountreduceMoney = (((Number(row.includeTaxMoney) - Number(row.discountMoney)) / (1 + row.taxRate / 100))).toFixed(2)
|
||||||
return row.discountreduceMoney
|
return row.discountreduceMoney
|
||||||
},
|
},
|
||||||
getdiscountreduceMoney2(row) {
|
getdiscountreduceMoney2(row) {
|
||||||
|
@ -963,7 +964,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 计算税额
|
// 计算税额
|
||||||
getTaxMoney2(row) {
|
getTaxMoney2(row) {
|
||||||
row.tax = (Number(row.includeTaxMoney) - Number(row.money)).toFixed(2)
|
row.tax = (((Number(row.includeTaxMoney) - Number(row.discountMoney)) / (1 + (row.taxRate / 100))) * (row.taxRate / 100)).toFixed(2)
|
||||||
return row.tax
|
return row.tax
|
||||||
},
|
},
|
||||||
// 计算含税金额
|
// 计算含税金额
|
||||||
|
|
|
@ -355,7 +355,8 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getdiscountreduceMoney(row) {
|
getdiscountreduceMoney(row) {
|
||||||
row.discountreduceMoney = (Number(row.money) - Number(row.discountMoney)).toFixed(2)
|
// row.discountreduceMoney = (Number(row.money) - Number(row.discountMoney)).toFixed(2)
|
||||||
|
row.discountreduceMoney = (((Number(row.includeTaxMoney) - Number(row.discountMoney)) / (1 + row.taxRate / 100))).toFixed(2)
|
||||||
return row.discountreduceMoney
|
return row.discountreduceMoney
|
||||||
},
|
},
|
||||||
getdiscountreduceMoney2(row) {
|
getdiscountreduceMoney2(row) {
|
||||||
|
@ -374,8 +375,8 @@ export default {
|
||||||
},
|
},
|
||||||
// 计算税额
|
// 计算税额
|
||||||
getTaxMoney2(row) {
|
getTaxMoney2(row) {
|
||||||
row.tax = (Number(row.includeTaxMoney) - Number(row.money)).toFixed(6)
|
// row.tax = (Number(row.includeTaxMoney) - Number(row.money)).toFixed(6)
|
||||||
|
row.tax = (((Number(row.includeTaxMoney) - Number(row.discountMoney)) / (1 + (row.taxRate / 100))) * (row.taxRate / 100)).toFixed(2)
|
||||||
return row.tax
|
return row.tax
|
||||||
},
|
},
|
||||||
// 计算含税金额
|
// 计算含税金额
|
||||||
|
|
|
@ -260,7 +260,7 @@
|
||||||
<p v-show="jundgeprice()">{{ getTaxMoney(scope.row) }}</p>
|
<p v-show="jundgeprice()">{{ getTaxMoney(scope.row) }}</p>
|
||||||
</template>
|
</template>
|
||||||
</el-editable-column>
|
</el-editable-column>
|
||||||
<el-editable-column :label="$t('updates.se')" prop="tax" align="center" min-width="150px">
|
<el-editable-column :label="$t('updates.se')" prop="taxMoney" align="center" min-width="150px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<p v-show="jundgeprice()">{{ getTaxMoney2(scope.row) }}</p>
|
<p v-show="jundgeprice()">{{ getTaxMoney2(scope.row) }}</p>
|
||||||
</template>
|
</template>
|
||||||
|
@ -909,12 +909,15 @@ export default {
|
||||||
// } else {
|
// } else {
|
||||||
// row.tax = 0
|
// row.tax = 0
|
||||||
// }
|
// }
|
||||||
row.tax = (Number(row.includeTaxMoney) - Number(row.money)).toFixed(2)
|
// row.tax = (Number(row.includeTaxMoney) - Number(row.money)).toFixed(2)
|
||||||
|
row.taxMoney = (((Number(row.includeTaxMoney) - Number(row.discountMoney)) / (1 + (row.taxRate / 100))) * (row.taxRate / 100)).toFixed(2)
|
||||||
|
|
||||||
return row.tax
|
return row.taxMoney
|
||||||
},
|
},
|
||||||
getdiscountreduceMoney(row) {
|
getdiscountreduceMoney(row) {
|
||||||
row.discountreduceMoney = (Number(row.money) - Number(row.discountMoney)).toFixed(2)
|
// row.discountreduceMoney = (Number(row.money) - Number(row.discountMoney)).toFixed(2)
|
||||||
|
row.discountreduceMoney = (((Number(row.includeTaxMoney) - Number(row.discountMoney)) / (1 + row.taxRate / 100))).toFixed(2)
|
||||||
|
|
||||||
return row.discountreduceMoney
|
return row.discountreduceMoney
|
||||||
},
|
},
|
||||||
getdiscountreduceMoney2(row) {
|
getdiscountreduceMoney2(row) {
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select v-model="loginForm.country" clearable style="margin-left: 18px;width: 88%">
|
<el-select v-model="loginForm.country" clearable style="margin-left: 18px;width: 88%">
|
||||||
<el-option label="china" value="1"/>
|
<el-option label="china" value="1"/>
|
||||||
|
<!-- <el-option label="南京" value="1"/> -->
|
||||||
<el-option label="philippines" value="2"/>
|
<el-option label="philippines" value="2"/>
|
||||||
<el-option label="Thailand" value="3"/>
|
<el-option label="Thailand" value="3"/>
|
||||||
<el-option label="srilanka" value="4"/>
|
<el-option label="srilanka" value="4"/>
|
||||||
|
|
Loading…
Reference in a new issue