|  | @@ -6,6 +6,11 @@
 | 
	
		
			
				|  |  |                     @click="backToList">返回列表
 | 
	
		
			
				|  |  |          </el-button>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  | +      <el-button type="primary"
 | 
	
		
			
				|  |  | +                 class="el-button--small-yh add-customer-btn-three"
 | 
	
		
			
				|  |  | +                 :disabled="true"
 | 
	
		
			
				|  |  | +                 @click.stop="">请核
 | 
	
		
			
				|  |  | +      </el-button>
 | 
	
		
			
				|  |  |        <el-button type="success"
 | 
	
		
			
				|  |  |                   class="el-button--small-yh add-customer-btn-two"
 | 
	
		
			
				|  |  |                   :disabled="true"
 | 
	
	
		
			
				|  | @@ -47,8 +52,8 @@
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |            </el-row>
 | 
	
		
			
				|  |  |          </basic-container>
 | 
	
		
			
				|  |  | -<!--        商品明细-->
 | 
	
		
			
				|  |  | -        <containerTitle title="商品明细"></containerTitle>
 | 
	
		
			
				|  |  | +<!--        销售明细-->
 | 
	
		
			
				|  |  | +        <containerTitle title="销售明细"></containerTitle>
 | 
	
		
			
				|  |  |          <basic-container style="margin-bottom: 10px">
 | 
	
		
			
				|  |  |            <avue-crud
 | 
	
		
			
				|  |  |              :option="importInventory"
 | 
	
	
		
			
				|  | @@ -60,30 +65,8 @@
 | 
	
		
			
				|  |  |              @row-del="rowDelList"
 | 
	
		
			
				|  |  |              @selection-change="productSelection"
 | 
	
		
			
				|  |  |            >
 | 
	
		
			
				|  |  | -            <template slot="price" slot-scope="{ row }">
 | 
	
		
			
				|  |  | -              <el-input
 | 
	
		
			
				|  |  | -                v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | -                v-model="row.price"
 | 
	
		
			
				|  |  | -                placeholder="请输入"
 | 
	
		
			
				|  |  | -                size="small"
 | 
	
		
			
				|  |  | -                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
 | 
	
		
			
				|  |  | -                @input="priceChange(row)"
 | 
	
		
			
				|  |  | -              ></el-input>
 | 
	
		
			
				|  |  | -              <span v-else>{{ row.price }}</span>
 | 
	
		
			
				|  |  | -            </template>
 | 
	
		
			
				|  |  | -            <template slot="orderQuantity" slot-scope="{ row }">
 | 
	
		
			
				|  |  | -              <el-input
 | 
	
		
			
				|  |  | -                v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | -                v-model="row.orderQuantity"
 | 
	
		
			
				|  |  | -                placeholder="请输入"
 | 
	
		
			
				|  |  | -                size="small"
 | 
	
		
			
				|  |  | -                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
 | 
	
		
			
				|  |  | -                @input="quantityChange(row)"
 | 
	
		
			
				|  |  | -              ></el-input>
 | 
	
		
			
				|  |  | -              <span v-else>{{ row.orderQuantity }}</span>
 | 
	
		
			
				|  |  | -            </template>
 | 
	
		
			
				|  |  |              <template slot-scope="{row}" slot="billNo">
 | 
	
		
			
				|  |  | -              <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
 | 
	
		
			
				|  |  | +              <span v-if="row.$cellEdit" class="required_fields">*</span>
 | 
	
		
			
				|  |  |                <el-input
 | 
	
		
			
				|  |  |                  v-if="row.$cellEdit"
 | 
	
		
			
				|  |  |                  v-model="row.billNo"
 | 
	
	
		
			
				|  | @@ -95,10 +78,10 @@
 | 
	
		
			
				|  |  |                <span v-else>{{ row.billNo }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  |              <template slot-scope="{row}" slot="orgOrderNo">
 | 
	
		
			
				|  |  | -              <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
 | 
	
		
			
				|  |  | +              <span v-if="row.$cellEdit" class="required_fields">*</span>
 | 
	
		
			
				|  |  |                <el-select
 | 
	
		
			
				|  |  |                  v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | -                style="width:90%"
 | 
	
		
			
				|  |  | +                style="width:90% !important;"
 | 
	
		
			
				|  |  |                  v-model="row.orgOrderNo"
 | 
	
		
			
				|  |  |                  placeholder=" "
 | 
	
		
			
				|  |  |                  size="small"
 | 
	
	
		
			
				|  | @@ -114,6 +97,43 @@
 | 
	
		
			
				|  |  |                </el-select>
 | 
	
		
			
				|  |  |                <span v-else>{{ row.orgOrderNo }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | +            <template slot="price" slot-scope="{ row }">
 | 
	
		
			
				|  |  | +              <el-input
 | 
	
		
			
				|  |  | +                v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | +                v-model="row.price"
 | 
	
		
			
				|  |  | +                placeholder="请输入"
 | 
	
		
			
				|  |  | +                size="small"
 | 
	
		
			
				|  |  | +                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
 | 
	
		
			
				|  |  | +                @input="priceChange(row)"
 | 
	
		
			
				|  |  | +              ></el-input>
 | 
	
		
			
				|  |  | +              <span v-else>{{ row.price }}</span>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +            <template slot="orderQuantity" slot-scope="{ row }">
 | 
	
		
			
				|  |  | +              <span v-if="row.$cellEdit" class="required_fields">*</span>
 | 
	
		
			
				|  |  | +              <el-input
 | 
	
		
			
				|  |  | +                v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | +                v-model="row.orderQuantity"
 | 
	
		
			
				|  |  | +                style="width: 90%"
 | 
	
		
			
				|  |  | +                placeholder="请输入"
 | 
	
		
			
				|  |  | +                size="small"
 | 
	
		
			
				|  |  | +                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
 | 
	
		
			
				|  |  | +                @input="quantityChange(row)"
 | 
	
		
			
				|  |  | +              ></el-input>
 | 
	
		
			
				|  |  | +              <span v-else>{{ row.orderQuantity }}</span>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +            <template slot="priceCategory" slot-scope="{row,index}">
 | 
	
		
			
				|  |  | +              <span v-if="row.$cellEdit" class="required_fields">*</span>
 | 
	
		
			
				|  |  | +              <el-input
 | 
	
		
			
				|  |  | +                v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | +                v-model="row.priceCategoryNames"
 | 
	
		
			
				|  |  | +                size="small"
 | 
	
		
			
				|  |  | +                placeholder="请点击右侧按钮选择"
 | 
	
		
			
				|  |  | +                :disabled="true"
 | 
	
		
			
				|  |  | +                style="width: 63%"
 | 
	
		
			
				|  |  | +              ></el-input>
 | 
	
		
			
				|  |  | +              <el-button v-if="row.$cellEdit" size="small" icon="el-icon-search" @click="choice(row)"></el-button>
 | 
	
		
			
				|  |  | +              <span v-else>{{ row.priceCategoryNames }}</span>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  |              <template slot="invoiceWeight" slot-scope="{ row }">
 | 
	
		
			
				|  |  |                <el-input
 | 
	
		
			
				|  |  |                  v-if="row.$cellEdit"
 | 
	
	
		
			
				|  | @@ -136,10 +156,6 @@
 | 
	
		
			
				|  |  |                ></el-input>
 | 
	
		
			
				|  |  |                <span v-else>{{ row.billWeight }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | -            <template slot="priceCategory" slot-scope="{row,index}">
 | 
	
		
			
				|  |  | -              <span style="margin-left: 12px;padding-top: 2px">{{ row.priceCategoryNames }}</span>
 | 
	
		
			
				|  |  | -              <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
 | 
	
		
			
				|  |  | -            </template>
 | 
	
		
			
				|  |  |              <template slot="menuLeft" slot-scope="{size}">
 | 
	
		
			
				|  |  |                <el-button type="primary"
 | 
	
		
			
				|  |  |                           icon="el-icon-plus"
 | 
	
	
		
			
				|  | @@ -187,7 +203,7 @@
 | 
	
		
			
				|  |  |        append-to-body
 | 
	
		
			
				|  |  |        class="el-dialogDeep"
 | 
	
		
			
				|  |  |        :visible.sync="dialogVisible"
 | 
	
		
			
				|  |  | -      width="80%"
 | 
	
		
			
				|  |  | +      width="60%"
 | 
	
		
			
				|  |  |        :close-on-click-modal="false"
 | 
	
		
			
				|  |  |        :destroy-on-close="true"
 | 
	
		
			
				|  |  |        :close-on-press-escape="false">
 | 
	
	
		
			
				|  | @@ -355,24 +371,12 @@ export default {
 | 
	
		
			
				|  |  |                  trigger: 'blur'
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |              ]
 | 
	
		
			
				|  |  | -          }, {
 | 
	
		
			
				|  |  | -            label: '销售公司',
 | 
	
		
			
				|  |  | -            prop: 'belongToCorpId',
 | 
	
		
			
				|  |  | -            dicData: [],
 | 
	
		
			
				|  |  | -            rules: [
 | 
	
		
			
				|  |  | -              {
 | 
	
		
			
				|  |  | -                required: false,
 | 
	
		
			
				|  |  | -                message: ' ',
 | 
	
		
			
				|  |  | -                trigger: 'blur'
 | 
	
		
			
				|  |  | -              }
 | 
	
		
			
				|  |  | -            ]
 | 
	
		
			
				|  |  | -          }, {
 | 
	
		
			
				|  |  | -            label: '工厂/贸易商名称',
 | 
	
		
			
				|  |  | +          },  {
 | 
	
		
			
				|  |  | +            label: '客户名称',
 | 
	
		
			
				|  |  |              prop: 'corpId',
 | 
	
		
			
				|  |  | -            dicData: [],
 | 
	
		
			
				|  |  |              rules: [
 | 
	
		
			
				|  |  |                {
 | 
	
		
			
				|  |  | -                required: false,
 | 
	
		
			
				|  |  | +                required: true,
 | 
	
		
			
				|  |  |                  message: ' ',
 | 
	
		
			
				|  |  |                  trigger: 'blur'
 | 
	
		
			
				|  |  |                }
 | 
	
	
		
			
				|  | @@ -678,11 +682,6 @@ export default {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -    // else{
 | 
	
		
			
				|  |  | -    //   getSysNo("JK-XS").then(res =>{
 | 
	
		
			
				|  |  | -    //     this.$set(this.form,"sysNo", res.data.data)
 | 
	
		
			
				|  |  | -    //   })
 | 
	
		
			
				|  |  | -    // }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    components: {
 | 
	
		
			
				|  |  |      feeInfo,
 | 
	
	
		
			
				|  | @@ -703,8 +702,8 @@ export default {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return parseFloat(item.billWeight);
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  | -      this.form.invoiceWeight = invoiceList.reduce((n,m) => n + m)
 | 
	
		
			
				|  |  | -      this.form.billWeight = billList.reduce((n,m) => n + m)
 | 
	
		
			
				|  |  | +      this.$set(this.form,"invoiceWeight", invoiceList.reduce((n,m) => n + m))
 | 
	
		
			
				|  |  | +      this.$set(this.form,"billWeight", billList.reduce((n,m) => n + m))
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //汇率
 | 
	
		
			
				|  |  |      currencyChange(value){
 | 
	
	
		
			
				|  | @@ -714,7 +713,7 @@ export default {
 | 
	
		
			
				|  |  |            // this.form.rmbAmount = this.form.orderAmount
 | 
	
		
			
				|  |  |          }else{
 | 
	
		
			
				|  |  |            this.form.exchangeRate = 6.3843
 | 
	
		
			
				|  |  | -          // this.form.rmbAmount = this.form.orderAmount * 6.3843
 | 
	
		
			
				|  |  | +          // this.form.rmbAmount =  _.multiply(this.form.orderAmount, 6.3843)
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -724,7 +723,7 @@ export default {
 | 
	
		
			
				|  |  |          row.price = "";
 | 
	
		
			
				|  |  |          row.amount = 0
 | 
	
		
			
				|  |  |        } else {
 | 
	
		
			
				|  |  | -        row.amount = (row.orderQuantity * row.price).toFixed(2);
 | 
	
		
			
				|  |  | +        row.amount = _.multiply(row.orderQuantity, row.price).toFixed(2);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //件数
 | 
	
	
		
			
				|  | @@ -733,7 +732,7 @@ export default {
 | 
	
		
			
				|  |  |          row.orderQuantity = "";
 | 
	
		
			
				|  |  |          row.amount = 0
 | 
	
		
			
				|  |  |        } else {
 | 
	
		
			
				|  |  | -        row.amount = (row.orderQuantity * row.price).toFixed(2);
 | 
	
		
			
				|  |  | +        row.amount =_.multiply(row.orderQuantity,row.price).toFixed(2);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      editCustomer(status) {
 | 
	
	
		
			
				|  | @@ -753,10 +752,19 @@ export default {
 | 
	
		
			
				|  |  |          let orderUpLoadList = this.$refs.uploadFile.submitData();
 | 
	
		
			
				|  |  |          for (let j = 0; j < this.importInventoryData.length; j++) {
 | 
	
		
			
				|  |  |            if (this.importInventoryData[j].billNo === "") {
 | 
	
		
			
				|  |  | -            return this.$message.error(`请输入商品明细第${j + 1}行的提单号`);
 | 
	
		
			
				|  |  | +            return this.$message.error(`请输入销售明细第${j + 1}行的提单号`);
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            if (this.importInventoryData[j].orgOrderNo === "") {
 | 
	
		
			
				|  |  | -            return this.$message.error(`请输入商品明细第${j + 1}行的合同号`);
 | 
	
		
			
				|  |  | +            return this.$message.error(`请输入销售明细第${j + 1}行的合同号`);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          if (this.importInventoryData[j].priceCategory === "") {
 | 
	
		
			
				|  |  | +            return this.$message.error(`请输入销售明细第${j + 1}行的货品物种`);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          if (this.importInventoryData[j].orderQuantity === "") {
 | 
	
		
			
				|  |  | +            return this.$message.error(`请输入销售明细第${j + 1}行的件数`);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          if (this.importInventoryData[j].orderQuantity === 0) {
 | 
	
		
			
				|  |  | +            return this.$message.error(`销售明细第${j + 1}行的件数不能为0`);
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (valid) {
 | 
	
	
		
			
				|  | @@ -820,20 +828,32 @@ export default {
 | 
	
		
			
				|  |  |            id:this.form.id,
 | 
	
		
			
				|  |  |            orderItemIds:this.selection.map(i=>{return i.id})
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if(this.$store.getters.goStatus){
 | 
	
		
			
				|  |  | -          this.$alert("发货单已存在,请保存发货单再进行操作", "温馨提示", {
 | 
	
		
			
				|  |  | -            confirmButtonText: "确定",
 | 
	
		
			
				|  |  | -            type: 'warning',
 | 
	
		
			
				|  |  | -            callback: action => {
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -          });
 | 
	
		
			
				|  |  | +        if(contrastObj(this.form,this.oldForm) || contrastList(this.contactsData,this.oldContactsData)
 | 
	
		
			
				|  |  | +          || contrastList(this.orderFeesList,this.oldFeesList) || contrastList(this.orderFilesList,this.oldFilesList)
 | 
	
		
			
				|  |  | +        ){
 | 
	
		
			
				|  |  | +          this.$confirm("您已改动数据,是否先保存在进行操作!", {
 | 
	
		
			
				|  |  | +            confirmButtonText: "保存",
 | 
	
		
			
				|  |  | +            cancelButtonText: "取消",
 | 
	
		
			
				|  |  | +            type: "warning"
 | 
	
		
			
				|  |  | +          }).then(() => {
 | 
	
		
			
				|  |  | +            this.editCustomer();
 | 
	
		
			
				|  |  | +          })
 | 
	
		
			
				|  |  |          }else{
 | 
	
		
			
				|  |  | -          generateShipment(params).then(res=>{
 | 
	
		
			
				|  |  | -            this.$router.push({
 | 
	
		
			
				|  |  | -              path: "/importTrade/invoice/index",
 | 
	
		
			
				|  |  | -              query: {form: JSON.stringify(res.data.data)},
 | 
	
		
			
				|  |  | +          if(this.$store.getters.goStatus){
 | 
	
		
			
				|  |  | +            this.$alert("发货单已存在,请保存发货单再进行操作", "温馨提示", {
 | 
	
		
			
				|  |  | +              confirmButtonText: "确定",
 | 
	
		
			
				|  |  | +              type: 'warning',
 | 
	
		
			
				|  |  | +              callback: action => {
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  |              });
 | 
	
		
			
				|  |  | -          })
 | 
	
		
			
				|  |  | +          }else{
 | 
	
		
			
				|  |  | +            generateShipment(params).then(res=>{
 | 
	
		
			
				|  |  | +              this.$router.push({
 | 
	
		
			
				|  |  | +                path: "/importTrade/invoice/index",
 | 
	
		
			
				|  |  | +                query: {form: JSON.stringify(res.data.data)},
 | 
	
		
			
				|  |  | +              });
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        }else{
 | 
	
		
			
				|  |  |          this.$confirm("列表内存在新录入数据,是否先保存此数据?", {
 | 
	
	
		
			
				|  | @@ -901,6 +921,12 @@ export default {
 | 
	
		
			
				|  |  |          const data = res.data.data;
 | 
	
		
			
				|  |  |          this.page.total = data.total;
 | 
	
		
			
				|  |  |          this.data = data.records;
 | 
	
		
			
				|  |  | +        if (this.page.total) {
 | 
	
		
			
				|  |  | +          this.option.height = window.innerHeight - 350;
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          this.option.height = window.innerHeight - 305;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }).finally(()=>{
 | 
	
		
			
				|  |  |          this.loading = false;
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -1053,6 +1079,16 @@ export default {
 | 
	
		
			
				|  |  |    color: #323233;
 | 
	
		
			
				|  |  |    font-weight: 400;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | +.required_fields{
 | 
	
		
			
				|  |  | +  color: #F56C6C;
 | 
	
		
			
				|  |  | +  display:inline-block;
 | 
	
		
			
				|  |  | +  width: 7%
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +.add-customer-btn-three {
 | 
	
		
			
				|  |  | +  position: fixed;
 | 
	
		
			
				|  |  | +  right: 266px;
 | 
	
		
			
				|  |  | +  top: 115px;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  .add-customer-btn {
 | 
	
		
			
				|  |  |    position: fixed;
 |