|
@@ -4,7 +4,8 @@
|
|
|
<!-- <el-header>
|
|
|
<label>新建账款</label>
|
|
|
</el-header> -->
|
|
|
- <el-container>
|
|
|
+ <el-container
|
|
|
+ v-loading.fullscreen.lock="fullscreenLoading">
|
|
|
<el-aside
|
|
|
style="
|
|
|
background-color: white;
|
|
@@ -188,7 +189,7 @@
|
|
|
<el-table
|
|
|
stripe
|
|
|
:data="fileList"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
+ @selection-change="handleInvoiceSelectionChange"
|
|
|
row-key="categoryId"
|
|
|
default-expand-all
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
@@ -270,7 +271,8 @@
|
|
|
:file-list="fileList"
|
|
|
:auto-upload="false"
|
|
|
:http-request="httpRequest"
|
|
|
- :before-remove="invoiceRemove"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :on-remove="invoiceRemove"
|
|
|
action=""
|
|
|
multiple
|
|
|
>
|
|
@@ -442,7 +444,8 @@
|
|
|
ref="contractUpload"
|
|
|
list-type="picture-card"
|
|
|
:on-preview="invoicePictureCardPreview"
|
|
|
- :before-remove="handleRemove">
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :on-remove="handleRemove">
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</div>
|
|
@@ -464,7 +467,8 @@
|
|
|
ref="logisticsUpload"
|
|
|
list-type="picture-card"
|
|
|
:on-preview="invoicePictureCardPreview"
|
|
|
- :before-remove="handleRemove">
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :on-remove="handleRemove">
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</div>
|
|
@@ -486,7 +490,8 @@
|
|
|
ref="otherUpload"
|
|
|
list-type="picture-card"
|
|
|
:on-preview="invoicePictureCardPreview"
|
|
|
- :before-remove="handleRemove">
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :on-remove="handleRemove">
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</div>
|
|
@@ -504,7 +509,6 @@
|
|
|
>上一步</el-button
|
|
|
>
|
|
|
<el-button type="primary" @click="next()" v-if="active != 4"
|
|
|
- v-loading.fullscreen.lock="fullscreenLoading"
|
|
|
>下一步</el-button
|
|
|
>
|
|
|
<el-button type="primary" @click="submit()" v-if="active == 4"
|
|
@@ -525,6 +529,7 @@ import {
|
|
|
companyRelList
|
|
|
} from "@/api/common/company";
|
|
|
import { amtformat } from "@/utils/amtCommon"
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
|
|
|
export default {
|
|
|
name: "BillAdd",
|
|
@@ -685,8 +690,8 @@ export default {
|
|
|
checkedCount > 0 && checkedCount < this.fileList.length;
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map((item) => item.dciCatalogId);
|
|
|
+ handleInvoiceSelectionChange(selection) {
|
|
|
+ this.ids = selection.map((item) => item.ziiId);
|
|
|
this.single = selection.length !== 1;
|
|
|
this.multiple = !selection.length;
|
|
|
},
|
|
@@ -751,6 +756,7 @@ export default {
|
|
|
fd.append("zbiId", this.form.zbiId); //文件类型
|
|
|
console.log(fd.get("file"));
|
|
|
getInvoiceText(fd).then((response) => {
|
|
|
+ response.url = response.url + "/" + getToken()
|
|
|
this.fileList.push(response.data);
|
|
|
this.fullscreenLoading = false
|
|
|
}).catch(() => {
|
|
@@ -779,6 +785,7 @@ export default {
|
|
|
fd.append("zbiId", this.form.zbiId); //文件类型
|
|
|
fd.append("type", "0"); //文件类型
|
|
|
uploadBillFile(fd).then((response) => {
|
|
|
+ response.url = response.url + "/" + getToken()
|
|
|
this.contractList.push(response.data);
|
|
|
this.fullscreenLoading = false
|
|
|
}).catch(() => {
|
|
@@ -795,6 +802,7 @@ export default {
|
|
|
fd.append("zbiId", this.form.zbiId); //文件类型
|
|
|
fd.append("type", "1"); //文件类型
|
|
|
uploadBillFile(fd).then((response) => {
|
|
|
+ response.url = response.url + "/" + getToken()
|
|
|
this.logisticsList.push(response.data);
|
|
|
this.fullscreenLoading = false
|
|
|
}).catch(() => {
|
|
@@ -811,12 +819,22 @@ export default {
|
|
|
fd.append("zbiId", this.form.zbiId); //文件类型
|
|
|
fd.append("type", "2"); //文件类型
|
|
|
uploadBillFile(fd).then((response) => {
|
|
|
+ response.url = response.url + "/" + getToken()
|
|
|
this.otherList.push(response.data);
|
|
|
this.fullscreenLoading = false
|
|
|
}).catch(() => {
|
|
|
this.fullscreenLoading = false
|
|
|
});
|
|
|
},
|
|
|
+ //删除图片
|
|
|
+ beforeRemove(file, fileList) {
|
|
|
+ console.log(file)
|
|
|
+ let a = true;
|
|
|
+ if (file && file.status==="success") {
|
|
|
+ a = this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
+ }
|
|
|
+ return a;
|
|
|
+ },
|
|
|
//删除合同附件
|
|
|
handleRemove(file, fileList) {
|
|
|
console.log(fileList);
|
|
@@ -856,21 +874,11 @@ export default {
|
|
|
//删除附件
|
|
|
delFile(row){
|
|
|
var self = this
|
|
|
- console.log(this.ids)
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$confirm("是否确认删除此数据项?", "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ self.fullscreenLoading = true;
|
|
|
+ delFile(ids).then(function() {
|
|
|
+ self.fullscreenLoading = false;
|
|
|
})
|
|
|
- .then(function() {
|
|
|
- self.fullscreenLoading = true;
|
|
|
- return delFile(ids);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.getInvoiceList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- });
|
|
|
},
|
|
|
//查看图片
|
|
|
invoicePictureCardPreview(file) {
|
|
@@ -880,13 +888,19 @@ export default {
|
|
|
},
|
|
|
//删除发票
|
|
|
invoiceRemove(file, fileList) {
|
|
|
- console.log(fileList);
|
|
|
- if (this.fileList) {
|
|
|
+ var self = this
|
|
|
+ if (file && file.status==="success") {
|
|
|
this.fileList = this.fileList.filter((item) =>{
|
|
|
if(item.uid !== file.uid){
|
|
|
return item
|
|
|
}else{
|
|
|
- this.delInvoice(item)
|
|
|
+ self.fullscreenLoading = true;
|
|
|
+ delInvoice(item.ziiId).then(function() {
|
|
|
+ self.fullscreenLoading = false;
|
|
|
+ self.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {
|
|
|
+ self.fullscreenLoading = false
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -947,6 +961,9 @@ export default {
|
|
|
} else if(this.active == 1) {
|
|
|
//查询合同
|
|
|
getFile("0",this.form.zbiId).then((response) => {
|
|
|
+ response.data.forEach(element => {
|
|
|
+ element.url = element.url + "/" + getToken()
|
|
|
+ });
|
|
|
this.contractList = response.data;
|
|
|
this.fullscreenLoading = false
|
|
|
}).catch(() => {
|
|
@@ -956,6 +973,9 @@ export default {
|
|
|
} else if(this.active == 2) {
|
|
|
//查询物流
|
|
|
getFile("1",this.form.zbiId).then((response) => {
|
|
|
+ response.data.forEach(element => {
|
|
|
+ element.url = element.url + "/" + getToken()
|
|
|
+ });
|
|
|
this.logisticsList = response.data;
|
|
|
this.fullscreenLoading = false
|
|
|
}).catch(() => {
|
|
@@ -965,6 +985,9 @@ export default {
|
|
|
} else if(this.active == 3) {
|
|
|
//查询其他附件
|
|
|
getFile("2",this.form.zbiId).then((response) => {
|
|
|
+ response.data.forEach(element => {
|
|
|
+ element.url = element.url + "/" + getToken()
|
|
|
+ });
|
|
|
this.otherList = response.data;
|
|
|
this.fullscreenLoading = false
|
|
|
}).catch(() => {
|
|
@@ -980,6 +1003,9 @@ export default {
|
|
|
getInvoiceList(){
|
|
|
getInvoice(this.form.zbiId).then((response) => {
|
|
|
console.log(response);
|
|
|
+ response.data.forEach(element => {
|
|
|
+ element.url = element.url + "/" + getToken()
|
|
|
+ });
|
|
|
this.fileList = response.data;
|
|
|
this.fullscreenLoading = false
|
|
|
}).catch(() => {
|