|  | @@ -133,6 +133,15 @@
 | 
	
		
			
				|  |  |                >
 | 
	
		
			
				|  |  |                <span> {{ row.cname }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | +            <template slot="partsList" slot-scope="{ row, index }">
 | 
	
		
			
				|  |  | +              <el-button
 | 
	
		
			
				|  |  | +                size="small"
 | 
	
		
			
				|  |  | +                type="text"
 | 
	
		
			
				|  |  | +                @click="partrePick(row, index)"
 | 
	
		
			
				|  |  | +                :disabled="disabled"
 | 
	
		
			
				|  |  | +                >操作</el-button
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  |              <template slot="itemType" slot-scope="{ row }">
 | 
	
		
			
				|  |  |                <el-select
 | 
	
		
			
				|  |  |                  v-if="row.$cellEdit"
 | 
	
	
		
			
				|  | @@ -378,6 +387,14 @@
 | 
	
		
			
				|  |  |        reportName="客户询价"
 | 
	
		
			
				|  |  |        @onClose="onClose()"
 | 
	
		
			
				|  |  |      ></report-dialog>
 | 
	
		
			
				|  |  | +    <part-dialog
 | 
	
		
			
				|  |  | +      ref="part"
 | 
	
		
			
				|  |  | +      @partOpen="partOpen()"
 | 
	
		
			
				|  |  | +      :partList="partList"
 | 
	
		
			
				|  |  | +      @importPart="importPart"
 | 
	
		
			
				|  |  | +      @partClosed="partClosed"
 | 
	
		
			
				|  |  | +      @partReData="partReData"
 | 
	
		
			
				|  |  | +    />
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -399,6 +416,7 @@ import {
 | 
	
		
			
				|  |  |  } from "@/api/basicData/salesContract";
 | 
	
		
			
				|  |  |  import _ from "lodash";
 | 
	
		
			
				|  |  |  import reportDialog from "@/components/report-dialog/main";
 | 
	
		
			
				|  |  | +import partDialog from "@/components/part-dialog/main";
 | 
	
		
			
				|  |  |  import { micrometerFormat } from "@/util/validate";
 | 
	
		
			
				|  |  |  import { contrastObj, contrastList } from "@/util/contrastData";
 | 
	
		
			
				|  |  |  import customerDialog from "@/components/customer-dialog/main";
 | 
	
	
		
			
				|  | @@ -746,8 +764,11 @@ export default {
 | 
	
		
			
				|  |  |        oldorderFeesList: [],
 | 
	
		
			
				|  |  |        oldorderFilesList: [],
 | 
	
		
			
				|  |  |        subLoading: false,
 | 
	
		
			
				|  |  | -       pageLoading: false,
 | 
	
		
			
				|  |  | -      showBut: true
 | 
	
		
			
				|  |  | +      pageLoading: false,
 | 
	
		
			
				|  |  | +      showBut: true,
 | 
	
		
			
				|  |  | +      partreData: null,
 | 
	
		
			
				|  |  | +      partType: false,
 | 
	
		
			
				|  |  | +      partList: []
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    props: {
 | 
	
	
		
			
				|  | @@ -759,7 +780,8 @@ export default {
 | 
	
		
			
				|  |  |      reportDialog,
 | 
	
		
			
				|  |  |      feeInfo,
 | 
	
		
			
				|  |  |      uploadFile,
 | 
	
		
			
				|  |  | -    customerDialog
 | 
	
		
			
				|  |  | +    customerDialog,
 | 
	
		
			
				|  |  | +    partDialog
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    async created() {
 | 
	
		
			
				|  |  |      this.tableOption = await this.getColumnData(
 | 
	
	
		
			
				|  | @@ -812,6 +834,27 @@ export default {
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | +    partReData(row) {
 | 
	
		
			
				|  |  | +      this.partreData = row;
 | 
	
		
			
				|  |  | +      this.partOpen();
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    partOpen() {
 | 
	
		
			
				|  |  | +      this.partType = true;
 | 
	
		
			
				|  |  | +      this.newDetails();
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    partrePick(row, index) {
 | 
	
		
			
				|  |  | +      this.partList = row.partsList;
 | 
	
		
			
				|  |  | +      this.$refs.part.init(row.partsList, index);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    importPart(rows, sum, index) {
 | 
	
		
			
				|  |  | +      this.data[index].partsList = rows;
 | 
	
		
			
				|  |  | +      this.data[index].partsPrice = sum;
 | 
	
		
			
				|  |  | +      this.priceChange(this.data[index]);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    partClosed() {
 | 
	
		
			
				|  |  | +      this.partList = [];
 | 
	
		
			
				|  |  | +      this.partreData = null;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      saveSell() {
 | 
	
		
			
				|  |  |        if (!this.form.id) {
 | 
	
		
			
				|  |  |          return this.$message.error("此单据没有提交记录,请先提交");
 | 
	
	
		
			
				|  | @@ -855,18 +898,21 @@ export default {
 | 
	
		
			
				|  |  |      priceChange(row) {
 | 
	
		
			
				|  |  |        const sum = _.multiply(
 | 
	
		
			
				|  |  |          _.add(
 | 
	
		
			
				|  |  | -          Number(
 | 
	
		
			
				|  |  | -            _.multiply(
 | 
	
		
			
				|  |  | -              row.price ? row.price : 0,
 | 
	
		
			
				|  |  | -              row.orderQuantity ? row.orderQuantity : 0
 | 
	
		
			
				|  |  | +          _.add(
 | 
	
		
			
				|  |  | +            Number(
 | 
	
		
			
				|  |  | +              _.multiply(
 | 
	
		
			
				|  |  | +                row.price ? row.price : 0,
 | 
	
		
			
				|  |  | +                row.orderQuantity ? row.orderQuantity : 0
 | 
	
		
			
				|  |  | +              )
 | 
	
		
			
				|  |  | +            ),
 | 
	
		
			
				|  |  | +            Number(
 | 
	
		
			
				|  |  | +              _.add(
 | 
	
		
			
				|  |  | +                Number(row.insurance ? row.insurance : 0),
 | 
	
		
			
				|  |  | +                Number(row.freight ? row.freight : 0)
 | 
	
		
			
				|  |  | +              )
 | 
	
		
			
				|  |  |              )
 | 
	
		
			
				|  |  |            ),
 | 
	
		
			
				|  |  | -          Number(
 | 
	
		
			
				|  |  | -            _.add(
 | 
	
		
			
				|  |  | -              Number(row.insurance ? row.insurance : 0),
 | 
	
		
			
				|  |  | -              Number(row.freight ? row.freight : 0)
 | 
	
		
			
				|  |  | -            )
 | 
	
		
			
				|  |  | -          )
 | 
	
		
			
				|  |  | +          Number(row.partsPrice ? row.partsPrice : 0)
 | 
	
		
			
				|  |  |          ),
 | 
	
		
			
				|  |  |          _.divide(row.discount ? row.discount : 10, 10)
 | 
	
		
			
				|  |  |        );
 | 
	
	
		
			
				|  | @@ -949,8 +995,41 @@ export default {
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      importGoods() {
 | 
	
		
			
				|  |  | -      if (this.reData) {
 | 
	
		
			
				|  |  | -        console.log(this.reData);
 | 
	
		
			
				|  |  | +      if (this.partType) {
 | 
	
		
			
				|  |  | +        if (this.partreData) {
 | 
	
		
			
				|  |  | +          if (this.selectionList.length != 1) {
 | 
	
		
			
				|  |  | +            return this.$message.error("重新选择的时候只能选择一条数据");
 | 
	
		
			
				|  |  | +          } else {
 | 
	
		
			
				|  |  | +            this.selectionList.forEach(e => {
 | 
	
		
			
				|  |  | +              this.partList.forEach((item, index) => {
 | 
	
		
			
				|  |  | +                if (index == this.partreData.index) {
 | 
	
		
			
				|  |  | +                  item.goodId = e.id;
 | 
	
		
			
				|  |  | +                  item.goodTypeId = e.goodsTypeId;
 | 
	
		
			
				|  |  | +                  item.goodTypeName = e.goodsTypeName;
 | 
	
		
			
				|  |  | +                  item.goodName = e.cname;
 | 
	
		
			
				|  |  | +                  item.price = this.partreData.goodNumber;
 | 
	
		
			
				|  |  | +                  item.goodNumber = this.partreData.goodNumber;
 | 
	
		
			
				|  |  | +                  item.amout = this.partreData.amout;
 | 
	
		
			
				|  |  | +                  item.$cellEdit = true;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +              });
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          this.selectionList.forEach(e => {
 | 
	
		
			
				|  |  | +            this.partList.push({
 | 
	
		
			
				|  |  | +              goodId: e.id,
 | 
	
		
			
				|  |  | +              goodTypeId: e.goodsTypeId,
 | 
	
		
			
				|  |  | +              goodTypeName: e.goodsTypeName,
 | 
	
		
			
				|  |  | +              goodName: e.cname,
 | 
	
		
			
				|  |  | +              price: e.price,
 | 
	
		
			
				|  |  | +              goodNumber: 0,
 | 
	
		
			
				|  |  | +              amout: 0,
 | 
	
		
			
				|  |  | +              $cellEdit: true
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      } else if (this.reData) {
 | 
	
		
			
				|  |  |          if (this.selectionList.length != 1) {
 | 
	
		
			
				|  |  |            return this.$message.error("重新选择的时候只能选择一条数据");
 | 
	
		
			
				|  |  |          } else {
 | 
	
	
		
			
				|  | @@ -1011,6 +1090,9 @@ export default {
 | 
	
		
			
				|  |  |        this.selectionList = [];
 | 
	
		
			
				|  |  |        this.treeDeptId = "";
 | 
	
		
			
				|  |  |        this.reData = null;
 | 
	
		
			
				|  |  | +      if (this.partType) {
 | 
	
		
			
				|  |  | +        this.partType = false;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      goodsSelectionChange(list) {
 | 
	
		
			
				|  |  |        this.orderItemIds = [];
 |