|  | @@ -40,7 +40,7 @@
 | 
	
		
			
				|  |  |          </template>
 | 
	
		
			
				|  |  |          <template slot-scope="{type,size,row,$index}" slot="menuLeft">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -          <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">新建订单</el-button>
 | 
	
		
			
				|  |  | +          <el-button icon="el-icon-plus" type="primary" :size="size" @click="newOrder">新建订单</el-button>
 | 
	
		
			
				|  |  |            <el-button type="warning" icon="el-icon-download" size="small" @click="outExport">导出</el-button>
 | 
	
		
			
				|  |  |          </template>
 | 
	
		
			
				|  |  |          <template slot-scope="{ row, index }" slot="ordNo">
 | 
	
	
		
			
				|  | @@ -63,6 +63,7 @@ import detailsPage from "./detailsPage"
 | 
	
		
			
				|  |  |  import { getDetails } from "@/api/tirePartsMall/salesManagement/saleOrder";
 | 
	
		
			
				|  |  |  import { getToken } from "@/util/auth";
 | 
	
		
			
				|  |  |  import { dateFormat } from '@/util/date'
 | 
	
		
			
				|  |  | +import { isProcurement } from "@/api/basicData/configuration";
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    name: "index",
 | 
	
		
			
				|  |  |    components: {
 | 
	
	
		
			
				|  | @@ -70,6 +71,7 @@ export default {
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  | +      whetherFinancing: null,
 | 
	
		
			
				|  |  |        orderStatusList: [],
 | 
	
		
			
				|  |  |        actualStatusList: [],
 | 
	
		
			
				|  |  |        returnStatusList: [],
 | 
	
	
		
			
				|  | @@ -383,7 +385,7 @@ export default {
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  |              label: '订单保证金',
 | 
	
		
			
				|  |  |              prop: "primaryBondAmount",
 | 
	
		
			
				|  |  | -            width:100,
 | 
	
		
			
				|  |  | +            width: 100,
 | 
	
		
			
				|  |  |              disabled: true,
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '订单数量',
 | 
	
	
		
			
				|  | @@ -607,35 +609,48 @@ export default {
 | 
	
		
			
				|  |  |      this.getWorkDicts("return_Status").then(res => {
 | 
	
		
			
				|  |  |        this.returnStatusList = res.data.data
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  | +    isProcurement({ "param": "whether.financing" }).then(res => {
 | 
	
		
			
				|  |  | +      this.whetherFinancing = res.data.data
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | +    newOrder() {
 | 
	
		
			
				|  |  | +      if (this.whetherFinancing == 1) {
 | 
	
		
			
				|  |  | +        this.detailsOpen = true
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        this.$message.error("该功能未开通,请联系管理员");
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      // 导出
 | 
	
		
			
				|  |  |      outExport() {
 | 
	
		
			
				|  |  | -      console.log(this.search, 412)
 | 
	
		
			
				|  |  | -      let config = { params: { ...this.search } }
 | 
	
		
			
				|  |  | -      if (config.params) {
 | 
	
		
			
				|  |  | -        for (const propName of Object.keys(config.params)) {
 | 
	
		
			
				|  |  | -          const value = config.params[propName];
 | 
	
		
			
				|  |  | -          if (value !== null && typeof (value) !== "undefined") {
 | 
	
		
			
				|  |  | -            if (value instanceof Array) {
 | 
	
		
			
				|  |  | -              for (const key of Object.keys(value)) {
 | 
	
		
			
				|  |  | -                let params = propName + '[' + key + ']';
 | 
	
		
			
				|  |  | -                config.params[params] = value[key]
 | 
	
		
			
				|  |  | +      if (this.whetherFinancing == 1) {
 | 
	
		
			
				|  |  | +        let config = { params: { ...this.search } }
 | 
	
		
			
				|  |  | +        if (config.params) {
 | 
	
		
			
				|  |  | +          for (const propName of Object.keys(config.params)) {
 | 
	
		
			
				|  |  | +            const value = config.params[propName];
 | 
	
		
			
				|  |  | +            if (value !== null && typeof (value) !== "undefined") {
 | 
	
		
			
				|  |  | +              if (value instanceof Array) {
 | 
	
		
			
				|  |  | +                for (const key of Object.keys(value)) {
 | 
	
		
			
				|  |  | +                  let params = propName + '[' + key + ']';
 | 
	
		
			
				|  |  | +                  config.params[params] = value[key]
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                delete config.params[propName]
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  | -              delete config.params[propName]
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        config.params.bsType = 'RZCG'
 | 
	
		
			
				|  |  | +        console.log(config, 427)
 | 
	
		
			
				|  |  | +        const routeData = this.$router.resolve({
 | 
	
		
			
				|  |  | +          path: '/api/blade-sales-part/order/listExport',      //跳转目标下载地址
 | 
	
		
			
				|  |  | +          query: {
 | 
	
		
			
				|  |  | +            ...config.params    //括号内是要传递给新窗口的参数
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +        window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        this.$message.error("该功能未开通,请联系管理员");
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      config.params.bsType = 'RZCG'
 | 
	
		
			
				|  |  | -      console.log(config, 427)
 | 
	
		
			
				|  |  | -      const routeData = this.$router.resolve({
 | 
	
		
			
				|  |  | -        path: '/api/blade-sales-part/order/listExport',      //跳转目标下载地址
 | 
	
		
			
				|  |  | -        query: {
 | 
	
		
			
				|  |  | -          ...config.params    //括号内是要传递给新窗口的参数
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | -      window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      check(row) {
 | 
	
		
			
				|  |  |        this.form = row
 | 
	
	
		
			
				|  | @@ -651,92 +666,106 @@ export default {
 | 
	
		
			
				|  |  |        this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      editOpen(row, status) {
 | 
	
		
			
				|  |  | -      this.form = row
 | 
	
		
			
				|  |  | -      this.detailData = {
 | 
	
		
			
				|  |  | -        id: row.id,
 | 
	
		
			
				|  |  | -        status: status
 | 
	
		
			
				|  |  | -      };
 | 
	
		
			
				|  |  | -      console.log(status);
 | 
	
		
			
				|  |  | -      this.$store.commit("IN_FINACING_DETAIL");
 | 
	
		
			
				|  |  | -      this.detailsOpen = true;
 | 
	
		
			
				|  |  | +      if (this.whetherFinancing == 1) {
 | 
	
		
			
				|  |  | +        this.form = row
 | 
	
		
			
				|  |  | +        this.detailData = {
 | 
	
		
			
				|  |  | +          id: row.id,
 | 
	
		
			
				|  |  | +          status: status
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  | +        console.log(status);
 | 
	
		
			
				|  |  | +        this.$store.commit("IN_FINACING_DETAIL");
 | 
	
		
			
				|  |  | +        this.detailsOpen = true;
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        this.$message.error("该功能未开通,请联系管理员");
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //刷新
 | 
	
		
			
				|  |  |      refreshChange() {
 | 
	
		
			
				|  |  |        this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      confirm(row, index, type) {
 | 
	
		
			
				|  |  | -      if (type == 1) {
 | 
	
		
			
				|  |  | -        if (row.goodsTotalShipNum == 0) return this.$message.error("入库数量为0,请先入库");
 | 
	
		
			
				|  |  | -        this.$confirm('采购数量:' + row.goodsTotalNum + ',金额:' + row.totalMoney + '<br/>到货数量:' + row.goodsTotalShipNum + ',金额:' + row.goodsTotalShipAmount, '提示', {
 | 
	
		
			
				|  |  | -          confirmButtonText: '确定',
 | 
	
		
			
				|  |  | -          cancelButtonText: '取消',
 | 
	
		
			
				|  |  | -          type: 'warning',
 | 
	
		
			
				|  |  | -          dangerouslyUseHTMLString: true,
 | 
	
		
			
				|  |  | -        }).then(() => {
 | 
	
		
			
				|  |  | -          confirmWarehouse(row).then(res => {
 | 
	
		
			
				|  |  | -            this.$message.success("确认成功");
 | 
	
		
			
				|  |  | -            this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  | +      if (this.whetherFinancing == 1) {
 | 
	
		
			
				|  |  | +        if (type == 1) {
 | 
	
		
			
				|  |  | +          if (row.goodsTotalShipNum == 0) return this.$message.error("入库数量为0,请先入库");
 | 
	
		
			
				|  |  | +          this.$confirm('采购数量:' + row.goodsTotalNum + ',金额:' + row.totalMoney + '<br/>到货数量:' + row.goodsTotalShipNum + ',金额:' + row.goodsTotalShipAmount, '提示', {
 | 
	
		
			
				|  |  | +            confirmButtonText: '确定',
 | 
	
		
			
				|  |  | +            cancelButtonText: '取消',
 | 
	
		
			
				|  |  | +            type: 'warning',
 | 
	
		
			
				|  |  | +            dangerouslyUseHTMLString: true,
 | 
	
		
			
				|  |  | +          }).then(() => {
 | 
	
		
			
				|  |  | +            confirmWarehouse(row).then(res => {
 | 
	
		
			
				|  |  | +              this.$message.success("确认成功");
 | 
	
		
			
				|  |  | +              this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | -      if (type == 2) {
 | 
	
		
			
				|  |  | -        this.$confirm('是否撤销到货?', '提示', {
 | 
	
		
			
				|  |  | -          confirmButtonText: '确定',
 | 
	
		
			
				|  |  | -          cancelButtonText: '取消',
 | 
	
		
			
				|  |  | -          type: 'warning'
 | 
	
		
			
				|  |  | -        }).then(() => {
 | 
	
		
			
				|  |  | -          revokeWarehouse(row).then(res => {
 | 
	
		
			
				|  |  | -            this.$message.success("撤销成功");
 | 
	
		
			
				|  |  | -            this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (type == 2) {
 | 
	
		
			
				|  |  | +          this.$confirm('是否撤销到货?', '提示', {
 | 
	
		
			
				|  |  | +            confirmButtonText: '确定',
 | 
	
		
			
				|  |  | +            cancelButtonText: '取消',
 | 
	
		
			
				|  |  | +            type: 'warning'
 | 
	
		
			
				|  |  | +          }).then(() => {
 | 
	
		
			
				|  |  | +            revokeWarehouse(row).then(res => {
 | 
	
		
			
				|  |  | +              this.$message.success("撤销成功");
 | 
	
		
			
				|  |  | +              this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | -      if (type == 3) {
 | 
	
		
			
				|  |  | -        const start = new Date(row.businesDate);
 | 
	
		
			
				|  |  | -        const end = new Date(dateFormat(new Date(), 'yyyy-MM-dd'))
 | 
	
		
			
				|  |  | -        const daysDiff = (end - start) / (1000 * 60 * 60 * 24);
 | 
	
		
			
				|  |  | -        this.$confirm('订单超过90天需要赎回,当前单据为' + daysDiff + '天,确实要赎回吗?', '提示', {
 | 
	
		
			
				|  |  | -          confirmButtonText: '确定',
 | 
	
		
			
				|  |  | -          cancelButtonText: '取消',
 | 
	
		
			
				|  |  | -          type: 'warning'
 | 
	
		
			
				|  |  | -        }).then(() => {
 | 
	
		
			
				|  |  | -          confirmRedeem(row).then(res => {
 | 
	
		
			
				|  |  | -            this.$message.success("确认成功");
 | 
	
		
			
				|  |  | -            this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (type == 3) {
 | 
	
		
			
				|  |  | +          const start = new Date(row.businesDate);
 | 
	
		
			
				|  |  | +          const end = new Date(dateFormat(new Date(), 'yyyy-MM-dd'))
 | 
	
		
			
				|  |  | +          const daysDiff = (end - start) / (1000 * 60 * 60 * 24);
 | 
	
		
			
				|  |  | +          this.$confirm('订单超过90天需要赎回,当前单据为' + daysDiff + '天,确实要赎回吗?', '提示', {
 | 
	
		
			
				|  |  | +            confirmButtonText: '确定',
 | 
	
		
			
				|  |  | +            cancelButtonText: '取消',
 | 
	
		
			
				|  |  | +            type: 'warning'
 | 
	
		
			
				|  |  | +          }).then(() => {
 | 
	
		
			
				|  |  | +            confirmRedeem(row).then(res => {
 | 
	
		
			
				|  |  | +              this.$message.success("确认成功");
 | 
	
		
			
				|  |  | +              this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (type == 4) {
 | 
	
		
			
				|  |  | +          this.$confirm('是否撤销赎回?', '提示', {
 | 
	
		
			
				|  |  | +            confirmButtonText: '确定',
 | 
	
		
			
				|  |  | +            cancelButtonText: '取消',
 | 
	
		
			
				|  |  | +            type: 'warning'
 | 
	
		
			
				|  |  | +          }).then(() => {
 | 
	
		
			
				|  |  | +            revokeRedeem(row).then(res => {
 | 
	
		
			
				|  |  | +              this.$message.success("撤销成功");
 | 
	
		
			
				|  |  | +              this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +          })
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        this.$message.error("该功能未开通,请联系管理员");
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      if (type == 4) {
 | 
	
		
			
				|  |  | -        this.$confirm('是否撤销赎回?', '提示', {
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    rowDel(form, index) {
 | 
	
		
			
				|  |  | +      if (this.whetherFinancing == 1) {
 | 
	
		
			
				|  |  | +        this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
 | 
	
		
			
				|  |  |            confirmButtonText: '确定',
 | 
	
		
			
				|  |  |            cancelButtonText: '取消',
 | 
	
		
			
				|  |  |            type: 'warning'
 | 
	
		
			
				|  |  |          }).then(() => {
 | 
	
		
			
				|  |  | -          revokeRedeem(row).then(res => {
 | 
	
		
			
				|  |  | -            this.$message.success("撤销成功");
 | 
	
		
			
				|  |  | -            this.onLoad(this.page, this.search)
 | 
	
		
			
				|  |  | +          remove({ id: form.id }).then(res => {
 | 
	
		
			
				|  |  | +            this.$message({
 | 
	
		
			
				|  |  | +              type: 'success',
 | 
	
		
			
				|  |  | +              message: '删除成功!'
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +            this.dataList.splice(index, 1);
 | 
	
		
			
				|  |  | +            this.onLoad(this.page)
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  | +        }).catch(() => {
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        this.$message.error("该功能未开通,请联系管理员");
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -    rowDel(form, index) {
 | 
	
		
			
				|  |  | -      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
 | 
	
		
			
				|  |  | -        confirmButtonText: '确定',
 | 
	
		
			
				|  |  | -        cancelButtonText: '取消',
 | 
	
		
			
				|  |  | -        type: 'warning'
 | 
	
		
			
				|  |  | -      }).then(() => {
 | 
	
		
			
				|  |  | -        remove({ id: form.id }).then(res => {
 | 
	
		
			
				|  |  | -          this.$message({
 | 
	
		
			
				|  |  | -            type: 'success',
 | 
	
		
			
				|  |  | -            message: '删除成功!'
 | 
	
		
			
				|  |  | -          });
 | 
	
		
			
				|  |  | -          this.dataList.splice(index, 1);
 | 
	
		
			
				|  |  | -          this.onLoad(this.page)
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  | -      }).catch(() => {
 | 
	
		
			
				|  |  | -      });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      // 点击搜索触发
 | 
	
		
			
				|  |  |      searchChange(params, done) {
 |