Browse Source

报价单详情

cz 1 year ago
parent
commit
249975bb62

+ 1 - 0
src/components/product/SelectMaterial.vue

@@ -90,6 +90,7 @@ import treeList from "@/components/product/treeList";
 const { proxy } = getCurrentInstance();
 // 接收父组件的传值
 const props = defineProps({
+  // 过滤是否是原料的数据
   isNeRawMaterial: {
     type: String,
     default: "0",

+ 9 - 0
src/components/product/SelectProduct.vue

@@ -109,6 +109,11 @@ const props = defineProps({
     type: String,
     default: "",
   },
+  // 过滤是否配置过bom
+  isRawMaterial: {
+    type: String,
+    default: "",
+  },
 });
 const tableHeight = ref(0);
 const getTableHeight = () => {
@@ -724,6 +729,10 @@ getTreeList();
 if (props && props.companyId) {
   sourceList.value.pagination.companyId = props.companyId;
 }
+if (props && props.isRawMaterial) {
+  sourceList.value.pagination.isRawMaterial = props.isRawMaterial;
+}
+
 getList();
 const clickSelect = (item) => {
   item.selectType = "1";

+ 509 - 0
src/views/EHSD/saleContract/PriceSheetDetail.vue

@@ -0,0 +1,509 @@
+<template>
+  <div v-loading="loading">
+    <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
+      <template #chart>
+        <div style="width:100%;padding-left:25px">
+          <div ref="chartDom" style="height:300px"></div>
+        </div>
+      </template>
+      <template #buyer>
+        <div style="width: 100%">
+          <el-form-item label="客户信息" prop="buyCorporationId" class="wid100">
+            <el-select v-model="formData.data.buyCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
+                       :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer">
+              <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="地址" class="wid100">
+            <el-row style="width: 100%">
+              <el-col :span="6">
+                <el-form-item label="" prop="buyCountryId" class="margin-b-0 wid100">
+                  <el-select v-model="formData.data.buyCountryId" placeholder="国家" style="width:100%" filterable
+                             @change="(val) => getCityData(val, '20', true)">
+                    <el-option v-for="item in countryData" :label="item.name" :value="item.id">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="" prop="provinceName" class="margin-b-0 wid100">
+                  <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="buyProvinceId" addressName="provinceName"
+                              v-model="formData.data" :data="provinceData">
+                  </selectCity>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="" prop="cityName" class="margin-b-0 wid100">
+                  <selectCity placeholder="城市" addressId="buyCityId" addressName="cityName" v-model="formData.data" :data="cityData">
+                  </selectCity>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="" prop="buyPostalCode" class="margin-b-0">
+                  <el-input v-model="formData.data.buyPostalCode" placeholder="请输入邮编" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form-item>
+          <el-form-item label="详细地址" prop="buyAddress" class="margin-b-0 wid100">
+            <el-input v-model="formData.data.buyAddress" type="textarea">
+            </el-input>
+          </el-form-item>
+        </div>
+      </template>
+
+      <template #commodity>
+        <div style="width: 100%;padding-left:25px">
+          <el-table :data="formData.data.quotationProductList" style="width: 100%;" default-expand-all>
+            <el-table-column type="expand" width="50" align="center">
+              <template #default="scope">
+                <div style="padding-left:50px">
+                  <div style="margin-bottom:10px;">
+                    <TitleInfo content='BOM单:'></TitleInfo>
+                  </div>
+                  <el-table :data="scope.row.quotationProductBomList" style="width: 100%;" border class="bom-table">
+                    <el-table-column label="图片" width="80">
+                      <template #default="{ row }">
+                        <div v-if="row.fileUrl">
+                          <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+                        </div>
+                        <div v-else></div>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="productCode" label="物料编码" width="190" />
+                    <el-table-column prop="productName" label="物料名称" min-width="200" />
+                    <el-table-column label="尺寸 cm*cm*cm" width="150">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                        </div>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="quantity" label="数量" width="110" />
+                    <!-- <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.quantity'"
+                                        :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
+                            <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
+                                             :controls="false" :min="1" :disabled="row.type==1" @change="changeQuantity()" />
+                          </el-form-item>
+                        </div>
+                      </template> -->
+                    <el-table-column prop="allQuantity" label="总量" width="80" />
+                    <el-table-column prop="price" label="单价" width="110" />
+                    <el-table-column prop="amount" label="小计" width="110" />
+                    <el-table-column prop="remark" label="备注" width="180" />
+                    <!-- <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.remark'"
+                                        :rules="rules.remark" :inline-message="true" class="margin-b-0 wid100">
+                            <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" :min="0" />
+                          </el-form-item>
+                        </div>
+                      </template> -->
+
+                  </el-table>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="图片" width="80">
+              <template #default="{ row }">
+                <div v-if="row.fileUrl">
+                  <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+                </div>
+                <div v-else></div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="productCode" label="商品编码" width="190" />
+            <el-table-column prop="productName" label="商品名称" min-width="200" />
+            <el-table-column label="尺寸 cm*cm*cm" width="150">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="quantity" label="数量" width="110" />
+            <!-- <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'quotationProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
+                                     :controls="false" :min="1" @change="changeQuantity()" />
+
+                  </el-form-item>
+                </div>
+              </template> -->
+            <el-table-column prop="price" label="单价" width="110" />
+            <el-table-column prop="amount" label="小计" width="110" />
+          </el-table>
+        </div>
+      </template>
+    </byForm>
+  </div>
+</template>
+
+<script setup>
+import byForm from "@/components/byForm/index";
+import selectCity from "@/components/selectCity/index.vue";
+import * as echarts from "echarts";
+const { proxy } = getCurrentInstance();
+const props = defineProps({
+  rowData: Object,
+  dataType: {
+    type: String,
+    default: "1",
+  },
+});
+const typeData = ref([
+  {
+    label: "内销",
+    value: "1",
+  },
+  {
+    label: "外销",
+    value: "2",
+  },
+]);
+const treeData = ref([]);
+const countryData = ref([]);
+const provinceData = ref([]);
+const cityData = ref([]);
+const formData = reactive({
+  data: {
+    type: "1",
+    quotationProductList: [],
+  },
+});
+const loading = ref(false);
+const formDom = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  disabled: true,
+});
+let myChart = null;
+const chartDom = ref(null);
+const isShowChart = ref(false);
+const formConfig = computed(() => {
+  return [
+    // {
+    //   type: "title1",
+    //   title: "报价趋势",
+    //   isShow: isShowChart.value,
+    // },
+    // {
+    //   type: "slot",
+    //   slotName: "chart",
+    //   isShow: isShowChart.value,
+    // },
+    {
+      type: "title1",
+      title: "报价类型",
+    },
+    {
+      type: "select",
+      prop: "type",
+      label: "报价类型",
+      data: typeData.value,
+      itemWidth: 50,
+    },
+    {
+      type: "treeSelect",
+      prop: "companyId",
+      label: "报价公司",
+      data: treeData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+      fn: (val) => {
+        companyId.value = val;
+      },
+    },
+    {
+      type: "title1",
+      title: "贸易信息",
+    },
+    {
+      type: "slot",
+      slotName: "buyer",
+      label: "",
+      itemWidth: 100,
+    },
+    {
+      type: "input",
+      itemType: "text",
+      label: "联系人",
+      prop: "buyContactName",
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      itemType: "text",
+      label: "联系人电话",
+      prop: "buyContactNumber",
+      itemWidth: 50,
+    },
+    {
+      type: "title1",
+      title: "商品信息",
+    },
+    {
+      type: "slot",
+      slotName: "commodity",
+      label: "",
+    },
+    {
+      type: "title1",
+      title: "报价总金额",
+    },
+    {
+      type: "input",
+      prop: "amount",
+      label: "报价总金额",
+      itemWidth: 25,
+      disabled: true,
+    },
+  ];
+});
+
+const getCityData = (id, type, isChange = false) => {
+  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
+    if (type === "20") {
+      provinceData.value = res;
+      if (isChange) {
+        formData.data.buyProvinceId = "";
+        formData.data.provinceName = "";
+        formData.data.buyCityId = "";
+        formData.data.cityName = "";
+      }
+    } else if (type === "30") {
+      cityData.value = res;
+      if (isChange) {
+        formData.data.buyCityId = "";
+        formData.data.cityName = "";
+      }
+    } else {
+      countryData.value = res;
+    }
+  });
+};
+getCityData("0");
+
+const getDict = () => {
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+      type: 0,
+    })
+    .then((res) => {
+      treeData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+getDict();
+
+const getFileData = () => {
+  let ids = [];
+  formData.data.quotationProductList.map((x) => {
+    ids.push(x.productId);
+    x.quotationProductBomList.map((y) => {
+      ids.push(y.materialId);
+    });
+  });
+  ids = Array.from(new Set(ids));
+  proxy
+    .post("/fileInfo/getList", {
+      businessIdList: ids,
+    })
+    .then((fileObj) => {
+      formData.data.quotationProductList.map((x) => {
+        x.fileList = fileObj[x.productId] || [];
+        if (x.fileList && x.fileList.length > 0) {
+          x.fileUrl = x.fileList[0].fileUrl;
+        }
+        x.quotationProductBomList.map((y) => {
+          y.fileList = fileObj[y.materialId] || [];
+          if (y.fileList && y.fileList.length > 0) {
+            y.fileUrl = y.fileList[0].fileUrl;
+          }
+        });
+      });
+    });
+};
+const changeQuantity = () => {
+  let money = 0;
+  if (
+    formData.data.quotationProductList &&
+    formData.data.quotationProductList.length > 0
+  ) {
+    // 单个产品的价格
+    for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+      let iele = formData.data.quotationProductList[i];
+      let productPrice = 0;
+      for (let j = 0; j < iele.quotationProductBomList.length; j++) {
+        const jele = iele.quotationProductBomList[j];
+        productPrice += Number(
+          parseFloat(Number(jele.quantity) * Number(jele.price)).toFixed(2)
+        );
+      }
+      iele.price = parseFloat(productPrice).toFixed(2);
+    }
+
+    // 计算数量以及小计
+    for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+      let iele = formData.data.quotationProductList[i];
+      if (iele.quantity) {
+        if (iele.price) {
+          iele.amount = parseFloat(
+            Number(iele.quantity) * Number(iele.price)
+          ).toFixed(2);
+          money += Number(iele.amount);
+        }
+        for (let j = 0; j < iele.quotationProductBomList.length; j++) {
+          const jele = iele.quotationProductBomList[j];
+          jele.allQuantity = iele.quantity * jele.quantity;
+          if (jele.price) {
+            jele.amount = parseFloat(
+              Number(jele.allQuantity) * Number(jele.price)
+            ).toFixed(2);
+          }
+        }
+      }
+    }
+    formData.data.amount = parseFloat(money).toFixed(2);
+  }
+};
+const chartData = ref([]);
+const chartOption = reactive({
+  data: {
+    tooltip: {
+      trigger: "axis",
+    },
+    // legend: {
+    //   data: ["价格"],
+    // },
+    grid: {
+      left: "3%",
+      right: "6%",
+      top: "10%",
+      bottom: "3%",
+      containLabel: true,
+    },
+    tooltip: {
+      show: true,
+      trigger: "axis",
+      // 格式化函数
+      // valueFormatter: (val) => {
+      //   return val + "aaa";
+      // },
+      formatter: (params, ticket, callback) => {
+        return `
+        ${params[0].seriesName}:${params[0].value}
+        <br/>
+         报价单号:${chartData.value[params[0].dataIndex].code}
+        `;
+      },
+      textStyle: {
+        fontSize: 12,
+      },
+    },
+    // toolbox: {
+    //   feature: {
+    //     saveAsImage: {},
+    //   },
+    // },
+    xAxis: {
+      type: "category",
+      boundaryGap: false,
+      data: [],
+    },
+    yAxis: {
+      type: "value",
+    },
+    series: [
+      {
+        name: "报价金额",
+        type: "line",
+        data: [],
+      },
+    ],
+  },
+});
+
+const getData = (query) => {
+  let url =
+    props.dataType == "1" ? "/saleQuotation/detail" : "/extQuotation/detail";
+  loading.value = true;
+  proxy.post(url, query).then((res) => {
+    formData.data = res;
+    // 城市数据回显
+    if (formData.data.buyCountryId) {
+      getCityData(formData.data.buyCountryId, "20");
+    }
+    if (formData.data.buyProvinceId) {
+      getCityData(formData.data.buyProvinceId, "30");
+    }
+    getFileData();
+    changeQuantity();
+    loading.value = false;
+    // if (res.quotationTrendList && res.quotationTrendList.length >= 2) {
+    //   isShowChart.value = true;
+    //   nextTick(() => {
+    //     myChart = echarts.init(chartDom.value);
+    //     window.addEventListener("resize", () => {
+    //       myChart.resize();
+    //     });
+    //     chartData.value = res.quotationTrendList;
+    //     chartOption.data.xAxis.data = chartData.value.map((item) => {
+    //       return item.createTime.slice(0, 10);
+    //     });
+    //     chartOption.data.series[0].data = chartData.value.map((item, index) => {
+    //       if (item.code == props.rowData.code) {
+    //         return {
+    //           value: item.amount || 0,
+    //           itemStyle: { color: "red" },
+    //         };
+    //       } else {
+    //         return item.amount || 0;
+    //       }
+    //     });
+    //     myChart.setOption(chartOption.data);
+    //     myChart.resize();
+    //   });
+    // } else {
+    //   isShowChart.value = false;
+    // }
+  });
+};
+
+watch(
+  () => props.rowData,
+  (val) => {
+    if (props.rowData.id) {
+      getData({ id: props.rowData.id });
+    }
+  },
+  {
+    immediate: true,
+    deep: true,
+  }
+);
+</script>
+
+<style lang="scss" scoped>
+.pic {
+  object-fit: contain;
+  width: 50px;
+  height: 50px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+
+:deep(.bom-table .el-table__body-wrapper .el-table__body .el-table__row) {
+  background: #fbfbfb !important;
+}
+</style>

+ 210 - 0
src/views/EHSD/saleContract/PriceSheetDetailList.vue

@@ -0,0 +1,210 @@
+<template>
+  <div style="background: #fff;height:calc(100vh - 150px)">
+    <div class="content-box">
+      <div class="left">
+        <div style="text-align:center;margin-bottom:20px">
+          <TitleInfo :content="'历史版本'" size="18"></TitleInfo>
+        </div>
+        <div v-for="(i, index) in leftList" :key="i.id" class="left-item" :style="{ color: rowData.id === i.id ? '#409eff' : '' }"
+             @click="handleItemClick(i)">
+          {{ i.code }}
+        </div>
+      </div>
+      <div class="center"></div>
+      <div class="right">
+        <el-tabs v-model="activeName" class="demo-tabs" type="card" @tab-change="handleTabChange">
+          <el-tab-pane label="报价详情" name="first"></el-tab-pane>
+          <el-tab-pane label="报价趋势" name="second" v-if="isShowChart"></el-tab-pane>
+        </el-tabs>
+        <div style="height:calc(100% - 100px);overflow: auto;">
+          <PriceSheetDetail :rowData="rowData" :dataType="props.dataType" v-show="activeName=='first'"></PriceSheetDetail>
+          <div style="width:100%;" v-show="activeName=='second'">
+            <div ref="chartDom" style="height:500px"></div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import PriceSheetDetail from "@/views/EHSD/saleContract/PriceSheetDetail";
+import * as echarts from "echarts";
+
+const { proxy } = getCurrentInstance();
+const props = defineProps({
+  rowData: Object,
+  dataType: {
+    type: String,
+    default: "1",
+  },
+});
+const activeName = ref("first");
+const rowData = ref({});
+const leftList = ref([]);
+
+let myChart = null;
+const chartDom = ref(null);
+const isShowChart = ref(false);
+const chartData = ref([]);
+const chartOption = reactive({
+  data: {
+    tooltip: {
+      trigger: "axis",
+    },
+    grid: {
+      left: "3%",
+      right: "6%",
+      top: "10%",
+      bottom: "3%",
+      containLabel: true,
+    },
+    tooltip: {
+      show: true,
+      trigger: "axis",
+      formatter: (params, ticket, callback) => {
+        return `
+        ${params[0].seriesName}:${params[0].value}
+        <br/>
+         报价单号:${chartData.value[params[0].dataIndex].code}
+        `;
+      },
+      textStyle: {
+        fontSize: 12,
+      },
+    },
+    xAxis: {
+      type: "category",
+      boundaryGap: false,
+      data: [],
+    },
+    yAxis: {
+      type: "value",
+    },
+    series: [
+      {
+        name: "报价金额",
+        type: "line",
+        data: [],
+      },
+    ],
+  },
+});
+const initChart = () => {
+  if (
+    rowData.value.quotationTrendList &&
+    rowData.value.quotationTrendList.length >= 2
+  ) {
+    isShowChart.value = true;
+    nextTick(() => {
+      setTimeout(() => {
+        myChart = echarts.init(chartDom.value);
+        window.addEventListener("resize", () => {
+          myChart.resize();
+        });
+        chartData.value = rowData.value.quotationTrendList;
+        chartOption.data.xAxis.data = chartData.value.map((item) => {
+          return item.createTime.slice(0, 10);
+        });
+        chartOption.data.series[0].data = chartData.value.map((item, index) => {
+          if (item.code == rowData.value.code) {
+            return {
+              value: item.amount || 0,
+              itemStyle: { color: "red" },
+            };
+          } else {
+            return item.amount || 0;
+          }
+        });
+        myChart.setOption(chartOption.data);
+        myChart.resize();
+      }, 0);
+    });
+  } else {
+    isShowChart.value = false;
+  }
+};
+const handleItemClick = (i) => {
+  rowData.value = i;
+  if (
+    rowData.value.quotationTrendList &&
+    rowData.value.quotationTrendList.length >= 2
+  ) {
+    isShowChart.value = true;
+  } else {
+    isShowChart.value = false;
+  }
+  if (activeName.value == "second") {
+    initChart();
+  }
+};
+
+const handleTabChange = (val) => {
+  if (val == "second") {
+    initChart();
+  }
+};
+
+const getData = (query) => {
+  let url =
+    props.dataType == "1"
+      ? "/saleQuotation/getVersionList"
+      : "/extQuotation/getVersionList";
+  proxy.post(url, query).then((res) => {
+    leftList.value = res;
+    if (leftList.value && leftList.value.length > 0) {
+      handleItemClick(leftList.value[0]);
+    }
+  });
+};
+
+watch(
+  () => props.rowData,
+  (val) => {
+    if (props.rowData.id) {
+      getData({ id: props.rowData.id });
+    }
+  },
+  {
+    immediate: true,
+    deep: true,
+  }
+);
+</script>
+
+<style lang="scss" scoped>
+.content-box {
+  display: flex;
+  height: 100%;
+  .left {
+    width: 150px;
+    // background: #ccc;
+    .left-item {
+      height: 36px;
+      line-height: 36px;
+      text-align: left;
+      cursor: pointer;
+    }
+  }
+  .center {
+    height: calc(100% + 60px);
+    margin-top: -30px;
+    width: 20px;
+    background-color: #f0f2f5;
+  }
+  .right {
+    width: calc(100% - 150px - 20px);
+    padding-left: 10px;
+  }
+}
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid black;
+  border-left: 1px solid black;
+}
+.contentRow {
+  border-right: 1px solid black;
+  line-height: 24px;
+  padding-left: 4px;
+}
+</style>

+ 31 - 7
src/views/EHSD/saleContract/priceSheetEHSD/index.vue

@@ -11,7 +11,9 @@
 
         <template #code="{ item }">
           <div style="width: 100%">
-            <span style="color: #409eff; cursor: pointer; word-break: break-all" @click="getDtl(item,true)">{{ item.code }}</span>
+            <!-- <span style="color: #409eff; cursor: pointer; word-break: break-all" @click="getDtl(item,true)">{{ item.code }}</span> -->
+            <span style="color: #409eff; cursor: pointer; word-break: break-all" @click="handleOpenDetail(item)">{{ item.code }}</span>
+
           </div>
         </template>
 
@@ -65,7 +67,8 @@
               <el-button type="primary" text v-debounce v-if="item.quotationStatus==2" @click="handleBack(item)">退回</el-button>
               <el-button type="primary" text v-debounce v-if="item.status == 30 && item.quotationStatus==2"
                          @click="getDtl(item, false,true)">变更</el-button>
-              <el-button type="primary" text v-debounce v-if="item.quotationStatus==2" @click="handleForeign(item)">转对外</el-button>
+              <el-button type="primary" text v-debounce v-if="item.quotationStatus==2 && !item.extQuotationId"
+                         @click="handleForeign(item)">转对外</el-button>
               <el-button type="danger" text v-debounce v-if="item.status !=0 && item.status !=88"
                          @click="handleRepeal(item,'/saleQuotation/cancellation')">作废</el-button>
             </span>
@@ -378,7 +381,7 @@
     </el-dialog>
 
     <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
-      <SelectProduct @selectProduct="selectProduct" :companyId="companyId"></SelectProduct>
+      <SelectProduct @selectProduct="selectProduct" :companyId="companyId" :isRawMaterial="'1'"></SelectProduct>
       <template #footer>
         <el-button @click="openProductCompany = false" size="defualt" v-debounce>关 闭</el-button>
       </template>
@@ -390,6 +393,10 @@
         <el-button @click="openSelectMaterial = false" size="defualt" v-debounce>关 闭</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog v-if="detailDialog" v-model="detailDialog" title="报价详情" width="90%" append-to-body>
+      <PriceSheetDetailList :rowData="detailRowData" dataType="1"></PriceSheetDetailList>
+    </el-dialog>
   </div>
 </template>
 
@@ -401,6 +408,7 @@ import selectCity from "@/components/selectCity/index.vue";
 import SelectProduct from "@/components/product/SelectProduct.vue";
 import SelectMaterial from "@/components/product/SelectMaterial.vue";
 import * as echarts from "echarts";
+import PriceSheetDetailList from "@/views/EHSD/saleContract/PriceSheetDetailList";
 
 const { proxy } = getCurrentInstance();
 const companyId = ref("");
@@ -1095,6 +1103,7 @@ const selectMaterial = (goods) => {
       price: null,
       amount: "",
       fileList: [],
+      type: 2,
     });
     proxy.msgTip("选择成功");
   } else {
@@ -1107,6 +1116,7 @@ const onPicture = (path) => {
 };
 const handleRemove = (index) => {
   formData.data.quotationProductList.splice(index, 1);
+  changeQuantity();
 };
 
 const handleDeleteMaterial = (index, sonIndex) => {
@@ -1114,6 +1124,7 @@ const handleDeleteMaterial = (index, sonIndex) => {
     sonIndex,
     1
   );
+  changeQuantity();
 };
 const loadingSearch = ref(false);
 const remoteMethod = (keyword) => {
@@ -1404,11 +1415,13 @@ const totalAmount = () => {
         ).toFixed(2);
         // 计算物料总计
         jele.amount = parseFloat(
-          Number(jele.allQuantity) * Number(jele.price)
+          Number(jele.allQuantity) *
+            Number(jele.priceCopy) *
+            Number(jele.coefficient)
         ).toFixed(2);
         // 单个产品的一个物料的钱
         productPrice += Number(
-          parseFloat(Number(jele.quantity) * Number(jele.price)).toFixed(2)
+          parseFloat(Number(jele.quantity) * Number(jele.priceCopy)).toFixed(2)
         );
       }
       iele.price = parseFloat(productPrice).toFixed(2);
@@ -1441,11 +1454,15 @@ const publicTotalAmount = (val) => {
           ).toFixed(2);
           // 计算物料总计
           jele.amount = parseFloat(
-            Number(jele.allQuantity) * Number(jele.price)
+            Number(jele.allQuantity) *
+              Number(jele.priceCopy) *
+              Number(jele.coefficient)
           ).toFixed(2);
           // 单个产品的一个物料的钱
           productPrice += Number(
-            parseFloat(Number(jele.quantity) * Number(jele.price)).toFixed(2)
+            parseFloat(Number(jele.quantity) * Number(jele.priceCopy)).toFixed(
+              2
+            )
           );
         }
         iele.price = parseFloat(productPrice).toFixed(2);
@@ -1475,6 +1492,13 @@ const handleSubmitOne = () => {
       .catch((err) => {});
   });
 };
+
+const detailDialog = ref(false);
+const detailRowData = ref({});
+const handleOpenDetail = (item) => {
+  detailRowData.value = item;
+  detailDialog.value = true;
+};
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
src/views/EHSD/saleContract/priceSheetEstimate/index.vue

@@ -58,7 +58,7 @@
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
         <template #commodity>
           <div style="width: 100%;padding-left:25px">
-            <el-table :data="formData.data.quotationProductList" style="width: 100%;" default-expand-all row-key="productId">
+            <el-table :data="formData.data.quotationProductList" style="width: 100%;" default-expand-all>
               <el-table-column type="expand" width="50" align="center">
                 <template #default="scope">
                   <div style="padding-left:50px">

+ 18 - 5
src/views/EHSD/saleContract/priceSheetForeign/index.vue

@@ -6,8 +6,8 @@
 
       <template #code="{ item }">
         <div style="width: 100%">
-          {{ item.code }}
-          <!-- <span style="color: #409eff; cursor: pointer; word-break: break-all" @click="handleGenerate(item,true)">{{ item.code }}</span> -->
+          <!-- {{ item.code }} -->
+          <span style="color: #409eff; cursor: pointer; word-break: break-all" @click="handleOpenDetail(item)">{{ item.code }}</span>
         </div>
       </template>
 
@@ -96,7 +96,7 @@
           <!-- <el-button type="primary" text v-debounce @click="handleFollow(item)">跟进</el-button> -->
           <el-button type="primary" text v-debounce @click="handleGenerate(item)">生成订单</el-button>
           <el-button type="primary" text v-debounce @click="getDtl(item)">变更</el-button>
-          <el-button type="danger" text v-debounce v-if="item.status !=0" @click="handleRepeal(item)">作废</el-button>
+          <el-button type="danger" text v-debounce v-if="item.status !=0 && item.status !=88" @click="handleRepeal(item)">作废</el-button>
         </div>
       </template>
     </byTable>
@@ -132,7 +132,7 @@
       <byForm :formConfig="updateFormConfig" :formOption="updateFormOption" v-model="formData.updateData" :rules="updateRules" ref="formDomOne">
         <template #commodity>
           <div style="width: 100%;padding-left:25px">
-            <el-table :data="formData.updateData.quotationProductList" style="width: 100%;" default-expand-all row-key="productId">
+            <el-table :data="formData.updateData.quotationProductList" style="width: 100%;" default-expand-all>
               <el-table-column type="expand" width="50" align="center">
                 <template #default="scope">
                   <div style="padding-left:50px">
@@ -211,6 +211,11 @@
         <el-button type="primary" @click="handleSubmitOne()" size="default" v-debounce>提 交</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog v-if="detailDialog" v-model="detailDialog" title="报价详情" width="90%" append-to-body>
+      <PriceSheetDetailList :rowData="detailRowData" dataType="2"></PriceSheetDetailList>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -218,6 +223,7 @@
 import byTable from "@/components/byTable/index";
 import moment from "moment";
 import byForm from "@/components/byForm/index";
+import PriceSheetDetailList from "@/views/EHSD/saleContract/PriceSheetDetailList";
 
 const { proxy } = getCurrentInstance();
 const accountList = ref([]);
@@ -362,7 +368,7 @@ const config = computed(() => {
       attrs: {
         label: "跟进",
         slot: "follow",
-        "min-width": 400,
+        "min-width": 420,
       },
     },
     {
@@ -701,6 +707,13 @@ const handleSubmitOne = (type) => {
     }
   });
 };
+
+const detailDialog = ref(false);
+const detailRowData = ref({});
+const handleOpenDetail = (item) => {
+  detailRowData.value = item;
+  detailDialog.value = true;
+};
 </script>
 
 <style lang="scss" scoped>