This commit is contained in:
liushuai
2019-09-18 09:06:49 +08:00
parent 53a9f57fe1
commit 4a39ba8190
11 changed files with 260 additions and 137 deletions

View File

@@ -222,21 +222,21 @@
<el-input v-model="form1.remark" size="small" placeholder="备注"/>
</el-form-item>
</el-col>
<b v-show="title1 === '创建发票结算申请单'" style="float:left;color: #f56c6c;margin-top: 13px">* </b>
<el-form-item v-show="title1 === '创建发票结算申请单'" label="发票扫描件" style="display: inline-block">
<el-upload
id="invoiceScan"
ref="upload"
:auto-upload="false"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
:on-exceed="warningExceed"
:limit="limit"
:action="upload+'?invoiceNum='+form1.invoiceNum+'&money='+form1.money+'&supplierValue='+form1.supplierValue+'&paid='+form1.paid+'&unpaid='+form1.unpaid+'&tax='+form1.tax+'&isCost='+form1.isCost+'&remark='+form1.remark+'&personId='+id"
list-type="picture-card">
<i class="el-icon-plus"/>
</el-upload>
</el-form-item>
<!--<b v-show="title1 === '创建发票结算申请单'" style="float:left;color: #f56c6c;margin-top: 13px">* </b>-->
<!--<el-form-item v-show="title1 === '创建发票结算申请单'" label="发票扫描件" style="display: inline-block">-->
<!--<el-upload-->
<!--id="invoiceScan"-->
<!--ref="upload"-->
<!--:auto-upload="false"-->
<!--:on-success="uploadSuccess"-->
<!--:before-upload="beforeUpload"-->
<!--:on-exceed="warningExceed"-->
<!--:limit="limit"-->
<!--:action="upload+'?invoiceNum='+form1.invoiceNum+'&money='+form1.money+'&supplierValue='+form1.supplierValue+'&paid='+form1.paid+'&unpaid='+form1.unpaid+'&tax='+form1.tax+'&isCost='+form1.isCost+'&remark='+form1.remark+'&personId='+id"-->
<!--list-type="picture-card">-->
<!--<i class="el-icon-plus"/>-->
<!--</el-upload>-->
<!--</el-form-item>-->
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -317,11 +317,11 @@
</template>
<script>
import { searchSupplier, searchTable1, submitEdit, submitDelete, submitApply, searchTable2, searchPurchase, searchOffline, searchPurchaseDetail, searchOfflineDetail,
import { insertInto, searchSupplier, searchTable1, submitEdit, submitDelete, submitApply, searchTable2, searchPurchase, searchOffline, searchPurchaseDetail, searchOfflineDetail,
addTable2, deleteTable2 } from '@/api/WorkshopProcurement/InvoiceSettlementApplication1'
import { mapGetters } from 'vuex'
import { uploadInvoiceScan1, readFile } from '@/utils/request'
import request from '@/utils/request'
import { uploadInvoiceScan1 } from '@/utils/request'
export default {
name: '', // 发票结算申请
data() {
@@ -429,9 +429,16 @@ export default {
submitAdd1() { // 提交新增
this.$refs['form1'].validate((valid) => {
if (valid) {
this.$refs.upload.submit() // 上传图片
insertInto(this.form1.invoiceNum, this.form1.money, this.form1.supplierValue, this.form1.paid, this.form1.unpaid, this.form1.tax, this.form1.isCost, this.form1.remark).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.dialogVisible1 = false
this.searchTable1()
} else {
this.$message.error('增加失败')
}
})
} else {
console.log('error submit!!')
return false
}
})
@@ -449,7 +456,6 @@ export default {
} else { this.$message.error('编辑失败') }
})
} else {
console.log('error submit!!')
return false
}
})
@@ -492,16 +498,6 @@ export default {
})
},
async searchPic(row, i) {
const { data } = await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 车间采购管理_采购发票_附件 where 是否启用 = 1 and 发票交接流水号 = ${row.发票结算申请单流水号}`
}
})
this.tableData1[i].scanSrc = readFile + data[0].文件标识 + '.' + data[0].文件后缀
console.log(this.tableData1[i].scanSrc)
},
warningExceed() {
this.$message.error('仅可上传一张发票')
@@ -567,7 +563,6 @@ export default {
this.supplierValue = row.供应商流水号
Number(row.是否提交申请) === 1 ? this.disabled = true : this.disabled = false
searchTable2(row.发票结算申请单流水号).then(response => {
console.log(response.data)
this.tableData2 = response.data
})
},