瀏覽代碼

销售订单增加bom单

cz 1 年之前
父節點
當前提交
810c68aa74

+ 13 - 13
src/assets/styles/element-ui.scss

@@ -1,19 +1,19 @@
 // cover some element-ui styles
 // 全局字号大小
 .el-table .el-table__cell {
-  padding: 4px 0px !important;
-  font-size: 12px !important
-}
-
-.el-form-item--default .el-form-item__label,
-.el-input,
-.el-textarea__inner,
-.el-upload-dragger .el-upload__text,
-.el-tabs__item,
-.el-button,
-.el-dropdown-menu__item {
-  font-size: 12px !important;
-}
+  padding: 6px 0px !important;
+  // font-size: 12px !important
+}
+
+// .el-form-item--default .el-form-item__label,
+// .el-input,
+// .el-textarea__inner,
+// .el-upload-dragger .el-upload__text,
+// .el-tabs__item,
+// .el-button,
+// .el-dropdown-menu__item {
+//   font-size: 12px !important;
+// }
 
 .el-breadcrumb__inner,
 .el-breadcrumb__inner a {

+ 1 - 1
src/components/byTable/ElementsMapping.vue

@@ -124,7 +124,7 @@ export default defineComponent({
 <style>
 .more-btn {
   line-height: 34px;
-  font-size: 12px;
+  font-size: 14px;
   color: #ff9315;
 }
 .dn {

+ 9 - 9
src/components/byTable/index.vue

@@ -57,7 +57,7 @@
         </div>
         <div class="by-dropdown" v-for="(i, index) in selectConfigCopy" :key="i.prop" style="margin-right: 10px">
           <div v-if="i.type" class="selectTime" style="display:flex;align-items:center">
-            <span style="font-size:12px;height:32px;margin-right:15px">{{i.label || ''}}</span>
+            <span style="font-size: 14px;height:32px;margin-right:15px">{{i.label || ''}}</span>
             <el-date-picker v-model="pagination[i.prop]" :type="i.itemType?i.itemType:'date'" size="small" :placeholder="i.placeholder"
                             style="width:120px" :value-format="dateFormatInit(i.itemType)"
                             @change="i.fn?i.fn(pagination[i.prop]):searchItemSelctOne(i,pagination[i.prop],pagination[i.propOne])"
@@ -86,8 +86,8 @@
       </div>
 
       <div style="display: flex;align-items:center">
-        <el-input :placeholder="$t('common.pleaseEnterKeywords')" style="font-size:12px" suffix-icon="search" size="mini" v-model="pagination.keyword"
-                  @keyup.enter="searchFn">
+        <el-input :placeholder="$t('common.pleaseEnterKeywords')" style="font-size: 14px" suffix-icon="search" size="mini"
+                  v-model="pagination.keyword" @keyup.enter="searchFn">
         </el-input>
         <el-icon :size="16" style="cursor:pointer;margin-left: 10px" @click="searchFn">
           <Search />
@@ -626,7 +626,7 @@ export default defineComponent({
   border-color: #b2b4b9;
 }
 .el-table .cell {
-  line-height: 34px;
+  line-height: 22px;
 }
 </style>
 <style lang="scss" scoped>
@@ -801,7 +801,7 @@ export default defineComponent({
   line-height: 32px;
 
   .by-dropdown-title {
-    font-size: 12px;
+    font-size: 14px;
     background-color: #fff;
   }
   ul {
@@ -817,7 +817,7 @@ export default defineComponent({
     min-width: 80px;
     li {
       list-style: none;
-      font-size: 12px;
+      font-size: 14px;
       height: 30px;
       padding: 0 10px;
       text-align: left;
@@ -883,7 +883,7 @@ export default defineComponent({
       font-size: 12px;
     }
     :deep() td {
-      font-size: 12px;
+      font-size: 14px;
     }
   }
 }
@@ -897,10 +897,10 @@ export default defineComponent({
 }
 :deep(.selectTime .el-input__inner) {
   color: #000 !important;
-  font-size: 12px !important;
+  font-size: 14px !important;
 }
 :deep(.selectTime .el-input .el-input__icon) {
   color: #000 !important;
-  font-size: 12px !important;
+  font-size: 14px !important;
 }
 </style>

+ 5 - 5
src/components/headerBar/header-bar.vue

@@ -162,7 +162,7 @@
             <div v-for="(item, index) in sidebarRoutersCopy" :key="item.name" v-show="item.type == 1 && item.status == '0'"
                  style="border-bottom:2px dashed #edeaea;padding-bottom:20px;margin-bottom:20px;">
               <div class="first-order-title">
-                <TitleInfo :content="item.menuName" :size="14"></TitleInfo>
+                <TitleInfo :content="item.menuName" :size="16"></TitleInfo>
               </div>
               <div class="layout-box">
                 <ul class="son-box" v-for="i in item.children" :key="i.menuId">
@@ -184,7 +184,7 @@
           </div>
           <div class="right-banner">
             <div class="first-order-title">
-              <TitleInfo :content="'常用功能'" :size="14"></TitleInfo>
+              <TitleInfo :content="'常用功能'" :size="16"></TitleInfo>
             </div>
 
             <div class="collect" id="collect">
@@ -862,7 +862,7 @@ const plugDowload = () => {
           height: 40px;
           line-height: 40px;
           // border-bottom: 1px solid #efebeb;
-          font-size: 13px;
+          font-size: 14px;
           width: 140px;
           margin: 0 5vw 0 0;
 
@@ -876,7 +876,7 @@ const plugDowload = () => {
           // padding-left: 10px;
           height: 30px;
           line-height: 30px;
-          font-size: 13px;
+          font-size: 14px;
           font-weight: 400;
         }
 
@@ -902,7 +902,7 @@ const plugDowload = () => {
 
       .item {
         // margin-bottom: 4px;
-        font-size: 13px;
+        font-size: 14px;
         display: flex;
         justify-content: space-between;
         align-items: center;

+ 4 - 4
src/components/notice/index.vue

@@ -311,10 +311,10 @@ const getPushInfo = (flag) => {
       if (current) {
         createNotification(current.title);
         index.value = 0;
-        current.businessData = current.title;
-        current.title = "流程";
-        data.value = [current];
-        value.value = true;
+        // current.businessData = current.title;
+        // current.title = "流程";
+        // data.value = [current];
+        // value.value = true;
       }
     }
     setTimeout(() => {

+ 166 - 37
src/components/process/SF/Contract.vue

@@ -127,8 +127,54 @@
 
       <template #commodity>
         <div style="width: 100%">
-          <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!judgeStatus()">产品库</el-button>
-          <el-table :data="formData.data.contractProductList" style="width: 100%; ">
+          <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px"
+                     v-if="!judgeStatus() && isEditList">产品库</el-button>
+          <el-table :data="formData.data.contractProductList" 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" />
+                    <!-- <el-table-column prop="allQuantity" label="总量" width="80" /> -->
+                    <!-- <el-table-column prop="price" label="单价" width="110">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          ¥ {{row.price}}
+                        </div>
+                      </template>
+                    </el-table-column> -->
+                    <!-- <el-table-column prop="amount" label="小计" width="110">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          ¥ {{row.amount}}
+                        </div>
+                      </template>
+                    </el-table-column> -->
+                    <el-table-column prop="remark" label="备注" width="180" />
+                  </el-table>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column label="商品图片" width="80">
               <template #default="{ row }">
                 <div v-if="row.fileUrl">
@@ -171,7 +217,8 @@
                   <el-form-item :prop="'contractProductList.' + $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="0" @change="calculationAmount('quantity')" />
+                                     :controls="false" :min="0" @change="calculationAmount('quantity')" v-if="isEditList" />
+                    <div v-else> {{row.quantity}}</div>
                   </el-form-item>
                 </div>
               </template>
@@ -183,7 +230,8 @@
                                 class="margin-b-0 wid100">
                     <div style="display:flex;">
                       <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
-                                       :controls="false" :min="0" @change="calculationAmount()" />
+                                       :controls="false" :min="0" @change="calculationAmount()" v-if="isEditList" />
+                      <div v-else>¥ {{row.price}}</div>
                       <el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
                         <template #default>
                           <div>
@@ -242,11 +290,17 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column prop="amount" label="小计" width="120" />
-            <el-table-column label="操作" width="120" align="center" fixed="right" v-if="!judgeStatus()">
+            <el-table-column prop="amount" label="小计" width="110">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  ¥ {{row.amount}}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="140" align="center" fixed="right" v-if="!judgeStatus()">
               <template #default="{ $index }">
-                <el-button type="primary" link @click="handleClickUpload('prodFilePath',true,$index)">重置</el-button>
-                <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
+                <el-button type="primary" link @click="handleClickUpload('prodFilePath',true,$index)">定制图稿</el-button>
+                <el-button type="primary" link @click="handleRemove($index)" v-if="isEditList">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -306,7 +360,7 @@
 
     <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="公司产品库" width="90%" append-to-body>
       <!-- <SelectCompanyProduct @selectProduct="selectProduct" :alreadySelectData="formData.data.contractProductList"></SelectCompanyProduct> -->
-      <SelectProduct @selectProduct="selectProduct"></SelectProduct>
+      <SelectProduct @selectProduct="selectProduct" :isRawMaterial="'1'"></SelectProduct>
     </el-dialog>
 
     <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '合同选择' : '样品单选择'" width="90%" append-to-body>
@@ -404,7 +458,14 @@ const formConfig = computed(() => {
     // },
     {
       type: "title",
-      title: "合同类型",
+      title: "基本信息",
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "合同号",
+      disabled: true,
+      isShow: formData.data.code ? true : false,
     },
     {
       type: "select",
@@ -908,30 +969,60 @@ const handlePerson = (item) => {
     formData.data.buyContactNumber = data[0].contactNo;
   }
 };
-
+const quotationProductBomList = ref([]);
 const selectProduct = (goods) => {
   if (goods && goods.id) {
     let fileUrl = "";
     if (goods.fileList && goods.fileList.length > 0) {
       fileUrl = goods.fileList[0].fileUrl;
     }
-    formData.data.contractProductList.push({
-      fileUrl: fileUrl,
-      productId: goods.id,
-      productCnName: goods.name,
-      productCode: goods.customCode,
-      productLength: goods["length"],
-      productWidth: goods.width,
-      productHeight: goods.height,
-      prodFilePath: goods.prodFilePath,
-      quantity: null,
-      price: null,
-      amount: "",
-      remark: "",
-      fileList: [],
+    proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
+      if (res.productBomDetailList && res.productBomDetailList.length > 0) {
+        quotationProductBomList.value = res.productBomDetailList.map((x) => ({
+          fileUrl: "",
+          materialId: x.materialId,
+          productName: x.materialName,
+          productCode: x.materialCode,
+          productLength: x["length"],
+          productWidth: x.width,
+          productHeight: x.height,
+          quantity: x.quantity || null,
+          allQuantity: "",
+          price: x.materialPrice || null,
+          amount: "",
+          fileList: [],
+          type: x.type,
+        }));
+        formData.data.contractProductList.push({
+          fileUrl: fileUrl,
+          productId: goods.id,
+          productCnName: goods.name,
+          productCode: goods.customCode,
+          productLength: goods["length"],
+          productWidth: goods.width,
+          productHeight: goods.height,
+          prodFilePath: goods.prodFilePath,
+          quantity: null,
+          price: goods.price || null,
+          amount: "",
+          remark: "",
+          fileList: [],
+          quotationProductBomList: quotationProductBomList.value,
+        });
+        proxy.msgTip("添加成功", 1);
+        changeProductPrice();
+        let ids = quotationProductBomList.value.map((x) => x.materialId);
+        proxy.getFile(
+          ids,
+          quotationProductBomList.value,
+          "materialId",
+          "fileList",
+          "fileUrl"
+        );
+      } else {
+        return proxy.msgTip("该产品未配置BOM", 2);
+      }
     });
-    proxy.msgTip("添加成功", 1);
-    changeProductPrice();
   } else {
     return proxy.msgTip("选择错误", 2);
   }
@@ -1230,7 +1321,6 @@ const getAllData = (businessId) => {
         "fileList",
         "imageUrl"
       );
-
       changeProductPrice();
     }
     if (formData.data.countryId) {
@@ -1241,6 +1331,34 @@ const getAllData = (businessId) => {
     }
   });
 };
+
+const getFileData = () => {
+  let ids = [];
+  formData.data.contractProductList.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.contractProductList.map((x) => {
+        if (fileObj[x.productId] && fileObj[x.productId].length > 0) {
+          x.fileUrl = fileObj[x.productId][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 getPriceSheetData = (id) => {
   proxy.post("/extQuotation/detail", { id }).then((res) => {
     formData.data = res;
@@ -1253,6 +1371,7 @@ const getPriceSheetData = (id) => {
       buyPostalCode: res.buyPostalCode,
       buyContactName: res.buyContactName,
       buyContactNumber: res.buyContactNumber,
+      amount: res.amount,
     };
     if (res.type == 1) {
       formData.data.contractType = "2";
@@ -1277,17 +1396,23 @@ const getPriceSheetData = (id) => {
       price: x.price,
       amount: x.amount,
       fileList: [],
+      quotationProductBomList: x.quotationProductBomList.map((y) => {
+        y.quotationProductBomId = y.id;
+        delete y.id;
+        return y;
+      }),
     }));
     changeProductPrice();
-    let productIds = formData.data.contractProductList.map((x) => x.productId);
-    proxy.getFile(
-      productIds,
-      formData.data.contractProductList,
-      "productId",
-      "fileListOne",
-      "fileUrl"
-    );
-    totalAmount();
+    getFileData();
+    // let productIds = formData.data.contractProductList.map((x) => x.productId);
+    // proxy.getFile(
+    //   productIds,
+    //   formData.data.contractProductList,
+    //   "productId",
+    //   "fileListOne",
+    //   "fileUrl"
+    // );
+    // totalAmount();
     formData.data.countryId = res.buyCountryId;
     formData.data.provinceId = res.buyProvinceId;
     formData.data.cityId = res.buyCityId;
@@ -1299,6 +1424,8 @@ const getPriceSheetData = (id) => {
     }
   });
 };
+// 是否能编辑修改产品列表
+const isEditList = ref(true);
 onMounted(() => {
   if (currencyData.value && currencyData.value.length > 0) {
     formData.data.currency = currencyData.value[0].dictKey;
@@ -1307,6 +1434,7 @@ onMounted(() => {
   // 报价转销售订单
   if (route.query && route.query.priceSheetId) {
     getPriceSheetData(route.query.priceSheetId);
+    isEditList.value = false;
   } else if (route.query && route.query.businessId && route.query.processType) {
     let businessId = route.query.businessId;
     getAllData(businessId);
@@ -1328,6 +1456,7 @@ watch(
     immediate: true,
   }
 );
+
 const showPriceInfo = () => {
   if (props.queryData.processType) {
     return false;

+ 12 - 1
src/components/process/SF/Purchase.vue

@@ -376,8 +376,19 @@ const formConfig = computed(() => {
     // },
     {
       type: "title",
+      title: "基本信息",
+      isShow: formData.data.code,
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "合同号",
+      isShow: formData.data.code,
+    },
+    {
+      type: "title",
       title: "贸易信息",
-      haveLine: false,
+      haveLine: formData.data.code,
     },
     {
       type: "slot",

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

@@ -227,6 +227,12 @@ const formConfig = computed(() => {
       title: "报价类型",
     },
     {
+      type: "input",
+      prop: "code",
+      label: "报价单号",
+      isShow: formData.data.code,
+    },
+    {
       type: "select",
       prop: "type",
       label: "报价类型",

+ 15 - 18
src/views/EHSD/saleContract/priceSheetEHSD/index.vue

@@ -1075,24 +1075,21 @@ const selectProduct = (goods) => {
     }
     proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
       if (res.productBomDetailList && res.productBomDetailList.length > 0) {
-        quotationProductBomList.value = res.productBomDetailList || [];
-        quotationProductBomList.value = quotationProductBomList.value.map(
-          (x) => ({
-            fileUrl: "",
-            materialId: x.materialId,
-            productName: x.materialName,
-            productCode: x.materialCode,
-            productLength: x["length"],
-            productWidth: x.width,
-            productHeight: x.height,
-            quantity: x.quantity || null,
-            allQuantity: "",
-            price: null,
-            amount: "",
-            fileList: [],
-            type: x.type,
-          })
-        );
+        quotationProductBomList.value = res.productBomDetailList.map((x) => ({
+          fileUrl: "",
+          materialId: x.materialId,
+          productName: x.materialName,
+          productCode: x.materialCode,
+          productLength: x["length"],
+          productWidth: x.width,
+          productHeight: x.height,
+          quantity: x.quantity || null,
+          allQuantity: "",
+          price: x.materialPrice || null,
+          amount: "",
+          fileList: [],
+          type: x.type,
+        }));
         formData.data.quotationProductList.push({
           fileUrl: fileUrl,
           productId: goods.id,