瀏覽代碼

部分需求修改

cz 1 年之前
父節點
當前提交
eb526a3693

+ 66 - 57
src/views/EHSD/saleContract/priceSheetEHSD/index.vue

@@ -826,60 +826,63 @@
       <byForm :formConfig="formConfigTwo" :formOption="formOptionTwo" v-model="formData.dataTwo" :rules="rulesTwo" ref="formDomTwo"
               v-loading="submitLoading">
         <template #commodity>
-          <div style="width: 100%;padding-left:25px">
+          <div style="width: 100%;padding-left:25px" class="confirm">
             <el-collapse v-model="activeNames">
               <el-card style="margin-bottom:15px" v-for="(product,index) in formData.dataTwo.quotationProductList" :key="index">
                 <el-collapse-item :name="index">
                   <template #title>
-                    <el-row style="width:100%">
-                      <el-col :span="4">
-                        <div style="font-size:14px;font-weight:700;padding-left:15px;">
-                          产品编码:{{product.productCode || '定制产品'}}
-                        </div>
-                      </el-col>
-                      <el-col :span="8" style="display:flex;justify-content:space-around">
-                        <span>数量:{{product.quantity}}</span>
-                        <span> 工厂出厂单价:<span v-if="product.prodPrice">{{moneyFormat(product.prodPrice,2)}}</span></span>
-                        <span> 小计:<span v-if="product.amount">{{moneyFormat(product.amount,2)}}</span></span>
-                      </el-col>
-                      <!-- <el-col :span="3" style="padding-left:10px">
-                        工厂出厂单价:<span>{{product.prodPrice}}</span>
-                      </el-col>
-                      <el-col :span="3" style="padding-left:10px">
-                        小计:<span>{{product.amount}}</span>
-                      </el-col> -->
-                      <el-col :span="3">
-                        <el-form-item label="业务成本单价" class="margin-b-0" :prop="'quotationProductList.' +index + '.businessCostPrice'"
-                                      :rules="rulesTwo.businessCostPrice" :inline-message="true" @click.stop v-if="!isDetailData">
-                          <el-input-number v-model="product.businessCostPrice" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
-                                           :min="0" onmousewheel="return false;" @change="changeQuantityOne" />
-                        </el-form-item>
-                        <span v-else> 业务成本单价:<span v-if="product.businessCostPrice">{{moneyFormat(product.businessCostPrice,2)}}</span> </span>
-                      </el-col>
-                      <el-col :span="3">
-                        <el-form-item label="业务员最低报价" class="margin-b-0" :prop="'quotationProductList.' +index + '.minPrice'"
-                                      :rules="rulesTwo.minPrice" :inline-message="true" @click.stop v-if="!isDetailData">
-                          <el-input-number v-model="product.minPrice" placeholder="请输入" style="width: 100%" :precision="2" :controls="false" :min="0"
-                                           onmousewheel="return false;" @change="changeMinPrice" />
-                        </el-form-item>
-                        <span v-else> 业务员最低报价:<span v-if="product.minPrice">{{moneyFormat(product.minPrice,2)}}</span> </span>
-                      </el-col>
-                      <el-col :span="3" v-if="!isDetailData">
-                        <el-form-item label="上调比列(%)" class="margin-b-0" :prop="'quotationProductList.' +index + '.amplifyRatio'"
-                                      :rules="rulesTwo.amplifyRatio" :inline-message="true" @click.stop v-if="!isDetailData">
-                          <el-input-number v-model="product.amplifyRatio" placeholder="请输入" style="width: 100%" :precision="0" :controls="false"
-                                           onmousewheel="return false;" :min="1" :max="100" @change="changeMinPrice" />
-                        </el-form-item>
-                        <span v-else> 上调比列(%):{{product.amplifyRatio}}</span>
-                      </el-col>
-                      <el-col :span="3" style="padding-left:10px">
-                        业务员最高报价:<span v-if="product.maxPrice">{{moneyFormat(product.maxPrice,2)}}</span>
-                      </el-col>
-                      <el-col :span="3" v-if="isDetailData">
-                        最终单价:
-                        <span v-if="product.price">{{moneyFormat(product.price,2)}}</span>
-                      </el-col>
-                    </el-row>
+                    <div style="width:100%">
+                      <el-row style="width:100%">
+                        <el-col :span="6">
+                          <div style="font-size:14px;font-weight:700;padding-left:15px;">
+                            产品编码:{{product.productCode || '定制产品'}}
+                          </div>
+                        </el-col>
+                        <el-col :span="6">
+                          <span>数量:{{product.quantity}}</span>
+                        </el-col>
+                        <el-col :span="6">
+                          <span> 工厂出厂单价:<span v-if="product.prodPrice">{{moneyFormat(product.prodPrice,2)}}</span></span>
+                        </el-col>
+                        <el-col :span="6">
+                          <span> 小计:<span v-if="product.amount">{{moneyFormat(product.amount,2)}}</span></span>
+                        </el-col>
+                      </el-row>
+                      <el-row style="width:100%">
+                        <el-col :span="6" style="padding-left:15px;">
+                          <el-form-item label="业务成本单价" class="margin-b-0" :prop="'quotationProductList.' +index + '.businessCostPrice'"
+                                        :rules="rulesTwo.businessCostPrice" :inline-message="true" @click.stop v-if="!isDetailData">
+                            <el-input-number v-model="product.businessCostPrice" placeholder="请输入" style="width: 100%" :precision="2"
+                                             :controls="false" :min="0" onmousewheel="return false;" @change="changeQuantityOne" />
+                          </el-form-item>
+                          <span v-else> 业务成本单价:<span v-if="product.businessCostPrice">{{moneyFormat(product.businessCostPrice,2)}}</span> </span>
+                        </el-col>
+                        <el-col :span="6">
+                          <el-form-item label="业务员最低报价" class="margin-b-0" :prop="'quotationProductList.' +index + '.minPrice'"
+                                        :rules="rulesTwo.minPrice" :inline-message="true" @click.stop v-if="!isDetailData">
+                            <el-input-number v-model="product.minPrice" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
+                                             :min="0" onmousewheel="return false;" @change="changeMinPrice" />
+                          </el-form-item>
+                          <span v-else> 业务员最低报价:<span v-if="product.minPrice">{{moneyFormat(product.minPrice,2)}}</span> </span>
+                        </el-col>
+                        <el-col :span="6" v-if="!isDetailData">
+                          <el-form-item label="上调比列(%)" class="margin-b-0" :prop="'quotationProductList.' +index + '.amplifyRatio'"
+                                        :rules="rulesTwo.amplifyRatio" :inline-message="true" @click.stop v-if="!isDetailData">
+                            <el-input-number v-model="product.amplifyRatio" placeholder="请输入" style="width: 100%" :precision="0" :controls="false"
+                                             onmousewheel="return false;" :min="1" :max="100" @change="changeMinPrice" />
+                          </el-form-item>
+                          <span v-else> 上调比列(%):{{product.amplifyRatio}}</span>
+                        </el-col>
+                        <el-col :span="6" style="padding-left:10px">
+                          业务员最高报价:<span v-if="product.maxPrice">{{moneyFormat(product.maxPrice,2)}}</span>
+                        </el-col>
+                        <el-col :span="6" v-if="isDetailData">
+                          最终单价:
+                          <span v-if="product.price">{{moneyFormat(product.price,2)}}</span>
+                        </el-col>
+                      </el-row>
+                    </div>
+
                   </template>
                   <el-form disabled label-width="100px">
                     <div style="width:100%">
@@ -2448,7 +2451,7 @@ const formConfigOne = computed(() => {
     },
     {
       type: "input",
-      prop: "amount",
+      prop: "showAmount",
       label: "报价总金额",
       itemWidth: 25,
       disabled: true,
@@ -2503,9 +2506,11 @@ const handleForeign = (row) => {
     for (let i = 0; i < formData.data.quotationProductList.length; i++) {
       const iele = formData.data.quotationProductList[i];
       iele.quotationProductId = iele.id;
-      iele.maxPrice = Number(
-        parseFloat((iele.amplifyRatio / 100 + 1) * iele.minPrice).toFixed(2)
-      );
+      if (iele.maxPrice == null) {
+        iele.maxPrice = Number(
+          parseFloat((iele.amplifyRatio / 100 + 1) * iele.minPrice).toFixed(2)
+        );
+      }
       // iele.price = iele.minPrice;
       for (let j = 0; j < iele.quotationProductBomList.length; j++) {
         const jele = iele.quotationProductBomList[j];
@@ -3024,10 +3029,10 @@ const changeForeignQuantity = () => {
       } else {
         iele.isShowYiJia = false;
       }
-      iele.amount = Number(parseFloat(iele.price * iele.quantity).toFixed(2));
-      // money += Number(iele.amount);
+      iele.amountaa = Number(parseFloat(iele.price * iele.quantity).toFixed(2));
+      money += Number(iele.amountaa);
     }
-    formData.data.amount = parseFloat(money).toFixed(2);
+    formData.data.showAmount = parseFloat(money).toFixed(2);
   }
   isShowYiJia.value = num > 0 ? true : false;
 };
@@ -3167,6 +3172,10 @@ const handleOfCompanyIdChange = (val) => {
 // }
 :deep(.el-collapse-item__header) {
   background-color: #eee;
+  // line-height: 96px;
+}
+:deep(.confirm .el-collapse-item__header) {
+  height: 96px;
 }
 </style>
 

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

@@ -439,7 +439,7 @@
                         <td class="align-right">
                           <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.price'" :rules="rules.price"
                                         :inline-message="true">
-                            <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="2"
+                            <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="4"
                                              :controls="false" :min="0" @change="changeTotalAmount()" />
                           </el-form-item>
                         </td>
@@ -482,7 +482,7 @@
                         <td class="align-right">
                           <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.price'" :rules="rules.price"
                                         :inline-message="true">
-                            <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="2"
+                            <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="4"
                                              :controls="false" :min="0" @change="changeTotalAmount()" />
                           </el-form-item>
                         </td>
@@ -518,7 +518,7 @@
                         <td class="align-right">
                           <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.price'" :rules="rules.price"
                                         :inline-message="true">
-                            <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="2"
+                            <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="4"
                                              :controls="false" :min="0" @change="changeTotalAmount()" />
                           </el-form-item>
                         </td>

+ 2 - 2
src/views/production/project/processes/index.vue

@@ -109,7 +109,7 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "成本单价",
+        label: "生产单价",
         prop: "costPrice",
       },
     },
@@ -224,7 +224,7 @@ const formConfig = computed(() => {
     {
       type: "number",
       prop: "costPrice",
-      label: "成本单价",
+      label: "生产单价",
       precision: 2,
       min: 0,
       controls: false,

+ 155 - 121
src/views/purchaseManage/supplier/supplyPrice/index.vue

@@ -26,29 +26,26 @@
             <el-button type="primary" @click="openProduct = true" v-if="modalType == 'add'" style="margin-bottom: 15px">
               选择
             </el-button>
+            <el-table :data="formData.data.supplierPriceList">
+              <el-table-column prop="customCode" label="物料编码" width="160" />
+              <el-table-column prop="name" label="物料名称" min-width="150" />
+              <!-- <el-table-column prop="spec" label="规格型号" /> -->
+              <el-table-column prop="unit" label="单位" :formatter="(row) => dictKeyValue(row.unit, materialUnit)" width="80" />
+              <el-table-column prop="price" label="供应单价" width="140">
+                <template #default="{ row, $index }">
+                  <el-form-item label-width="0px" label="" :prop="'supplierPriceList.' + $index + '.price'" :rules="rules.price"
+                                :inline-message="true" class="margin-b-0 wid100">
+                    <el-input-number v-model="row.price" :precision="2" :controls="false" :min="0.01" onmousewheel="return false;" />
+                  </el-form-item>
+                </template>
+              </el-table-column>
 
-            <el-form ref="tableForm" :model="formData.data" :rules="rules" label-width="0px">
-              <el-table :data="formData.data.supplierPriceList">
-                <el-table-column prop="customCode" label="物料编码" width="160" />
-                <el-table-column prop="name" label="物料名称" min-width="150" />
-                <!-- <el-table-column prop="spec" label="规格型号" /> -->
-                <el-table-column prop="unit" label="单位" :formatter="(row) => dictKeyValue(row.unit, materialUnit)" width="80" />
-                <el-table-column prop="price" label="供应单价" width="140">
-                  <template #default="{ row, $index }">
-                    <el-form-item :prop="'supplierPriceList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
-                                  class="margin-b-0 wid100">
-                      <el-input-number v-model="row.price" :precision="2" :controls="false" :min="1" onmousewheel="return false;" />
-                    </el-form-item>
-                  </template>
-                </el-table-column>
-
-                <el-table-column prop="zip" label="操作" width="60" v-if="modalType == 'add'">
-                  <template #default="{ $index }">
-                    <el-button type="primary" link @click="handleRemove($index)" :disabled="modalType == 'edit'">删除</el-button>
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-form>
+              <el-table-column prop="zip" label="操作" width="60" v-if="modalType == 'add'">
+                <template #default="{ $index }">
+                  <el-button type="primary" link @click="handleRemove($index)" :disabled="modalType == 'edit'">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
           </div>
         </template>
       </byForm>
@@ -85,6 +82,7 @@ const materialUnit = computed(
 const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
 const headers = ref({ Authorization: "Bearer " + getToken() });
 const uploadData = ref({});
+const supplierData = ref([]);
 const loading = ref(false);
 const submitLoading = ref(false);
 const sourceList = ref({
@@ -145,7 +143,7 @@ const config = computed(() => {
       attrs: {
         label: "所属分类",
         prop: "productClassifyName",
-        width: 150,
+        width: 200,
       },
     },
     {
@@ -261,7 +259,7 @@ const config = computed(() => {
   ];
 });
 
-let formData = reactive({
+const formData = reactive({
   data: {
     supplierPriceList: [],
   },
@@ -272,25 +270,14 @@ const formOption = reactive({
   itemWidth: 100,
 });
 const byform = ref(null);
-const formConfig = reactive([
+const formConfig = computed(() => [
   {
     type: "select",
     prop: "supplierInfoId",
     label: "供应商",
-    required: true,
-    disabled: false,
+    disabled: modalType.value == "edit",
     filterable: true,
-    isLoad: {
-      url: "/supplierInfo/page",
-      req: {
-        pageNum: 1,
-        pageSize: 9999,
-      },
-      labelKey: "name",
-      labelVal: "id",
-      method: "post",
-      resUrl: "rows",
-    },
+    data: supplierData.value,
   },
   {
     type: "slot",
@@ -298,6 +285,43 @@ const formConfig = reactive([
     prop: "supplierPriceList",
     label: "供应明细",
     required: true,
+    isShow: modalType.value == "add",
+  },
+  {
+    type: "input",
+    prop: "code",
+    label: "产品编码",
+    disabled: true,
+    isShow: modalType.value == "edit",
+    itemWidth: 50,
+  },
+  {
+    type: "input",
+    prop: "name",
+    label: "产品名称",
+    disabled: true,
+    isShow: modalType.value == "edit",
+    itemWidth: 50,
+  },
+  {
+    type: "select",
+    prop: "unit",
+    label: "单位",
+    disabled: true,
+    filterable: true,
+    data: materialUnit.value,
+    isShow: modalType.value == "edit",
+    itemWidth: 50,
+  },
+  {
+    type: "number",
+    prop: "price",
+    label: "单价",
+    precision: 2,
+    min: 0.01,
+    controls: false,
+    itemWidth: 50,
+    isShow: modalType.value == "edit",
   },
 ]);
 const getList = (req) => {
@@ -314,7 +338,6 @@ const getList = (req) => {
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
-  formConfig[0].disabled = false;
   formData.data = {
     supplierPriceList: [],
     renewWhileItExists: false,
@@ -324,90 +347,86 @@ const openModal = () => {
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
     if (formData.data.supplierPriceList.length > 0) {
-      proxy.$refs.tableForm.validate((vaild) => {
-        if (vaild) {
-          if (!formData.data.id) {
-            const submitData = {
-              ...formData.data,
-              supplierPriceList: formData.data.supplierPriceList.map((x) => ({
-                productInfoId: x.productInfoId,
-                price: x.price,
-              })),
-            };
-            submitLoading.value = true;
-            proxy.post("/supplierPrice/" + modalType.value, submitData).then(
-              (res) => {
-                if (res.addSuccess) {
-                  ElMessage({
-                    message: modalType.value == "add" ? "添加成功" : "编辑成功",
-                    type: "success",
-                  });
-                  getList();
-                  dialogVisible.value = false;
-                  submitLoading.value = false;
-                } else {
-                  ElMessage({
-                    message: `已存在供应价格,价格为${res.existSupplierPriceList[0].price}`,
-                    type: "info",
-                  });
-                  ElMessageBox.confirm(
-                    "继续提交将修改已存在的单价数据, 是否继续?",
-                    "提示",
-                    {
-                      confirmButtonText: "确定",
-                      cancelButtonText: "取消",
-                      type: "warning",
-                    }
-                  )
-                    .then(() => {
-                      submitData.renewWhileItExists = true;
-                      proxy
-                        .post("/supplierPrice/" + modalType.value, submitData)
-                        .then((res) => {
-                          if (res.addSuccess) {
-                            ElMessage({
-                              message: "修改成功",
-                              type: "success",
-                            });
-                            getList();
-                            dialogVisible.value = false;
-                            submitLoading.value = false;
-                          }
+      if (!formData.data.id) {
+        const submitData = {
+          ...formData.data,
+          supplierPriceList: formData.data.supplierPriceList.map((x) => ({
+            productInfoId: x.productInfoId,
+            price: x.price,
+          })),
+        };
+        submitLoading.value = true;
+        proxy.post("/supplierPrice/" + modalType.value, submitData).then(
+          (res) => {
+            if (res.addSuccess) {
+              ElMessage({
+                message: modalType.value == "add" ? "添加成功" : "编辑成功",
+                type: "success",
+              });
+              getList();
+              dialogVisible.value = false;
+              submitLoading.value = false;
+            } else {
+              ElMessage({
+                message: `已存在供应价格,价格为${res.existSupplierPriceList[0].price}`,
+                type: "info",
+              });
+              ElMessageBox.confirm(
+                "继续提交将修改已存在的单价数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              )
+                .then(() => {
+                  submitData.renewWhileItExists = true;
+                  proxy
+                    .post("/supplierPrice/" + modalType.value, submitData)
+                    .then((res) => {
+                      if (res.addSuccess) {
+                        ElMessage({
+                          message: "修改成功",
+                          type: "success",
                         });
-                    })
-                    .catch(() => {
-                      submitLoading.value = false;
+                        getList();
+                        dialogVisible.value = false;
+                        submitLoading.value = false;
+                      }
                     });
-                }
-              },
-              (err) => {
-                submitLoading.value = false;
-              }
-            );
-          } else {
-            formData.data.supplierInfoId = formData.data.supplierInfoIdCopy;
-            formData.data.productInfoId =
-              formData.data.supplierPriceList[0].productInfoId;
-            formData.data.price = formData.data.supplierPriceList[0].price;
-            delete formData.data.supplierPriceList;
-            delete formData.data.supplierInfoIdCopy;
-            proxy.post("/supplierPrice/" + modalType.value, formData.data).then(
-              (res) => {
-                ElMessage({
-                  message: "修改成功",
-                  type: "success",
+                })
+                .catch(() => {
+                  submitLoading.value = false;
                 });
-                getList();
-                dialogVisible.value = false;
-                submitLoading.value = false;
-              },
-              (err) => {
-                submitLoading.value = false;
-              }
-            );
+            }
+          },
+          (err) => {
+            submitLoading.value = false;
           }
-        }
-      });
+        );
+      } else {
+        formData.data.supplierInfoId = formData.data.supplierInfoIdCopy;
+        formData.data.productInfoId =
+          formData.data.supplierPriceList[0].productInfoId;
+        // formData.data.price = formData.data.supplierPriceList[0].price;
+        delete formData.data.supplierPriceList;
+        delete formData.data.supplierInfoIdCopy;
+        proxy.post("/supplierPrice/" + modalType.value, formData.data).then(
+          (res) => {
+            ElMessage({
+              message: "修改成功",
+              type: "success",
+            });
+            getList();
+            dialogVisible.value = false;
+            submitLoading.value = false;
+          },
+          (err) => {
+            submitLoading.value = false;
+          }
+        );
+      }
     } else {
       return ElMessage({
         message: "请添加供应明细!",
@@ -419,7 +438,6 @@ const submitForm = () => {
 
 const getDtl = (row) => {
   modalType.value = "edit";
-  formConfig[0].disabled = true;
   dialogVisible.value = true;
   formData.data = {
     id: row.id,
@@ -431,10 +449,14 @@ const getDtl = (row) => {
         name: row.productName,
         code: row.productCode,
         unit: row.productUnit,
-        spec: row.productSpec,
         price: row.price,
       },
     ],
+    productInfoId: row.productInfoId,
+    name: row.productName,
+    code: row.productCode,
+    unit: row.productUnit,
+    price: row.price,
   };
 };
 
@@ -512,6 +534,18 @@ const pushGoods = (goods) => {
 };
 
 getList();
+
+const getDict = () => {
+  proxy
+    .post("/supplierInfo/page", {
+      pageNum: 1,
+      pageSize: 9999,
+    })
+    .then((res) => {
+      supplierData.value = res.rows;
+    });
+};
+getDict();
 const acquireSelectList = () => {
   let data = [];
   if (