فهرست منبع

Merge remote-tracking branch 'origin/master'

guoyujia 9 ماه پیش
والد
کامیت
84b6465329

+ 63 - 0
src/api/business/certificate.js

@@ -0,0 +1,63 @@
+import request from '@/utils/request'
+const baseUrl = import.meta.env.VITE_APP_PRODUCTION_API
+import { download, downloadPdf } from '@/utils/request'
+
+// 查询合格证列表
+export function listCertificate(query) {
+  return request({
+    url: baseUrl + '/business/certificate/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询合格证详细
+export function getCertificate(id) {
+  return request({
+    url: baseUrl + '/business/certificate/' + id,
+    method: 'get'
+  })
+}
+
+// 新增合格证
+export function addCertificate(data) {
+  return request({
+    url: baseUrl + '/business/certificate',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改合格证
+export function updateCertificate(data) {
+  return request({
+    url: baseUrl + '/business/certificate',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除合格证
+export function delCertificate(id) {
+  return request({
+    url: baseUrl + '/business/certificate/' + id,
+    method: 'delete'
+  })
+}
+export function generateQrCode(data) {
+  return request({
+    url: baseUrl + '/business/certificate/generate',
+    method: 'post',
+    data: data
+  })
+}
+
+export function printPdf(data) {
+  downloadPdf(
+    baseUrl + "/business/certificate/printPdf",
+    {
+      ...data
+    },
+    `合格证_${new Date().getTime()}.pdf`
+  )
+}

+ 8 - 0
src/api/business/dayworkAuxiliaryItem.js

@@ -28,4 +28,12 @@ export function updateDayworkItemInfo(data) {
     method: 'post',
     data: data
   })
+}
+
+export function listDaywork(data) {
+  return request({
+    url: baseUrl + '/business/auxiliaryDaywork/listDaywork',
+    method: 'get',
+    params: data
+  })
 }

+ 23 - 4
src/views/business/auxiliaryDaywork/form.vue

@@ -60,8 +60,20 @@
             </el-form-item>
           </el-col>
           <el-col :span="7">
-            <el-form-item label="总工时:" prop="workingHoursTime" label-width="82px">
-              <el-input v-model.trim="workingHoursTime" :disabled="true" style="width: 220px; margin-left: 0px" />
+            <el-form-item label="投产数量:" prop="endTime">
+              <div>{{ form.prodNum }}</div>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="合格数量:" prop="endTime" label-width="90px">
+              <el-input-number :disabled="!editStatus" v-model="form.qualifiedNum" style="width: 220px;" :step="1"
+                step-strictly :controls="false" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="废品数量:" prop="endTime" label-width="90px">
+              <el-input-number :disabled="true" v-model="form.rejectNum" :step="1" style="width: 220px;" step-strictly
+                :controls="false" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -82,12 +94,11 @@
           <el-table-column prop="dayworkItem.nickName" label="生产工序加工人" align="center"></el-table-column>
           <el-table-column prop="dayworkItem.startTime" label="开始时间" align="center"></el-table-column>
           <el-table-column prop="dayworkItem.endTime" label="结束时间" align="center"></el-table-column>
-          <el-table-column prop="prodNum" label="投产数量" align="center"></el-table-column>
           <el-table-column prop="rejectNum" label="废品数量" align="center">
             <template #default="scope">
               <div v-if="!editStatus"> {{ scope.row.rejectNum }}</div>
               <el-input-number v-else v-model="scope.row.rejectNum" style="width: 100px" :step="1" step-strictly
-                :controls="false" />
+                :controls="false" @change="handleChangeRejectNum(scope.row)" />
             </template>
           </el-table-column>
           <el-table-column prop="qualifiedNum" label="合格数量" align="center"></el-table-column>
@@ -265,6 +276,14 @@ function handleGetUser(selection) {
 function handleSelectUserSingle() {
   proxy.$refs.dialogPersonRef.open()
 }
+
+function handleChangeRejectNum(row) {
+  let sumReject = 0;
+  form.value.groupRejectList.forEach(t => {
+    sumReject += t.rejectNum
+  })
+  form.value.rejectNum = sumReject
+}
 /**
  * 对话框关闭 事件
  */

+ 5 - 5
src/views/business/auxiliaryDaywork/index.vue

@@ -58,10 +58,10 @@
           <el-select-v2 v-model="queryItemParams.auxiliaryProcessId" clearable :options="processList"
             placeholder="请选择工序" style="width: 100%" @change="handleProcessChange" />
         </el-form-item>
-        <el-form-item style="margin-left: 0">
+        <!-- <el-form-item style="margin-left: 0">
           <el-button type="info" @click="handleOpenHistory">历史记录
           </el-button>
-        </el-form-item>
+        </el-form-item> -->
       </el-form>
 
       <div class="el-table-container">
@@ -72,7 +72,6 @@
             <el-table-column label="辅助工序" prop="auxiliaryProcessAlias" align="center" />
             <el-table-column label="开始时间" prop="startTime" width="160" align="center" />
             <el-table-column label="结束时间" prop="endTime" width="160" align="center" />
-            <el-table-column label="总工时" prop="workingHours" width="160" align="center" />
             <el-table-column label="生产状态" prop="status" width="100" align="center">
               <template #default="scope">
                 <dict-tag :options="daywork_status" :value="scope.row.status" />
@@ -102,12 +101,12 @@
 
 <script setup>
 import {
-  listDaywork,
+  // listDaywork,
   getProcessList,
   delDayworkItem
 } from "@/api/business/daywork.js";
 import { listDeptProcess } from "@/api/business/deptProcess";
-import { listDayworkItem } from '@/api/business/dayworkAuxiliaryItem'
+import { listDaywork, listDayworkItem } from '@/api/business/dayworkAuxiliaryItem'
 import { selectUserPermissionList } from "@/api/system/user.js";
 import router from "@/router";
 import useUserStore from '@/store/modules/user'
@@ -148,6 +147,7 @@ const queryDayworkParams = ref({
   lotCode: "",
   pageNum: 1,
   pageSize: 10,
+  userId: useUserStore().user.userId
 });
 const queryItemParams = ref({
   dayworkId: "0",

+ 176 - 0
src/views/business/certificate/form.vue

@@ -0,0 +1,176 @@
+<template>
+  <!-- 添加或修改项目信息对话框 -->
+  <el-drawer v-model="visible" size="100%" direction="rtl" :close-on-press-escape="false">
+    <div class="page-container form-container">
+      <div class="form-btns-container" style="display: flex; align-items: center">
+        <span class="title-label"><el-icon>
+            <Document />
+          </el-icon>
+          打印合格证</span>
+        <el-button style="margin-left: 30px" type="primary" icon="Check" @click="handleGenerate">生成
+        </el-button>
+        <el-button style="margin-left: 30px" type="primary" icon="Check" @click="handlePrint">打印
+        </el-button>
+        <el-button icon="Close" @click="cancel">取 消 </el-button>
+        <div class="close-btn" @click="cancel">
+          <i class="fa fa-times" aria-hidden="true" />
+          <!-- <span>关闭</span> -->
+        </div>
+      </div>
+      <!-- 报工选择工序、完成状态、箱号部分 -->
+      <div style="padding: 0px 16px 0px 16px">
+        <el-row :gutter="30" style="margin-top: 10px; padding-top: 10px">
+          <el-col :span="3">
+            <span class="leftInfo">打印信息</span>
+          </el-col>
+        </el-row>
+        <el-form :model="form" ref="queryRef" :inline="true"
+          style="margin-right: 0px; font-size: 15px; padding-top: 10px">
+          <el-form-item label="生成日期" prop="selectedProcess">
+          </el-form-item>
+          <el-form-item label="箱号:" prop="carrierIds">
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+  </el-drawer>
+</template>
+<script setup>
+import { ref } from "vue";
+import { getCertificate, generateQrCode, printPdf } from '@/api/business/certificate'
+import useUserStore from "@/store/modules/user";
+import { debounce } from "lodash";
+
+/** 父组件传参 */
+const props = defineProps({
+  getList: {
+    type: Function,
+    default: () => { },
+  },
+});
+
+const { getList } = toRefs(props);
+const { proxy } = getCurrentInstance();
+
+const loading = ref(false);
+const visible = ref(false);
+/** 查询对象 */
+const queryParams = ref({
+  pageNum: 1,
+  pageSize: 10,
+});
+
+const dayworkItem = ref({
+  qualifiedNum: 0,
+  rejectNum: 0,
+});
+
+const data = reactive({
+  daywoerkItem: {},
+  daywork: {},
+  rules: {},
+});
+const form = ref({})
+const { daywork, daywoerkItem, rules } = toRefs(data);
+
+/***********************  方法区  ****************************/
+/** 打开抽屉 */
+const open = (row) => {
+  visible.value = true;
+  if (row) {
+    getCertificate(row.id).then(res => {
+      form.value = res.data;
+    })
+  }
+};
+
+/** 取消按钮 */
+const cancel = () => {
+  visible.value = false;
+  isEdit.value = false;
+  reset();
+  getList.value();
+};
+
+function handleGenerate() {
+  generateQrCode(form.value).then(res => {
+    if (res.code === 200) {
+      proxy.$modal.msgSuccess("生成成功");
+    } else {
+      proxy.$modal.msgError("生成失败");
+    }
+  })
+}
+
+/** 表单重置 */
+function reset() {
+  productList.value = [];
+  firstOrder.value = true;
+  batchNo.value = {};
+  processList.value = [];
+  lotList.value = [];
+  lotClick.value = false;
+  selectedProcess.value = null;
+  daywork.value = {};
+  furnaceNumberInfoList.value = [];
+  dayworkItemList.value = [];
+  processAlias.value = [];
+  furnaceNoInfo.value = {};
+  carriers.value = [];
+  queryParams.value = {
+    pageNum: 1,
+    pageSize: 10,
+    deptId: null,
+  };
+
+  proxy.resetForm("queryRef");
+}
+
+function handlePrint() {
+  printPdf(form.value)
+}
+
+/** 暴露给父组件的方法 */
+defineExpose({
+  open,
+});
+</script>
+<style scoped>
+.leftInfo {
+  color: #000;
+  font-size: 15px;
+  width: 120px;
+  /* display: inline-block; */
+}
+
+.middleInfo {
+  color: #000;
+  font-size: 15px;
+  width: 65px;
+  display: inline-block;
+}
+
+.switch-container {
+  font-size: 15px;
+  margin-left: 10px;
+  display: flex;
+  align-items: center;
+  justify-content: left;
+}
+
+.ml-15 {
+  margin-left: 15px;
+  margin-right: 15px;
+}
+
+.table-container {
+  max-width: 600px;
+  /* 或者你希望的最大宽度 */
+}
+
+.rightInfo {
+  font-size: 16px;
+  padding-left: 0px;
+}
+</style>

+ 173 - 0
src/views/business/certificate/index.vue

@@ -0,0 +1,173 @@
+<template>
+  <div class="page-container row-container">
+
+    <section class="list-part-container" style="flex: 2">
+      <!-- 搜索区域 -->
+      <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
+        <el-form-item class="section-title" label="合格证打印" />
+        <el-form-item>
+          <el-button type="primary" @click="handleQuery">搜索</el-button>
+        </el-form-item>
+      </el-form>
+      <!-- 列表区域 -->
+      <div class="el-table-container">
+        <div class="el-table-inner-container">
+          <el-table ref="certificateTable" v-loading="loading" row-key="id" @row-click="handleRow"
+            :data="certificateList" height="100%">
+            <el-table-column type="selection" width="55" align="center" />"
+            <el-table-column label="行号" type="index" width="80" align="center" />
+            <el-table-column label="产品编码" prop="productCode" align="center" />
+            <el-table-column label="产品描述" prop="productDescription" align="center" />
+            <el-table-column label="客户名称" prop="customerName" align="center" />
+            <el-table-column label="包装数量" prop="number" align="center" />
+            <el-table-column label="标签数量" prop="labelNumber" align="center" />
+            <el-table-column label="批次号" prop="lotCode" align="center" />
+            <el-table-column label="打印次数" prop="printNumber" align="center" />
+            <el-table-column label="操作">
+              <template #default="scope">
+                <el-button type="primary" @click="handleInfo(scope.row)">详情</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize" @pagination="getList" />
+    </section>
+    <form-dialog ref="formRef" />
+    <!-- 设备档案管理表单 -->
+  </div>
+</template>
+
+<script setup name="Equipment">
+import { listCertificate } from '@/api/business/certificate'
+import { getToken } from '@/utils/auth'
+import formDialog from '@/views/business/certificate/form'
+const { proxy } = getCurrentInstance();
+
+const webHost = import.meta.env.VITE_APP_BASE_API
+const headers = { Authorization: getToken() }
+/**字典数组 */
+/** 设备档案管理 */
+const selections = ref([]);
+const certificateTable = ref(null);
+const total = ref(0);
+const sealItem = ref({})
+const certificateList = ref([]);
+const loading = ref(false);
+const formRef = ref(null)
+const webUrl = ref("")
+/** 设备档案 查询对象 */
+const queryParams = ref({
+  pageNum: 1,
+  pageSize: 10,
+});
+const form = ref({})
+const formLoading = ref(false)
+
+/****************************************************  生命周期函数区  ****************************************************/
+onMounted(() => {
+  getList();
+});
+/****************************************************  方法区  ****************************************************/
+
+
+
+
+/****************************** 设备档案 事件处理区 ******************************/
+
+
+/** 获取设备档案列表 */
+const getList = () => {
+  form.value = {}
+  listCertificate(queryParams.value).then(res => {
+    if (res.code == 200) {
+      certificateList.value = res.rows;
+      if (certificateList.value.length > 0) {
+        handleRow(certificateList.value[0])
+      }
+      total.value = res.total;
+    }
+  })
+
+};
+
+function processImageUrl(data) {
+  console.log('processImageUrl')
+  for (var i = 0; i < data.length; i++) {
+    var item = data[i]
+    var urlList = previewImageUrl(item.url)
+    item.pictureList = urlList
+  }
+}
+function previewImageUrl(url) {
+  var urlList = []
+  if (url) {
+
+    var itemUrl = document.location.origin + webHost + url
+    console.log(itemUrl)
+    urlList.push(itemUrl)
+  }
+  return urlList
+}
+
+function handleRow(row) {
+  sealItem.value = row
+}
+/** 文件上传前的 回调事件 */
+function beforeUpload(file) {
+
+  formLoading.value = true;
+  const allowedTypes = ['image/jpeg', 'image/png']; // 添加或修改为图片的MIME类型
+  const isAllowed = allowedTypes.includes(file.type);
+  console.log(isAllowed)
+  if (!isAllowed) {
+    proxy.$modal.msgError('只能上传图片格式的文件!');
+    formLoading.value = false;
+    return false;
+  }
+
+}
+
+/**文件数量超出的回调 */
+function handleExceed(files) {
+  form.value.url = files[0].url
+}
+
+/**
+* 列表checkbox列选择 事件
+*/
+function handleSelectionChange(selection) {
+  selections.value = selection;
+}
+/**
+ * @param {*} row 
+ */
+function handleInfo(row) {
+  formRef.value.open(row)
+}
+
+function handleQuery() {
+  getList()
+}
+
+</script>
+<style scoped>
+:deep(.el-tree-node__label) {
+  font-size: 14px !important;
+  display: inline-block;
+  width: 100%;
+}
+
+:deep(.el-tree-node__content) {
+  height: 40px;
+  border-bottom: 1px solid #ebeef5;
+  padding: 8px 0;
+  line-height: 23px;
+}
+
+.move-handle {
+  cursor: move;
+  background-color: #eee;
+}
+</style>

+ 1 - 1
src/views/business/inspectionChamber/index.vue

@@ -170,7 +170,7 @@ function handleDelete(row, index) {
   }
 }
 
-function checkPermi(arg) {
+function checkPermi(permissionDatas) {
   const permissions = useUserStore().permissions
   const all_permission = "*:*:*";
   const hasPermission = permissions.some(permission => {

+ 1 - 1
src/views/business/outsourceInspectionVerify/index.vue

@@ -42,7 +42,7 @@
       <div class="el-table-inner-container">
         <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
           @selection-change="handleSelectionChange">
-          <el-table-column type="selection" width="48" align="center" />
+          <!--<el-table-column type="selection" width="48" align="center" />-->
           <el-table-column label="外协单位" align="center" prop="outsourcedOrderDetail.supplierName" width="150" />
           <el-table-column label="批次号" align="center" prop="lotCode" width="100" />
           <el-table-column label="产品描述" align="center" prop="productDescription" width="320" />