Browse Source

0.6部分需求

cz 1 year ago
parent
commit
2e364fe63a

+ 29 - 1
src/components/process/SendPurchase.vue

@@ -27,12 +27,13 @@
               v-model="formData.data.purchaseTime"
               type="datetime"
               placeholder="请选择"
+              style="width: 100%"
             />
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="10">
-        <el-col :span="8">
+        <el-col :span="6">
           <el-form-item label="供应商" prop="supplyId">
             <el-select
               v-model="formData.data.supplyId"
@@ -50,6 +51,33 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="发票类型" prop="supplyId">
+            <el-select
+              v-model="formData.data.supplyId"
+              placeholder="请选择"
+              @change="handleChangeSupplier"
+              filterable
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in supplierData"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="税率" prop="supplyId">
+            <el-input v-model="formData.data.aa">
+              <template #suffix>
+                <div>%</div>
+              </template>
+            </el-input>
+          </el-form-item>
+        </el-col>
       </el-row>
       <el-form-item label="采购说明" prop="purchaseContent">
         <el-input

+ 186 - 53
src/views/purchaseManage/purchaseManage/handoverSlip/index.vue

@@ -23,7 +23,8 @@
           action: () => start(),
         },
       ]"
-      @get-list="getList">
+      @get-list="getList"
+    >
       <template #claimTime="{ item }">
         <div>
           <span v-if="item.claimTime">{{ item.claimTime }}</span>
@@ -51,8 +52,12 @@
       </template>
       <template #btn="{ item }">
         <div v-if="item.expendQuantity > 0">
-          <el-button type="primary" link @click="start(10, item)">采购</el-button>
-          <el-button type="primary" link @click="transferToProduction(item)">转生产</el-button>
+          <el-button type="primary" link @click="start(10, item)"
+            >采购</el-button
+          >
+          <el-button type="primary" link @click="transferToProduction(item)"
+            >转生产</el-button
+          >
         </div>
         <div v-else-if="item.expendQuantity == 0">
           <el-button type="primary" link @click="handleFollow(item)"
@@ -63,26 +68,83 @@
           >
         </div>
         <div v-else>
-          <el-button type="primary" link style="color: #f54a45" @click="handleFollow(item)">跟进</el-button>
-          <el-button type="primary" link style="color: #f54a45" @click="lookRecords(item)">跟进记录</el-button>
+          <el-button
+            type="primary"
+            link
+            style="color: #f54a45"
+            @click="handleFollow(item)"
+            >跟进</el-button
+          >
+          <el-button
+            type="primary"
+            link
+            style="color: #f54a45"
+            @click="lookRecords(item)"
+            >跟进记录</el-button
+          >
         </div>
       </template>
     </byTable>
 
-    <el-dialog title="转生产" v-if="dialogVisible" v-model="dialogVisible" width="1200" v-loading="loadingDialog">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+    <el-dialog
+      title="转生产"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="1200"
+      v-loading="loadingDialog"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="submit"
+      >
         <template #details>
           <div style="width: 100%">
-            <el-table :data="formData.data.list" style="width: 100%; margin-top: 16px">
-              <el-table-column prop="productCode" label="物品编码" width="140" />
-              <el-table-column prop="productName" label="物品名称" min-width="220" />
-              <el-table-column prop="productUnit" label="单位" width="100" :formatter="(row) => dictValueLabel(row.productUnit, productUnit)" />
-              <el-table-column prop="expendQuantity" label="待处理数量" width="120" />
+            <el-table
+              :data="formData.data.list"
+              style="width: 100%; margin-top: 16px"
+            >
+              <el-table-column
+                prop="productCode"
+                label="物品编码"
+                width="140"
+              />
+              <el-table-column
+                prop="productName"
+                label="物品名称"
+                min-width="220"
+              />
+              <el-table-column
+                prop="productUnit"
+                label="单位"
+                width="100"
+                :formatter="
+                  (row) => dictValueLabel(row.productUnit, productUnit)
+                "
+              />
+              <el-table-column
+                prop="expendQuantity"
+                label="待处理数量"
+                width="120"
+              />
               <el-table-column label="转生产数量" width="160">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
-                      <el-input-number v-model="row.quantity" placeholder="请输入数量" style="width: 100%" :precision="0" :controls="false" :min="0" />
+                    <el-form-item
+                      :prop="'list.' + $index + '.quantity'"
+                      :rules="rules.quantity"
+                      :inline-message="true"
+                    >
+                      <el-input-number
+                        v-model="row.quantity"
+                        placeholder="请输入数量"
+                        style="width: 100%"
+                        :precision="0"
+                        :controls="false"
+                        :min="0"
+                      />
                     </el-form-item>
                   </div>
                 </template>
@@ -90,15 +152,31 @@
               <el-table-column label="完工期限" width="180">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <el-form-item :prop="'list.' + $index + '.time'" :rules="rules.time" :inline-message="true">
-                      <el-date-picker v-model="row.time" type="date" placeholder="请选择" value-format="YYYY-MM-DD" />
+                    <el-form-item
+                      :prop="'list.' + $index + '.time'"
+                      :rules="rules.time"
+                      :inline-message="true"
+                    >
+                      <el-date-picker
+                        v-model="row.time"
+                        type="date"
+                        placeholder="请选择"
+                        value-format="YYYY-MM-DD"
+                      />
                     </el-form-item>
                   </div>
                 </template>
               </el-table-column>
-              <el-table-column align="center" label="操作" width="80" fixed="right">
+              <el-table-column
+                align="center"
+                label="操作"
+                width="80"
+                fixed="right"
+              >
                 <template #default="{ row, $index }">
-                  <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
+                  <el-button type="primary" link @click="handleDelete($index)"
+                    >删除</el-button
+                  >
                 </template>
               </el-table-column>
             </el-table>
@@ -107,21 +185,45 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
-    <el-dialog title="填写跟进" v-if="dialogVisibleOne" v-model="dialogVisibleOne" width="500" v-loading="loadingDialog">
-      <byForm :formConfig="formConfigOne" :formOption="formOption" v-model="formData.dataOne" :rules="rulesOne" ref="submitOne"> </byForm>
+    <el-dialog
+      title="填写跟进"
+      v-if="dialogVisibleOne"
+      v-model="dialogVisibleOne"
+      width="500"
+      v-loading="loadingDialog"
+    >
+      <byForm
+        :formConfig="formConfigOne"
+        :formOption="formOption"
+        v-model="formData.dataOne"
+        :rules="rulesOne"
+        ref="submitOne"
+      >
+      </byForm>
       <template #footer>
-        <el-button @click="dialogVisibleOne = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitFormOne()" size="large">确 定</el-button>
+        <el-button @click="dialogVisibleOne = false" size="large"
+          >取 消</el-button
+        >
+        <el-button type="primary" @click="submitFormOne()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
 
     <el-dialog title="跟进记录" v-model="dialogVisibleTwo" width="500">
       <div style="width: 100%">
         <el-timeline :reverse="false">
-          <el-timeline-item placement="top" v-for="(activity, index) in activities" :key="index" :timestamp="activity.followUpTime">
+          <el-timeline-item
+            placement="top"
+            v-for="(activity, index) in activities"
+            :key="index"
+            :timestamp="activity.followUpTime"
+          >
             <div>
               跟进结果:
               <span>{{ activity.resultType ? "已处理" : "处理中" }}</span>
@@ -132,11 +234,24 @@
       </div>
     </el-dialog>
 
-    <el-dialog title="交接单" v-if="openHandover" v-model="openHandover" width="800">
-      <byForm :formConfig="formHandoverConfig" :formOption="formOption" v-model="productRow.data">
+    <el-dialog
+      title="交接单"
+      v-if="openHandover"
+      v-model="openHandover"
+      width="800"
+    >
+      <byForm
+        :formConfig="formHandoverConfig"
+        :formOption="formOption"
+        v-model="productRow.data"
+      >
         <template #remark>
           <div style="width: 100%">
-            <Editor ref="remarkEditor" :readOnly="true" :value="productRow.data.remark" />
+            <Editor
+              ref="remarkEditor"
+              :readOnly="true"
+              :value="productRow.data.remark"
+            />
           </div>
         </template>
         <template #file>
@@ -145,7 +260,8 @@
               v-model:fileList="productRow.data.fileList"
               action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
               multiple
-              :on-preview="onPreviewFile">
+              :on-preview="onPreviewFile"
+            >
             </el-upload>
           </div>
         </template>
@@ -215,6 +331,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "下单时间",
+        prop: "contractCode",
+        width: "155",
+      },
+    },
+    {
+      attrs: {
         label: "合同到账时间",
         slot: "claimTime",
         width: "155",
@@ -287,16 +410,18 @@ const config = computed(() => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/contractProduct/page", sourceList.value.pagination).then((message) => {
-    sourceList.value.data = message.rows.map((x) => ({
-      ...x,
-      isCheck: true,
-    }));
-    sourceList.value.pagination.total = message.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/contractProduct/page", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        isCheck: true,
+      }));
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 getList();
 const productUnit = ref([]);
@@ -424,8 +549,12 @@ const formConfigOne = computed(() => {
 });
 
 const rulesOne = ref({
-  resultType: [{ required: true, message: "请选择跟进结果", trigger: "change" }],
-  followUpTime: [{ required: true, message: "请选择跟进时间", trigger: "change" }],
+  resultType: [
+    { required: true, message: "请选择跟进结果", trigger: "change" },
+  ],
+  followUpTime: [
+    { required: true, message: "请选择跟进时间", trigger: "change" },
+  ],
   remark: [{ required: true, message: "请输入跟进记录", trigger: "blur" }],
 });
 
@@ -599,19 +728,23 @@ const formHandoverConfig = computed(() => {
 });
 const remarkEditor = ref(null);
 const handleClickDetails = (row) => {
-  proxy.post("/flowProcess/getStartData", { flowId: row.flowId }).then(async (res) => {
-    const current = res.contractProductList.find((x) => x.productId === row.productId);
-    productRow.data = current || {};
-    productRow.data.fileList =
-      current.fileList.map((x) => ({
-        raw: x,
-        name: x.fileName,
-        url: x.fileUrl,
-      })) || [];
-    openHandover.value = true;
-    await nextTick();
-    remarkEditor.value.changeHtml(productRow.data.remark);
-  });
+  proxy
+    .post("/flowProcess/getStartData", { flowId: row.flowId })
+    .then(async (res) => {
+      const current = res.contractProductList.find(
+        (x) => x.productId === row.productId
+      );
+      productRow.data = current || {};
+      productRow.data.fileList =
+        current.fileList.map((x) => ({
+          raw: x,
+          name: x.fileName,
+          url: x.fileUrl,
+        })) || [];
+      openHandover.value = true;
+      await nextTick();
+      remarkEditor.value.changeHtml(productRow.data.remark);
+    });
 };
 const onPreviewFile = (file) => {
   window.open(file.raw.fileUrl, "_blank");

+ 280 - 0
src/views/purchaseSales/stockManage/monthlyReport/index.vue

@@ -0,0 +1,280 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        :selectConfig="selectConfig"
+        highlight-current-row
+        :action-list="[
+          {
+            text: '导出Excel',
+            action: () => deriveExcel(),
+          },
+        ]"
+        @get-list="getList"
+      >
+        <template #warehouseName="{ item }">
+          <div>
+            <!-- <span v-if="item.opType == 1">{{ item.toWarehouseName }}</span>
+            <span v-else>{{ item.warehouseName }}</span> -->
+            <span>{{ item.warehouseName }}</span>
+          </div>
+        </template>
+      </byTable>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { computed, nextTick, ref, toRef } from "vue";
+import byTable from "@/components/byTable/index";
+
+const { proxy } = getCurrentInstance();
+const route = useRoute();
+const opTypeList = ref([
+  {
+    label: "入库",
+    value: "1",
+  },
+  {
+    label: "出库",
+    value: "2",
+  },
+]);
+const typeList = ref([
+  {
+    label: "手动入库",
+    value: "1",
+  },
+  {
+    label: "手动出库",
+    value: "2",
+  },
+  {
+    label: "调仓入库",
+    value: "3",
+  },
+  {
+    label: "待入库入库",
+    value: "4",
+  },
+  {
+    label: "待出库出库",
+    value: "5",
+  },
+  {
+    label: "组合入库",
+    value: "6",
+  },
+  {
+    label: "组合出库",
+    value: "7",
+  },
+  {
+    label: "组合拆分入库",
+    value: "8",
+  },
+  {
+    label: "组合拆分出库",
+    value: "9",
+  },
+  {
+    label: "京东销售出库",
+    value: "10",
+  },
+  {
+    label: "调仓出库",
+    value: "11",
+  },
+  {
+    label: "销售订单出库",
+    value: "12",
+  },
+  {
+    label: "退货出库",
+    value: "13",
+  },
+  {
+    label: "到货入库",
+    value: "14",
+  },
+  {
+    label: "京东退货入库",
+    value: "15",
+  },
+  {
+    label: "采购到货",
+    value: "18",
+  },
+  {
+    label: "到货质检",
+    value: "19",
+  },
+  {
+    label: "生产任务出库",
+    value: "20",
+  },
+]);
+const warehouseList = ref([]);
+const productUnit = ref([]);
+const currencyType = ref([]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    opType: "",
+    productId: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "年份",
+      prop: "opType",
+      data: opTypeList.value,
+    },
+    {
+      label: "月份",
+      prop: "type",
+      data: typeList.value,
+    },
+    {
+      label: "仓库名称",
+      prop: "type",
+      data: warehouseList.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "opType",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
+        label: "物品编码",
+        prop: "type",
+        width: 130,
+      },
+    },
+
+    {
+      attrs: {
+        label: "物品名称",
+        prop: "productName",
+      },
+    },
+    {
+      attrs: {
+        label: "规格型号",
+        prop: "productSpec",
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "productUnit",
+        width: 80,
+      },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
+    },
+    {
+      attrs: {
+        label: "期初数量",
+        prop: "quantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "入库数量",
+        prop: "quantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "出库数量",
+        prop: "quantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "结存数量",
+        prop: "quantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "结存单价",
+        prop: "quantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "结存金额",
+        prop: "quantity",
+        width: 120,
+      },
+    },
+  ];
+});
+const getDict = () => {
+  proxy.post("/warehouse/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      warehouseList.value = res.rows.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+  proxy.getDictOne(["unit"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/stockJournalDetails/page", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+getDict();
+getList();
+const deriveExcel = () => {
+  console.log("deriveExcel");
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>