guoyujia 1 년 전
부모
커밋
90cfc5efb4
2개의 변경된 파일206개의 추가작업 그리고 115개의 파일을 삭제
  1. 6 0
      src/api/business/planDetailSubDetail.js
  2. 200 115
      src/views/business/reportPlan/index.vue

+ 6 - 0
src/api/business/planDetailSubDetail.js

@@ -35,6 +35,12 @@ export function getDept() {
     method: 'get'
   })
 }
+export function getDeptList() {
+  return request({
+    url: baseUrl + '/business/planDetailSubDetail/getDeptList',
+    method: 'get'
+  })
+}
 
 // 新增生产子计划明细
 export function savePlanDetailSubDetail(data) {

+ 200 - 115
src/views/business/reportPlan/index.vue

@@ -1,136 +1,221 @@
 <template>
     <div class="page-container column-container">
-        <section class="list-part-container column-container" style="flex: 1">
-            <!-- 搜索区 -->
-            <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
-                <el-form-item class="section-title" label="生产计划" />
-                <el-form-item label="生产计划单号:">
-                    <el-input placeholder="请输入生产计划单号" v-model.trim="queryParams.productionPlanNo"
-                        @keyup.enter="handleQueryProductionPlanDetail" @keydown.enter.prevent clearable
-                        style="width: 200px" />
-                </el-form-item>
-                <el-form-item label="产品描述:">
-                    <el-input placeholder="请输入产品描述" v-model.trim="queryParams.keywords"
-                        @keyup.enter="handleQueryProductionPlanDetail" @keydown.enter.prevent clearable
-                        style="width: 200px" />
-                </el-form-item>
-                <el-form-item class="section-title" label="请选择当前工段:">
-                    <el-select-v2 v-model="queryParams.deptId" filterable :options="deptList" placeholder="请选择工段"
-                        style="width: 100%" @change="handleDeptChange" />
-                </el-form-item>
-                <el-form-item>
-                    <el-button type="info" icon="Search" @click="handleQueryProductionPlanDetail">
-                        搜索
-                    </el-button>
-                </el-form-item>
-
-            </el-form>
-            <div class="el-table-container">
-                <div class="el-table-inner-container">
-                    <el-table ref="planDetailTable" :data="detailPlanList" v-loading="detailLoading" highlight-current-row
-                        height="100%">
-                        <el-table-column label="客户简称" prop="companyAlias" width="120" align="center" />
-                        <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center" />
-                        <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
-                        <el-table-column label="产品描述" prop="productDescription" align="center" />
-                        <el-table-column label="图纸版本" prop="technologyVersion" width="70" align="center" />
-                        <el-table-column label="在产批数" prop="inProduction" width="70" align="center" />
-                        <el-table-column label="已完成批数" prop="afterProduction" width="70" align="center" />
-                        <el-table-column label="未投产批数" prop="technologyVersion" width="70" align="center">
-                            <template #default="scope">
-                                {{ scope.row.totalLotNumber - scope.row.inProduction - scope.row.afterProduction }}
-                            </template>
-                        </el-table-column>
-                        <el-table-column label="工段" prop="currentDepartment" width="70" align="center" />
-                    </el-table>
-                </div>
-            </div>
-        </section>
-        <!-- 分页 -->
-        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
-            v-model:limit="queryParams.pageSize" @pagination="getProductionPlanDetail" />
-
-
+      <section class="list-part-container column-container" style="flex: 1">
+        <!-- 搜索区 -->
+        <el-form
+          class="list-search-container"
+          :model="queryParams"
+          ref="queryRef"
+          :inline="true"
+        >
+          <el-form-item class="section-title" label="生产计划" />
+          <el-form-item label="生产计划单号:">
+            <el-input
+              placeholder="请输入生产计划单号"
+              v-model.trim="queryParams.productionPlanNo"
+              @keyup.enter="handleQueryProductionPlanDetail"
+              @keydown.enter.prevent
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+          <el-form-item label="产品描述:">
+            <el-input
+              placeholder="请输入产品描述"
+              v-model.trim="queryParams.keywords"
+              @keyup.enter="handleQueryProductionPlanDetail"
+              @keydown.enter.prevent
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+          <el-form-item class="section-title" label="请选择当前工段:">
+            <el-select-v2
+              v-model="queryParams.deptId"
+              filterable
+              :options="deptList"
+              placeholder="请选择工段"
+              style="width: 100%"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              type="info"
+              icon="Search"
+              @click="handleQueryProductionPlanDetail"
+            >
+              搜索
+            </el-button>
+            <el-button type="success"  icon="Download" @click="handleExport">导出</el-button>
+          </el-form-item>
+        </el-form>
+        <div class="el-table-container">
+          <div class="el-table-inner-container">
+            <el-table
+              ref="planDetailTable"
+              :data="detailPlanList"
+              v-loading="detailLoading"
+              highlight-current-row
+              height="100%"
+            >
+              <el-table-column
+                label="客户简称"
+                prop="companyAlias"
+                width="120"
+                align="center"
+              />
+              <el-table-column
+                label="生产计划单号"
+                prop="productionPlanNo"
+                width="110"
+                align="center"
+              />
+              <el-table-column
+                label="序号"
+                width="60"
+                prop="lineNumber"
+                align="center"
+              />
+              <el-table-column
+                label="产品描述"
+                prop="productDescription"
+                align="center"
+              />
+              <el-table-column
+                label="图纸版本"
+                prop="technologyVersion"
+                width="70"
+                align="center"
+              />
+              <el-table-column
+                label="在产批数"
+                prop="inProduction"
+                width="70"
+                align="center"
+              />
+              <el-table-column
+                label="已完成批数"
+                prop="afterProduction"
+                width="70"
+                align="center"
+              />
+              <el-table-column
+                label="未投产批数"
+                prop="notProduction"
+                width="70"
+                align="center"
+              >
+              </el-table-column>
+              <el-table-column
+                label="工段"
+                prop="currentDepartment"
+                width="70"
+                align="center"
+              >
+              </el-table-column>
+            </el-table>
+          </div>
+        </div>
+      </section>
+      <!-- 分页 -->
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize"
+        @pagination="getProductionPlanDetail"
+      />
     </div>
-</template>
-<script setup name="ProductionBatch">
-import { ref } from "vue";
-import { reportListPlanDetail } from "@/api/business/productionPlanDetail.js";
-import { getDept } from "@/api/business/planDetailSubDetail.js";
-// import productionDialog from "./DialogProduction";
-const { proxy } = getCurrentInstance();
-/** 生产计划 */
-const currentPlanDetail = ref({});
-const detailPlanList = ref([]);
-const detailLoading = ref(false);
-const total = ref(0);
-/** 工段 */
-const loading = ref(false);
-const deptList = ref([]);
-/** 查询对象 */
-const queryParams = ref({
+  </template>
+  <script setup name="ProductionBatch">
+  import { ref } from "vue";
+  import { reportListPlanDetail } from "@/api/business/productionPlanDetail.js";
+  import { getDeptList } from "@/api/business/planDetailSubDetail.js";
+  // import productionDialog from "./DialogProduction";
+  const { proxy } = getCurrentInstance();
+  /** 生产计划 */
+  const currentPlanDetail = ref({});
+  const detailPlanList = ref([]);
+  const detailLoading = ref(false);
+  const isDispatch = ref(false);
+  const total = ref(0);
+  /** 工段 */
+  const loading = ref(false);
+  const deptList = ref([]);
+  /** 查询对象 */
+  const queryParams = ref({
     deptId: "",
     keywords: "",
     pageNum: 1,
     pageSize: 10,
-});
-
-/***********************  方法区  ****************************/
-/***********************  工段  ****************************/
-/**
-查询工段
- *
- */
-function getList() {
+  });
+  
+  /***********************  方法区  ****************************/
+  /***********************  工段  ****************************/
+  /**
+  查询工段
+   *
+   */
+  function getList() {
     loading.value = true;
-    getDept().then((response) => {
-        deptList.value = response.data;
-        // queryParams.value.deptId = '14'
-        if (deptList.value.length > 0) {
-            queryParams.value.deptId = deptList.value[0].value;
-
-            getProductionPlanDetail();
-        }
+    getDeptList().then((response) => {
+      deptList.value = response.data.rows;
+      isDispatch.value = response.data.others.isDispatch;
+      // queryParams.value.deptId = '14'
+      if (deptList.value.length > 0 && !isDispatch.value) {
+        queryParams.value.deptId = deptList.value[0].value;
+      }else{
+        console.log("777")
+          deptList.value.unshift({ label: "全部", value: "0" });
+      }
+      getProductionPlanDetail();
     });
     loading.value = false;
-}
-/**工段下拉框change事件 */
-function handleDeptChange() {
+  }
+  /**工段下拉框change事件 */
+  function handleDeptChange() {
     handlePlanDetailCurrentChange(currentPlanDetail.value);
-}
-/***********************  生产计划  ****************************/
-
-
-/**查询计划明细 */
-function getProductionPlanDetail() {
+  }
+  /***********************  生产计划  ****************************/
+  
+  /**查询计划明细 */
+  function getProductionPlanDetail() {
     detailLoading.value = true;
-    console.log(queryParams.value)
+    console.log(queryParams.value);
     reportListPlanDetail(queryParams.value).then((res) => {
-        detailPlanList.value = res.rows;
-        total.value = res.total;
-        detailLoading.value = false;
-
+      detailPlanList.value = res.rows;
+      total.value = res.total;
+      detailLoading.value = false;
     });
-}
-/** 生产计划搜索按钮操作 */
-function handleQueryProductionPlanDetail() {
+  }
+  /** 生产计划搜索按钮操作 */
+  function handleQueryProductionPlanDetail() {
     queryParams.value.pageNum = 1;
     getProductionPlanDetail();
-}
-//查询生产计划单的领料信息
-function handleCheckMarterialInfo(row) {
+  }
+  //查询生产计划单的领料信息
+  function handleCheckMarterialInfo(row) {
     proxy.$refs.checkMaterialRef.open(row);
-}
-
-
-onMounted(() => {
+  }
+  /** 导出按钮操作 */
+  function handleExport() {
+      proxy.download('/ezhizao-dms-production/business/productionPlanDetail/download', {
+          ...queryParams.value
+      }, `报工日报${new Date().getTime()}.xlsx`)
+  }
+  
+  onMounted(() => {
     getList();
-});
-</script>
-<style scoped>
-.list-search-container-child .el-form-item {
+  });
+  </script>
+  <style scoped>
+  .list-search-container-child .el-form-item {
     /* 修改样式 */
     margin-right: 10px;
-}
-</style>
+  }
+  .strike-through {
+    text-decoration: line-through;
+  }
+  </style>
+