|
@@ -24,7 +24,7 @@
|
|
|
<div class="substance">
|
|
|
<ws-form>
|
|
|
<div style="width: 50%; margin: 0 auto">
|
|
|
- <div class="title">基本信息</div>
|
|
|
+ <div class="titles">基本信息</div>
|
|
|
<ws-info-table>
|
|
|
<ws-form-item label="编号" span="1" prop="paymentNo">
|
|
|
<ws-input
|
|
@@ -72,7 +72,7 @@
|
|
|
<ws-input v-model="paymentList.solidGrainPrice" placeholder="请输入干粮单价" maxlength="100" size="small" :disabled='disabled' />
|
|
|
</ws-form-item>
|
|
|
</ws-info-table>
|
|
|
- <div class="title">质检数据</div>
|
|
|
+ <div class="titles">质检数据</div>
|
|
|
<ws-info-table>
|
|
|
<ws-form-item label="等级" span="1" prop="waterContent">
|
|
|
<ws-input v-model="paymentList.qualityInspectionManagement.grade" placeholder="请输入等级" maxlength="100" size="small" disabled />
|
|
@@ -127,7 +127,7 @@
|
|
|
</ws-form-item>
|
|
|
</ws-info-table>
|
|
|
|
|
|
- <div v-if='paymentList.type=="潮粮"' class="title">单价核算</div>
|
|
|
+ <div v-if='paymentList.type=="潮粮"' class="titles">单价核算</div>
|
|
|
<ws-info-table v-if='paymentList.type=="潮粮"'>
|
|
|
<ws-form-item label="潮粮水分(%)" span="1" prop="waterContent">
|
|
|
<ws-input
|
|
@@ -209,7 +209,7 @@
|
|
|
</ws-form-item>
|
|
|
</ws-info-table>
|
|
|
|
|
|
- <div class="title">结算金额(元)</div>
|
|
|
+ <div class="titles">结算金额(元)</div>
|
|
|
<ws-info-table>
|
|
|
<ws-form-item v-if='paymentList.type=="潮粮"'
|
|
|
label="粮款 = 净重 x 净重单价 ="
|
|
@@ -368,15 +368,33 @@
|
|
|
</div>
|
|
|
</ws-form>
|
|
|
</div>
|
|
|
- <!-- <houseSelfCollectPrint v-show="false"></houseSelfCollectPrint> -->
|
|
|
+ <el-dialog
|
|
|
+ width="70%"
|
|
|
+ class="table-content"
|
|
|
+ center
|
|
|
+ :visible.sync="isShowPrint"
|
|
|
+ title="中天昊元粮食贸易有限公司结算凭证"
|
|
|
+ @close="closeDialog"
|
|
|
+ >
|
|
|
+ <paymentPrint :printData="printData" ref="saveImg"></paymentPrint>
|
|
|
+ <div style="text-align:center">
|
|
|
+ <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
|
|
|
+ <!-- <el-button type="primary" @click="printSmall">打印小票</el-button> -->
|
|
|
+ <el-button type="primary" @click="printBig">打印单据</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {getpaymentexamine,postpaymentedit} from '@/model/houseSelfCollect/index'
|
|
|
-// import houseSelfCollectPrint from './houseSelfCollectPrint.vue'
|
|
|
+import {getpaymentexamine,postpaymentedit,settlementEdit} from '@/model/houseSelfCollect/index'
|
|
|
+import paymentPrint from './component/paymentPrint.vue'
|
|
|
+import html2canvas from "html2canvas"
|
|
|
+import axios from "axios"
|
|
|
export default {
|
|
|
components: {
|
|
|
- // houseSelfCollectPrint,
|
|
|
+ paymentPrint
|
|
|
},
|
|
|
watch: {},
|
|
|
data() {
|
|
@@ -390,8 +408,10 @@ export default {
|
|
|
},
|
|
|
disabled:false,
|
|
|
types:'',
|
|
|
-
|
|
|
+ isShowPrint:false,
|
|
|
information:'结算',
|
|
|
+ printData:{},
|
|
|
+ imgUrl:"",
|
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
@@ -406,6 +426,41 @@ export default {
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ closeDialog(){
|
|
|
+ debugger
|
|
|
+ html2canvas(this.$refs.saveImg.$el).then((canvas) => {
|
|
|
+ let dataURL = canvas.toDataURL('image/png')
|
|
|
+ this.imgUrl = dataURL
|
|
|
+ if (this.imgUrl !== '') {
|
|
|
+ let b = this.dataURLtoFile(this.imgUrl, 'printImage')
|
|
|
+ let formdata = new FormData()
|
|
|
+ formdata.append('file', b)
|
|
|
+ axios({
|
|
|
+ method: 'post',
|
|
|
+ url: 'https://www.zthymaoyi.com/upload/admin',
|
|
|
+ data: formdata,
|
|
|
+ }).then((response) => {
|
|
|
+ //编辑接口
|
|
|
+ this.paymentList.pictureAddress = response.data.url
|
|
|
+ settlementEdit(this.paymentList)
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {})
|
|
|
+ })
|
|
|
+ this.dialogTableVisible = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ printSmall() {
|
|
|
+ window.location.href =
|
|
|
+ '../../../../../static/payprint.html?type=1&dataList=' +
|
|
|
+ JSON.stringify(this.printData)
|
|
|
+ },
|
|
|
+ printBig() {
|
|
|
+ window.location.href =
|
|
|
+ '../../../../../static/payprint.html?type=2&dataList=' +
|
|
|
+ JSON.stringify(this.printData)
|
|
|
+ },
|
|
|
getList(){
|
|
|
getpaymentexamine({id:this.$route.query.id}).toPromise().then((response) => {
|
|
|
this.paymentList = response
|
|
@@ -524,126 +579,120 @@ export default {
|
|
|
return chineseStr;
|
|
|
},
|
|
|
print() {
|
|
|
- if (!this.paymentList.buckleWeightRatio) {
|
|
|
- this.$message({
|
|
|
- message: '扣重比不能为空',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.paymentList.buckleWeightRatio < 0 || this.paymentList.buckleWeightRatio > 2) {
|
|
|
- this.$message({
|
|
|
- message: '扣重比输入错误',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (!this.paymentList.buckleWeightRatio) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '扣重比不能为空',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if (this.paymentList.buckleWeightRatio < 0 || this.paymentList.buckleWeightRatio > 2) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '扣重比输入错误',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- if (this.paymentList.weighingSubsidy < 0 || this.paymentList.weighingSubsidy > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '称重补助范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.paymentList.weighingSubsidy < 0 || this.paymentList.weighingSubsidy > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '称重补助范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- if (this.paymentList.weighingDeduction < 0 || this.paymentList.weighingDeduction > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '称重扣款范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.paymentList.weighingDeduction < 0 || this.paymentList.weighingDeduction > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '称重扣款范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- if (this.paymentList.freightSubsidy < 0 || this.paymentList.freightSubsidy > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '运费补助范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.paymentList.freightSubsidy < 0 || this.paymentList.freightSubsidy > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '运费补助范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- if (this.paymentList.freightDeduction < 0 || this.paymentList.freightDeduction > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '运费扣款范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.paymentList.freightDeduction < 0 || this.paymentList.freightDeduction > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '运费扣款范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- if (this.paymentList.unloadSubsidy < 0 || this.paymentList.unloadSubsidy > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '卸车补助范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.paymentList.unloadSubsidy < 0 || this.paymentList.unloadSubsidy > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '卸车补助范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- if (this.paymentList.unloadDeduction < 0 || this.paymentList.unloadDeduction > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '卸车扣款范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.paymentList.unloadDeduction < 0 || this.paymentList.unloadDeduction > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '卸车扣款范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- if (this.paymentList.otherSubsidy < 0 || this.paymentList.unloadDeduction > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '其他补助范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.paymentList.otherSubsidy < 0 || this.paymentList.unloadDeduction > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '其他补助范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- if (this.paymentList.qualityDeduction < 0 || this.paymentList.qualityDeduction > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '质量扣款范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.paymentList.qualityDeduction < 0 || this.paymentList.qualityDeduction > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '质量扣款范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- if (this.paymentList.otherDeduction < 0 || this.paymentList.otherDeduction > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '其他扣款范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- // if (
|
|
|
- // String(this.paymentList.actualPayment).indexOf('.') != -1 &&
|
|
|
- // String(this.paymentList.actualPayment).length -
|
|
|
- // (String(this.paymentList.actualPayment).indexOf('.') + 1) >
|
|
|
- // 2
|
|
|
- // ) {
|
|
|
- // this.$message({
|
|
|
- // message: '毛重输入错误',
|
|
|
- // type: 'warning',
|
|
|
- // })
|
|
|
- // return
|
|
|
- // }
|
|
|
- if (this.paymentList.actualPayment < 0 || this.paymentList.otherDeduction > 100000) {
|
|
|
- this.$message({
|
|
|
- message: '实际付款范围应在0-100000内',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.paymentList.remarks.length > 20) {
|
|
|
- this.$message({
|
|
|
- message: '记事字数应在0-20个字',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.paymentList.otherDeduction < 0 || this.paymentList.otherDeduction > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '其他扣款范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if (this.paymentList.actualPayment < 0 || this.paymentList.otherDeduction > 100000) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '实际付款范围应在0-100000内',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if (this.paymentList.remarks.length > 20) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '记事字数应在0-20个字',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+
|
|
|
this.paymentList.id=this.$route.query.id
|
|
|
this.paymentList.settlementClerk = sessionStorage.getItem('ws-pf_staffName')
|
|
|
postpaymentedit(this.paymentList).toPromise().then((response) => {
|
|
|
- this.$router.push({ path: 'houseSelfCollectPrint',
|
|
|
- query:{
|
|
|
- name:"123"
|
|
|
- }
|
|
|
- })
|
|
|
+ getpaymentexamine({id:this.$route.query.id}).toPromise().then((response) => {
|
|
|
+ this.printData= response
|
|
|
+ })
|
|
|
+ this.isShowPrint = true
|
|
|
+
|
|
|
+ // this.$router.push({ path: 'houseSelfCollectPrint',
|
|
|
+ // query:{
|
|
|
+ // name:"123"
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
)
|
|
|
},
|
|
@@ -662,6 +711,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
cancel() {
|
|
|
+ this.paymentList = []
|
|
|
this.$router.push({ path: 'paymentManagement' })
|
|
|
},
|
|
|
},
|
|
@@ -689,12 +739,12 @@ export default {
|
|
|
/deep/.ws-info-table .el-form-item .el-form-item__content {
|
|
|
border: none;
|
|
|
}
|
|
|
-.title {
|
|
|
+.titles {
|
|
|
font-size: 16px;
|
|
|
font-weight: 600;
|
|
|
margin: 10px;
|
|
|
}
|
|
|
-.title::before {
|
|
|
+.titles::before {
|
|
|
content: '';
|
|
|
display: inline-block;
|
|
|
width: 5px;
|
|
@@ -750,4 +800,43 @@ export default {
|
|
|
overflow: scroll;
|
|
|
height: 86vh;
|
|
|
}
|
|
|
+/deep/.el-table .el-table__header .cell,
|
|
|
+.el-table .el-table__body .cell {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+/deep/.el-table--enable-row-transition .el-table__body td {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.title{
|
|
|
+ padding:10px;
|
|
|
+ text-align:center;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/.el-dialog__title {
|
|
|
+ font-size: 24px !important;
|
|
|
+}
|
|
|
+/deep/.el-dialog__header {
|
|
|
+ text-align: center !important;
|
|
|
+ padding: 10px 0 !important;
|
|
|
+ height: auto !important;
|
|
|
+}
|
|
|
+.title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 600;
|
|
|
+}
|
|
|
+table,
|
|
|
+table tr th,
|
|
|
+table tr td {
|
|
|
+ border: 2px solid #333333;
|
|
|
+ padding: 5px 0;
|
|
|
+}
|
|
|
+
|
|
|
+table {
|
|
|
+ width: 100%;
|
|
|
+ min-height: 25px;
|
|
|
+ line-height: 25px;
|
|
|
+ text-align: center;
|
|
|
+ border-collapse: collapse;
|
|
|
+ border: 3px solid #333333;
|
|
|
+}
|
|
|
</style>
|