Sfoglia il codice sorgente

售价体系页面

lxf 1 anno fa
parent
commit
7f43adeb54

+ 179 - 73
src/views/group/BOM/management/index.vue

@@ -44,7 +44,7 @@
             @get-list="getList"
             @clickReset="clickReset">
             <template #typeExpand="{ item }">
-              <div style="padding: 0px 20px; box-sizing: border-box" v-if="item.bomSpecList && item.bomSpecList.length > 0">
+              <div style="box-sizing: border-box" v-if="item.bomSpecList && item.bomSpecList.length > 0">
                 <div
                   v-for="spec in item.bomSpecList"
                   :key="spec.id"
@@ -70,9 +70,31 @@
                   <div style="width: 180px">
                     {{ `${spec.length}  *  ${spec.width}  *  ${spec.height}(cm³)` }}
                   </div>
-                  <div style="width: 60px; text-align: center" v-if="props.selectStatus">
+                  <div style="width: 60px; text-align: center" v-if="props.selectStatus && !props.priceSystemId">
                     <el-button type="text" @click="selectBOM(spec)" :disabled="selectBtnStatus" v-db-click>选择</el-button>
                   </div>
+                  <div style="width: 140px; padding: 0 12px" v-if="props.priceSystemId">
+                    <el-input-number
+                      onmousewheel="return false;"
+                      v-model="spec.internalSellingPrice"
+                      placeholder="对内销售价"
+                      style="width: 100%"
+                      :controls="false"
+                      :min="0"
+                      :precision="2"
+                      @change="changePrice(spec)" />
+                  </div>
+                  <div style="width: 140px; padding: 0 12px" v-if="props.priceSystemId">
+                    <el-input-number
+                      onmousewheel="return false;"
+                      v-model="spec.externalSellingPrice"
+                      placeholder="对外销售价"
+                      style="width: 100%"
+                      :controls="false"
+                      :min="0"
+                      :precision="2"
+                      @change="changePrice(spec)" />
+                  </div>
                 </div>
               </div>
             </template>
@@ -81,6 +103,19 @@
                 <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickName(item)">{{ item.name }}</a>
               </div>
             </template>
+            <template #priceBillingStandardId="{ item }">
+              <div style="width: 100%">
+                <el-select v-model="item.priceBillingStandardId" placeholder="加工报价" clearable @change="changePriceBillingStandard(item)">
+                  <el-option v-for="item in priceBillingStandardList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
+                </el-select>
+              </div>
+            </template>
+            <template #internalSellingPrice>
+              <div style="width: 100%"></div>
+            </template>
+            <template #externalSellingPrice>
+              <div style="width: 100%"></div>
+            </template>
           </byTable>
         </el-card>
       </el-col>
@@ -116,6 +151,7 @@ const props = defineProps({
   selectStatus: Boolean,
   bomClassifyIdList: Array,
   expressStatus: Boolean,
+  priceSystemId: String,
 });
 const filterTree = ref("");
 const treeCategory = ref(null);
@@ -157,6 +193,7 @@ const sourceList = ref({
     colour: "",
     bomClassifyId: "",
     bomClassifyIdList: [],
+    priceSystemId: "",
   },
 });
 const loading = ref(false);
@@ -230,7 +267,7 @@ const config = computed(() => {
       attrs: {
         label: "项目小类",
         prop: "itemSubclass",
-        width: 140,
+        width: 120,
       },
       render(val) {
         return proxy.dictKeyValue(val, proxy.useUserStore().allDict["bom_itemSubclass"]);
@@ -240,7 +277,7 @@ const config = computed(() => {
       attrs: {
         label: "种类",
         prop: "species",
-        width: 140,
+        width: 120,
       },
       render(val) {
         return proxy.dictKeyValue(val, proxy.useUserStore().allDict["bom_species"]);
@@ -256,74 +293,104 @@ const config = computed(() => {
         return proxy.dictKeyValue(val, proxy.useUserStore().allDict["bom_chromatophore"]);
       },
     },
-    {
-      attrs: {
-        label: "压纹工艺",
-        prop: "embossingProcess",
-        width: 140,
-      },
-      render(val) {
-        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["bom_embossingProcess"]);
-      },
-    },
-    {
-      attrs: {
-        label: "正面纹路",
-        prop: "frontGrain",
-        width: 140,
-      },
-      render(val) {
-        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["bom_frontGrain"]);
-      },
-    },
-    {
-      attrs: {
-        label: "背面纹路",
-        prop: "reverseGrain",
-        width: 140,
-      },
-      render(val) {
-        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["bom_reverseGrain"]);
-      },
-    },
-    {
-      attrs: {
-        label: "操作",
-        width: 120,
-        align: "center",
-        fixed: "right",
-      },
-      renderHTML(row) {
-        return [
-          props.selectStatus
-            ? {}
-            : {
-                attrs: {
-                  label: "编辑",
-                  type: "primary",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  clickUpdate(row);
-                },
-              },
-          props.selectStatus
-            ? {}
-            : {
-                attrs: {
-                  label: "删除",
-                  type: "primary",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  clickDelete(row);
-                },
-              },
-        ];
-      },
-    },
+    props.priceSystemId
+      ? {
+          attrs: {
+            label: "加工报价",
+            slot: "priceBillingStandardId",
+            width: 160,
+          },
+        }
+      : {
+          attrs: {
+            label: "压纹工艺",
+            prop: "embossingProcess",
+            width: 120,
+          },
+          render(val) {
+            return proxy.dictKeyValue(val, proxy.useUserStore().allDict["bom_embossingProcess"]);
+          },
+        },
+    props.priceSystemId
+      ? {
+          attrs: {
+            label: "对内销售价(含税)",
+            slot: "internalSellingPrice",
+            width: 140,
+          },
+        }
+      : {
+          attrs: {
+            label: "正面纹路",
+            prop: "frontGrain",
+            width: 120,
+          },
+          render(val) {
+            return proxy.dictKeyValue(val, proxy.useUserStore().allDict["bom_frontGrain"]);
+          },
+        },
+    props.priceSystemId
+      ? {
+          attrs: {
+            label: "对内销售价(含税)",
+            slot: "externalSellingPrice",
+            width: 140,
+          },
+        }
+      : {
+          attrs: {
+            label: "背面纹路",
+            prop: "reverseGrain",
+            width: 120,
+          },
+          render(val) {
+            return proxy.dictKeyValue(val, proxy.useUserStore().allDict["bom_reverseGrain"]);
+          },
+        },
+    props.priceSystemId
+      ? {
+          attrs: {
+            width: 16,
+          },
+        }
+      : {
+          attrs: {
+            label: "操作",
+            width: 120,
+            align: "center",
+            fixed: "right",
+          },
+          renderHTML(row) {
+            return [
+              props.selectStatus
+                ? {}
+                : {
+                    attrs: {
+                      label: "编辑",
+                      type: "primary",
+                      text: true,
+                    },
+                    el: "button",
+                    click() {
+                      clickUpdate(row);
+                    },
+                  },
+              props.selectStatus
+                ? {}
+                : {
+                    attrs: {
+                      label: "删除",
+                      type: "primary",
+                      text: true,
+                    },
+                    el: "button",
+                    click() {
+                      clickDelete(row);
+                    },
+                  },
+            ];
+          },
+        },
   ];
 });
 const getList = async (req, status) => {
@@ -342,7 +409,12 @@ const getList = async (req, status) => {
     sourceList.value.pagination.bomClassifyId = "1682221528948760578";
   }
   loading.value = true;
-  proxy.post("/bom/page", sourceList.value.pagination).then((res) => {
+  let path = "/bom/page";
+  if (props.priceSystemId) {
+    path = "/priceSystem/getBomPriceDetail";
+    sourceList.value.pagination.priceSystemId = props.priceSystemId;
+  }
+  proxy.post(path, sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
@@ -476,6 +548,40 @@ const selectBOM = (item) => {
     selectBtnStatus.value = false;
   }, 200);
 };
+const priceBillingStandardList = ref([]);
+const getPriceBillingStandard = () => {
+  proxy.post("/priceBillingStandard/list", {}).then((res) => {
+    if (res && res.length > 0) {
+      priceBillingStandardList.value = res.map((item) => {
+        return {
+          dictKey: item.id,
+          dictValue: item.name,
+        };
+      });
+    }
+  });
+};
+if (props.priceSystemId) {
+  getPriceBillingStandard();
+}
+const changePriceBillingStandard = (row) => {
+  let data = {
+    priceSystemId: props.priceSystemId,
+    bomId: row.id,
+    priceBillingStandardId: row.priceBillingStandardId,
+  };
+  proxy.post("/priceSystemBom/saveOrEdit", data).then();
+};
+const changePrice = (row) => {
+  
+  let data = {
+    priceSystemId: props.priceSystemId,
+    bomSpecId: row.id,
+    internalSellingPrice: row.internalSellingPrice,
+    externalSellingPrice: row.externalSellingPrice,
+  };
+  proxy.post("/priceSystemBomSpec/saveOrEdit", data).then();
+}
 </script>
 
 <style lang="scss" scoped>

+ 20 - 5
src/views/group/selling-price/price-system/index.vue

@@ -19,13 +19,20 @@
       </byTable>
     </el-card>
 
-    <el-dialog :title="modalType == 'add' ? '添加售价体系' : '编辑售价体系'" v-if="openDialog" v-model="openDialog" width="900">
+    <el-dialog :title="modalType == 'add' ? '添加售价体系' : '编辑售价体系'" v-if="openDialog" v-model="openDialog" width="600">
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit"> </byForm>
       <template #footer>
         <el-button @click="openDialog = false" size="large">取 消</el-button>
         <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="售价配置" v-if="openDisposition" v-model="openDisposition" width="96%">
+      <SelectBOM :selectStatus="true" :priceSystemId="priceSystemId"></SelectBOM>
+      <template #footer>
+        <el-button @click="openDisposition = false" size="large">关 闭</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -33,6 +40,7 @@
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { ElMessage, ElMessageBox } from "element-plus";
+import SelectBOM from "@/views/group/BOM/management/index";
 
 const { proxy } = getCurrentInstance();
 const sourceList = ref({
@@ -87,7 +95,7 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              clickUpdate(row);
+              clickDisposition(row);
             },
           },
           {
@@ -144,7 +152,7 @@ const openDialog = ref(false);
 const submit = ref(null);
 const formOption = reactive({
   inline: true,
-  labelWidth: "120px",
+  labelWidth: "100px",
   itemWidth: 100,
   rules: [],
   labelPosition: "right",
@@ -198,6 +206,12 @@ const submitForm = () => {
     );
   });
 };
+const openDisposition = ref(false);
+const priceSystemId = ref("");
+const clickDisposition = (row) => {
+  priceSystemId.value = row.id;
+  openDisposition.value = true;
+};
 const clickUpdate = (row) => {
   modalType.value = "edit";
   formData.data = row;
@@ -219,7 +233,8 @@ const clickDelete = (row) => {
 </script>
 
 <style lang="scss" scoped>
-::v-deep(.el-input-number .el-input__inner) {
-  text-align: left;
+:deep(.el-dialog) {
+  margin-top: 10px !important;
+  margin-bottom: 10px !important;
 }
 </style>