Browse Source

Merge branch 'master' of http://192.168.101.4:3000/jiaxiaoqiang/JG-CLIENT-TEMP

jiaxiaoqiang 1 year ago
parent
commit
18605772ca

+ 1 - 1
.env.development

@@ -13,7 +13,7 @@ VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
 # 线上接口地址
 # VITE_APP_API_URL = http://vapi.youlai.tech
 # 开发接口地址
- VITE_APP_API_URL = 'http://192.168.101.90:8079'
+ VITE_APP_API_URL = 'http://192.168.101.4:8079'
 
 ``
 # 是否启用 Mock 服务

+ 0 - 1
src/views/pro-operation/call-materiel/index.vue

@@ -58,7 +58,6 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
   width: 290px;
   height: 80px;
   border-radius: 0;
-
   font-weight: 500;
   font-size: 24px;
   overflow: hidden;

+ 1 - 0
src/views/pro-steps/Jiluxiang.vue

@@ -2,6 +2,7 @@
   <!-- <MaterialCollectionDG ref="MaterialCollectionDGRef" />
   <el-button @click="handleClick">物料采集</el-button>
   <el-input v-model="input" style="width: 240px" placeholder="Please input" /> -->
+
   <el-scrollbar style="padding-bottom: 24px">
     <LeftBarInfo />
     <Operates />

+ 14 - 3
src/views/pro-steps/components/ESOP.vue

@@ -3,7 +3,7 @@
     <div class="header">
       <div class="imgView">
         <el-image class="img" :src="getImgurl(srcList[selectImgIndex]?.imgUrl)" :initial-index="selectImgIndex"
-          :preview-src-list="srcList" fit="cover" />
+          :preview-src-list="showSrcList" fit="cover" />
       </div>
 
       <div class="textBox">
@@ -52,6 +52,16 @@ const setScrollbarHeight = () => {
   scrollbarHeight.value = viewportHeight - 300;
 };
 const srcList = ref([]);
+const showSrcList = ref([]);
+const setShowSrcList = () => {
+  let array = JSON.parse(JSON.stringify(srcList.value));
+  let resArray = [];
+  array.forEach((item) => {
+    resArray.push(getImgurl(item.imgUrl));
+  });
+  showSrcList.value = resArray;
+  console.log(resArray, "resArray");
+};
 const getImgListData = async () => {
   const { data } = await getImgList({
     // operationId: store.odersData.operationId,
@@ -61,9 +71,10 @@ const getImgListData = async () => {
   });
   srcList.value = data.records;
 };
-onMounted(() => {
+onMounted(async () => {
   setScrollbarHeight();
-  getImgListData();
+  await getImgListData();
+  setShowSrcList();
 });
 </script>
 

+ 4 - 1
src/views/pro-steps/components/jiluxiang.vue

@@ -14,7 +14,10 @@
       </div>
       <div class="rightOperate">
         <div></div>
-        <NumberInput v-model="input" />
+        <div class="operate">
+          <div class="describeText operateText">实际值</div>
+          <NumberInput v-model="input" />
+        </div>
       </div>
     </div>
   </div>

+ 2 - 2
src/views/pro-steps/components/leftBarInfo.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="container">
+  <div class="containerBox">
     <div class="textBox">
       <el-tooltip class="box-item" effect="dark" :content="processInfo.materialName" placement="left" trigger="click">
         <div class="titleText blackColor">
@@ -48,7 +48,7 @@ onMounted(() => {
   right: 0;
 }
 
-.container {
+.containerBox {
   width: 100%;
   height: 200px;
   border-radius: 16px;

+ 4 - 8
src/views/pro-steps/components/operates.vue

@@ -1,11 +1,7 @@
 <template>
-  <div class="container">
-    <div
-      v-for="(item, index) in stepComponents"
-      :key="index"
-      :class="selectIndex == index ? 'operator active' : 'operator'"
-      @click="setIndex(index)"
-    >
+  <div class="containerBox">
+    <div v-for="(item, index) in stepComponents" :key="index"
+      :class="selectIndex == index ? 'operator active' : 'operator'" @click="setIndex(index)">
       <div class="operatorText">{{ item.compentName }}</div>
       <div class="operatorIcon">
         <svg-icon :icon-class="item.compentType" size="45" />
@@ -88,7 +84,7 @@ const stepComponents = ref([
 </script>
 
 <style lang="scss" scoped>
-.container {
+.containerBox {
   width: 100%;
   font-weight: $Medium;
 

+ 24 - 3
src/views/pro-steps/components/wuliaocaiji.vue

@@ -24,7 +24,7 @@
     </div>
   </div>
   <xiangqingPopUp v-model="showXQ" />
-  <caijiRightPopUp v-model="showCJ" />
+  <caijiRightPopUp v-model="showCJ" @submit="submit" ref="caijiRef" :seqNo="scanCode" />
 </template>
 
 <script lang="ts" setup>
@@ -34,13 +34,14 @@ import xiangqingPopUp from "../popUpView/xiangqingPopUp.vue";
 import {
   recordList,
   searchMaterial,
-  itemInfoList,
+  itemRecordAdd,
 } from "@/api/prosteps/wuliaocaiji";
 import { useProcessStore } from "@/store";
 
 defineOptions({
   name: "Wuliaocaiji",
 });
+const caijiRef = ref(null);
 const store = useProcessStore();
 const scanCode = ref("");
 const showXQ = ref(false);
@@ -61,7 +62,7 @@ const enterfnc = async () => {
     workOrderCode: "GD2404150002",
   });
   if (code == "200") {
-    scanData.value = data;
+    scanData.value = [...data, ...data];
     showCJ.value = true;
   }
 };
@@ -69,6 +70,26 @@ const opCompentDataList = ref([]);
 const toXQPop = async (item: any) => {
   showXQ.value = true;
 };
+//提交录入信息
+const submitRecordAdd = async (index) => {
+  console.log(index, "222");
+  const { data } = await itemRecordAdd({
+    itemCode: "242",
+    itemModel: "14",
+    itemName: "1202010000005",
+    itemSeq: "1202010000005",
+    operationId: "1202010000005",
+    processId: "1202010000005",
+    trackBy: "name",
+    workOrderCode: "1202010000005",
+  });
+};
+const submit = () => {
+  let selectIndex = caijiRef.value.selectIndex;
+  console.log(selectIndex);
+  submitRecordAdd(selectIndex);
+};
+
 //获取tag列表数据
 const getOpCompentData = async () => {
   // const { data } = await recordList({

+ 1 - 0
src/views/pro-steps/index.vue

@@ -47,6 +47,7 @@ defineOptions({ name: "ProSteps" });
 const route = useRoute();
 const router = useRouter();
 const loading = ref(false);
+
 //配置标签信息Data
 const stepComponents = ref([]);
 const defaultComponents = [

+ 32 - 6
src/views/pro-steps/popUpView/caijiRightPopUp.vue

@@ -4,12 +4,12 @@
       <div class="headerTittle">物料采集</div>
       <div class="header">
         <div class="inputBox">
-          <ScanCodeInput v-model="scanCode" />
+          <ScanCodeInput v-model="showSeqNo" />
         </div>
       </div>
       <el-scrollbar>
         <div class="body">
-          <div class="infoBox" v-for="(item, index) in scanData" :key="index">
+          <div class="infoBox" v-for="(item, index) in scanData" @click="setSelectIndex(index)" :key="index">
             <div class="leftInfo">
               <div class="titleText">{{ item.materialName }}</div>
               <div class="describeText">{{ item.spec }}</div>
@@ -20,32 +20,52 @@
             </div>
             <div class="rightInput">
               <div></div>
-              <NumberInput />
+              <div class="operate">
+                <div class="describeText operateText">录入数量</div>
+                <template v-if="selectIndex == index">
+                  <NumberInput v-model="scanSum" />
+                </template>
+                <div v-else class="titleText">0</div>
+              </div>
             </div>
           </div>
         </div>
       </el-scrollbar>
       <div class="bottomBtn">
         <el-button class="leftBtn" @click="handleClose">取消</el-button>
-        <el-button class="rightBtn" type="primary">确认</el-button>
+        <el-button class="rightBtn" @click="emits('submit')" type="primary">确认</el-button>
       </div>
     </div>
   </div>
 </template>
 
 <script lang="ts" setup>
-const emits = defineEmits(["update:modelValue"]);
+const emits = defineEmits(["update:modelValue", "submit"]);
 const props = defineProps<{
   modelValue: {
     type: Boolean;
     default: false;
   };
+  seqNo: {
+    type: String;
+    default: "";
+  };
 }>();
+const selectIndex = ref();
+const setSelectIndex = (index: number) => {
+  selectIndex.value = index;
+};
 const scanData = inject("scanData");
-const scanCode = ref("");
+const scanSum = ref(0);
 const handleClose = () => {
   emits("update:modelValue", false);
 };
+const showSeqNo = computed(() => {
+  return props.seqNo;
+});
+defineExpose({
+  selectIndex,
+});
 </script>
 
 <style lang="scss" scoped>
@@ -90,6 +110,12 @@ const handleClose = () => {
       display: flex;
       flex-direction: column;
       justify-content: space-between;
+
+      .operate {
+        .operateText {
+          text-align: left;
+        }
+      }
     }
   }
 }