Kaynağa Gözat

出入库流水增加修正操作数量功能

cz 1 yıl önce
ebeveyn
işleme
25c3cfa662
4 değiştirilmiş dosya ile 140 ekleme ve 13 silme
  1. 1 1
      .env.development
  2. 1 1
      .env.production
  3. 1 1
      .env.staging
  4. 137 10
      src/views/WDLY/outInBound/record/index.vue

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = ByteSailing
+VITE_APP_TITLE = '维多利亚'
 
 # 开发环境配置
 VITE_APP_ENV = 'development'

+ 1 - 1
.env.production

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = ByteSailing
+VITE_APP_TITLE = '维多利亚'
 
 # 生产环境配置
 VITE_APP_ENV = 'production'

+ 1 - 1
.env.staging

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = ByteSailing
+VITE_APP_TITLE = '维多利亚'
 
 # 生产环境配置
 VITE_APP_ENV = 'staging'

+ 137 - 10
src/views/WDLY/outInBound/record/index.vue

@@ -8,14 +8,13 @@
         :loading="loading"
         :selectConfig="selectConfig"
         highlight-current-row
-        :action-list="[
-          {
-            text: '导出Excel',
-            action: () => deriveExcel(),
-          },
-        ]"
+        :action-list="[]"
         @get-list="getList"
       >
+        <!-- {
+            text: '导出Excel',
+            action: () => deriveExcel(),
+          }, -->
         <template #warehouseName="{ item }">
           <div>
             <!-- <span v-if="item.opType == 1">{{ item.toWarehouseName }}</span>
@@ -25,12 +24,41 @@
         </template>
       </byTable>
     </div>
+
+    <el-dialog
+      :title="'修正数量'"
+      v-model="dialogVisible"
+      width="500"
+      destroy-on-close
+    >
+      <byForm
+        v-loading="submitLoading"
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
-import { computed, ref } from "vue";
+import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
 
 const { proxy } = getCurrentInstance();
 const route = useRoute();
@@ -152,7 +180,7 @@ const config = computed(() => {
       attrs: {
         label: "操作类型",
         prop: "opType",
-        width: 140,
+        width: 100,
       },
       render(type) {
         return proxy.dictValueLabel(type, opTypeList.value);
@@ -166,9 +194,21 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "物流单号",
+        prop: "logisticsCode",
+      },
+    },
+    {
+      attrs: {
+        label: "物流/快递公司",
+        prop: "logisticsCompanyName",
+      },
+    },
+    {
+      attrs: {
         label: "出入库类型",
         prop: "type",
-        width: 140,
+        width: 120,
       },
       render(type) {
         return proxy.dictValueLabel(type, typeList.value);
@@ -202,6 +242,7 @@ const config = computed(() => {
       attrs: {
         label: "单位",
         prop: "productUnit",
+        width: 100,
       },
       render(unit) {
         return proxy.dictValueLabel(unit, productUnit.value);
@@ -211,19 +252,46 @@ const config = computed(() => {
       attrs: {
         label: "操作数量",
         prop: "quantity",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "操作人",
         prop: "opUserName",
+        width: 120,
       },
     },
     {
       attrs: {
         label: "操作时间",
         prop: "createTime",
-        width: 155,
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "80",
+        align: "center",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          row.type == "18"
+            ? {
+                attrs: {
+                  label: "修正",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              }
+            : {},
+        ];
       },
     },
   ];
@@ -270,6 +338,65 @@ onMounted(() => {
 const deriveExcel = () => {
   console.log("deriveExcel");
 };
+const dialogVisible = ref(false);
+const submitLoading = ref(false);
+const formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const formConfig = reactive([
+  {
+    type: "input",
+    label: "原来数量",
+    prop: "oldQuantity",
+    disabled: true,
+    itemWidth: 50,
+  },
+  {
+    type: "number",
+    label: "修正数量",
+    prop: "quantity",
+    precision: 0,
+    min: 0,
+    controls: false,
+    itemWidth: 50,
+  },
+]);
+const rules = ref({
+  quantity: [{ required: true, message: "请输入修正数量", trigger: "blur" }],
+});
+const getDtl = (row) => {
+  formData.data = {
+    id: row.id,
+    oldQuantity: row.quantity || "0",
+    quantity: null,
+  };
+  dialogVisible.value = true;
+};
+
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/stockJournalDetails/editQuantity", formData.data).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
 </script>
 
 <style lang="scss" scoped>