|
|
@@ -84,9 +84,6 @@ export default {
|
|
|
type: Array,
|
|
|
default: []
|
|
|
},
|
|
|
- itemType:{
|
|
|
- type: String
|
|
|
- },
|
|
|
billUrl:{
|
|
|
type: String
|
|
|
}
|
|
|
@@ -352,89 +349,88 @@ export default {
|
|
|
if (result.some(item => item)) {
|
|
|
const itemsList = this.list.map(item => {
|
|
|
item.form.corpId = this.corpId;
|
|
|
- item.tradeType = this.billData.optionType
|
|
|
+ item.form.tradeType = this.billData.optionType
|
|
|
+ item.form.srcType = 1
|
|
|
return item.form
|
|
|
})
|
|
|
-
|
|
|
- const params = {
|
|
|
- itemType:this.itemType,
|
|
|
- billType : this.billType,
|
|
|
- url:this.billUrl,
|
|
|
- DC : this.billData.itemType === "采购"?"C":"D", //账单明细会根据D C区分采购 销售搜索
|
|
|
- itemsList: itemsList
|
|
|
- }
|
|
|
- // 采购申请货款 销售申请退款 都会走申请 走审核 => 付款申请
|
|
|
- if(this.billType === "申请"){
|
|
|
- applyLoan(params).then(res =>{
|
|
|
- if(res.data.success){
|
|
|
- this.$message.success("操作成功!")
|
|
|
- this.$emit("choceFun");
|
|
|
- //跳转付款申请页面
|
|
|
- if(this.$store.getters.pqStatus){
|
|
|
- this.$alert("无法自动跳转到付款申请页面,因为页面已存在。", "温馨提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- type: 'warning',
|
|
|
- callback: action => {
|
|
|
- }
|
|
|
- });
|
|
|
- }else{
|
|
|
- //关闭一下存在的列表页 跳转
|
|
|
- this.$router.$avueRouter.closeTag('/financialManagement/paymentRequest/index');
|
|
|
- this.$router.push({
|
|
|
- path: "/financialManagement/paymentRequest/index",
|
|
|
- query: {params: res.data.data.id},
|
|
|
- });
|
|
|
+ const params = {
|
|
|
+ billType : this.billType,
|
|
|
+ url:this.billUrl,
|
|
|
+ DC : this.billData.itemType === "采购"?"C":"D", //账单明细会根据D C区分采购 销售搜索
|
|
|
+ itemsList: itemsList
|
|
|
+ }
|
|
|
+ // 采购申请货款 销售申请退款 都会走申请 走审核 => 付款申请
|
|
|
+ if(this.billType === "申请"){
|
|
|
+ applyLoan(params).then(res =>{
|
|
|
+ if(res.data.success){
|
|
|
+ this.$message.success("操作成功!")
|
|
|
+ this.$emit("choceFun");
|
|
|
+ //跳转付款申请页面
|
|
|
+ if(this.$store.getters.pqStatus){
|
|
|
+ this.$alert("无法自动跳转到付款申请页面,因为页面已存在。", "温馨提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ type: 'warning',
|
|
|
+ callback: action => {
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ //关闭一下存在的列表页 跳转
|
|
|
+ this.$router.$avueRouter.closeTag('/financialManagement/paymentRequest/index');
|
|
|
+ this.$router.push({
|
|
|
+ path: "/financialManagement/paymentRequest/index",
|
|
|
+ query: {params: res.data.data.id},
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- //采购退款结算 销售收款结算 不需申请请核 直接结算 => 结算
|
|
|
- if(this.billType === "收费"){
|
|
|
- paymentApply(params).then(res=>{
|
|
|
- if(res.data.success){
|
|
|
- this.$message.success("操作成功!")
|
|
|
- this.$emit("choceFun");
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //采购退款结算 销售收款结算 不需申请请核 直接结算 => 结算
|
|
|
+ if(this.billType === "收费"){
|
|
|
+ paymentApply(params).then(res=>{
|
|
|
+ if(res.data.success){
|
|
|
+ this.$message.success("操作成功!")
|
|
|
+ this.$emit("choceFun");
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * @param instance 实例
|
|
|
- * @param result 校验结果数组
|
|
|
- * 递归校验每个表格实例
|
|
|
- */
|
|
|
- handleValid(instance,result) {
|
|
|
- if(!instance) {
|
|
|
- result.push(true)
|
|
|
- }else if(Array.isArray(instance)) {
|
|
|
- instance.map(item => this.handleValid(item,result))
|
|
|
- }else{
|
|
|
- if(instance.validate) {
|
|
|
- instance.validate(valid => {
|
|
|
- result.push(valid)
|
|
|
- instance.hide && instance.hide()
|
|
|
- })
|
|
|
- }else {
|
|
|
- instance.validateCellForm().then(msg=>{
|
|
|
- if((msg && !Object.keys(msg).length) || undefined === msg){
|
|
|
- result.push(true)
|
|
|
- }else{
|
|
|
- result.push(false)
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @param instance 实例
|
|
|
+ * @param result 校验结果数组
|
|
|
+ * 递归校验每个表格实例
|
|
|
+ */
|
|
|
+ handleValid(instance,result) {
|
|
|
+ if(!instance) {
|
|
|
+ result.push(true)
|
|
|
+ }else if(Array.isArray(instance)) {
|
|
|
+ instance.map(item => this.handleValid(item,result))
|
|
|
+ }else{
|
|
|
+ if(instance.validate) {
|
|
|
+ instance.validate(valid => {
|
|
|
+ result.push(valid)
|
|
|
+ instance.hide && instance.hide()
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ instance.validateCellForm().then(msg=>{
|
|
|
+ if((msg && !Object.keys(msg).length) || undefined === msg){
|
|
|
+ result.push(true)
|
|
|
+ }else{
|
|
|
+ result.push(false)
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * @param resultArr 校验结果数组
|
|
|
- * 统一校验方法
|
|
|
- */
|
|
|
- handleRulesValid(refsList,resultArr) {
|
|
|
- refsList.map(item => this.handleValid(this.$refs[`${item}`],resultArr))
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @param resultArr 校验结果数组
|
|
|
+ * 统一校验方法
|
|
|
+ */
|
|
|
+ handleRulesValid(refsList,resultArr) {
|
|
|
+ refsList.map(item => this.handleValid(this.$refs[`${item}`],resultArr))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|