创建采购合同
This commit is contained in:
@@ -176,20 +176,20 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--<el-tooltip :open-delay="1000" content="一键删除交货期" placement="right">-->
|
||||
<!--<el-button type="danger" icon="el-icon-date" size="small" @click="deleteAllDate()"/>-->
|
||||
<!--</el-tooltip>-->
|
||||
<!--<span>①选择合同模板:</span>-->
|
||||
<!--<el-radio-group v-model="demoRadio" size="small" @change="demoChange">-->
|
||||
<!--<el-radio-button label="模板1"/>-->
|
||||
<!--<el-radio-button label="模板2" disabled/>-->
|
||||
<!--<!–<el-radio-button label="自定义" disabled/>–>-->
|
||||
<!--</el-radio-group>-->
|
||||
<!--<el-button type="primary" plain size="small" style="margin-left:10px;" @click="editContract()">预览合同</el-button>-->
|
||||
<el-tooltip v-show="false" :open-delay="1000" content="一键删除交货期" placement="right">
|
||||
<el-button type="danger" icon="el-icon-date" size="small" @click="deleteAllDate()"/>
|
||||
</el-tooltip>
|
||||
<span>①选择合同模板:</span>
|
||||
<el-radio-group v-show="false" v-model="demoRadio" size="small" @change="demoChange">
|
||||
<el-radio-button label="模板1"/>
|
||||
<el-radio-button label="模板2" disabled/>
|
||||
<!--<el-radio-button label="自定义" disabled/>-->
|
||||
</el-radio-group>
|
||||
<el-button type="primary" plain size="small" style="margin-left:10px;" @click="editContract()">预览合同</el-button>
|
||||
<!--<span>②确认合同总额:</span>-->
|
||||
<!--<el-input v-model="actualTotal" size="small" style="width: 100px"/>-->
|
||||
<!--<el-button type="primary" size="small" @click="submitTotal()">确认</el-button>-->
|
||||
<span>递交审批:</span>
|
||||
<span>②递交审批:</span>
|
||||
<el-tooltip :open-delay="1000" effect="dark" content="核对信息后生成合同" placement="top">
|
||||
<el-button type="success" size="small" @click="generateContract()">递交</el-button>
|
||||
</el-tooltip>
|
||||
@@ -242,7 +242,7 @@ export default {
|
||||
hasTax: '含税',
|
||||
taxRate: 0.13,
|
||||
preview: false, // 预览
|
||||
demoRadio: '', // 模板radio
|
||||
demoRadio: '模板1', // 模板radio
|
||||
content: ``, // 合同格式模板
|
||||
contentNew: ``, // tinymce的
|
||||
contractName: '采购合同', // 合同名称
|
||||
@@ -285,6 +285,7 @@ export default {
|
||||
this.fetchData11()
|
||||
this.fetchData()
|
||||
this.initDirection()
|
||||
this.demo1()
|
||||
},
|
||||
methods: {
|
||||
fetchData11() {
|
||||
@@ -300,6 +301,7 @@ export default {
|
||||
},
|
||||
selectHetong() {
|
||||
this.contractNumValue = ''
|
||||
this.tableData1 = []
|
||||
if (this.supplierValue11) { this.asdasd = 1 } else { this.asdasd = 0 }
|
||||
searchInquirySheet(0, 0, 0, 0, 1, this.id, this.asdasd, this.supplierValue11).then(response => { // 初始化询价单号
|
||||
this.contractNums = []
|
||||
@@ -421,6 +423,7 @@ export default {
|
||||
},
|
||||
fetchData() {
|
||||
initSupplier(this.id).then(res => {
|
||||
// this.id
|
||||
this.supplier = []
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
this.supplier.push({
|
||||
@@ -558,8 +561,6 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
this.demo1()
|
||||
this.editContract()
|
||||
},
|
||||
demoChange() { // 模板change
|
||||
switch (this.demoRadio) {
|
||||
@@ -569,152 +570,152 @@ export default {
|
||||
case '模板2':
|
||||
this.demo2()
|
||||
break
|
||||
// case '自定义':
|
||||
// this.customization()
|
||||
// break
|
||||
// case '自定义':
|
||||
// this.customization()
|
||||
// break
|
||||
}
|
||||
},
|
||||
demo1() { // 选择合同模板1
|
||||
this.content = `
|
||||
<h2 style="text-align: center;">
|
||||
<strong>采购合同</strong>
|
||||
<strong>采购合同</strong>
|
||||
</h2>
|
||||
<table style="border-collapse: collapse; width: 100%;" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 25%; text-align: center;" rowspan="2">
|
||||
<h1>
|
||||
<strong>GAOJING</strong>
|
||||
</h1>
|
||||
</td>
|
||||
<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"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;">
|
||||
<h4 style="text-align: center;">合同编号:</h4>
|
||||
</td>
|
||||
<td id="contractNum" style="width: 25%;text-align: center;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 25%; text-align: center;" rowspan="2">
|
||||
<h1>
|
||||
<strong>GAOJING</strong>
|
||||
</h1>
|
||||
</td>
|
||||
<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"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%;">
|
||||
<h4 style="text-align: center;">合同编号:</h4>
|
||||
</td>
|
||||
<td id="contractNum" style="width: 25%;text-align: center;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table style="border-collapse: collapse; width: 100%;" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 15%;">买方:</td>
|
||||
<td style="width: 35%;">江苏高精机电装配有限公司</td>
|
||||
<td style="width: 15%;">卖方:</td>
|
||||
<td id="supplierName" style="width: 35%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 15%;">地址:</td>
|
||||
<td style="width: 35%;">${this.companyAddress}</td>
|
||||
<td style="width: 15%;">地址:</td>
|
||||
<td id="supplierAddress" style="width: 35%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 15%;">法定代表人:</td>
|
||||
<td style="width: 35%;">徐秀兵</td>
|
||||
<td style="width: 15%;">法定代表人:</td>
|
||||
<td id="legalPerson" style="width: 35%;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 15%;">买方:</td>
|
||||
<td style="width: 35%;">江苏高精机电装配有限公司</td>
|
||||
<td style="width: 15%;">卖方:</td>
|
||||
<td id="supplierName" style="width: 35%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 15%;">地址:</td>
|
||||
<td style="width: 35%;">${this.companyAddress}</td>
|
||||
<td style="width: 15%;">地址:</td>
|
||||
<td id="supplierAddress" style="width: 35%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 15%;">法定代表人:</td>
|
||||
<td style="width: 35%;">徐秀兵</td>
|
||||
<td style="width: 15%;">法定代表人:</td>
|
||||
<td id="legalPerson" style="width: 35%;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>根据中华人民共和国合同法及相关法律法规,经买卖双方平等协商,就卖方向买方出售合同项下产品事宜达成一致,签订本合同(明细表及合同通用条款)如下:</p>
|
||||
<table style="border-collapse: collapse; width: 100%;" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 20%;">合同总额(RMB):</td>
|
||||
<td class="actualTotal" style="width: 20%;"></td>
|
||||
<td style="width: 20%;">大写:</td>
|
||||
<td id="actualTotal_zh" style="width: 40%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;" rowspan="3">交货地点:</td>
|
||||
<td style="width: 20%;">地址:</td>
|
||||
<td style="width: 30%;" colspan="2">${this.sendAddress}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">联系人:</td>
|
||||
<td style="width: 30%;" colspan="2">${this.name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">联系电话:</td>
|
||||
<td style="width: 30%;" colspan="2">${this.phone2}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">交货日期:</td>
|
||||
<td id="deliveryDate" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">开票信息:</td>
|
||||
<td id="invoiceInfo" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">支付日期:</td>
|
||||
<td id="payDate" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">支付方式:</td>
|
||||
<td id="payMethod" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">其他说明:</td>
|
||||
<td id="otherInfo" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 20%;">合同总额(RMB):</td>
|
||||
<td class="actualTotal" style="width: 20%;"></td>
|
||||
<td style="width: 20%;">大写:</td>
|
||||
<td id="actualTotal_zh" style="width: 40%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;" rowspan="3">交货地点:</td>
|
||||
<td style="width: 20%;">地址:</td>
|
||||
<td style="width: 30%;" colspan="2">${this.sendAddress}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">联系人:</td>
|
||||
<td style="width: 30%;" colspan="2">${this.name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">联系电话:</td>
|
||||
<td style="width: 30%;" colspan="2">${this.phone2}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">交货日期:</td>
|
||||
<td id="deliveryDate" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">开票信息:</td>
|
||||
<td id="invoiceInfo" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">支付日期:</td>
|
||||
<td id="payDate" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">支付方式:</td>
|
||||
<td id="payMethod" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%;">其他说明:</td>
|
||||
<td id="otherInfo" style="width: 30%;" colspan="3"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table style="border-collapse: collapse; width: 100%;" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 50%;">
|
||||
<span>卖方:${this.supplierName}(盖章)</span><br>
|
||||
<span>受托人:${this.trustee}</span><br>
|
||||
<span>开户行:${this.bank1}</span><br>
|
||||
<span>账号:${this.account1}</span><br>
|
||||
<span>税号:${this.taxCode1}</span><br>
|
||||
<span>电话:${this.phone1}</span><br>
|
||||
<span>传真:${this.fax1}</span><br>
|
||||
<span>邮编:${this.postCode1}</span>
|
||||
</td>
|
||||
<td style="width: 50%;">
|
||||
<span>买方:江苏高精机电装配有限公司(盖章)</span><br>
|
||||
<span>受托人:${this.name}</span><br>
|
||||
<span>开户行:${this.bank2}</span><br>
|
||||
<span>账号:${this.account2}</span><br>
|
||||
<span>税号:${this.taxCode2}</span><br>
|
||||
<span>电话:${this.phone2}</span><br>
|
||||
<span>传真:${this.fax2}</span><br>
|
||||
<span>邮编:${this.postCode2}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 50%;">
|
||||
<span>卖方:${this.supplierName}(盖章)</span><br>
|
||||
<span>受托人:${this.trustee}</span><br>
|
||||
<span>开户行:${this.bank1}</span><br>
|
||||
<span>账号:${this.account1}</span><br>
|
||||
<span>税号:${this.taxCode1}</span><br>
|
||||
<span>电话:${this.phone1}</span><br>
|
||||
<span>传真:${this.fax1}</span><br>
|
||||
<span>邮编:${this.postCode1}</span>
|
||||
</td>
|
||||
<td style="width: 50%;">
|
||||
<span>买方:江苏高精机电装配有限公司(盖章)</span><br>
|
||||
<span>受托人:${this.name}</span><br>
|
||||
<span>开户行:${this.bank2}</span><br>
|
||||
<span>账号:${this.account2}</span><br>
|
||||
<span>税号:${this.taxCode2}</span><br>
|
||||
<span>电话:${this.phone2}</span><br>
|
||||
<span>传真:${this.fax2}</span><br>
|
||||
<span>邮编:${this.postCode2}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p style="text-align: right;">日期:_${this.year}_年_${this.month}_月_${this.day}_日</p>
|
||||
<hr />
|
||||
<p style="text-align: center;">
|
||||
<strong>明细表</strong>
|
||||
(<strong id="hasTax"></strong>)
|
||||
<strong>明细表</strong>
|
||||
(<strong id="hasTax"></strong>)
|
||||
</p>
|
||||
<table style="border-collapse: collapse; width: 100%;" border="1">
|
||||
<tbody id="tbody">
|
||||
<tr id="tableHead">
|
||||
<td>序号</td>
|
||||
<td>机床号-组号</td>
|
||||
<td>名称</td>
|
||||
<td>图号或型号</td>
|
||||
<td>规格</td>
|
||||
<td>数量</td>
|
||||
<td>单位</td>
|
||||
<td>单价</td>
|
||||
<td>合计</td>
|
||||
<td>交货时间</td>
|
||||
<td>备注</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody id="tbody">
|
||||
<tr id="tableHead">
|
||||
<td>序号</td>
|
||||
<td>机床号-组号</td>
|
||||
<td>名称</td>
|
||||
<td>图号或型号</td>
|
||||
<td>规格</td>
|
||||
<td>数量</td>
|
||||
<td>单位</td>
|
||||
<td>单价</td>
|
||||
<td>合计</td>
|
||||
<td>交货时间</td>
|
||||
<td>备注</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<span>未税合计:</span><span id="untaxTotal"></span><span>元</span><br>
|
||||
<span>税额:</span><span id="tax"></span><br>
|
||||
@@ -729,106 +730,106 @@ export default {
|
||||
this.day = date.getDate()
|
||||
this.demoChange()
|
||||
await sleep(0)
|
||||
// if (this.contractNumValue) {
|
||||
// if (this.demoRadio) {
|
||||
// this.$refs.tinymce.destroyTinymce()
|
||||
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 : ''
|
||||
document.getElementById('supplierAddress') ? document.getElementById('supplierAddress').innerHTML = this.supplierAddress : ''
|
||||
document.getElementById('legalPerson') ? document.getElementById('legalPerson').innerHTML = this.legalPerson : ''
|
||||
document.getElementById('payDate') ? document.getElementById('payDate').innerHTML = this.payDate : ''
|
||||
document.getElementById('payMethod') ? document.getElementById('payMethod').innerHTML = this.payMethod : ''
|
||||
document.getElementById('invoiceInfo') ? document.getElementById('invoiceInfo').innerHTML = this.invoiceInfo : ''
|
||||
document.getElementById('deliveryDate') ? document.getElementById('deliveryDate').innerHTML = this.deliveryDate : ''
|
||||
document.getElementById('otherInfo') ? document.getElementById('otherInfo').innerHTML = this.otherInfo : ''
|
||||
document.getElementById('hasTax') ? document.getElementById('hasTax').innerHTML = this.hasTax : ''
|
||||
document.getElementById('taxRate') ? document.getElementById('taxRate').innerHTML = this.taxRate * 100 + '%' : ''
|
||||
// 明细表
|
||||
// 移出旧数据
|
||||
const children = document.getElementsByClassName('tableData')
|
||||
const parent = document.getElementById('tbody')
|
||||
if (children.length !== 0) {
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
parent.removeChild(children[i])
|
||||
}
|
||||
}
|
||||
const merge = []
|
||||
this.tableData1.map(v => {
|
||||
if ((this.hasTax === '含税' && v.含税单价.trim() !== '') || (this.hasTax === '未税' && v.未税单价.trim() !== '')) { // 筛掉未询到价格的物料
|
||||
merge.push({
|
||||
机床图号: v.机床图号,
|
||||
组号: v.组号,
|
||||
图号: v.图号,
|
||||
名称: v.名称,
|
||||
规格: v.规格,
|
||||
数量: Number(v.数量),
|
||||
计量单位: v.计量单位,
|
||||
单价: this.hasTax === '含税' ? v.含税单价 : v.未税单价,
|
||||
合计: (Number(v.数量) * (this.hasTax === '含税' ? Number(v.含税单价) : Number(v.未税单价))).toFixed(2),
|
||||
交货期: v.交货期 ? v.交货期.split(' ')[0] : '',
|
||||
备注: v.备注
|
||||
if (this.contractNumValue) {
|
||||
if (this.demoRadio) {
|
||||
// this.$refs.tinymce.destroyTinymce()
|
||||
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 : ''
|
||||
document.getElementById('supplierAddress') ? document.getElementById('supplierAddress').innerHTML = this.supplierAddress : ''
|
||||
document.getElementById('legalPerson') ? document.getElementById('legalPerson').innerHTML = this.legalPerson : ''
|
||||
document.getElementById('payDate') ? document.getElementById('payDate').innerHTML = this.payDate : ''
|
||||
document.getElementById('payMethod') ? document.getElementById('payMethod').innerHTML = this.payMethod : ''
|
||||
document.getElementById('invoiceInfo') ? document.getElementById('invoiceInfo').innerHTML = this.invoiceInfo : ''
|
||||
document.getElementById('deliveryDate') ? document.getElementById('deliveryDate').innerHTML = this.deliveryDate : ''
|
||||
document.getElementById('otherInfo') ? document.getElementById('otherInfo').innerHTML = this.otherInfo : ''
|
||||
document.getElementById('hasTax') ? document.getElementById('hasTax').innerHTML = this.hasTax : ''
|
||||
document.getElementById('taxRate') ? document.getElementById('taxRate').innerHTML = this.taxRate * 100 + '%' : ''
|
||||
// 明细表
|
||||
// 移出旧数据
|
||||
const children = document.getElementsByClassName('tableData')
|
||||
const parent = document.getElementById('tbody')
|
||||
if (children.length !== 0) {
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
parent.removeChild(children[i])
|
||||
}
|
||||
}
|
||||
const merge = []
|
||||
this.tableData1.map(v => {
|
||||
if ((this.hasTax === '含税' && v.含税单价.trim() !== '') || (this.hasTax === '未税' && v.未税单价.trim() !== '')) { // 筛掉未询到价格的物料
|
||||
merge.push({
|
||||
机床图号: v.机床图号,
|
||||
组号: v.组号,
|
||||
图号: v.图号,
|
||||
名称: v.名称,
|
||||
规格: v.规格,
|
||||
数量: Number(v.数量),
|
||||
计量单位: v.计量单位,
|
||||
单价: this.hasTax === '含税' ? v.含税单价 : v.未税单价,
|
||||
合计: (Number(v.数量) * (this.hasTax === '含税' ? Number(v.含税单价) : Number(v.未税单价))).toFixed(2),
|
||||
交货期: v.交货期 ? v.交货期.split(' ')[0] : '',
|
||||
备注: v.备注
|
||||
})
|
||||
}
|
||||
})
|
||||
let mergeData = []
|
||||
mergeData = groupBy(merge, ['图号', '名称', '规格', '计量单位', '单价', '交货期', '备注'])
|
||||
// 放入新数据
|
||||
const tr = []
|
||||
for (let i = 0; i < mergeData.length; i++) {
|
||||
tr[i] = document.createElement('tr')
|
||||
tr[i].setAttribute('class', 'tableData')
|
||||
tr[i].innerHTML = '<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>'
|
||||
const tableHead = $('#tableHead')
|
||||
tableHead ? tableHead.after(tr[i]) : ''
|
||||
}
|
||||
this.actualTotal = 0
|
||||
this.untaxTotal = 0
|
||||
this.taxTotal = 0
|
||||
for (let j = 0; j < this.tableData1.length; j++) {
|
||||
this.actualTotal += Number(this.tableData1[j].含税总额)
|
||||
this.untaxTotal += Number(this.tableData1[j].未税总额)
|
||||
this.taxTotal += Number(this.tableData1[j].含税总额)
|
||||
}
|
||||
for (let j = 0; j < mergeData.length; j++) {
|
||||
if (document.getElementsByClassName('tableData')[j]) {
|
||||
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
|
||||
document.getElementsByClassName('tableData')[j].children[1].innerHTML = mergeData[j].机床图号_组号
|
||||
document.getElementsByClassName('tableData')[j].children[2].innerHTML = mergeData[j].名称
|
||||
document.getElementsByClassName('tableData')[j].children[3].innerHTML = mergeData[j].图号
|
||||
document.getElementsByClassName('tableData')[j].children[4].innerHTML = mergeData[j].规格
|
||||
document.getElementsByClassName('tableData')[j].children[5].innerHTML = mergeData[j].数量
|
||||
document.getElementsByClassName('tableData')[j].children[6].innerHTML = mergeData[j].计量单位
|
||||
document.getElementsByClassName('tableData')[j].children[7].innerHTML = mergeData[j].单价
|
||||
document.getElementsByClassName('tableData')[j].children[8].innerHTML = (Number(mergeData[j].数量) * Number(mergeData[j].单价)).toFixed(2)
|
||||
document.getElementsByClassName('tableData')[j].children[9].innerHTML = mergeData[j].交货期
|
||||
document.getElementsByClassName('tableData')[j].children[10].innerHTML = mergeData[j].备注
|
||||
}
|
||||
}
|
||||
this.actualTotal = this.actualTotal.toFixed(2)
|
||||
this.untaxTotal = this.untaxTotal.toFixed(2)
|
||||
this.taxTotal = this.taxTotal.toFixed(2)
|
||||
this.tax = (this.taxTotal - this.untaxTotal).toFixed(2)
|
||||
document.getElementById('untaxTotal') ? document.getElementById('untaxTotal').innerHTML = this.untaxTotal : ''
|
||||
document.getElementById('tax') ? document.getElementById('tax').innerHTML = this.tax : ''
|
||||
document.getElementById('taxTotal') ? document.getElementById('taxTotal').innerHTML = this.taxTotal : ''
|
||||
document.getElementsByClassName('actualTotal')[0] ? document.getElementsByClassName('actualTotal')[0].innerHTML = this.actualTotal : ''
|
||||
document.getElementsByClassName('actualTotal')[1] ? document.getElementsByClassName('actualTotal')[1].innerHTML = this.actualTotal : ''
|
||||
document.getElementById('actualTotal_zh') ? document.getElementById('actualTotal_zh').innerHTML = this.actualTotal_zh : ''
|
||||
document.getElementsByClassName('actualTotal')[0].innerHTML = this.actualTotal
|
||||
document.getElementsByClassName('actualTotal')[1].innerHTML = this.actualTotal
|
||||
document.getElementById('actualTotal_zh').innerHTML = convertCurrency(this.actualTotal)
|
||||
this.contentNew = document.getElementsByClassName('editor-content')[0].innerHTML
|
||||
this.$refs.tinymce.initTinymce()
|
||||
setTimeout(() => {
|
||||
this.$refs.tinymce.setContent(this.contentNew)
|
||||
}, 1000)
|
||||
} else {
|
||||
this.$message.warning('请先选择合同模板,再预览')
|
||||
}
|
||||
})
|
||||
let mergeData = []
|
||||
mergeData = groupBy(merge, ['图号', '名称', '规格', '计量单位', '单价', '交货期', '备注'])
|
||||
// 放入新数据
|
||||
const tr = []
|
||||
for (let i = 0; i < mergeData.length; i++) {
|
||||
tr[i] = document.createElement('tr')
|
||||
tr[i].setAttribute('class', 'tableData')
|
||||
tr[i].innerHTML = '<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>'
|
||||
const tableHead = $('#tableHead')
|
||||
tableHead ? tableHead.after(tr[i]) : ''
|
||||
} else {
|
||||
this.$message.warning('请先选择合同,再预览')
|
||||
}
|
||||
this.actualTotal = 0
|
||||
this.untaxTotal = 0
|
||||
this.taxTotal = 0
|
||||
for (let j = 0; j < this.tableData1.length; j++) {
|
||||
this.actualTotal += Number(this.tableData1[j].含税总额)
|
||||
this.untaxTotal += Number(this.tableData1[j].未税总额)
|
||||
this.taxTotal += Number(this.tableData1[j].含税总额)
|
||||
}
|
||||
for (let j = 0; j < mergeData.length; j++) {
|
||||
if (document.getElementsByClassName('tableData')[j]) {
|
||||
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
|
||||
document.getElementsByClassName('tableData')[j].children[1].innerHTML = mergeData[j].机床图号_组号
|
||||
document.getElementsByClassName('tableData')[j].children[2].innerHTML = mergeData[j].名称
|
||||
document.getElementsByClassName('tableData')[j].children[3].innerHTML = mergeData[j].图号
|
||||
document.getElementsByClassName('tableData')[j].children[4].innerHTML = mergeData[j].规格
|
||||
document.getElementsByClassName('tableData')[j].children[5].innerHTML = mergeData[j].数量
|
||||
document.getElementsByClassName('tableData')[j].children[6].innerHTML = mergeData[j].计量单位
|
||||
document.getElementsByClassName('tableData')[j].children[7].innerHTML = mergeData[j].单价
|
||||
document.getElementsByClassName('tableData')[j].children[8].innerHTML = (Number(mergeData[j].数量) * Number(mergeData[j].单价)).toFixed(2)
|
||||
document.getElementsByClassName('tableData')[j].children[9].innerHTML = mergeData[j].交货期
|
||||
document.getElementsByClassName('tableData')[j].children[10].innerHTML = mergeData[j].备注
|
||||
}
|
||||
}
|
||||
this.actualTotal = this.actualTotal.toFixed(2)
|
||||
this.untaxTotal = this.untaxTotal.toFixed(2)
|
||||
this.taxTotal = this.taxTotal.toFixed(2)
|
||||
this.tax = (this.taxTotal - this.untaxTotal).toFixed(2)
|
||||
document.getElementById('untaxTotal') ? document.getElementById('untaxTotal').innerHTML = this.untaxTotal : ''
|
||||
document.getElementById('tax') ? document.getElementById('tax').innerHTML = this.tax : ''
|
||||
document.getElementById('taxTotal') ? document.getElementById('taxTotal').innerHTML = this.taxTotal : ''
|
||||
document.getElementsByClassName('actualTotal')[0] ? document.getElementsByClassName('actualTotal')[0].innerHTML = this.actualTotal : ''
|
||||
document.getElementsByClassName('actualTotal')[1] ? document.getElementsByClassName('actualTotal')[1].innerHTML = this.actualTotal : ''
|
||||
document.getElementById('actualTotal_zh') ? document.getElementById('actualTotal_zh').innerHTML = this.actualTotal_zh : ''
|
||||
document.getElementsByClassName('actualTotal')[0].innerHTML = this.actualTotal
|
||||
document.getElementsByClassName('actualTotal')[1].innerHTML = this.actualTotal
|
||||
document.getElementById('actualTotal_zh').innerHTML = convertCurrency(this.actualTotal)
|
||||
this.contentNew = document.getElementsByClassName('editor-content')[0].innerHTML
|
||||
this.$refs.tinymce.initTinymce()
|
||||
setTimeout(() => {
|
||||
this.$refs.tinymce.setContent(this.contentNew)
|
||||
}, 1000)
|
||||
// } else {
|
||||
// this.$message.warning('请先选择合同模板,再预览')
|
||||
// }
|
||||
// } else {
|
||||
// this.$message.warning('请先选择合同,再预览')
|
||||
// }
|
||||
},
|
||||
demo2() {
|
||||
this.content = `demo2`
|
||||
@@ -859,33 +860,33 @@ export default {
|
||||
inquiryDetailNum_old.push(v.询价单明细流水号)
|
||||
}
|
||||
})
|
||||
// if (this.contractNumValue) {
|
||||
// if (this.demoRadio) {
|
||||
this.$confirm('此采购合同将递交审批,递交后该合同不可删除,确认完成编辑?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
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, this.taxRate * 100, inquiryDetailNum_old, this.备注组).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('合同生成成功')
|
||||
this.reload()
|
||||
} else {
|
||||
this.$message.error('生成合同失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
// } else {
|
||||
// this.$message.warning('请先选择模板进行预览')
|
||||
// }
|
||||
// } else {
|
||||
// this.$message.warning('请先选择合同进行编辑')
|
||||
// }
|
||||
if (this.contractNumValue) {
|
||||
if (this.demoRadio) {
|
||||
this.$confirm('此采购合同将递交审批,递交后该合同不可删除,确认完成编辑?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
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, this.taxRate * 100, inquiryDetailNum_old, this.备注组).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('合同生成成功')
|
||||
this.reload()
|
||||
} else {
|
||||
this.$message.error('生成合同失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请先选择模板进行预览')
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('请先选择合同进行编辑')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user