|  | @@ -40,6 +40,9 @@
 | 
	
		
			
				|  |  |                <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
 | 
	
		
			
				|  |  |                  <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
 | 
	
		
			
				|  |  |                                  size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="detailData.seeDisabled"/>
 | 
	
		
			
				|  |  | +                <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
 | 
	
		
			
				|  |  | +                                size="small" type="date" placeholder="选择日期"
 | 
	
		
			
				|  |  | +                                :disabled="detailData.seeDisabled"/>
 | 
	
		
			
				|  |  |                  <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]"
 | 
	
		
			
				|  |  |                                   :configuration="configuration" style="width: 100%" :disabled="detailData.seeDisabled"/>
 | 
	
		
			
				|  |  |                  <el-select v-else-if="item.prop === 'paymentType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled">
 | 
	
	
		
			
				|  | @@ -57,8 +60,17 @@
 | 
	
		
			
				|  |  |              <el-col v-for="(item,index) in contactInformation.column" :key="index" :span="item.span?item.span:8">
 | 
	
		
			
				|  |  |                <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
 | 
	
		
			
				|  |  |                  <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="item.disabled || detailData.seeDisabled"/>
 | 
	
		
			
				|  |  | +                <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
 | 
	
		
			
				|  |  | +                                size="small" type="date" placeholder="选择日期"
 | 
	
		
			
				|  |  | +                                :disabled="detailData.seeDisabled"/>
 | 
	
		
			
				|  |  |                  <selectComponent v-else-if="item.prop === 'belongToCorpId'" v-model="form[item.prop]" :configuration="configuration" style="width: 100%" :disabled="detailData.seeDisabled"/>
 | 
	
		
			
				|  |  | -                <el-input v-else-if="(item.prop === 'advancePayment') || (item.prop === 'settlmentAmount')" v-model="form[item.prop]" size="small" autocomplete="off" @change="computedCost" :disabled="detailData.seeDisabled"></el-input>
 | 
	
		
			
				|  |  | +                <el-input
 | 
	
		
			
				|  |  | +                  v-else-if="(item.prop === 'advancePayment') || (item.prop === 'settlmentAmount') || (item.prop === 'overPayment')"
 | 
	
		
			
				|  |  | +                  v-model="form[item.prop]" size="small" autocomplete="off"
 | 
	
		
			
				|  |  | +                  @change="computedCost"
 | 
	
		
			
				|  |  | +                  :disabled="detailData.seeDisabled"
 | 
	
		
			
				|  |  | +                  v-input-limit="2"
 | 
	
		
			
				|  |  | +                ></el-input>
 | 
	
		
			
				|  |  |                  <el-select v-else-if="item.prop === 'orderStatus'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled">
 | 
	
		
			
				|  |  |                    <el-option v-for="(item,index) in statusOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
 | 
	
		
			
				|  |  |                  </el-select>
 | 
	
	
		
			
				|  | @@ -277,6 +289,7 @@
 | 
	
		
			
				|  |  |                         ref="crud"
 | 
	
		
			
				|  |  |                         @refresh-change="refreshChange"
 | 
	
		
			
				|  |  |                         @selection-change="selectionChange"
 | 
	
		
			
				|  |  | +                       @search-change="goodsSearch"
 | 
	
		
			
				|  |  |                         :page.sync="page"
 | 
	
		
			
				|  |  |                         @on-load="onLoad"></avue-crud>
 | 
	
		
			
				|  |  |            </basic-container>
 | 
	
	
		
			
				|  | @@ -624,9 +637,21 @@ export default {
 | 
	
		
			
				|  |  |                  trigger: 'blur'
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |              ]
 | 
	
		
			
				|  |  | -          }, {
 | 
	
		
			
				|  |  | -            label: '应收预付款',
 | 
	
		
			
				|  |  | -            prop: 'advancePayment',
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          // {
 | 
	
		
			
				|  |  | +          //   label: '应收预付款',
 | 
	
		
			
				|  |  | +          //   prop: 'advancePayment',
 | 
	
		
			
				|  |  | +          //   rules: [
 | 
	
		
			
				|  |  | +          //     {
 | 
	
		
			
				|  |  | +          //       required: false,
 | 
	
		
			
				|  |  | +          //       message: ' ',
 | 
	
		
			
				|  |  | +          //       trigger: 'blur'
 | 
	
		
			
				|  |  | +          //     }
 | 
	
		
			
				|  |  | +          //   ]
 | 
	
		
			
				|  |  | +          // },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: '保证金',
 | 
	
		
			
				|  |  | +            prop: 'deposit',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -635,8 +660,8 @@ export default {
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |              ]
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  | -            label: '保证金',
 | 
	
		
			
				|  |  | -            prop: 'deposit',
 | 
	
		
			
				|  |  | +            label: '逾期账款',
 | 
	
		
			
				|  |  | +            prop: 'overDueAccounts',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -645,8 +670,9 @@ export default {
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |              ]
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  | -            label: '逾期账款',
 | 
	
		
			
				|  |  | -            prop: 'overDueAccounts',
 | 
	
		
			
				|  |  | +            label: '实际发货日期',
 | 
	
		
			
				|  |  | +            prop: 'actualDeliveryDate',
 | 
	
		
			
				|  |  | +            type: 'datetime',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -668,7 +694,7 @@ export default {
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '合同日期',
 | 
	
		
			
				|  |  |              prop: 'businesDate',
 | 
	
		
			
				|  |  | -            type: 'datetime',
 | 
	
		
			
				|  |  | +            type: 'date',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -677,17 +703,6 @@ export default {
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |              ]
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  | -            label: '实际发货日期',
 | 
	
		
			
				|  |  | -            prop: 'actualDeliveryDate',
 | 
	
		
			
				|  |  | -            type: 'datetime',
 | 
	
		
			
				|  |  | -            rules: [
 | 
	
		
			
				|  |  | -              {
 | 
	
		
			
				|  |  | -                required: false,
 | 
	
		
			
				|  |  | -                message: ' ',
 | 
	
		
			
				|  |  | -                trigger: 'blur'
 | 
	
		
			
				|  |  | -              }
 | 
	
		
			
				|  |  | -            ]
 | 
	
		
			
				|  |  | -          },  {
 | 
	
		
			
				|  |  |              label: '毛利率',
 | 
	
		
			
				|  |  |              prop: 'grossProfitRate',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
	
		
			
				|  | @@ -895,7 +910,7 @@ export default {
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '要求发货日期',
 | 
	
		
			
				|  |  |              prop: 'requiredDeliveryDate',
 | 
	
		
			
				|  |  | -            type: 'datetime',
 | 
	
		
			
				|  |  | +            type: 'date',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: true,
 | 
	
	
		
			
				|  | @@ -906,7 +921,7 @@ export default {
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '要求到货日期',
 | 
	
		
			
				|  |  |              prop: 'requiredArrivalDate',
 | 
	
		
			
				|  |  | -            type: 'datetime',
 | 
	
		
			
				|  |  | +            type: 'date',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: true,
 | 
	
	
		
			
				|  | @@ -959,6 +974,7 @@ export default {
 | 
	
		
			
				|  |  |        this.statusOption = res.data.data
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  |      this.$set(this.form, 'orderStatus', '录入')
 | 
	
		
			
				|  |  | +    this.$set(this.form, 'overPayment', 0)
 | 
	
		
			
				|  |  |      if (this.detailData.id) {
 | 
	
		
			
				|  |  |        this.queryData(this.detailData.id)
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -977,7 +993,6 @@ export default {
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  |      queryData(id, isCopy = false){
 | 
	
		
			
				|  |  |        detail(id).then(res => {
 | 
	
		
			
				|  |  | -        console.log(res.data.data)
 | 
	
		
			
				|  |  |          this.form = res.data.data;
 | 
	
		
			
				|  |  |          this.contactsData = this.form.orderItemsList
 | 
	
		
			
				|  |  |          this.advantageProjectData = this.form.orderFeesList
 | 
	
	
		
			
				|  | @@ -1369,6 +1384,7 @@ export default {
 | 
	
		
			
				|  |  |          this.$set(list[item], 'priceType', this.policyForm.cname)
 | 
	
		
			
				|  |  |          this.$set(list[item], 'cname', list[item].productCategory)
 | 
	
		
			
				|  |  |          this.$set(list[item], 'sort', this.maxGoodsNum + 1)
 | 
	
		
			
				|  |  | +        this.$set(list[item], 'purchaseAmount', list[item].purchasePrice)
 | 
	
		
			
				|  |  |          this.maxGoodsNum++
 | 
	
		
			
				|  |  |          this.$refs.crudContact.rowCellAdd(list[item]);
 | 
	
		
			
				|  |  |          this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
 | 
	
	
		
			
				|  | @@ -1436,8 +1452,14 @@ export default {
 | 
	
		
			
				|  |  |          this.contactsDataBuyFree = res.data.data.presentItemList
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    //
 | 
	
		
			
				|  |  | +    goodsSearch(params, done) {
 | 
	
		
			
				|  |  | +      this.onLoad(this.page, params);
 | 
	
		
			
				|  |  | +      done()
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      //商品列表查询
 | 
	
		
			
				|  |  |      onLoad(page, params = {}) {
 | 
	
		
			
				|  |  | +      console.log(params)
 | 
	
		
			
				|  |  |        this.loading = true;
 | 
	
		
			
				|  |  |        getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
 | 
	
		
			
				|  |  |          console.log(res)
 | 
	
	
		
			
				|  | @@ -1543,10 +1565,17 @@ export default {
 | 
	
		
			
				|  |  |            // 计算毛利额
 | 
	
		
			
				|  |  |            this.$set(this.form, 'grossProfit', 0)
 | 
	
		
			
				|  |  |            this.$set(this.form, 'orderAmount', 0)
 | 
	
		
			
				|  |  | +          // 成本价
 | 
	
		
			
				|  |  | +          let purchaseAmount = 0
 | 
	
		
			
				|  |  | +          // 计算销售金额
 | 
	
		
			
				|  |  |            this.contactsData.forEach(item => {
 | 
	
		
			
				|  |  | -            this.form.grossProfit += Number(item.amount)
 | 
	
		
			
				|  |  | -            this.form.orderAmount += Number(item.amount)
 | 
	
		
			
				|  |  | +            if (item.purchaseAmount) {
 | 
	
		
			
				|  |  | +              purchaseAmount += (Number(item.purchaseAmount) * Number(item.orderQuantity)).toFixed(2)
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            // this.form.grossProfit += Number(item.amount)
 | 
	
		
			
				|  |  | +            this.form.orderAmount += Number(item.amount).toFixed(2)
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  | +          this.form.grossProfit = (Number(this.form.orderAmount) - Number(purchaseAmount)).toFixed(2)
 | 
	
		
			
				|  |  |            if (this.form.orderAmount && this.form.overPayment) {
 | 
	
		
			
				|  |  |              this.form.debitAmount = Number(this.form.orderAmount) - Number(this.form.overPayment)
 | 
	
		
			
				|  |  |            }
 | 
	
	
		
			
				|  | @@ -1591,13 +1620,18 @@ export default {
 | 
	
		
			
				|  |  |        let orderAmount = 0;
 | 
	
		
			
				|  |  |        // 已收款
 | 
	
		
			
				|  |  |        let settlmentAmount = 0;
 | 
	
		
			
				|  |  | +      // 溢付款
 | 
	
		
			
				|  |  | +      let overPayment = 0
 | 
	
		
			
				|  |  |        if (this.form.orderAmount) {
 | 
	
		
			
				|  |  |          orderAmount = this.form.orderAmount
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        if (this.form.settlmentAmount) {
 | 
	
		
			
				|  |  |          settlmentAmount = this.form.settlmentAmount
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      this.$set(this.form, "balanceAmount", (Number(orderAmount) - Number(settlmentAmount)).toFixed(2));
 | 
	
		
			
				|  |  | +      if (this.form.overPayment) {
 | 
	
		
			
				|  |  | +        overPayment = this.form.overPayment
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      this.$set(this.form, "balanceAmount", (Number(orderAmount) - Number(overPayment) - Number(settlmentAmount)).toFixed(2));
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      quantityChange(row) {
 | 
	
		
			
				|  |  |        if (!row.orderQuantity) {
 | 
	
	
		
			
				|  | @@ -1756,4 +1790,11 @@ export default {
 | 
	
		
			
				|  |  |    padding: 10.5px 0 10.5px 30px;
 | 
	
		
			
				|  |  |    //border: 1px solid #000;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | +::v-deep .el-form-item {
 | 
	
		
			
				|  |  | +  margin-bottom: 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +::v-deep .el-form-item__content{
 | 
	
		
			
				|  |  | +  line-height: 32px;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  |  </style>
 |