guoyujia 6 月之前
父節點
當前提交
a5879485aa

+ 8 - 1
src/api/business/resourceGroupDetail.js

@@ -1,5 +1,6 @@
 import request from '@/utils/request'
 const baseUrl = import.meta.env.VITE_APP_BASE_API
+const productionUrl = import.meta.env.VITE_APP_PRODUCTION_API
 
 // 查询工段资源组明细列表
 export function listGroupDetail(query) {
@@ -17,7 +18,13 @@ export function groupDetailEquipmentList(query) {
     params: query
   })
 }
-
+export function getUserInfoByDeptIdAndProductionPlanDetailId(query) {
+  return request({
+    url: productionUrl + '/business/detail/getUserInfoByDeptIdAndProductionPlanDetailId',
+    method: 'get',
+    params: query
+  })
+}
 // 查询工段资源组明细详细
 export function getDetail(id) {
   return request({

+ 32 - 8
src/views/business/daywork/form.vue

@@ -105,13 +105,11 @@
           </el-col>
           <el-col :span="9">
             <el-form-item label="操作者:" prop="nickName" label-width="82px">
-              <el-input
-                v-model.trim="form.nickName"
-                placeholder="请输入操作者"
-                :disabled="true"
-                :clearable="true"
-                style="width: 220px; margin-left: 8px"
-              />
+              <el-input v-model.trim="form.nickName" placeholder="请输入操作者" readonly 
+                style="width: 220px; margin-left: 8px" >
+                <template #append>
+              <el-button icon="Search" @click="handleSelectUserSingle" v-if="editStatus && currentDept"  />
+            </template></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -253,6 +251,8 @@
           </el-table-column>
         </el-table>
       </div>
+      <!-- 搜索人员弹窗 -->
+      <dialog-person ref="dialogPersonRef" :single-selected="handleGetUser" />
     </div>
   </el-drawer>
 </template>
@@ -266,7 +266,7 @@ import {
   getDayworkItemOriginalRejectList
 } from "@/api/business/daywork.js";
 import { ref } from "vue";
-
+import dialogPerson from "./person.vue"
 const { proxy } = getCurrentInstance();
 const emit = defineEmits(["handleSaveSuccess"]);
 /** 字典 */
@@ -374,6 +374,9 @@ const data = reactive({
       { required: true, message: "合格数量不能为空", trigger: "blur" },
       { validator: validateQualifiedNum, trigger: "blur" },
     ],
+    equipmentDetailId: [
+      { required: true, message: "设备不能为空", trigger: "change" },
+    ],
   },
 });
 
@@ -466,6 +469,27 @@ const open = (row) => {
     visible.value = true;
   }
 };
+function handleSelectUserSingle(){
+  proxy.$modal
+    .confirm("修改操作者,设备会清空!")
+    .then(function () {
+      let info = {
+        deptId: detailInfo.value.deptId,
+        productionPlanDetailId: detailInfo.value.productionPlanDetailId
+      }
+       proxy.$refs.dialogPersonRef.open(info)
+    })
+}
+//操作者带回
+//操作者人员带回
+function handleGetUser(selection) {
+ form.value.nickName = selection.nickName;
+ form.value.userId = selection.userId;
+ form.value.userName = selection.userName;
+ getEquipmentInfo(form.value)
+ form.value.equipmentDetailId = null
+ form.value.equipmentDetailCode = null
+}
 /**
  * 对话框关闭 事件
  */

+ 133 - 0
src/views/business/daywork/person.vue

@@ -0,0 +1,133 @@
+<template>
+  <el-dialog title="员工选择" v-model="visible" :width="width" @close="close" append-to-body draggable>
+    <el-form ref="dialogForm" class="list-search-container" :inline="true" :model="queryParams" >
+      <el-form-item label="员工编码:" prop="commonCode">
+        <el-input v-model.trim="queryParams.commonCode" type="text" placeholder="请输入员工编码" @keydown.enter.prevent @keyup.enter="handleSearch" style="width: 180px" clearable />
+      </el-form-item>
+      <el-form-item label="员工姓名:" prop="commonName">
+        <el-input v-model.trim="queryParams.commonName" type="text" placeholder="请输入员工姓名" @keydown.enter.prevent @keyup.enter="handleSearch" style="width: 180px" clearable />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="info" icon="Search" @click="handleSearch">搜索</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table ref="dialogTable" :data="list" :row-key="getRowKey" v-loading="personLoading" height="440px"  align="center">
+      <el-table-column v-if="multiple" type="selection" width="40" align="center"  />
+      <el-table-column type="index" label="行号" width="50" align="center" />
+      <el-table-column label="员工编码" prop="commonCode"  align="center" />
+      <el-table-column label="员工姓名" prop="commonName"  align="center" />
+      <el-table-column v-if="!multiple" label="操作" width="50" align="center">
+        <template #default="scope">
+          <el-button type="success" icon="finished" circle @click="handleSingleSelected(scope.row)" />
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button v-if="multiple" type="primary" :disabled="selections.length === 0" icon="Check" @click="handleMultipleSelected">
+          确定
+        </el-button>
+        <el-button icon="Close" @click="close">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+<script setup>
+import { ref } from '@vue/reactivity'
+import { getUserInfoByDeptIdAndProductionPlanDetailId } from '@/api/business/resourceGroupDetail'
+
+
+const { proxy } = getCurrentInstance()
+const total = ref(0)
+const props = defineProps({
+  width: {
+    type: String,
+    default: '1000px'
+  },
+  multiple: {
+    type: Boolean,
+    default: false
+  },
+  singleSelected: {
+    type: Function,
+    default: null
+  }
+})
+const { singleSelected } = toRefs(props)
+const list = ref([])
+const personLoading = ref(false)
+const visible = ref(false)
+const data = reactive({
+  queryParams: {
+    commonCode: null,
+    commonName: null,
+    pageSize: 10,
+    pageNum: 1
+  }
+})
+const { queryParams } = toRefs(data)
+/**
+ * 对话框打开 事件
+ */
+function open(data) {
+  console.log(data)
+  visible.value = true
+  queryParams.value.deptId = data.deptId
+  queryParams.value.productionPlanDetailId = data.productionPlanDetailId
+  getList()
+}
+/** 获取行 id */
+function getRowKey(row) {
+  return row.userId
+}
+
+/**
+ * 对话框关闭 事件
+ */
+function close() {
+  proxy.$refs.dialogForm.resetFields()
+  proxy.$refs.dialogTable.clearSelection()
+  queryParams.value.pageNum = 1
+  visible.value = false
+}
+
+/**
+ * 加载数据
+ */
+function getList() {
+  personLoading.value = true
+  getUserInfoByDeptIdAndProductionPlanDetailId(queryParams.value).then(res =>{
+    if(res.code == 200) {
+      list.value = res.rows
+      total.value = res.total
+    }
+  })
+  personLoading.value = false
+}
+
+
+/**  搜索 事件 */
+function handleSearch() {
+  queryParams.value.pageNum = 1
+  getList()
+
+}
+
+/** 单选事件 */
+function handleSingleSelected(row) {
+  if (singleSelected.value) {
+    let select = {
+      userId: row.commonId,
+      userName: row.commonCode,
+      nickName:row.commonName
+    }
+    singleSelected.value(select)
+  }
+  close()
+}
+
+defineExpose({
+  open
+})
+</script>

+ 26 - 3
src/views/business/daywork/sortForm.vue

@@ -51,8 +51,11 @@
           </el-col>
           <el-col :span="9">
             <el-form-item label="操作者:" prop="nickName" label-width="82px">
-              <el-input v-model.trim="form.nickName" placeholder="请输入操作者" :disabled="true" :clearable="true"
-                style="width: 220px; margin-left: 8px" />
+              <el-input v-model.trim="form.nickName" placeholder="请输入操作者" readonly 
+                style="width: 220px; margin-left: 8px" >
+                <template #append>
+              <el-button icon="Search" @click="handleSelectUserSingle" v-if="editStatus && currentDept"  />
+            </template></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -140,6 +143,8 @@
           </el-table-column>
         </el-table>
       </div>
+        <!-- 搜索人员弹窗 -->
+        <dialog-person ref="dialogPersonRef" :single-selected="handleGetUser" />
     </div>
   </el-drawer>
 </template>
@@ -153,7 +158,7 @@ import {
 } from "@/api/business/daywork.js";
 import { listInspectionInstruction } from "@/api/business/productInspectionInstruction.js";
 import { ref } from "vue";
-
+import dialogPerson from "./person.vue"
 const { proxy } = getCurrentInstance();
 const emit = defineEmits(["handleSaveSuccess"]);
 /** 字典 */
@@ -355,6 +360,20 @@ const open = (row) => {
     visible.value = true;
   }
 };
+function handleSelectUserSingle(){
+      let info = {
+        deptId: detailInfo.value.deptId,
+        productionPlanDetailId: detailInfo.value.productionPlanDetailId
+      }
+       proxy.$refs.dialogPersonRef.open(info)
+}
+//操作者带回
+//操作者人员带回
+function handleGetUser(selection) {
+ form.value.nickName = selection.nickName;
+ form.value.userId = selection.userId;
+ form.value.userName = selection.userName;
+}
 /**
  * 对话框关闭 事件
  */
@@ -546,12 +565,16 @@ function handleQueryReject() {
           response.data[i].rejectNum = parseInt(response.data[i].rejectNum);
           response.data[i].type = response.data[i].type + '';
           if (sortProductInspection.value.length > 0) {
+            console.log(sortProductInspection.value)
+            console.log(response.data[i])
             response.data[i].standardList = sortProductInspection.value.filter(item => response.data[i].type == item.type).map(item => {
               return { value: item.inspectionInstructionId, label: item.standard }
             })
+            console.log(response.data[i].standardList)
             response.data[i].sortStandard = response.data[i].standardList.filter(item => response.data[i].checkStandard == item.label)[0].value
             console.log(response.data[i].sortStandard)
           }
+
         }
         form.value.groupRejectList = response.data;
       }

+ 1 - 0
src/views/business/employee/index.vue

@@ -495,6 +495,7 @@ function reset() {
     sex: "男",
     remark: "",
     contractCompanyId: null,
+    status:"0",
     roleIds: [],
   };
   proxy.resetForm("userRef");