修改bug
This commit is contained in:
@@ -158,13 +158,13 @@
|
||||
|
||||
<script>
|
||||
import Tinymce from '@/components/Tinymce'
|
||||
import QRCode from 'qrcode'
|
||||
import { searchInquirySheet, searchSheetContract, doneContract } from '@/api/PurchasingCenter/CreatePurchaseContract'
|
||||
import { convertCurrency } from '@/vendor/int2Chinese'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: { Tinymce },
|
||||
inject: ['reload'],
|
||||
data() {
|
||||
return {
|
||||
hasTax: '未税',
|
||||
@@ -303,14 +303,14 @@ export default {
|
||||
<td style="width: 25%;">
|
||||
<h4 style="text-align: center;">合同名称:</h4>
|
||||
</td>
|
||||
<td id="contractName" style="width: 25%;text-align: center;"> </td>
|
||||
<td style="width: 25%;text-align: center;" rowspan="2"><img id="qrCode"></td>
|
||||
<td id="contractName" style="width: 25%;text-align: center;"></td>
|
||||
<td style="width: 25%;text-align: center;" rowspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;">
|
||||
<h4 style="text-align: center;">合同编号:</h4>
|
||||
</td>
|
||||
<td id="contractNum" style="width: 25%;text-align: center;"> </td>
|
||||
<td id="contractNum" style="width: 25%;text-align: center;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -320,31 +320,31 @@ export default {
|
||||
<td style="width: 20%;">买方:</td>
|
||||
<td style="width: 30%;">江苏高精机电装配有限公司</td>
|
||||
<td style="width: 20%;">卖方:</td>
|
||||
<td id="supplierName" style="width: 30%;"> </td>
|
||||
<td id="supplierName" style="width: 30%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">地址:</td>
|
||||
<td style="width: 30%;">盐城市开放大道666号</td>
|
||||
<td style="width: 20%;">地址:</td>
|
||||
<td id="supplierAddress" style="width: 30%;"> </td>
|
||||
<td id="supplierAddress" style="width: 30%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">法定代表人:</td>
|
||||
<td style="width: 30%;">徐秀兵</td>
|
||||
<td style="width: 20%;">法定代表人:</td>
|
||||
<td style="width: 30%;"> </td>
|
||||
<td style="width: 30%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">电话:</td>
|
||||
<td style="width: 30%;"> </td>
|
||||
<td style="width: 30%;"></td>
|
||||
<td style="width: 20%;">电话:</td>
|
||||
<td id="supplierPhone" style="width: 30%;"> </td>
|
||||
<td id="supplierPhone" style="width: 30%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">传真:</td>
|
||||
<td style="width: 30%;"> </td>
|
||||
<td style="width: 30%;"></td>
|
||||
<td style="width: 20%;">传真:</td>
|
||||
<td id="supplierFax" style="width: 30%;"> </td>
|
||||
<td id="supplierFax" style="width: 30%;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -361,44 +361,44 @@ export default {
|
||||
<tr>
|
||||
<td style="width: 25%;">交货日期:</td>
|
||||
<td style="width: 25%;" colspan="3">
|
||||
<p id="deliveryDate"> </p>
|
||||
<p id="deliveryDate"></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;" rowspan="3">交货地点:</td>
|
||||
<td style="width: 25%;">地址:</td>
|
||||
<td style="width: 25%;" colspan="2"> </td>
|
||||
<td style="width: 25%;" colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;">联系人:</td>
|
||||
<td style="width: 25%;" colspan="2"> </td>
|
||||
<td style="width: 25%;" colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;">联系电话:</td>
|
||||
<td style="width: 25%;" colspan="2"> </td>
|
||||
<td style="width: 25%;" colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;">开票信息:</td>
|
||||
<td style="width: 25%;" colspan="3">
|
||||
<p id="invoiceInfo"> </p>
|
||||
<p id="invoiceInfo"></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;">支付日期:</td>
|
||||
<td style="width: 25%;" colspan="3">
|
||||
<p id="payDate"> </p>
|
||||
<p id="payDate"></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;">支付方式:</td>
|
||||
<td style="width: 25%;" colspan="3">
|
||||
<p id="payMethod"> </p>
|
||||
<p id="payMethod"></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;">其他说明:</td>
|
||||
<td style="width: 25%;" colspan="3">
|
||||
<p id="otherInfo"> </p>
|
||||
<p id="otherInfo"></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -410,15 +410,15 @@ export default {
|
||||
<p>买方:</p>
|
||||
<p>(盖章)</p>
|
||||
<p>授权代表人:_______________</p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p></p>
|
||||
<p></p>
|
||||
</td>
|
||||
<td style="width: 50%;">
|
||||
<p>卖方:</p>
|
||||
<p>(盖章)</p>
|
||||
<p>授权代表人:_______________ </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p>授权代表人:_______________</p>
|
||||
<p></p>
|
||||
<p></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -454,21 +454,6 @@ export default {
|
||||
editContract() { // 选择一个询价单,整成合同明细
|
||||
if (this.contractNumValue) {
|
||||
this.$refs.tinymce.destroyTinymce()
|
||||
const opts = {
|
||||
errorCorrectionLevel: 'H',
|
||||
type: 'image/jpeg',
|
||||
rendererOpts: {
|
||||
quality: 0.3
|
||||
}
|
||||
}
|
||||
const str = this.contractNumValue.toString()
|
||||
QRCode.toDataURL(str, opts, function(err, url) {
|
||||
if (err) throw err
|
||||
if (document.getElementById('qrCode')) {
|
||||
const img = document.getElementById('qrCode')
|
||||
img.src = url
|
||||
}
|
||||
})
|
||||
document.getElementById('contractName') ? document.getElementById('contractName').innerHTML = this.contractName : ''
|
||||
document.getElementById('contractNum') ? document.getElementById('contractNum').innerHTML = this.contractNum : ''
|
||||
document.getElementById('supplierName') ? document.getElementById('supplierName').innerHTML = this.supplierName : ''
|
||||
@@ -513,7 +498,7 @@ export default {
|
||||
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.tableData1[j].规格
|
||||
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData1[j].数量
|
||||
this.hasTax === '含税' ? document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData1[j].含税单价 : document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData1[j].未税单价
|
||||
document.getElementsByClassName('tableData')[j].children[6].innerHTML = Number(document.getElementsByClassName('tableData')[j].children[5].innerHTML) * Number(this.tableData1[j].数量)
|
||||
document.getElementsByClassName('tableData')[j].children[6].innerHTML = (Number(document.getElementsByClassName('tableData')[j].children[5].innerHTML) * Number(this.tableData1[j].数量)).toFixed(2)
|
||||
this.tableData1[j].交货期 ? document.getElementsByClassName('tableData')[j].children[7].innerHTML = this.tableData1[j].交货期.split(' ')[0] : document.getElementsByClassName('tableData')[j].children[7].innerHTML = ''
|
||||
document.getElementsByClassName('tableData')[j].children[8].innerHTML = `备注` + j
|
||||
}
|
||||
@@ -544,7 +529,9 @@ export default {
|
||||
this.content = `自定义`
|
||||
},
|
||||
generateContract() { // 生成采购合同
|
||||
this.content = this.contentNew // 更新tinymce中的东西到html中,后续会用到
|
||||
this.content = this.contentNew.replace(/ /g, '')
|
||||
this.content = this.content.replace(/\n/g, '')
|
||||
this.content = this.content.replace(/==/g, '= =') // 更新tinymce中的东西到html中,后续会用到
|
||||
this.组件零件流水号组 = []
|
||||
this.组件零件基本件流水号组 = []
|
||||
this.数量组 = []
|
||||
@@ -564,9 +551,12 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log(this.contractNum, this.contractName, this.deliveryDate, this.payDate, this.payMethod, this.invoiceInfo, this.otherInfo, this.actualTotal, this.id, this.supplierValue, this.单价是否含税, this.组件零件流水号组, this.组件零件基本件流水号组, this.数量组, this.单价组, this.交货期组)
|
||||
doneContract(this.contractNum, this.contractName, this.deliveryDate, this.payDate, this.payMethod, this.invoiceInfo, this.otherInfo, this.actualTotal, this.id, this.supplierValue, this.单价是否含税, this.组件零件流水号组, this.组件零件基本件流水号组, this.数量组, this.单价组, this.交货期组).then(response => {
|
||||
console.log(response.data)
|
||||
console.log(this.contractNum, this.contractName, this.deliveryDate, this.payDate, this.payMethod, this.invoiceInfo, this.otherInfo, this.actualTotal, this.id, this.supplierValue, this.单价是否含税, this.组件零件流水号组, this.组件零件基本件流水号组, this.数量组, this.单价组, this.交货期组, this.content)
|
||||
doneContract(this.contractNum, this.contractName, this.deliveryDate, this.payDate, this.payMethod, this.invoiceInfo, this.otherInfo, this.actualTotal, this.id, this.supplierValue, this.单价是否含税, this.组件零件流水号组, this.组件零件基本件流水号组, this.数量组, this.单价组, this.交货期组, this.content).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('合同生成成功')
|
||||
this.reload()
|
||||
} else { this.$message.error('生成合同失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
|
||||
Reference in New Issue
Block a user