|  | @@ -567,6 +567,34 @@
 | 
	
		
			
				|  |  |                         ref="crud"
 | 
	
		
			
				|  |  |                         @selection-change="selectionChangePolicy"
 | 
	
		
			
				|  |  |                         :page.sync="pagePolicy">
 | 
	
		
			
				|  |  | +              <template slot="menuLeft">
 | 
	
		
			
				|  |  | +                <el-button
 | 
	
		
			
				|  |  | +                  type="info"
 | 
	
		
			
				|  |  | +                  size="mini"
 | 
	
		
			
				|  |  | +                  icon="el-icon-download"
 | 
	
		
			
				|  |  | +                  @click="downLoadPolicy"
 | 
	
		
			
				|  |  | +                >下载模板</el-button>
 | 
	
		
			
				|  |  | +                <el-upload
 | 
	
		
			
				|  |  | +                  :action="policyUrl+'?policyName=' + uploadPolicy.policyName + '&salesType=1'"
 | 
	
		
			
				|  |  | +                  :headers="headers"
 | 
	
		
			
				|  |  | +                  :disabled="detailData.seeDisabled || browse"
 | 
	
		
			
				|  |  | +                  :on-progress="uploading"
 | 
	
		
			
				|  |  | +                  :show-file-list=false
 | 
	
		
			
				|  |  | +                  accept=".xls,.xlsx"
 | 
	
		
			
				|  |  | +                  multiple
 | 
	
		
			
				|  |  | +                  :on-success="successPolicy"
 | 
	
		
			
				|  |  | +                  :on-error="uploadError"
 | 
	
		
			
				|  |  | +                  style="float: right"
 | 
	
		
			
				|  |  | +                >
 | 
	
		
			
				|  |  | +                  <el-button
 | 
	
		
			
				|  |  | +                    type="primary"
 | 
	
		
			
				|  |  | +                    size="mini"
 | 
	
		
			
				|  |  | +                    icon="el-icon-upload"
 | 
	
		
			
				|  |  | +                    :disabled="uploadPolicy.policyName === ''"
 | 
	
		
			
				|  |  | +                    :loading="loadingPolicy"
 | 
	
		
			
				|  |  | +                  >导 入</el-button>
 | 
	
		
			
				|  |  | +                </el-upload>
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  |                <template slot="orderQuantity" slot-scope="{row}">
 | 
	
		
			
				|  |  |                  <el-input-number
 | 
	
		
			
				|  |  |                    v-model="row.orderQuantity"
 | 
	
	
		
			
				|  | @@ -935,7 +963,6 @@ export default {
 | 
	
		
			
				|  |  |            const newTime = new Date().toLocaleString('chinese',{hour12:false})
 | 
	
		
			
				|  |  |            policyColumn({newTime: newTime,parentId: parentId,corps: this.form.corpId}).then(res => {
 | 
	
		
			
				|  |  |              resolve(res.data.data.map(item => {
 | 
	
		
			
				|  |  | -              console.log(item)
 | 
	
		
			
				|  |  |                return {
 | 
	
		
			
				|  |  |                  ...item,
 | 
	
		
			
				|  |  |                  leaf: !item.hasChildren
 | 
	
	
		
			
				|  | @@ -1279,6 +1306,28 @@ export default {
 | 
	
		
			
				|  |  |                  trigger: 'blur'
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |              ]
 | 
	
		
			
				|  |  | +          },{
 | 
	
		
			
				|  |  | +            label: '重量合计',
 | 
	
		
			
				|  |  | +            prop: 'cartonWeight',
 | 
	
		
			
				|  |  | +            disabled: true,
 | 
	
		
			
				|  |  | +            rules: [
 | 
	
		
			
				|  |  | +              {
 | 
	
		
			
				|  |  | +                required: false,
 | 
	
		
			
				|  |  | +                message: ' ',
 | 
	
		
			
				|  |  | +                trigger: 'blur'
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +            ]
 | 
	
		
			
				|  |  | +          },{
 | 
	
		
			
				|  |  | +            label: '体积合计',
 | 
	
		
			
				|  |  | +            prop: 'cntrVolumn',
 | 
	
		
			
				|  |  | +            disabled: true,
 | 
	
		
			
				|  |  | +            rules: [
 | 
	
		
			
				|  |  | +              {
 | 
	
		
			
				|  |  | +                required: false,
 | 
	
		
			
				|  |  | +                message: ' ',
 | 
	
		
			
				|  |  | +                trigger: 'blur'
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +            ]
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '制单人',
 | 
	
		
			
				|  |  |              prop: 'createUserName',
 | 
	
	
		
			
				|  | @@ -1561,7 +1610,13 @@ export default {
 | 
	
		
			
				|  |  |        switchDialog: false,
 | 
	
		
			
				|  |  |        // 商品信息表格loading
 | 
	
		
			
				|  |  |        goodsLoading: false,
 | 
	
		
			
				|  |  | -      baseURL: '/api/blade-purchase-sales/orderitems/importPrice',
 | 
	
		
			
				|  |  | +      // 上传时带的参数
 | 
	
		
			
				|  |  | +      uploadPolicy: {
 | 
	
		
			
				|  |  | +        policyName: '',
 | 
	
		
			
				|  |  | +        salesType: 1
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      baseURL: '/api/blade-purchase-sales/orderitems/importPrice', // 商品明细上传路径
 | 
	
		
			
				|  |  | +      policyUrl: '/api/blade-purchase-sales/orderitems/importPolicy', // 导入政策上传路径
 | 
	
		
			
				|  |  |        headers: { "Blade-Auth": 'Bearer ' + getToken()},
 | 
	
		
			
				|  |  |        activeName: 'searchList',
 | 
	
		
			
				|  |  |        // 商品列表数据合计
 | 
	
	
		
			
				|  | @@ -1633,7 +1688,6 @@ export default {
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      // 获取角色
 | 
	
		
			
				|  |  |      this.roleName = localStorage.getItem('roleName')
 | 
	
		
			
				|  |  | -    console.log(this.roleName)
 | 
	
		
			
				|  |  |      if (!this.roleName.includes('admin') && !this.roleName.includes('assistant')) {
 | 
	
		
			
				|  |  |        this.contactInformation.column.forEach(item => {
 | 
	
		
			
				|  |  |          if (item.prop == 'grossProfitRate' || item.prop == 'grossProfit') item.display = false
 | 
	
	
		
			
				|  | @@ -1702,6 +1756,7 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      queryData(id, isCopy = false){
 | 
	
		
			
				|  |  |        this.pageLoading = true
 | 
	
		
			
				|  |  | +      this.saveLoading = true
 | 
	
		
			
				|  |  |        detail(id).then(async res => {
 | 
	
		
			
				|  |  |          this.form = res.data.data;
 | 
	
		
			
				|  |  |          this.browse = this.form.status > 0? true: false;
 | 
	
	
		
			
				|  | @@ -1991,6 +2046,7 @@ export default {
 | 
	
		
			
				|  |  |      uploading(event, file, fileList) {
 | 
	
		
			
				|  |  |        this.openFullScreen(false, '文件正在解析中');
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    // 商品明细上传成功钩子
 | 
	
		
			
				|  |  |      importTemplate(res, file) {
 | 
	
		
			
				|  |  |        this.openFullScreen(true)
 | 
	
		
			
				|  |  |        let goodsData = []
 | 
	
	
		
			
				|  | @@ -2028,6 +2084,16 @@ export default {
 | 
	
		
			
				|  |  |        this.goodsShowData = this.goodsShowData.concat(res.data)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    // 政策导入成功钩子
 | 
	
		
			
				|  |  | +    successPolicy(res, file) {
 | 
	
		
			
				|  |  | +      this.openFullScreen(true)
 | 
	
		
			
				|  |  | +      if (res.data.message === "" && !res.data.message) {
 | 
	
		
			
				|  |  | +        this.dataPolicy = res.data.list? res.data.list: [];
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        this.dataPolicy = res.data.list? res.data.list: [];
 | 
	
		
			
				|  |  | +        this.$message.error('导入失败,商品编码有:' + res.data.message);
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      uploadError(err, file, fileList) {
 | 
	
		
			
				|  |  |        this.openFullScreen(true)
 | 
	
		
			
				|  |  |        this.$message.error(JSON.parse(err.message).msg)
 | 
	
	
		
			
				|  | @@ -2537,6 +2603,7 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      closePolicy() {
 | 
	
		
			
				|  |  |        this.treePolicyId = '';
 | 
	
		
			
				|  |  | +      this.uploadPolicy.policyName = ''
 | 
	
		
			
				|  |  |        this.dataPolicy = [];
 | 
	
		
			
				|  |  |        this.contactsDataBuyFree = [];
 | 
	
		
			
				|  |  |        this.policyData = []
 | 
	
	
		
			
				|  | @@ -2558,6 +2625,7 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //导入页销售政策查询
 | 
	
		
			
				|  |  |      policyNodeClick(data) {
 | 
	
		
			
				|  |  | +      this.uploadPolicy.policyName = data.id;
 | 
	
		
			
				|  |  |        this.treePolicyId = data.id
 | 
	
		
			
				|  |  |        // detailList(data.id).then(res => {
 | 
	
		
			
				|  |  |        //   //特价促销
 | 
	
	
		
			
				|  | @@ -3274,18 +3342,24 @@ export default {
 | 
	
		
			
				|  |  |              item.property == "amount" ||
 | 
	
		
			
				|  |  |              item.property == "orderQuantity" ||
 | 
	
		
			
				|  |  |              item.property == "actualQuantity" ||
 | 
	
		
			
				|  |  | -            item.property == "integral"
 | 
	
		
			
				|  |  | +            item.property == "integral" ||
 | 
	
		
			
				|  |  | +            item.property == "cartonWeight" ||
 | 
	
		
			
				|  |  | +            item.property == "cntrVolumn"
 | 
	
		
			
				|  |  |            ) {
 | 
	
		
			
				|  |  |              let amountSum = 0;
 | 
	
		
			
				|  |  |              let orderQuantitySum = 0;
 | 
	
		
			
				|  |  |              let actualQuantitySum = 0;
 | 
	
		
			
				|  |  |              let integralSum = 0;
 | 
	
		
			
				|  |  | +            let cartonWeight = 0;
 | 
	
		
			
				|  |  | +            let cntrVolumn = 0;
 | 
	
		
			
				|  |  |              if (this.selection.length > 0) {
 | 
	
		
			
				|  |  |                this.selection.forEach(e => {
 | 
	
		
			
				|  |  |                  amountSum = _.add(amountSum, Number(e.amount));
 | 
	
		
			
				|  |  |                  orderQuantitySum = _.add(orderQuantitySum, Number(e.orderQuantity));
 | 
	
		
			
				|  |  |                  actualQuantitySum = _.add(actualQuantitySum, Number(e.actualQuantity));
 | 
	
		
			
				|  |  |                  integralSum = _.add(integralSum, Number(e.integral));
 | 
	
		
			
				|  |  | +                cartonWeight = _.add(cartonWeight, Number(e.cartonWeight));
 | 
	
		
			
				|  |  | +                cntrVolumn = _.add(cntrVolumn, Number(e.cntrVolumn));
 | 
	
		
			
				|  |  |                })
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              // 订货数量合计
 | 
	
	
		
			
				|  | @@ -3304,6 +3378,14 @@ export default {
 | 
	
		
			
				|  |  |              if (item.property == "integral") {
 | 
	
		
			
				|  |  |                sums[index] = integralSum ? integralSum.toFixed(2) : "0.00";
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            // 重量合计
 | 
	
		
			
				|  |  | +            if (item.property == "cartonWeight") {
 | 
	
		
			
				|  |  | +              sums[index] = cartonWeight ? cartonWeight.toFixed(2) : "0.00";
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            // 体积合计
 | 
	
		
			
				|  |  | +            if (item.property == "cntrVolumn") {
 | 
	
		
			
				|  |  | +              sums[index] = cntrVolumn ? cntrVolumn.toFixed(2) : "0.00";
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |        }
 | 
	
	
		
			
				|  | @@ -3422,12 +3504,14 @@ export default {
 | 
	
		
			
				|  |  |              checkFlag: 2,
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            this.pageLoading = true
 | 
	
		
			
				|  |  | +          this.saveLoading = true
 | 
	
		
			
				|  |  |            pleaseCheck(data).then(res => {
 | 
	
		
			
				|  |  |              this.$message.success('请核成功')
 | 
	
		
			
				|  |  |              this.saveActives = ''
 | 
	
		
			
				|  |  |              this.queryData(this.form.id)
 | 
	
		
			
				|  |  |            }).finally(() => {
 | 
	
		
			
				|  |  |              this.pageLoading = false
 | 
	
		
			
				|  |  | +            this.saveLoading = false
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |        }
 | 
	
	
		
			
				|  | @@ -3445,12 +3529,14 @@ export default {
 | 
	
		
			
				|  |  |              checkFlag: 2,
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            this.pageLoading = true
 | 
	
		
			
				|  |  | +         this.saveLoading = true
 | 
	
		
			
				|  |  |            repealCancel(data).then(res => {
 | 
	
		
			
				|  |  |              this.$message.success('撤回成功')
 | 
	
		
			
				|  |  |              this.saveActives = ''
 | 
	
		
			
				|  |  |              this.queryData(this.form.id)
 | 
	
		
			
				|  |  |            }).finally(() => {
 | 
	
		
			
				|  |  |              this.pageLoading = false
 | 
	
		
			
				|  |  | +            this.saveLoading = false
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -3466,12 +3552,14 @@ export default {
 | 
	
		
			
				|  |  |            checkFlag: 3
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          this.pageLoading = true
 | 
	
		
			
				|  |  | +        this.saveLoading = true
 | 
	
		
			
				|  |  |          pleaseCheck(data).then(res => {
 | 
	
		
			
				|  |  |            this.$message.success('请核成功')
 | 
	
		
			
				|  |  |            this.saveActives = ''
 | 
	
		
			
				|  |  |            this.queryData(this.form.id)
 | 
	
		
			
				|  |  |          }).finally(() => {
 | 
	
		
			
				|  |  |            this.pageLoading = false
 | 
	
		
			
				|  |  | +          this.saveLoading = false
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -3601,6 +3689,20 @@ export default {
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |        this.$message.success('刷新成功')
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    // 导入政策下载模板
 | 
	
		
			
				|  |  | +    downLoadPolicy() {
 | 
	
		
			
				|  |  | +      this.$confirm('是否下载模板文件?', '提示', {
 | 
	
		
			
				|  |  | +        confirmButtonText: '确定',
 | 
	
		
			
				|  |  | +        cancelButtonText: '取消',
 | 
	
		
			
				|  |  | +        type: 'warning'
 | 
	
		
			
				|  |  | +      }).then(() => {
 | 
	
		
			
				|  |  | +        window.open(
 | 
	
		
			
				|  |  | +          `/api/blade-purchase-sales/orderitems/policy?${
 | 
	
		
			
				|  |  | +            this.website.tokenHeader
 | 
	
		
			
				|  |  | +          }=${getToken()}`
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    computed: {
 | 
	
		
			
				|  |  |      ...mapGetters(["userInfo", "permission"])
 |