guoyujia 2 hafta önce
ebeveyn
işleme
ee94eb27e7

+ 46 - 0
src/api/business/taksStockLot.js

@@ -20,6 +20,38 @@ export function getOutsourceInfo(query) {
     params: query
   })
 }
+export function getNotInboundInfo(query) {
+  return request({
+    url: baseUrl + '/business/taksStockLot/getNotInboundInfo',
+    method: 'get',
+    params: query
+  })
+}
+export function getAnyInboundInfo(query) {
+  return request({
+    url: baseUrl + '/business/taksStockLot/getAnyInboundInfo',
+    method: 'get',
+    params: query
+  })
+}
+export function notInboundExport(data) {
+  download(
+    baseUrl + "/business/taksStockLot/notInboundExport",
+    {
+      ...data,
+    },
+    `未入库盘点_${new Date().getTime()}.xlsx`
+  )
+}
+export function anyInboundExport(data) {
+  download(
+    baseUrl + "/business/taksStockLot/anyInboundExport",
+    {
+      ...data,
+    },
+    `部分入库盘点_${new Date().getTime()}.xlsx`
+  )
+}
 
 // 查询盘点批次信息详细
 export function getTaksStockLot(id) {
@@ -96,6 +128,20 @@ export function saveOutsourceInfo(data) {
     data: data
   })
 }
+export function saveNotInboundInfo(data) {
+  return request({
+    url: baseUrl + '/business/taksStockLot/saveNotInboundInfo',
+    method: 'post',
+    data: data
+  })
+}
+export function saveAnyInboundInfo(data) {
+  return request({
+    url: baseUrl + '/business/taksStockLot/saveAnyInboundInfo',
+    method: 'post',
+    data: data
+  })
+}
 
 
 

+ 1 - 0
src/permission.js

@@ -19,6 +19,7 @@ router.beforeEach((to, from, next) => {
   if (getToken()) {
     to.meta.title && useSettingsStore().setTitle(to.meta.title)
     useSettingsStore().initGenLotBySub()
+    useSettingsStore().initPullSource()
     useSettingsStore().initShowMessage()
     useSettingsStore().initShowNotification()
     /* has token*/

+ 7 - 0
src/store/modules/settings.js

@@ -20,6 +20,7 @@ const useSettingsStore = defineStore(
       sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo,
       dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle,
       genLotBySub: false,
+      dataSource:false,
       showMessage: false,
       showNotification: false,
       closeNotification: false
@@ -46,6 +47,12 @@ const useSettingsStore = defineStore(
           this.genLotBySub = res.msg == 'true'
         })
       },
+      initPullSource(config) {
+        getConfigKey('switch_data_source').then(res => {
+          // console.log(res)
+          this.dataSource = res.msg == 'true'
+        })
+      },
       initShowMessage(config) {
         getConfigKey('business.sys.message').then(res => {
           // console.log(res)

+ 6 - 2
src/utils/request.js

@@ -226,14 +226,18 @@ export function download(url, params, filename, config) {
         const resText = await data.text()
         const rspObj = JSON.parse(resText)
         const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
-        ElMessage.error(errMsg)
+        if (errMsg) {
+          ElMessage.error(errMsg)
+        }
         downloadLoadingInstance.close()
         return Promise.reject(new Error(errMsg))
       }
     })
     .catch((r) => {
       console.error(r)
-      ElMessage.error('下载文件出现错误,请联系管理员!')
+      if (!r.message) {
+        ElMessage.error('下载文件出现错误,请联系管理员!')
+      }
       downloadLoadingInstance.close()
       return Promise.reject(r)
     })

+ 297 - 0
src/views/business/inventoryCheck/anyInboundCheckForm.vue

@@ -0,0 +1,297 @@
+<template>
+  <el-drawer
+    title="部分入库盘点"
+    :with-header="false"
+    v-model="visible"
+    direction="rtl"
+    size="100%"
+  >
+    <div class="form-container column-container">
+      <div class="form-btns-container">
+        <span class="title-label">
+          <el-icon>
+            <Document />
+          </el-icon>
+          <span>部分入库盘点</span>
+        </span>
+        <div class="close-btn" @click="cancel">
+          <i class="fa fa-times" aria-hidden="true" />
+          <!-- <span>关闭</span> -->
+        </div>
+      </div>
+      <el-form
+        class="list-search-container"
+        :model="queryTaksParams"
+        ref="queryRef"
+        :inline="true"
+        style="margin-right: 0px"
+      >
+        <!-- style="float: inline-end" -->
+        <!-- && dataList.length > 0 -->
+        <el-form-item label="入库单号:">
+          <el-input
+            placeholder="请输入入库单号"
+            v-model.trim="queryTaksParams.inboundNumber"
+            @keydown.enter.prevent
+            clearable
+            style="width: 130px"
+          />
+          </el-form-item>
+          <el-form-item label="批次号:">
+          <el-input
+            placeholder="请输入批次号"
+            v-model.trim="queryTaksParams.lotCode"
+            @keydown.enter.prevent
+            clearable
+            style="width: 130px"
+          />
+        </el-form-item>
+
+        <el-form-item label="包装箱号:">
+          <el-input
+            placeholder="请输入包装箱号"
+            v-model.trim="queryTaksParams.barcode"
+            @keydown.enter.prevent
+            clearable
+            style="width: 130px"
+          />
+        </el-form-item>
+
+        <el-form-item style="margin-left: 0">
+          <el-button type="info" icon="Search" @click="getList"
+            >搜索
+          </el-button>
+          <el-button
+            type="primary"
+            style="background-color: #409eff"
+            v-if="!loading"
+            @click="handleInventory"
+            >一键盘点
+          </el-button>
+          <el-button
+            type="warning"
+            @click="handleExport"
+            >导出
+          </el-button>
+        </el-form-item>
+      </el-form>
+      <div class="el-table-container">
+        <div class="el-table-inner-container">
+          <el-table
+            ref="tableRef"
+            v-loading="loading"
+            :data="dataList"
+            size="small"
+            border
+            height="100%"
+          >
+            <!-- <el-table-column type="selection" width="48" align="center" /> -->
+            <el-table-column
+              label="行号"
+              type="index"
+              align="center"
+              width="48"
+            />
+            <el-table-column
+              label="入库单号"
+              prop="inboundNumber"
+              align="center"
+              width="120px"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="lotCode"
+              align="center"
+              width="120px"
+            >
+            </el-table-column>
+            <el-table-column
+              label="产品描述"
+              align="center"
+              prop="productDescription"
+              width="280px"
+            />
+            <el-table-column
+              label="投入数"
+              align="center"
+              prop="prodNum"
+              width="80"
+            />
+            <el-table-column
+              label="盘点数量"
+              align="center"
+              prop="taksStockNum"
+              width="100"
+            >
+            </el-table-column>
+            <el-table-column
+              label="包装箱"
+              align="center"
+              prop="barcodes"
+            >
+            </el-table-column>
+            <el-table-column label="标识" width="300" align="center">
+              <template #default="scope">
+                <el-tag
+                  v-if="scope.row.isWaste == 1"
+                  class="spacing"
+                  type="danger"
+                  >{{ "批废" }}</el-tag
+                >
+                <el-tag
+                  v-if="scope.row.isAmend == 1"
+                  class="spacing"
+                  type="danger"
+                  >{{ "工艺修改" }}</el-tag
+                >
+                <el-tag
+                  v-if="scope.row.isWasteRecycling == 1"
+                  class="spacing"
+                  type="primary"
+                  >{{ "废品回用" }}</el-tag
+                >
+                <el-tag
+                  v-if="scope.row.fromLotId != 0"
+                  class="spacing"
+                  type="warning"
+                  >{{ "分批" }}</el-tag
+                >
+                <el-tag
+                  v-if="scope.row.isSuperaddition == 1"
+                  class="spacing"
+                  type="info"
+                  >{{ "追增" }}</el-tag
+                >
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="盘点状态"
+              prop="isTaksStock"
+              width="200"
+              align="center"
+            >
+              <template #default="scope">
+                <dict-tag
+                  :options="is_taks_stock"
+                  :value="scope.row.isTaksStock"
+                />
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <!-- 分页 -->
+      <paginationMax
+        v-show="total > 0"
+        :total="total"
+        v-model:page="queryTaksParams.pageNum"
+        v-model:limit="queryTaksParams.pageSize"
+        @pagination="getList"
+      />
+    </div>
+  </el-drawer>
+</template>
+<script setup>
+import {
+  getAnyInboundInfo,
+  saveAnyInboundInfo,
+  anyInboundExport
+} from "@/api/business/taksStockLot";
+import { ref } from "vue";
+const emit = defineEmits(["handleSaveSuccess"]);
+const { proxy } = getCurrentInstance();
+/** 字典 */
+const { is_taks_stock } = proxy.useDict("is_taks_stock");
+/** 表单抽屉 页变量 */
+const loading = ref(false);
+const visible = ref(false);
+const detailInfo = ref({});
+const dataList = ref([]);
+const total = ref(0);
+const tableRef = ref(null);
+/** 查询对象 */
+const queryTaksParams = ref({
+  pageNum: 1,
+  pageSize: 50,
+  lotCode: null,
+  inboundNumber:null,
+  barcode: null,
+});
+
+/****************************  方法区  ****************************/
+/** 打开抽屉 */
+const open = (row) => {
+  visible.value = true;
+  detailInfo.value = proxy.deepClone(row);
+  reset();
+  getList();
+};
+
+//一键盘点
+function handleInventory() {
+
+  //弹出确认框,确认用户是否确认盘点
+  proxy.$modal
+  .confirm("是否确认一键盘点,将会盘点所有部分入库的批次?")
+    .then(() => {
+      loading.value = true;
+      saveAnyInboundInfo({ takeStockPeriodId: detailInfo.value.id }).then(
+        (res) => {
+          if (res.code == 200) {
+            proxy.$modal.msgSuccess("操作成功");
+            loading.value = false;
+            reset();
+            getList();
+          } else {
+            proxy.$modal.msgError("操作失败");
+          }
+          loading.value = false;
+        }
+      );
+    })
+}
+
+function getList() {
+  loading.value = true;
+
+  console.log("盘点明细", detailInfo.value);
+  queryTaksParams.value.takeStockPeriodId = detailInfo.value.id;
+  getAnyInboundInfo(queryTaksParams.value).then((res) => {
+    if (res.code == 200) {
+      dataList.value = res.rows;
+      total.value = res.total;
+      loading.value = false;
+    }
+  });
+}
+function handleExport() {
+  anyInboundExport({ takeStockPeriodId: detailInfo.value.id })
+}
+/** 取消按钮 */
+const cancel = () => {
+  visible.value = false;
+  reset();
+};
+
+/** 表单重置 */
+const reset = () => {
+  queryTaksParams.value = ({
+  pageNum: 1,
+  pageSize: 50,
+  lotCode: null,
+  inboundNumber:null,
+  barcode: null,
+});
+};
+
+/** 暴露给父组件的方法 */
+defineExpose({
+  open,
+});
+</script>
+<style scoped>
+.el-message-box {
+  max-width: none !important;
+  width: 420px;
+}
+</style>

+ 24 - 0
src/views/business/inventoryCheck/form.vue

@@ -142,6 +142,20 @@
             v-hasPermi="['business:inventoryCheck:notRetrievalCheck']"
             >导出零存库未领取批次
           </el-button>
+          <el-button
+            type="primary"
+            icon="List"
+              v-hasPermi="['business:inventoryCheck:notInboundCheck']"
+            @click="handleNotInboundCheckFrom"
+            >未入库盘点
+            </el-button>
+            <el-button
+            type="primary"
+            icon="List"
+              v-hasPermi="['business:inventoryCheck:anyInboundCheck']"
+            @click="handleAnyInboundCheckFrom"
+            >部分入库盘点
+            </el-button>
         </el-form-item>
       </el-form>
       <div class="el-table-container">
@@ -378,6 +392,8 @@
     <OutsourceCheckDialog ref="outsourceCheckDialogRef" />
     <taksForm ref="taksFormRef" @handleSaveSuccess="getList" />
     <OutsourceCheckFom ref="outsourceCheckFom" @handleSaveSuccess="getList" />
+    <NotInboundCheckForm ref="notInboundCheckForm"  />
+    <AnyInboundCheckForm ref="anyInboundCheckForm" />
   </el-drawer>
 </template>
 <script setup>
@@ -395,6 +411,8 @@ import { ref } from "vue";
 import router from "@/router";
 import OutsourceCheckDialog from "./OutsourceCheckDialog.vue";
 import OutsourceCheckFom from "./OutsourceCheckFom.vue";
+import NotInboundCheckForm from "./notInboundCheckForm.vue";
+import AnyInboundCheckForm from "./anyInboundCheckForm.vue";
 const { proxy } = getCurrentInstance();
 /** 字典 */
 const { is_identification } = proxy.useDict("is_identification");
@@ -482,6 +500,12 @@ function handleEdit(row, index) {
 function outsourceCheckFrom() {
   proxy.$refs.outsourceCheckFom.open(detailInfo.value);
 }
+function handleNotInboundCheckFrom(){
+  proxy.$refs.notInboundCheckForm.open(detailInfo.value);
+}
+function handleAnyInboundCheckFrom(){
+  proxy.$refs.anyInboundCheckForm.open(detailInfo.value);
+}
 function handleTaksLot() {
   getProductionPlanDetail(queryParams.value).then((res) => {
     if (res.data.length > 0) {

+ 280 - 0
src/views/business/inventoryCheck/notInboundCheckForm.vue

@@ -0,0 +1,280 @@
+<template>
+  <el-drawer
+    title="未入库盘点"
+    :with-header="false"
+    v-model="visible"
+    direction="rtl"
+    size="100%"
+  >
+    <div class="form-container column-container">
+      <div class="form-btns-container">
+        <span class="title-label">
+          <el-icon>
+            <Document />
+          </el-icon>
+          <span>未入库盘点</span>
+        </span>
+        <div class="close-btn" @click="cancel">
+          <i class="fa fa-times" aria-hidden="true" />
+          <!-- <span>关闭</span> -->
+        </div>
+      </div>
+      <el-form
+        class="list-search-container"
+        :model="queryTaksParams"
+        ref="queryRef"
+        :inline="true"
+        style="margin-right: 0px"
+      >
+        <!-- style="float: inline-end" -->
+        <!-- && dataList.length > 0 -->
+        <el-form-item label="批次号:">
+          <el-input
+            placeholder="请输入批次号"
+            v-model.trim="queryTaksParams.lotCode"
+            @keydown.enter.prevent
+            clearable
+            style="width: 130px"
+          />
+        </el-form-item>
+
+        <el-form-item label="包装箱号:">
+          <el-input
+            placeholder="请输入包装箱号"
+            v-model.trim="queryTaksParams.barcode"
+            @keydown.enter.prevent
+            clearable
+            style="width: 130px"
+          />
+        </el-form-item>
+
+        <el-form-item style="margin-left: 0">
+          <el-button type="info" icon="Search" @click="getList"
+            >搜索
+          </el-button>
+          <el-button
+            type="primary"
+            style="background-color: #409eff"
+            v-if="!loading"
+            @click="handleInventory"
+            >一键盘点
+          </el-button>
+          <el-button
+            type="warning"
+            @click="handleExport"
+            >导出
+          </el-button>
+        </el-form-item>
+      </el-form>
+      <div class="el-table-container">
+        <div class="el-table-inner-container">
+          <el-table
+            ref="tableRef"
+            v-loading="loading"
+            :data="dataList"
+            size="small"
+            border
+            height="100%"
+          >
+            <!-- <el-table-column type="selection" width="48" align="center" /> -->
+            <el-table-column
+              label="行号"
+              type="index"
+              align="center"
+              width="48"
+            />
+            <el-table-column
+              label="批次号"
+              prop="lotCode"
+              align="center"
+              width="120px"
+            >
+            </el-table-column>
+            <el-table-column
+              label="产品描述"
+              align="center"
+              prop="productDescription"
+              width="280px"
+            />
+            <el-table-column
+              label="投入数"
+              align="center"
+              prop="prodNum"
+              width="80"
+            />
+            <el-table-column
+              label="盘点数量"
+              align="center"
+              prop="taksStockNum"
+              width="100"
+            >
+            </el-table-column>
+            <el-table-column
+              label="包装箱"
+              align="center"
+              prop="barcodes"
+            >
+            </el-table-column>
+            <el-table-column label="标识" width="300" align="center">
+              <template #default="scope">
+                <el-tag
+                  v-if="scope.row.isWaste == 1"
+                  class="spacing"
+                  type="danger"
+                  >{{ "批废" }}</el-tag
+                >
+                <el-tag
+                  v-if="scope.row.isAmend == 1"
+                  class="spacing"
+                  type="danger"
+                  >{{ "工艺修改" }}</el-tag
+                >
+                <el-tag
+                  v-if="scope.row.isWasteRecycling == 1"
+                  class="spacing"
+                  type="primary"
+                  >{{ "废品回用" }}</el-tag
+                >
+                <el-tag
+                  v-if="scope.row.fromLotId != 0"
+                  class="spacing"
+                  type="warning"
+                  >{{ "分批" }}</el-tag
+                >
+                <el-tag
+                  v-if="scope.row.isSuperaddition == 1"
+                  class="spacing"
+                  type="info"
+                  >{{ "追增" }}</el-tag
+                >
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="盘点状态"
+              prop="isTaksStock"
+              width="200"
+              align="center"
+            >
+              <template #default="scope">
+                <dict-tag
+                  :options="is_taks_stock"
+                  :value="scope.row.isTaksStock"
+                />
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <!-- 分页 -->
+      <paginationMax
+        v-show="total > 0"
+        :total="total"
+        v-model:page="queryTaksParams.pageNum"
+        v-model:limit="queryTaksParams.pageSize"
+        @pagination="getList"
+      />
+    </div>
+  </el-drawer>
+</template>
+<script setup>
+import {
+  getNotInboundInfo,
+  saveNotInboundInfo,
+  notInboundExport
+} from "@/api/business/taksStockLot";
+import { ref } from "vue";
+const emit = defineEmits(["handleSaveSuccess"]);
+const { proxy } = getCurrentInstance();
+/** 字典 */
+const { is_taks_stock } = proxy.useDict("is_taks_stock");
+/** 表单抽屉 页变量 */
+const loading = ref(false);
+const visible = ref(false);
+const detailInfo = ref({});
+const dataList = ref([]);
+const total = ref(0);
+const tableRef = ref(null);
+/** 查询对象 */
+const queryTaksParams = ref({
+  pageNum: 1,
+  pageSize: 50,
+  lotCode: null,
+  barcode: null,
+});
+
+/****************************  方法区  ****************************/
+/** 打开抽屉 */
+const open = (row) => {
+  visible.value = true;
+  detailInfo.value = proxy.deepClone(row);
+  reset();
+  getList();
+};
+
+//一键盘点
+function handleInventory() {
+
+  //弹出确认框,确认用户是否确认盘点
+  proxy.$modal
+  .confirm("是否确认一键盘点,将会盘点所有未入库的批次?")
+    .then(() => {
+      loading.value = true;
+      saveNotInboundInfo({ takeStockPeriodId: detailInfo.value.id }).then(
+        (res) => {
+          if (res.code == 200) {
+            proxy.$modal.msgSuccess("操作成功");
+            loading.value = false;
+            reset();
+            getList();
+          } else {
+            proxy.$modal.msgError("操作失败");
+          }
+          loading.value = false;
+        }
+      );
+    })
+}
+
+function getList() {
+  loading.value = true;
+
+  console.log("盘点明细", detailInfo.value);
+  queryTaksParams.value.takeStockPeriodId = detailInfo.value.id;
+  getNotInboundInfo(queryTaksParams.value).then((res) => {
+    if (res.code == 200) {
+      dataList.value = res.rows;
+      total.value = res.total;
+      loading.value = false;
+    }
+  });
+}
+function handleExport() {
+  notInboundExport({ takeStockPeriodId: detailInfo.value.id })
+}
+/** 取消按钮 */
+const cancel = () => {
+  visible.value = false;
+  reset();
+};
+
+/** 表单重置 */
+const reset = () => {
+  queryTaksParams.value = ({
+  pageNum: 1,
+  pageSize: 50,
+  lotCode: null,
+  barcode: null,
+});
+};
+
+/** 暴露给父组件的方法 */
+defineExpose({
+  open,
+});
+</script>
+<style scoped>
+.el-message-box {
+  max-width: none !important;
+  width: 420px;
+}
+</style>