guoyujia 1 year ago
parent
commit
ada4bb8344

+ 7 - 0
src/api/business/daywork.js

@@ -102,6 +102,13 @@ export function getProducedLot(query) {
 		params: query
 	})
 }
+export function getLotPosition(query) {
+	return request({
+		url: baseUrl + '/business/productionDaywork/getLotPosition',
+		method: 'get',
+		params: query
+	})
+}
 export function getItemProcess(query) {
 	return request({
 		url: baseUrl + '/business/productionDaywork/getItemProcess',

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

@@ -49,6 +49,14 @@ export function saveOrUpdateDetail(data) {
 	})
 }
 // 新增收回单明细
+export function saveDetailsForAdd(data) {
+	return request({
+		url: baseUrl + '/business/returnReceiptDetail/saveDetailsForAdd',
+		method: 'post',
+		data: data
+	})
+}
+// 新增收回单明细
 export function saveDetails(data) {
 	return request({
 		url: baseUrl + '/business/returnReceiptDetail/saveDetails',

+ 1 - 1
src/views/business/carrier/multipleForm.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="载具类别表单"
+    title="批量新增载具"
     v-model="visible"
     width="400px"
     append-to-body

+ 1 - 1
src/views/business/inspectionStandard/form.vue

@@ -1,5 +1,5 @@
 <template>
-	<el-dialog title="检查指导项表单" v-model="visible" width="500px" append-to-body draggable>
+	<el-dialog title="新增检查标准" v-model="visible" width="500px" append-to-body draggable>
 		<div class="form-container">
 			<el-form ref="formRef" class="master-container" :rules="rules" v-loading="loading" :model="form" label-width="80px">
 				<el-form-item label="检测标准" prop="standard" required>

+ 1 - 1
src/views/business/inspectionStandard/formCategory.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="检查指导项类别表单"
+    title="新建分选标准"
     v-model="visible"
     width="400px"
     append-to-body

+ 81 - 16
src/views/business/returnReceiptDetail/index.vue

@@ -65,6 +65,8 @@
     <!-- 功能按钮区 -->
     <div class="list-btns-container">
       <el-button
+      :disabled = "dataList.find(item => item.editStatus)"
+      v-if="!editStatus"
         type="primary"
         icon="Plus"
         v-hasPermi="['business:returnReceiptDetail:add']"
@@ -72,6 +74,15 @@
       >
         新增
       </el-button>
+      <el-button
+      v-else
+        type="primary"
+        icon="Plus"
+        v-hasPermi="['business:returnReceiptDetail:add']"
+        @click="handleAddDetail(null)"
+      >
+        保存
+      </el-button>
     </div>
     <!-- 渲染数据区 -->
     <div class="el-table-container">
@@ -88,7 +99,7 @@
             label="外协商"
             align="center"
             prop="supplierName"
-            width="104"
+            width="120"
           >
           </el-table-column>
           <el-table-column
@@ -106,13 +117,13 @@
             label="收回日期"
             align="center"
             prop="formDate"
-            width="120"
+            width="100"
           >
             <template #default="scope">
               {{ parseTime(scope.row.formDate, "{y}-{m}-{d}") }}
             </template>
           </el-table-column>
-          <el-table-column label="外协数量" align="center" prop="productNum" width="100"/>
+          <el-table-column label="外协数量" align="center" prop="productNum" width="90"/>
           <el-table-column
             label="外协工序"
             align="center"
@@ -135,7 +146,7 @@
             <template #default="scope">
               <el-input
                 v-model="scope.row.remark"
-                v-if="scope.row.editStatus"
+                v-if="!scope.row.editAuditStatus &&scope.row.editStatus"
               />
               <span v-else>{{ scope.row.remark }}</span>
             </template>
@@ -179,8 +190,9 @@
 		  <template #default="scope">
 			<!-- 保存按钮 -->
 			<el-button
-				v-if="scope.row.productionDeptId == 0 && (scope.row.editStatus === true || scope.row.editAuditStatus === true)"
+				v-if="scope.row.productionDeptId == 0 && scope.row.editStatus == true"
 				link
+        :disabled = "scope.row.allowClick == false"
 				:loading="isSubmitting"
         v-hasPermi="['business:returnReceiptDetail:add']"
 				type="primary"
@@ -190,8 +202,9 @@
 
 			<!-- 编辑按钮 -->
 			<el-button
-				v-if="scope.row.productionDeptId == 0 && !(scope.row.editStatus === true || scope.row.editAuditStatus === true)"
+				v-if="scope.row.productionDeptId == 0 && scope.row.editStatus == false "
 				link
+        :disabled = "scope.row.allowClick == false"
 				type="warning"
         v-hasPermi="['business:returnReceiptDetail:edit']"
 				icon="Edit"
@@ -200,8 +213,9 @@
 
 			<!-- 审核通过按钮 -->
 			<el-button
-				v-if="scope.row.status === 0 && scope.row.id && !scope.row.editStatus && !scope.row.editAuditStatus"
+				v-if="scope.row.status === 0 &&scope.row.isAudit ==1 && scope.row.id && scope.row.editStatus == false && scope.row.editAuditStatus == false"
 				link
+        :disabled = "scope.row.allowClick == false"
 				type="warning"
         v-hasPermi="['business:returnReceiptDetail:edit']"
 				icon="CircleCheck"
@@ -210,8 +224,9 @@
 
 			<!-- 审核不通过按钮 -->
 			<el-button
-				v-if="scope.row.status === 1 && scope.row.id && !scope.row.editStatus && !scope.row.editAuditStatus"
+				v-if="scope.row.status === 1 &&scope.row.isAudit ==1 && scope.row.id && scope.row.editStatus == false && scope.row.editAuditStatus == false"
 				link
+        :disabled = "scope.row.allowClick == false"
 				type="warning"
         v-hasPermi="['business:returnReceiptDetail:edit']"
 				icon="CircleClose"
@@ -220,8 +235,9 @@
 
 			<!-- 反选按钮 -->
 			<el-button
-				v-if="scope.row.id && scope.row.editStatus && scope.row.productionDeptId == 0 "
+				v-if="scope.row.id && scope.row.productionDeptId == 0 && scope.row.editStatus == false"
 				link
+        :disabled = "scope.row.allowClick == false"
         v-hasPermi="['business:returnReceiptDetail:remove']"
 				type="danger"
 				icon="Delete"
@@ -252,7 +268,7 @@
 </template>
 
 <script setup name="returnReceiptDetail">
-import { listDetail,saveDetails,delReceiptDetail} from '@/api/business/returnReceiptDetail'
+import { listDetail,saveDetails,delReceiptDetail,saveDetailsForAdd} from '@/api/business/returnReceiptDetail'
 import receiptDetailForm from './form'
 import dialogOutsourceDetails from './DialogOutsourceDetails'
 const { proxy } = getCurrentInstance()
@@ -262,6 +278,8 @@ const { is_audit_num } = proxy.useDict("is_audit_num");
 const spanProps = ref([])
 const dataList = ref([])
 const loading = ref(true)
+const editStatus = ref(false)
+const detailList = ref([])
 const isSubmitting = ref(false)
 const ids = ref([])
 const total = ref(0)
@@ -282,11 +300,13 @@ const queryParams = ref({
 带箱方式,是整单的。如果换新箱子,明细中,都需要更换箱子列表 */
 function getList() {
 	loading.value = true
+  editStatus.value = false
 	listDetail(queryParams.value).then((response) => {
 		dataList.value = response.rows
 		dataList.value.forEach(item => {
 			item.editStatus = false
 			item.editAuditStatus = false
+      item.allowClick = true
 		})
 		total.value = response.total
 		loading.value = false
@@ -320,6 +340,10 @@ function handleSelectionChange(selection) {
 // 外协明细选择带回
 const handleMultipleSelectedOutsourceDetails = (selection) => {
 	console.log(selection)
+  dataList.value.forEach(item=>{
+    item.allowClick = false
+  })
+  editStatus.value = true
 	for(let i = 0;i<selection.length;i++) {
 		for(let j = 0;j<selection[i].processes.length;j++) {
 			const newDetail = {
@@ -350,9 +374,11 @@ const handleMultipleSelectedOutsourceDetails = (selection) => {
 			status:0,
 			auditNum:selection[i].processes[j].qualifiedNum?selection[i].processes[j].qualifiedNum:0,
 			editStatus:true,
-			isAudit:1
+      isAudit:0
 			}
 		    dataList.value.unshift(newDetail)
+        //存放新增的明细,走总的保存方法
+        detailList.value.push(newDetail)
 			spanPropGroup(dataList.value)
 		}
 		}
@@ -367,9 +393,6 @@ function handleAdd(row) {
 	let tempList = dataList.value.filter(item=>{
 	return item.outsourceDetailId == row.outsourceDetailId})
   //保存时将确认状态置为1,从而让状态变成已确认
-  tempList.forEach(item =>{
-    item.isAudit = 1
-  })
 	for(let i = 0;i<tempList.length;i++) {
 		if(tempList[i].auditNum == 0){
 			isSubmitting.value = false
@@ -403,6 +426,40 @@ if(flag) {
           });
 }
 }
+//总保存方法
+function handleAddDetail() {
+  var flag = true;
+  for(let i = 0;i<detailList.value.length;i++) {
+		if(detailList.value[i].auditNum == 0){
+			proxy.$modal
+      .confirm("第" + (i + 1) + "行确定数量是否确定为0")
+      .then(() => {
+      })
+      .catch(() => {
+        flag = false; 
+      })
+	  .finally(() => {
+      console.log(flag)
+        // 无论用户点击确定还是取消,都在这里检查 flag 值
+        if (flag) {
+          saveDetailsForAdd(detailList.value).then(res => {
+            editStatus.value = false
+            proxy.$modal.msgSuccess('操作成功');
+            getList();
+          });
+        }
+      });
+    return;
+  }
+}
+if(flag) {
+  saveDetailsForAdd(detailList.value).then(res => {
+            editStatus.value = false
+            proxy.$modal.msgSuccess('操作成功');
+            getList();
+          });
+}
+}
 //审核通过
 function handleCheckDetail(row) {
 	let tempList = dataList.value.filter(item=>{
@@ -428,20 +485,28 @@ function handleNotCheckDetail(row) {
 				getList()
 		})
 }
+//编辑
 function handleEditAuditNum(row) {
 	let tempList = dataList.value.filter(item=>{
 	return item.outsourceDetailId == row.outsourceDetailId})
 	tempList.forEach(item=>{
 		item.editAuditStatus = true
-		item.editStatus = false
+		item.editStatus = true
+	})
+  //除了选中的数据
+  let infoList = dataList.value.filter(item=>{
+	return item.outsourceDetailId != row.outsourceDetailId})
+  infoList.forEach(item=>{
+		item.allowClick = false
 	})
+  console.log(row)
 }
 //反选操作
 function handleDelReturnReceiveDetail(row) {
 	proxy.$modal
     .confirm("是否确认删除选中的数据项,如果删除,同时删除该批次下所有工序?")
     .then(function () {
-		delReceiptDetail(row.id).then(res=>{
+		delReceiptDetail(row.outsourceDetailId).then(res=>{
 			proxy.$modal.msgSuccess('操作成功')
 				getList()
 		})

+ 271 - 0
src/views/business/searchPosition/index.vue

@@ -0,0 +1,271 @@
+<template>
+  <div class="page-container column-container">
+    <!-- 搜索区 -->
+    <el-form
+      class="list-search-container"
+      :model="queryParams"
+      ref="queryRef"
+      :inline="true"
+    >
+      <el-form-item label="产品描述:" prop="productDescription">
+        <el-input
+          v-model="queryParams.productDescription"
+          placeholder="请输入产品描述"
+          style="width: 144px"
+          clearable
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="批次号:" prop="lotCode">
+        <el-input
+          v-model="queryParams.lotCode"
+          placeholder="请输入批次号"
+          style="width: 144px"
+          clearable
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="工段:">
+        <el-autocomplete
+          v-model.trim="deptName"
+          clearable
+          :fetch-suggestions="queryDeptSearchAsync"
+          placeholder="请选择工段"
+          @select="handleDeptSelect"
+          style="width: 140px"
+          @clear="handleClearDept"
+        >
+          <template #default="{ item }">
+            <div
+              style="
+                display: flex;
+                flex-direction: row;
+                justify-content: space-between;
+              "
+            >
+              <div class="name" style="font-size: 12px">
+                {{ item.deptName }}
+              </div>
+            </div>
+          </template>
+        </el-autocomplete>
+      </el-form-item>
+      <el-form-item class="section-title" label="车间:">
+          <el-select-v2
+            v-model="queryParams.workshopId"
+            clearable
+            :options="workshopList"
+            placeholder="请选择车间"
+            style="width: 100%"
+          />
+        </el-form-item>
+      <el-form-item label="箱号:" prop="carrierCode">
+        <el-input
+          v-model="queryParams.carrierCode"
+          placeholder="请输入箱号"
+          style="width: 144px"
+          clearable
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="Search" @click="handleQuery"
+          >搜索</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <!-- 渲染数据区 -->
+    <div class="el-table-container">
+      <div class="el-table-inner-container">
+        <el-table
+          v-loading="loading"
+          :data="dataList"
+          size="small"
+          border
+          height="100%"
+        >
+          <el-table-column
+            label="客户简称"
+            align="center"
+            prop="companyAlias"
+            width="120"
+          />
+          <el-table-column
+            label="生产计划单号"
+            align="center"
+            prop="productionPlanNo"
+            width="120"
+          />
+          <el-table-column
+            label="序号"
+            align="center"
+            prop="lineNumber"
+            width="70"
+          />
+          <el-table-column
+            label="批次号"
+            align="center"
+            prop="lotCode"
+            width="120"
+          />
+          <el-table-column
+            label="产品描述"
+            align="center"
+            prop="productDescription"
+          />
+          <el-table-column
+            label="图纸版本"
+            align="center"
+            prop="technologyVersion"
+            width="120"
+          />
+          <el-table-column
+            label="投产量"
+            align="center"
+            prop="productionQuantity"
+            width="120"
+          />
+          <el-table-column
+            label="当前车间"
+            align="center"
+            prop="workshopName"
+            width="120"
+          />
+          <el-table-column
+            label="当前工段"
+            align="center"
+            prop="deptName"
+            width="120"
+          />
+          <el-table-column
+            label="当前工序"
+            align="center"
+            prop="processAlias"
+            width="120"
+          />
+          <el-table-column
+            label="车间周转区"
+            align="center"
+            prop="turnoverArea"
+            width="150"
+          />
+          <el-table-column
+            label="工段周转区"
+            align="center"
+            prop="place"
+            width="150"
+          />
+          <el-table-column
+            label="箱号"
+            align="centerName"
+            prop="carrierName"
+            width="120"
+          />
+        </el-table>
+      </div>
+    </div>
+
+    <!-- 分页 -->
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script setup name="SearchPosition">
+import { listDept } from "@/api/system/dept";
+import { getDeptList } from "@/api/system/dept.js";
+import {getLotPosition} from "@/api/business/daywork";
+import {listWorkshop} from "@/api/business/workshop";
+const { proxy } = getCurrentInstance();
+
+const dataList = ref([]);
+const loading = ref(false);
+const workshopList = ref([])
+const deptName = ref("");
+const deptList = ref([]);
+const multiple = ref(true);
+const total = ref(0);
+/** 查询对象 */
+const queryParams = ref({
+  pageNum: 1,
+  pageSize: 10,
+  productDescription: null,
+  lotCode: null,
+  workshopId: null,
+  carrierCode: null
+});
+
+/***********************  方法区  ****************************/
+function getDept() {
+  resetQuery()
+  //获取工段信息
+  getDeptList({ type: 0, isWorkSection: 1 }).then((res) => {
+    if (res.code == 200) {
+      deptList.value = res.data;
+    }
+  });
+  getWorkshop()
+  getList()
+}
+//获取车间
+function getWorkshop() {
+  listWorkshop().then(res => {
+    workshopList.value = res.rows.map(item => {
+      return {
+        label: item.name,
+        value: item.id
+      }
+    })
+  })
+}
+/** 查询外协单主
+带箱方式,是整单的。如果换新箱子,明细中,都需要更换箱子列表 */
+function getList() {
+  loading.value = true;
+  getLotPosition(queryParams.value).then((response) => {
+    dataList.value = response.rows;
+    total.value = response.total;
+    loading.value = false;
+  });
+}
+
+/** 搜索按钮操作 */
+function handleQuery() {
+  queryParams.value.pageNum = 1;
+  getList();
+}
+
+/** 重置按钮操作 */
+function resetQuery() {
+  proxy.resetForm("queryRef");
+  handleQuery();
+}
+const queryDeptSearchAsync = (arg, cb) => {
+  const params =
+    arg != null
+      ? { pageSize: 200, deptName: arg, isWorkSection: 1 }
+      : { pageSize: 200 };
+  listDept(params).then((res) => {
+    const depts = res.rows;
+    cb(depts);
+  });
+};
+
+const handleDeptSelect = (item) => {
+  console.log(item);
+  deptName.value = item.deptName.trim();
+  queryParams.value.deptId = item.deptId;
+};
+const handleClearDept = () => {
+  deptName.value = "";
+  queryParams.value.deptId = null;
+};
+
+
+getDept();
+</script>

+ 4 - 3
src/views/business/supplier/index.vue

@@ -317,7 +317,7 @@ const queryProductParams = ref({
 /** 产品工序查询对象 */
 const queryProductProcessParams = ref({
 	supplierId: '0',
-	productId: '0',
+	productId: null,
 	pageNum: 1,
 	pageSize: 10
 })
@@ -470,7 +470,7 @@ const handleDelProduct = (row) => {
 const getCurrentSupplierProductProcess = () => {
 	supplierProductProcessLoading.value = true
 	queryProductProcessParams.value.supplierId = currentSupplier.value.id
-	queryProductProcessParams.value.productId = currentProduct.value.productId
+	queryProductProcessParams.value.supplierProductId = currentProduct.value.id
 	getSupplierProductProcess(queryProductProcessParams.value).then((res) => {
 		supplierProductProcessList.value = res.data
 		supplierProductProcessLoading.value = false
@@ -504,7 +504,8 @@ const handleProcessSelected = (selection) => {
 			processAlias: item.processAlias,
 			price: 0.0,
 			settlementType: currentSupplier.value.settlementType,
-			remark: ''
+			remark: '',
+			supplierProductId:currentProduct.value.id
 		}
 		dataList.push(newProcess)
 	})

+ 1 - 1
src/views/system/role/authUser.vue

@@ -26,7 +26,7 @@
       <el-table-column label="员工编号" prop="userName" align="center"/>
       <el-table-column label="员工姓名" prop="nickName" align="center" />
       <el-table-column label="邮箱" prop="email" align="center" />
-      <el-table-column label="手机" prop="phonenumber" align="center" />
+      <el-table-column label="手机" prop="phoneNumber" align="center" />
       <el-table-column label="状态" align="center" prop="status">
         <template #default="scope">
           <dict-tag :options="sys_normal_disable" :value="scope.row.status" />

+ 1 - 1
src/views/system/role/selectUser.vue

@@ -18,7 +18,7 @@
       <el-table-column label="员工编号" prop="userName" :show-overflow-tooltip="true" />
       <el-table-column label="员工姓名" prop="nickName" :show-overflow-tooltip="true" />
       <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
-      <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
+      <el-table-column label="手机" prop="phoneNumber" :show-overflow-tooltip="true" />
       <!-- <el-table-column label="状态" align="center" prop="status">
           <template #default="scope">
             <dict-tag :options="sys_normal_disable" :value="scope.row.status" />