|  | @@ -18,7 +18,7 @@
 | 
	
		
			
				|  |  |          <el-button
 | 
	
		
			
				|  |  |            class="el-button--small-yh"
 | 
	
		
			
				|  |  |            type="success" style="right: 140px;" @click="copyOrder"
 | 
	
		
			
				|  |  | -          :disabled="detailData.seeDisabled">
 | 
	
		
			
				|  |  | +          :disabled="detailData.seeDisabled || !this.form.id">
 | 
	
		
			
				|  |  |            复制新单
 | 
	
		
			
				|  |  |          </el-button>
 | 
	
		
			
				|  |  |          <el-button
 | 
	
	
		
			
				|  | @@ -49,6 +49,14 @@
 | 
	
		
			
				|  |  |                  <el-select v-else-if="item.prop === 'paymentType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled">
 | 
	
		
			
				|  |  |                    <el-option v-for="(item,index) in paymentOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
 | 
	
		
			
				|  |  |                  </el-select>
 | 
	
		
			
				|  |  | +                <el-input
 | 
	
		
			
				|  |  | +                  v-else-if="item.type == 'number'"
 | 
	
		
			
				|  |  | +                  placeholder="请输入"
 | 
	
		
			
				|  |  | +                  v-input-limit="2"
 | 
	
		
			
				|  |  | +                  size="small"
 | 
	
		
			
				|  |  | +                  :disabled="item.disabled || detailData.seeDisabled"
 | 
	
		
			
				|  |  | +                  v-model="form[item.prop]"
 | 
	
		
			
				|  |  | +                />
 | 
	
		
			
				|  |  |                  <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled"></el-input>
 | 
	
		
			
				|  |  |                  <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled"></el-input>
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
	
		
			
				|  | @@ -76,9 +84,17 @@
 | 
	
		
			
				|  |  |                  <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>
 | 
	
		
			
				|  |  | -                <el-input type="age" v-else-if="item.prop === 'grossProfitRate'" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled">
 | 
	
		
			
				|  |  | +                <el-input type="age" v-else-if="item.prop === 'grossProfitRate'" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled" v-input-limit="2">
 | 
	
		
			
				|  |  |                    <template   slot="append">%</template>
 | 
	
		
			
				|  |  |                  </el-input>
 | 
	
		
			
				|  |  | +                <el-input
 | 
	
		
			
				|  |  | +                  v-else-if="item.type == 'number'"
 | 
	
		
			
				|  |  | +                  placeholder="请输入"
 | 
	
		
			
				|  |  | +                  v-input-limit="2"
 | 
	
		
			
				|  |  | +                  size="small"
 | 
	
		
			
				|  |  | +                  :disabled="item.disabled || detailData.seeDisabled"
 | 
	
		
			
				|  |  | +                  v-model="form[item.prop]"
 | 
	
		
			
				|  |  | +                />
 | 
	
		
			
				|  |  |                  <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled"></el-input>
 | 
	
		
			
				|  |  |                  <el-input v-else type="age" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled"></el-input>
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
	
		
			
				|  | @@ -105,7 +121,7 @@
 | 
	
		
			
				|  |  |                  size="mini"
 | 
	
		
			
				|  |  |                  style="padding:4px 10px;float:left"
 | 
	
		
			
				|  |  |                  @click="commodityChoice(row)"
 | 
	
		
			
				|  |  | -                :disabled="detailData.seeDisabled">选择</el-button>
 | 
	
		
			
				|  |  | +                :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
 | 
	
		
			
				|  |  |                <span>{{ row.code }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  |              <template slot="purchaseAmount" slot-scope="{ row }">
 | 
	
	
		
			
				|  | @@ -115,6 +131,7 @@
 | 
	
		
			
				|  |  |                  @focus="getPurchasePrice(row)"
 | 
	
		
			
				|  |  |                  allow-create
 | 
	
		
			
				|  |  |                  filterable
 | 
	
		
			
				|  |  | +                v-input-limit="2"
 | 
	
		
			
				|  |  |                >
 | 
	
		
			
				|  |  |                  <el-option
 | 
	
		
			
				|  |  |                    v-for="(item, index) in purchasePriceOption"
 | 
	
	
		
			
				|  | @@ -124,6 +141,24 @@
 | 
	
		
			
				|  |  |                </el-select>
 | 
	
		
			
				|  |  |                <span v-else>{{ row.purchaseAmount }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | +            <template slot="price" slot-scope="{ row }">
 | 
	
		
			
				|  |  | +              <el-select
 | 
	
		
			
				|  |  | +                v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | +                v-model="row.price"
 | 
	
		
			
				|  |  | +                @focus="getMarketPrice(row)"
 | 
	
		
			
				|  |  | +                @input="priceChange(row)"
 | 
	
		
			
				|  |  | +                allow-create
 | 
	
		
			
				|  |  | +                filterable
 | 
	
		
			
				|  |  | +                v-input-limit="2"
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +                <el-option
 | 
	
		
			
				|  |  | +                  v-for="(item, index) in salesPriceOtion"
 | 
	
		
			
				|  |  | +                  :key="index"
 | 
	
		
			
				|  |  | +                  :label="item.salesPrice"
 | 
	
		
			
				|  |  | +                  :value="item.salesPrice"></el-option>
 | 
	
		
			
				|  |  | +              </el-select>
 | 
	
		
			
				|  |  | +              <span v-else>{{ row.price }}</span>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  |              <template slot="orderQuantity" slot-scope="{ row }">
 | 
	
		
			
				|  |  |                <el-input
 | 
	
		
			
				|  |  |                  v-if="row.$cellEdit"
 | 
	
	
		
			
				|  | @@ -134,15 +169,12 @@
 | 
	
		
			
				|  |  |                ></el-input>
 | 
	
		
			
				|  |  |                <span v-else>{{ row.orderQuantity }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | -            <template slot="price" slot-scope="{ row }">
 | 
	
		
			
				|  |  | -              <el-input
 | 
	
		
			
				|  |  | -                v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | -                v-model="row.price"
 | 
	
		
			
				|  |  | -                size="small"
 | 
	
		
			
				|  |  | -                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
 | 
	
		
			
				|  |  | -                @input="priceChange(row)"
 | 
	
		
			
				|  |  | -              ></el-input>
 | 
	
		
			
				|  |  | -              <span v-else>{{ row.price }}</span>
 | 
	
		
			
				|  |  | +            <template slot="cname" slot-scope="{ row }">
 | 
	
		
			
				|  |  | +              <goods-select v-if="row.$cellEdit" v-model="row.cname" @getRow="getGoodsRow($event, row)"
 | 
	
		
			
				|  |  | +                               :configuration="goodsConfiguration" @receiveList="receiveGoodList" @returnRow="getRow($event, row)"/>
 | 
	
		
			
				|  |  | +              <span v-else>
 | 
	
		
			
				|  |  | +                <span v-for="item in goodsConfiguration.dicData" v-if="item.cname == row.cname">{{ item.cname }}</span>
 | 
	
		
			
				|  |  | +              </span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  |              <template slot-scope="{row,index}" slot="menu">
 | 
	
		
			
				|  |  |                <el-button
 | 
	
	
		
			
				|  | @@ -207,6 +239,18 @@
 | 
	
		
			
				|  |  |                  <span v-for="item in configuration.dicData" v-if="item.id == row.corpId">{{ item.cname }}</span>
 | 
	
		
			
				|  |  |                </span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | +            <template slot="amount" slot-scope="{ row }">
 | 
	
		
			
				|  |  | +              <el-input v-if="row.$cellEdit" v-model="row.amount"
 | 
	
		
			
				|  |  | +                        size="small" v-input-limit="2"
 | 
	
		
			
				|  |  | +              ></el-input>
 | 
	
		
			
				|  |  | +              <span v-else>{{ row.amount }}</span>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +            <template slot="settlmentAmount" slot-scope="{ row }">
 | 
	
		
			
				|  |  | +              <el-input v-if="row.$cellEdit" v-model="row.settlmentAmount"
 | 
	
		
			
				|  |  | +                        size="small" v-input-limit="2"
 | 
	
		
			
				|  |  | +              ></el-input>
 | 
	
		
			
				|  |  | +              <span v-else>{{ row.settlmentAmount }}</span>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  |              <template slot-scope="{row,index}" slot="menu">
 | 
	
		
			
				|  |  |                <el-button
 | 
	
		
			
				|  |  |                    type="text"
 | 
	
	
		
			
				|  | @@ -468,6 +512,13 @@ export default {
 | 
	
		
			
				|  |  |          placeholder: '请点击右边按钮选择',
 | 
	
		
			
				|  |  |          dicData: []
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | +      goodsConfiguration: {
 | 
	
		
			
				|  |  | +        multipleChoices: false,
 | 
	
		
			
				|  |  | +        multiple: false,
 | 
	
		
			
				|  |  | +        collapseTags: false,
 | 
	
		
			
				|  |  | +        placeholder: '请点击右边按钮选择',
 | 
	
		
			
				|  |  | +        dicData: []
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  |        data: [],
 | 
	
		
			
				|  |  |        policyForm: {},
 | 
	
		
			
				|  |  |        dataPolicy: [],
 | 
	
	
		
			
				|  | @@ -600,6 +651,7 @@ export default {
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  |              label: '销售金额',
 | 
	
		
			
				|  |  |              prop: 'orderAmount',
 | 
	
		
			
				|  |  | +            type: 'number',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -610,6 +662,7 @@ export default {
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '其他费用',
 | 
	
		
			
				|  |  |              prop: 'otherAmount',
 | 
	
		
			
				|  |  | +            type: 'number',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -630,6 +683,7 @@ export default {
 | 
	
		
			
				|  |  |            },{
 | 
	
		
			
				|  |  |              label: '应收账款',
 | 
	
		
			
				|  |  |              prop: 'debitAmount',
 | 
	
		
			
				|  |  | +            type: 'number',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -673,6 +727,7 @@ export default {
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  |              label: '保证金',
 | 
	
		
			
				|  |  |              prop: 'deposit',
 | 
	
		
			
				|  |  | +            type: 'number',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -683,6 +738,7 @@ export default {
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '逾期账款',
 | 
	
		
			
				|  |  |              prop: 'overDueAccounts',
 | 
	
		
			
				|  |  | +            type: 'number',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -736,6 +792,7 @@ export default {
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '毛利额',
 | 
	
		
			
				|  |  |              prop: 'grossProfit',
 | 
	
		
			
				|  |  | +            type: 'number',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -746,6 +803,7 @@ export default {
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '历史运费(元/条)',
 | 
	
		
			
				|  |  |              prop: 'freightAmountHistory',
 | 
	
		
			
				|  |  | +            type: 'number',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: false,
 | 
	
	
		
			
				|  | @@ -911,6 +969,7 @@ export default {
 | 
	
		
			
				|  |  |            }, {
 | 
	
		
			
				|  |  |              label: '运费',
 | 
	
		
			
				|  |  |              prop: 'oceanFreight',
 | 
	
		
			
				|  |  | +            type: 'number',
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  |                  required: true,
 | 
	
	
		
			
				|  | @@ -984,6 +1043,8 @@ export default {
 | 
	
		
			
				|  |  |        oldUploadList: [],
 | 
	
		
			
				|  |  |        // 采购价格
 | 
	
		
			
				|  |  |        purchasePriceOption: [],
 | 
	
		
			
				|  |  | +      // 销售价格
 | 
	
		
			
				|  |  | +      salesPriceOtion: [],
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    //初始化查询
 | 
	
	
		
			
				|  | @@ -1014,6 +1075,13 @@ export default {
 | 
	
		
			
				|  |  |    watch: {
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | +    getGoodsRow(event,row) {
 | 
	
		
			
				|  |  | +      row.priceCategory = event.goodsTypeName
 | 
	
		
			
				|  |  | +      this.$set(row, 'priceType', '一般')
 | 
	
		
			
				|  |  | +      row.code = event.code
 | 
	
		
			
				|  |  | +      row.typeno = event.typeno
 | 
	
		
			
				|  |  | +      row.itemId = event.id
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      queryData(id, isCopy = false){
 | 
	
		
			
				|  |  |        detail(id).then(res => {
 | 
	
		
			
				|  |  |          this.form = res.data.data;
 | 
	
	
		
			
				|  | @@ -1035,6 +1103,15 @@ export default {
 | 
	
		
			
				|  |  |          this.configuration.dicData = this.configuration.dicData.concat(feesData)
 | 
	
		
			
				|  |  |          // 去重
 | 
	
		
			
				|  |  |          this.removeRepeat()
 | 
	
		
			
				|  |  | +        let goodsData = []
 | 
	
		
			
				|  |  | +        this.form.orderItemsList.forEach(item => {
 | 
	
		
			
				|  |  | +          let a = {
 | 
	
		
			
				|  |  | +            cname: item.cname,
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          goodsData.push(a)
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +        this.goodsConfiguration.dicData = [].concat(goodsData)
 | 
	
		
			
				|  |  | +        this.removeGoodsRepeat()
 | 
	
		
			
				|  |  |          delete this.form.orderItemsList
 | 
	
		
			
				|  |  |          delete this.form.orderFeesList
 | 
	
		
			
				|  |  |          delete this.form.orderFilesList
 | 
	
	
		
			
				|  | @@ -1074,13 +1151,16 @@ export default {
 | 
	
		
			
				|  |  |          this.oldGoodsList = []
 | 
	
		
			
				|  |  |          this.oldFeesList = []
 | 
	
		
			
				|  |  |          this.oldUploadList = []
 | 
	
		
			
				|  |  | -        this.oldGoodsList = this.oldGoodsList.concat(this.contactsData)
 | 
	
		
			
				|  |  | -        console.log(this.oldGoodsList)
 | 
	
		
			
				|  |  | -        this.oldFeesList = this.oldFeesList.concat(this.advantageProjectData)
 | 
	
		
			
				|  |  | -        this.oldUploadList = this.oldUploadList.concat(this.bankOfDepositData)
 | 
	
		
			
				|  |  | +        this.oldGoodsList = this.deepClone(this.contactsData)
 | 
	
		
			
				|  |  | +        this.oldFeesList = this.deepClone(this.advantageProjectData)
 | 
	
		
			
				|  |  | +        this.oldUploadList = this.deepClone(this.bankOfDepositData)
 | 
	
		
			
				|  |  |          if (isCopy) {
 | 
	
		
			
				|  |  |            this.$set(this.form, 'orderStatus', '录入')
 | 
	
		
			
				|  |  |            delete this.form.id
 | 
	
		
			
				|  |  | +          delete this.form.orgOrderNo
 | 
	
		
			
				|  |  | +          delete this.form.morderNo
 | 
	
		
			
				|  |  | +          delete this.form.createUserName
 | 
	
		
			
				|  |  | +          delete this.form.createTime
 | 
	
		
			
				|  |  |            this.contactsData.forEach(item => {
 | 
	
		
			
				|  |  |              delete item.id
 | 
	
		
			
				|  |  |              delete item.pid
 | 
	
	
		
			
				|  | @@ -1104,10 +1184,16 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      // 采购金额获取
 | 
	
		
			
				|  |  |      getPurchasePrice(row) {
 | 
	
		
			
				|  |  | -      getPurchasePrice({code: '3ELX978F'}).then(res => {
 | 
	
		
			
				|  |  | +      getPurchasePrice({code: row.code}).then(res => {
 | 
	
		
			
				|  |  |          this.purchasePriceOption = res.data.data
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    // 销售金额获取
 | 
	
		
			
				|  |  | +    getMarketPrice(row) {
 | 
	
		
			
				|  |  | +      getMarketPrice({code: row.code}).then(res => {
 | 
	
		
			
				|  |  | +        this.salesPriceOtion = res.data.data
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      // 生成采购单
 | 
	
		
			
				|  |  |      saveSell() {
 | 
	
		
			
				|  |  |        if (!this.form.id) {
 | 
	
	
		
			
				|  | @@ -1222,11 +1308,31 @@ export default {
 | 
	
		
			
				|  |  |          return current
 | 
	
		
			
				|  |  |        }, [])
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    removeGoodsRepeat() {
 | 
	
		
			
				|  |  | +      let obj = []
 | 
	
		
			
				|  |  | +      this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.reduce((current,next) => {
 | 
	
		
			
				|  |  | +        obj[next.id] ? '': obj[next.id] = true && current.push(next)
 | 
	
		
			
				|  |  | +        return current
 | 
	
		
			
				|  |  | +      }, [])
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      //
 | 
	
		
			
				|  |  |      receiveList(data){
 | 
	
		
			
				|  |  |        this.configuration.dicData = this.configuration.dicData.concat(data)
 | 
	
		
			
				|  |  |        this.removeRepeat()
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    receiveGoodList(data) {
 | 
	
		
			
				|  |  | +      console.log(data)
 | 
	
		
			
				|  |  | +      this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.concat(data)
 | 
	
		
			
				|  |  | +      this.removeGoodsRepeat()
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    getRow(event,row) {
 | 
	
		
			
				|  |  | +      console.log(event,row)
 | 
	
		
			
				|  |  | +      row.priceCategory = event[0].goodsTypeName
 | 
	
		
			
				|  |  | +      this.$set(row, 'priceType', '一般')
 | 
	
		
			
				|  |  | +      row.code = event[0].code
 | 
	
		
			
				|  |  | +      row.typeno = event[0].typeno
 | 
	
		
			
				|  |  | +      row.itemId = event[0].id
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      //点击商品明细选择触发
 | 
	
		
			
				|  |  |      commodityChoice(row) {
 | 
	
		
			
				|  |  |        this.dialogVisible = !this.dialogVisible
 | 
	
	
		
			
				|  | @@ -1303,7 +1409,7 @@ export default {
 | 
	
		
			
				|  |  |              this.$set(this.tableData[item], 'orderQuantity', 0)
 | 
	
		
			
				|  |  |              this.$set(this.tableData[item], 'actualQuantity', 0)
 | 
	
		
			
				|  |  |              this.$set(this.tableData[item], 'purchaseAmount', 0)
 | 
	
		
			
				|  |  | -            this.tableData[item].price = 0
 | 
	
		
			
				|  |  | +            this.tableData[item].price = '0'
 | 
	
		
			
				|  |  |              this.tableData[item].amount = 0
 | 
	
		
			
				|  |  |              this.tableData[item].sort = this.maxGoodsNum + 1
 | 
	
		
			
				|  |  |              delete this.tableData[item].id
 | 
	
	
		
			
				|  | @@ -1400,18 +1506,26 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //导入商品政策
 | 
	
		
			
				|  |  |      importPolicy() {
 | 
	
		
			
				|  |  | -      let list = this.policyData.concat(this.policyDataTwo)
 | 
	
		
			
				|  |  | +      let list = this.deepClone(this.policyData.concat(this.policyDataTwo))
 | 
	
		
			
				|  |  | +      // 买赠额外加一条
 | 
	
		
			
				|  |  | +      let buyFree = []
 | 
	
		
			
				|  |  | +      if (this.policyDataTwo.length > 0) {
 | 
	
		
			
				|  |  | +        buyFree = this.deepClone(this.policyDataTwo)
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |        for (let item in list) {
 | 
	
		
			
				|  |  |          selectGoodsNum({
 | 
	
		
			
				|  |  |            goodsId: list[item].itemId,
 | 
	
		
			
				|  |  |            typeno: list[item].typeno
 | 
	
		
			
				|  |  |          }).then(res => {
 | 
	
		
			
				|  |  |            this.$set(list[item], 'storageQuantity', res.data.data)
 | 
	
		
			
				|  |  | +          this.$set(buyFree[item], 'storageQuantity', res.data.data)
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |          if (this.policyData.length > 0) {
 | 
	
		
			
				|  |  |            this.$set(list[item], 'price', list[item].specialOffer)
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |            this.$set(list[item], 'price', list[item].salesPrice)
 | 
	
		
			
				|  |  | +          this.$set(buyFree[item], 'price', '0')
 | 
	
		
			
				|  |  | +          this.$set(buyFree[item], 'orderQuantity',  list[item].salesVolume)
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          this.$set(list[item], 'actualQuantity', 0)
 | 
	
		
			
				|  |  |          this.$set(list[item], 'orderQuantity', 0)
 | 
	
	
		
			
				|  | @@ -1421,6 +1535,14 @@ export default {
 | 
	
		
			
				|  |  |          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.$set(buyFree[item], 'actualQuantity', 0)
 | 
	
		
			
				|  |  | +        this.$set(buyFree[item], 'amount', 0)
 | 
	
		
			
				|  |  | +        this.$set(buyFree[item], 'priceCategory', list[item].productCategory)
 | 
	
		
			
				|  |  | +        this.$set(buyFree[item], 'priceType', this.policyForm.cname)
 | 
	
		
			
				|  |  | +        this.$set(buyFree[item], 'cname', list[item].productCategory)
 | 
	
		
			
				|  |  | +        this.$set(buyFree[item], 'sort', this.maxGoodsNum + 1)
 | 
	
		
			
				|  |  | +        this.$set(buyFree[item], 'purchaseAmount', list[item].purchasePrice)
 | 
	
		
			
				|  |  |          delete list[item].id
 | 
	
		
			
				|  |  |          delete list[item].pid
 | 
	
		
			
				|  |  |          delete list[item].isDeleted
 | 
	
	
		
			
				|  | @@ -1431,7 +1553,9 @@ export default {
 | 
	
		
			
				|  |  |          delete list[item].updateUserName
 | 
	
		
			
				|  |  |          this.maxGoodsNum++
 | 
	
		
			
				|  |  |          this.$refs.crudContact.rowCellAdd(list[item]);
 | 
	
		
			
				|  |  | -        this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
 | 
	
		
			
				|  |  | +        // this.$refs.crudContact.rowCell(list[item], this.contactsData.length - 1)
 | 
	
		
			
				|  |  | +        this.$refs.crudContact.rowCellAdd(buyFree[item]);
 | 
	
		
			
				|  |  | +        // this.$refs.crudContact.rowCell(buyFree[item], this.contactsData.length - 1)
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        this.policyDialog = false
 | 
	
		
			
				|  |  |      },
 |