Browse Source

bug修复,需求修改

lupeng 1 week ago
parent
commit
73bb0c60bd

+ 11 - 0
src/api/braze/index.ts

@@ -12,6 +12,17 @@ export function operationBrazeQuery(operationId: string | number) {
   });
 }
 
+/**
+ * 获取工序钎焊绑定信息,传入工序id
+ * @param id
+ * @returns
+ */
+export function processBrazeQuery(operationId: string | number) {
+  return request({
+    url: `/api/v1/processBraze/query/${operationId}`,
+    method: "get",
+  });
+}
 
 
 /**

+ 29 - 1
src/views/pro-steps/components/wuliaocaiji.vue

@@ -45,6 +45,7 @@
     v-model="showXQ"
     :showInfo="showInfo"
     :showInfoData="showInfoData"
+    @submitItem="submitItem"
   />
   <caijiRightPopUp
     ref="caijiRef"
@@ -65,7 +66,6 @@ import {
   searchMaterial,
 } from "@/api/prosteps/wuliaocaiji";
 import { useProcessStore } from "@/store";
-
 defineOptions({
   name: "Wuliaocaiji",
 });
@@ -137,6 +137,34 @@ const submit = () => {
   let selectIndex = caijiRef.value.selectIndex;
   submitRecordAdd(selectIndex);
 };
+const itemRecord=ref([]);
+const submitItem = async (itemNum) => {
+  itemRecord.value=[];
+  let items={
+    operationId: store.odersData.operationId,
+      processId: store.scanInfo.id,
+    seqNo: store.scanInfo.seqNo,
+    scanCode: store.scanInfo.seqNo,
+    workOrderCode: store.odersData.workOrderCode,
+    operationName: store.scanInfo.operationName,
+    needNum:showInfo.value.needNum,
+    itemCode:showInfo.value.itemCode,
+    itemName:showInfo.value.itemName,
+    itemModel:showInfo.value.itemModel,
+    itemSeq:showInfo.value.itemCode,
+    trackType:"S",
+    num:itemNum.value
+  }
+
+  itemRecord.value.push(items);
+  console.log(itemRecord.value);
+  const { code, data } = await itemRecordAdd(itemRecord.value);
+  if (code == "200") {
+    showXQ.value = false;
+    ElMessage.success("录入成功");
+    getOpCompentData();
+  }
+};
 
 //获取tag列表数据
 const getOpCompentData = async () => {

+ 23 - 4
src/views/pro-steps/components/zhiyin.vue

@@ -13,10 +13,11 @@
             :key="item.id"
             :label="item.brazeName"
             :value="item.id"
+            :style="{ color: priorityColor(item.isComplete) }"
           >
           </el-option>
         </el-select>
-        <el-button style="margin-left: 10px" type="success" @click="finishAll"
+        <el-button style="margin-left: 10px" type="success" @click="finishAll" v-if="!complete"
           >一键完成</el-button
         >
       </div>
@@ -95,6 +96,7 @@
 import { useProcessStore } from "@/store";
 import {
   operationBrazeQuery,
+  processBrazeQuery,
   processBrazePage1,
   processBrazeUpdate,
   processBrazeCompleteAll,
@@ -105,8 +107,14 @@ const proStore = useProcessStore();
 const selectBraze = ref([]);
 const brazeOption = ref([]);
 const baseUrl = import.meta.env.VITE_APP_UPLOAD_URL;
+const  complete=ref(false);
+const priorityColor=(isComplete)=>{
+    if(isComplete){
+       return 'green';
+    }
+}
 const getBrazeOption = () => {
-  operationBrazeQuery(proStore.odersData.operationId).then((res) => {
+  processBrazeQuery(proStore.odersData.operationId).then((res) => {
     brazeOption.value = res.data;
     if (res.data) {
       selectBraze.value = res.data[0].id;
@@ -178,9 +186,20 @@ const finishAll = async () => {
       processId: proStore.scanInfo.id,
       brazeId: selectBraze.value,
     };
-    await processBrazeCompleteAll(params);
+    let obj=brazeOption.value.find(item=>item.id===selectBraze.value);
+    if(obj.isComplete){
+      ElMessage.error("已全部完成不可再点!");
+      return;
+    }
+    await processBrazeCompleteAll(params).then(
+      (data)=>{
+        if(data.code==='200'){
+          getBrazeOption();
+        }
+      }
+    );
     ElMessage.success("操作成功");
-    handleSelectChange(selectBraze.value);
+    handleSelectChange(selectBraze.value)
   });
 };
 const toFinish = async (row) => {

+ 50 - 3
src/views/pro-steps/popUpView/xiangqingPopUp.vue

@@ -13,6 +13,7 @@
         </div>
         <div class="rightBox">
           <div></div>
+
           <div class="sumBox">
             <div class="describeText">录入数量</div>
             <div class="sum">
@@ -24,23 +25,37 @@
       <el-divider />
       <el-scrollbar>
         <div class="body">
+          <div class="centerInput" v-if="!showInfo.realNum||showInfo.realNum < showInfo.needNum">
+            <div></div>
+            <div class="operate" >
+              <div class="describeText operateText">录入数量</div>
+               <NumberInput v-model="itemNum" :min="1" :max="showInfo.needNum-showInfo.realNum" style="margin-left: 140px;margin-bottom: 10px"/>
+            </div>
+          </div>
           <div
             class="info titleText"
             v-for="(item, index) in showInfoData"
             :key="index"
           >
-            {{ item.batchNo }} &nbsp;&nbsp;&nbsp;&nbsp;* {{ item.num }}
+            {{ item.created }} &nbsp;&nbsp;&nbsp;&nbsp;* {{ item.num }}
             <span style="margin-right: 10px"></span>
           </div>
           <Empty v-if="showInfoData.length == 0" />
         </div>
+
       </el-scrollbar>
+      <div class="bottomBtn" v-if="!showInfo.realNum||showInfo.realNum < showInfo.needNum">
+        <el-button class="leftBtn" @click="handleClose">取消</el-button>
+        <el-button class="rightBtn" @click="submit" type="primary"
+        >确认</el-button
+        >
+      </div>
     </div>
   </div>
 </template>
 
 <script lang="ts" setup>
-const emits = defineEmits(["update:modelValue"]);
+const emits = defineEmits(["update:modelValue","submitItem"]);
 const props = defineProps({
   modelValue: {
     type: Boolean,
@@ -53,7 +68,11 @@ const props = defineProps({
     type: Object,
   },
 });
+const submit=()=>{
+  emits("submitItem",itemNum);
+}
 const scanCode = ref("");
+const itemNum=ref(1);
 const handleClose = () => {
   emits("update:modelValue", false);
 };
@@ -77,7 +96,9 @@ const handleClose = () => {
 .describeText {
   line-height: 25px !important;
 }
-
+.centerInput{
+  text-align: center;
+}
 .infoBox {
   width: 100%;
   height: 200px;
@@ -134,4 +155,30 @@ const handleClose = () => {
     line-height: 70px;
   }
 }
+.bottomBtn {
+  width: 100%;
+  height: 70px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: $p10 10% 0 10%;
+
+  .leftBtn {
+    height: 55px;
+    width: 45%;
+    border-radius: 16px;
+    font-size: $f20;
+    color: #0a59f7;
+    background-color: #00000015;
+    border: 0px;
+  }
+
+  .rightBtn {
+    height: 55px;
+    width: 45%;
+    border-radius: 16px;
+    font-size: $f20;
+    color: white;
+  }
+}
 </style>