Răsfoiți Sursa

0710电子图纸

zhuzeyu 11 luni în urmă
părinte
comite
0bbf694a2f

+ 68 - 0
src/api/business/drawing.js

@@ -10,6 +10,14 @@ export function listDrawing(query) {
   })
 }
 
+export function getNormalDrawing(query) {
+  return request({
+   url: baseUrl +'/business/drawing/drawingList',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询图纸名
 export function drawingByName(query) {
   return request({
@@ -18,6 +26,24 @@ export function drawingByName(query) {
     params: query
   })
 }
+
+// 根据文件名查询图纸会签列表
+export function getListByName(query) {
+  return request({
+   url: baseUrl +'/business/drawing/getListByName',
+    method: 'get',
+    params: query
+  })
+}
+
+// 电子图纸会签流程
+export function saveDrawing(data) {
+  return request({
+   url: baseUrl +'/business/drawing/save',
+    method: 'post',
+    data: data
+  })
+}
 // 查询电子图纸详细
 export function getDrawing(id) {
   return request({
@@ -35,6 +61,23 @@ export function addDrawing(data) {
   })
 }
 
+// 新增个人章
+export function addPersonalSeal(data) {
+  return request({
+   url: baseUrl +'/business/personalSeal',
+    method: 'post',
+    data: data
+  })
+}
+// 新增公共章
+export function addPublicSeal(data) {
+  return request({
+   url: baseUrl +'/business/publicSeal',
+    method: 'post',
+    data: data
+  })
+}
+
 // 修改电子图纸
 export function updateDrawing(data) {
   return request({
@@ -43,6 +86,31 @@ export function updateDrawing(data) {
     data: data
   })
 }
+// NG电子图纸
+export function drawingNG(data) {
+  return request({
+   url: baseUrl +'/business/drawing/drawingNG',
+    method: 'put',
+    data: data
+  })
+}
+
+// 废弃电子图纸
+export function drawingRemove(data) {
+  return request({
+   url: baseUrl +'/business/drawing/drawingRemove',
+    method: 'put',
+    data: data
+  })
+}
+// 替换电子图纸
+export function replace(data) {
+  return request({
+   url: baseUrl +'/business/drawing/replace',
+    method: 'put',
+    data: data
+  })
+}
 
 // 删除电子图纸
 export function delDrawing(id) {

+ 17 - 0
src/api/business/product.js

@@ -10,6 +10,14 @@ export function listProduct(query) {
 	})
 }
 
+export function getTechnological(query) {
+	return request({
+		url: baseUrl + '/business/product/getTechnological',
+		method: 'get',
+		params: query
+	})
+}
+
 // 查询产品管理详细
 export function getProduct(id) {
 	return request({
@@ -18,6 +26,15 @@ export function getProduct(id) {
 	})
 }
 
+// 查询产品管理详细
+export function getById(id) {
+	return request({
+		url: baseUrl + '/business/product/getById/' + id,
+		method: 'get'
+	})
+}
+
+
 // 保存产品信息
 export function saveProduct(data) {
 	let _action = ''

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

@@ -10,6 +10,14 @@ export function listTechnologicalProcessDetail(query) {
 	})
 }
 
+// 查询工艺从表下拉框
+export function getTechnologicalProcessDetails(query) {
+	return request({
+		url: baseUrl + '/base/technologicalProcessDetail/getTechnologicalProcessDetails',
+		method: 'get',
+		params: query
+	})
+}
 // 查询工艺从表详细
 export function getTechnologicalProcessDetail(id) {
 	return request({

+ 33 - 0
src/router/index.js

@@ -196,6 +196,39 @@ export const dynamicRoutes = [
       }
     ]
   },
+  {
+    path: '/drawing',
+    component: Layout,
+    hidden: true,
+    permissions: ['business:drawing:query'],
+    children: [
+      {
+        // 假设您要传递的三个参数
+        path: 'drawingDetail/:productId/:productProcessId/:processDetailId',
+        component: () => import('@/views/business/drawing/drawingDetail'),
+        name: 'drawingDetails',
+        meta: {
+          title: '产品图纸'
+        }
+      }
+    ]
+  },
+  // {
+  //   path: '/drawing',
+  //   component: Layout,
+  //   hidden: true,
+  //   permissions: ['business:drawing:query'],
+  //   children: [
+  //     {
+  //       path: 'drawingDetail/:currentProduct(.*)',
+  //       component: () => import('@/views/business/drawing/drawingDetail'),
+  //       name: 'drawingDetails',
+  //       meta: {
+  //         title: '产品图纸'
+  //       }
+  //     }
+  //   ]
+  // },
   {
     path: '/Production',
     component: Layout,

+ 24 - 43
src/views/business/drawing/drawingDetail.vue

@@ -74,23 +74,24 @@
                                         @click="handlePreview(scope.row)">审核
                                     </el-button>
                                     <el-button v-if="scope.row.status == 1" link type="success" plain
-                                        v-hasPermi="['business:electronicDrawings:ratify']"
+                                        v-hasPermi="['business:electronicDrawings:raift']"
                                         @click="handlePreview(scope.row)">批准</el-button>
 
-                                    <el-upload
-                                        :action="webHost + '/common/upload'" :headers="headers" :limit="1"
-                                        :on-success="handleReplaceSuccess" :on-exceed="handleReplaceExceed" :before-upload="beforeUpload"
-                                        :show-file-list="false">
-                                        <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link type="warning" plain
-                                            v-hasPermi="['business:drawing:download']"
-                                         >替换</el-button>
+                                    <el-upload :action="webHost + '/common/upload'" :headers="headers" :limit="1"
+                                        :on-success="handleReplaceSuccess" :on-exceed="handleReplaceExceed"
+                                        :before-upload="beforeUpload" :show-file-list="false">
+                                        <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link
+                                            type="warning" plain
+                                            v-hasPermi="['business:electronicDrawings:replace']">替换</el-button>
                                     </el-upload>
 
-                                    <el-button v-if="(scope.row.status == 0 || scope.row.status == 1)&& scope.row.abandoned == 0" link type="danger"
-                                        v-hasPermi="['business:electronicDrawings:remove']"
+
+                                    <el-button
+                                        v-if="(scope.row.status == 0 || scope.row.status == 1) && scope.row.abandoned == 0"
+                                        link type="danger" v-hasPermi="['business:electronicDrawings:NG']"
                                         @click="handleDrawingNG(scope.row)">NG
                                     </el-button>
-                                    <el-button v-if="scope.row.status == 2&& scope.row.abandoned == 0" link type="danger"
+                                    <el-button v-if="scope.row.status == 2 && scope.row.abandoned == 0" link type="danger"
                                         v-hasPermi="['business:electronicDrawings:remove']"
                                         @click="handleDrawingRemove(scope.row)">作废
                                     </el-button>
@@ -137,7 +138,7 @@
                 <el-form-item label="上传文件:" prop="url">
                     <el-input disabled v-model="form.url" placeholder="上传文件">
                         <template #append>
-                            <el-upload :disabled="!currentTechnologicalDetail.id" :action="webHost + '/common/upload'"
+                            <el-upload :disabled="!form.technologicalProcessDetailId" :action="webHost + '/common/upload'"
                                 :headers="headers" :limit="1" :on-success="handleSuccess" :on-exceed="handleExceed"
                                 :before-upload="beforeUpload" :show-file-list="false">
                                 <el-button icon="Upload"></el-button>
@@ -187,6 +188,7 @@ const technologicalDetailId = ref(null)
 const open = ref(false)
 const draform = ref({})
 const currentDrawing = ref({})
+const replaceForm  = ref({})
 const repeatingDrawings = ref([])
 const loading = ref(false);
 const drawingList = ref([])
@@ -340,9 +342,9 @@ function handleSuccess(row) {
                     item = repeatingDrawings.value[0]
                     item.parentId = currentDrawing.value.id
                     item.id = null
-                    item.url =  replaceForm.value.url
+                    item.url = replaceForm.value.url
                     item.drawingName = fileDrawing.drawingName
-                    item.technologicalProcessDetailId = fileDrawing.technologicalProcessDetailId 
+                    item.technologicalProcessDetailId = fileDrawing.technologicalProcessDetailId
                     handleReplace(item)
                 } else {
                     proxy.$modal.msgError("已有相同文件,请修改后重新上传");
@@ -364,35 +366,14 @@ function handleReplaceSuccess(row) {
     var fileDrawing = {}
     fileDrawing.drawingName = row.originalFilename
     fileDrawing.technologicalProcessDetailId = currentTechnologicalDetail.value.id
+    var item = {}
+    item.parentId = currentDrawing.value.id
+    item.id = null
+    item.url = replaceForm.value.url
+    item.drawingName = fileDrawing.drawingName
+    item.technologicalProcessDetailId = fileDrawing.technologicalProcessDetailId
+    handleReplace(item)
 
-    getListByName(fileDrawing).then(res => {
-        // debugger;
-        if (res.code == 200) {
-            console.log(res, "数据库查询")
-            repeatingDrawings.value = res.data
-            if (repeatingDrawings.value.length == 0) {
-
-                coverName.value = row.originalFilename
-                formLoading.value = false
-            } else {
-                //判断重名文件状态是否已发行需要替换
-                if (repeatingDrawings.value[0].status == 0) {
-                    proxy.$modal.msgWarning("待审核中已有相同文件");
-                    var item = {}
-                    item = repeatingDrawings.value[0]
-                    item.parentId = currentDrawing.value.id
-                    item.id = null
-                    item.url =  replaceForm.value.url
-                    item.drawingName = fileDrawing.drawingName
-                    item.technologicalProcessDetailId = fileDrawing.technologicalProcessDetailId 
-                    handleReplace(item)
-                } else {
-                    proxy.$modal.msgError("已有相同文件,请修改后重新上传");
-                    open.value = false
-                }
-            }
-        }
-    })
 }
 function submitForm() {
     proxy.$refs["drawingRef"].validate((valid) => {
@@ -462,7 +443,7 @@ function handelTechnological(row) {
 }
 /**工序选择change事件 */
 function handleDetailsChange(row) {
-    currentTechnologicalDetail.value.id = technologicalDetailId.value == undefined ? null:technologicalDetailId.value
+    currentTechnologicalDetail.value.id = technologicalDetailId.value == undefined ? null : technologicalDetailId.value
     getDrawing()
 }
 /**NG电子图纸 */

+ 4 - 4
src/views/business/drawingAuditing/index.vue

@@ -37,10 +37,10 @@
                 </el-form-item>
             </el-form>
             <div class="list-btns-container">
-                <el-button :disabled="selections.length == 0" type="success" v-hasPermi="['business:drawing:add']"
+                <el-button :disabled="selections.length == 0" type="success" v-hasPermi="['business:electronicDrawings:examine']"
                     @click="handleSaveBacth()">批量通过
                 </el-button>
-                <el-button :disabled="selections.length == 0" type="danger" v-hasPermi="['business:drawing:add']"
+                <el-button :disabled="selections.length == 0" type="danger" v-hasPermi="['business:electronicDrawings:NG']"
                     @click="handleNGBacth()">批量NG
                 </el-button>
             </div>
@@ -80,11 +80,11 @@
                         <el-table-column label="制作人" prop="producer" align="center" />
                         <el-table-column label="操作" width="150" align="center">
                             <template #default="scope">
-                                <el-button v-hasPermi="['business:equipment:edit']" link type="success"
+                                <el-button v-hasPermi="['business:electronicDrawings:examine']" link type="success"
                                     @click="saveDrawingDetail(scope.row)">
                                     通过
                                 </el-button>
-                                <el-button v-hasPermi="['business:equipment:remove']" link type="danger"
+                                <el-button v-hasPermi="['business:electronicDrawings:NG']" link type="danger"
                                     @click="handleNGdrawingDetail(scope.row.id)">
                                     NG
                                 </el-button>

+ 4 - 4
src/views/business/drawingRatify/index.vue

@@ -37,10 +37,10 @@
                 </el-form-item>
             </el-form>
             <div class="list-btns-container">
-                <el-button :disabled="selections.length == 0" type="success" v-hasPermi="['business:drawing:add']"
+                <el-button :disabled="selections.length == 0" type="success" v-hasPermi="['business:electronicDrawings:raift']"
                     @click="handleSaveBacth()">批量批准
                 </el-button>
-                <el-button :disabled="selections.length == 0" type="danger" v-hasPermi="['business:drawing:add']"
+                <el-button :disabled="selections.length == 0" type="danger" v-hasPermi="['business:electronicDrawings:NG']"
                     @click="handleNGBacth()">批量NG
                 </el-button>
             </div>
@@ -81,11 +81,11 @@
                         <el-table-column label="审核人" prop="reviewer" align="center" width="100"/>
                         <el-table-column label="操作" width="150" align="center">
                             <template #default="scope">
-                                <el-button v-hasPermi="['business:equipment:edit']" link type="success"
+                                <el-button v-hasPermi="['business:electronicDrawings:raift']" link type="success"
                                     @click="saveDrawingDetail(scope.row)">
                                     通过
                                 </el-button>
-                                <el-button v-hasPermi="['business:equipment:remove']" link type="danger"
+                                <el-button v-hasPermi="['business:electronicDrawings:NG']" link type="danger"
                                     @click="handleNGdrawingDetail(scope.row.id)">
                                     NG
                                 </el-button>

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

@@ -77,7 +77,7 @@
 						<el-table-column label="技术员编码" align="center" prop="technicianCode" />
 						<el-table-column fixed="right" label="图纸" align="center" width="140px">
 							<template #default="scope">
-								<el-button link type="primary" v-hasPermi="['business:product:remove']"
+								<el-button link type="primary" v-hasPermi="['business:electronicDrawings:query']"
 									@click="handleProduct(scope.row)">图纸</el-button>
 							</template>
 						</el-table-column>

+ 1 - 2
src/views/business/product/drawingForm.vue

@@ -275,8 +275,7 @@ function saveDrawing() {
 /**预览 */
 function handlePreview(row) {
   //0617预览不需要内嵌,新开一个标签页
-  // dialogVisible.value = true
-  // pdfCover.value = fileUrl +( webHost + row.url)
+  // hostUrl+webHost+row.url 必须时文件全路径 不能转
   window.open(fileUrl+ encodeURIComponent(Base64.encode(hostUrl+webHost+row.url)))
   console.log('全路径:'+hostUrl+webHost+row.url)
 }

+ 71 - 2
src/views/system/user/profile/index.vue

@@ -27,7 +27,8 @@
               </li>
               <li class="list-group-item">
                 <svg-icon icon-class="tree" />所属部门
-                <div class="pull-right" v-if="state.user.dept">{{ state.user.dept.deptName }} / {{ state.postGroup }}</div>
+                <div class="pull-right" v-if="state.user.dept">{{ state.user.dept.deptName }} / {{ state.postGroup }}
+                </div>
               </li>
               <li class="list-group-item">
                 <svg-icon icon-class="peoples" />所属角色
@@ -37,6 +38,19 @@
                 <svg-icon icon-class="date" />创建日期
                 <div class="pull-right">{{ state.user.createTime }}</div>
               </li>
+              <li class="list-group-item">
+                <el-upload :action="webHost + '/common/upload'" :headers="headers" :limit="1" :on-success="handleSuccess"
+                  :on-exceed="handleExceed" :before-upload="beforeUpload" :show-file-list="false">
+                  <el-button icon="Upload">上传个人章</el-button>
+                </el-upload>
+              </li>
+
+              <li class="list-group-item" v-if="state.user.userId == 1">
+                <el-upload  :action="webHost + '/common/upload'" :headers="headers" :limit="1" :on-success="handleSealSuccess"
+                  :on-exceed="handleSealExceed" :before-upload="beforeUpload" :show-file-list="false">
+                  <el-button  v-hasPermi="['business:electronicDrawings:publicSeal']" icon="Upload">上传公共章</el-button>
+                </el-upload>
+              </li>
             </ul>
           </div>
         </el-card>
@@ -67,8 +81,16 @@ import userAvatar from './userAvatar'
 import userInfo from './userInfo'
 import resetPwd from './resetPwd'
 import { getUserProfile } from '@/api/system/user'
-
+import { addPersonalSeal,addPublicSeal} from "@/api/business/drawing";
+import { getToken } from '@/utils/auth'
+import { ref } from "vue";
+const { proxy } = getCurrentInstance();
+const webHost = import.meta.env.VITE_APP_BASE_API
+const headers = { Authorization: getToken() }
+const formLoading = ref(false)
 const activeTab = ref('userinfo')
+const sealForm = ref({})
+const form = ref({})
 const state = reactive({
   user: {},
   roleGroup: {},
@@ -82,6 +104,53 @@ function getUser() {
     state.postGroup = response.postGroup
   })
 }
+/**上传成功回调 */
+function handleSuccess(row) {
+  form.value.url = row.fileName
+  var fileDrawing = {}
+  addPersonalSeal(form.value).then(res=>{
+    if(res.code == 200){
+      proxy.$modal.msgSuccess("上传成功");
+    }
+  })
+
+}
+/**文件数量超出的回调 */
+function handleExceed(files) {
+  form.value.url = files[0].url
+}
+
 
+
+
+/**公共章上传成功回调 */
+function handleSealSuccess(row) {
+  sealForm.value.url = row.fileName
+  var fileDrawing = {}
+  addPublicSeal(sealForm.value).then(res=>{
+    if(res.code == 200){
+      proxy.$modal.msgSuccess("上传成功");
+    }
+  })
+
+}
+/**文件数量超出的回调 */
+function handleSealExceed(files) {
+  sealForm.value.url = files[0].url
+}
+/** 文件上传前的 回调事件 */
+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;
+  }
+
+}
 getUser()
 </script>