Procházet zdrojové kódy

app功能修改 以及文件上传修改

cz před 1 rokem
rodič
revize
1760d6a95c

+ 5 - 1
.env.development

@@ -12,4 +12,8 @@ VUE_APP_WS_API = ':20010/test-api'
 VUE_APP_IP = '121.37.194.75'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
-VUE_APP_COMPRESS = gzip
+VUE_APP_COMPRESS = gzip
+
+#上传文件地址
+VUE_APP_UPLOAD_API='121.37.194.75:20010'
+VUE_APP_UPLOAD_BASE_API = '/test-api'

+ 5 - 1
.env.prod

@@ -12,4 +12,8 @@ VUE_APP_COMPRESS = gzip
 
 VUE_APP_WS_API = ':9900/prod-api'
 
-VUE_APP_IP = '139.9.102.170'
+VUE_APP_IP = '139.9.102.170'
+
+#上传文件地址
+VUE_APP_UPLOAD_API='121.37.194.75:20010'
+VUE_APP_UPLOAD_BASE_API = '/test-api'

+ 0 - 19
.env.prodSmt

@@ -1,19 +0,0 @@
-# 页面标题
-VUE_APP_TITLE = SANFAN MES制造执行系统
-
-# 生产环境配置
-VUE_APP_ENV = 'prodSmt'
-
-# 用户名
-VUE_APP_USERNAME = 'smt'
-
-# 若依管理系统/生产环境
-VUE_APP_BASE_API = '/prod-api'
-
-# 是否在打包时开启压缩,支持 gzip 和 brotli
-VUE_APP_COMPRESS = gzip
-
-VUE_APP_WS_API = '/prod-api'
-
-VUE_APP_IP = '139.159.251.109'
-

+ 0 - 15
.env.smt

@@ -1,15 +0,0 @@
-# 页面标题
-VUE_APP_TITLE = SANFAN MES制造执行系统
-
-# 生产环境配置
-VUE_APP_ENV = 'development'
-
-# 用户名
-VUE_APP_USERNAME = 'smt'
-
-# 若依管理系统/生产环境
-VUE_APP_BASE_API = '/test-api'
-
-# 是否在打包时开启压缩,支持 gzip 和 brotli
-VUE_APP_COMPRESS = gzip
-

+ 5 - 5
.env.staging

@@ -4,18 +4,18 @@ VUE_APP_TITLE = SANFAN MES制造执行系统
 # 生产环境配置
 VUE_APP_ENV = 'staging'
 
-# 用户名
-
-
 # 若依管理系统/生产环境
 VUE_APP_WS_API = ':20010/test-api'
 
 # 若依管理系统/生产环境
 VUE_APP_BASE_API = '/test-api'
 
-
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VUE_APP_COMPRESS = gzip
 
+VUE_APP_IP = '121.37.194.75'
+
 
-VUE_APP_IP = '121.37.194.75'
+#上传文件地址
+VUE_APP_UPLOAD_API='121.37.194.75:20010'
+VUE_APP_UPLOAD_BASE_API = '/test-api'

+ 1 - 4
package.json

@@ -7,10 +7,7 @@
     "build": "vue-cli-service build --mode staging",
     "build:prod": "vue-cli-service build --mode prod",
     "build:staging": "vue-cli-service build --mode staging",
-    "dev": "vue-cli-service serve --mode development",
-    "dev:smt": "vue-cli-service serve --mode smt",
-    "build:prodSmt": "vue-cli-service build --mode prodSmt",
-    "build:stagingSmt": "vue-cli-service build --mode smt"
+    "dev": "vue-cli-service serve --mode development"
   },
   "dependencies": {
     "@zxing/library": "^0.20.0",

+ 1 - 1
src/components/common-list.vue

@@ -17,7 +17,7 @@
                 {{ j.slotName }}插槽占位符
               </slot>
             </span>
-            <span v-else style="flex: 1;">
+            <span v-else style="flex: 1;" :style="j.style?j.style:{}">
               {{ i[j.prop] || ''}}
             </span>
           </div>

+ 4 - 2
src/components/testForm/index.vue

@@ -684,7 +684,7 @@ const afterRead = (file) => {
           let forms = new FormData();
           forms.append("file", file[i].file);
           proxy
-            .post("https://winfaster.obs.cn-south-1.myhuaweicloud.com", {
+            .post(proxy.uploadUrl, {
               ...res.data.uploadBody,
               file: forms.get("file"),
             })
@@ -692,6 +692,7 @@ const afterRead = (file) => {
               () => {
                 file[i].id = res.data.id;
                 file[i].url = res.data.fileUrl;
+                file[i].fileUrl = res.data.fileUrl;
                 file[i].fileName = res.data.fileName;
                 delete file[i].status;
                 delete file[i].message;
@@ -716,7 +717,7 @@ const afterRead = (file) => {
         let forms = new FormData();
         forms.append("file", file.file);
         proxy
-          .post("https://winfaster.obs.cn-south-1.myhuaweicloud.com", {
+          .post(proxy.uploadUrl, {
             ...res.data.uploadBody,
             file: forms.get("file"),
           })
@@ -724,6 +725,7 @@ const afterRead = (file) => {
             () => {
               file.id = res.data.id;
               file.url = res.data.fileUrl;
+              file.fileUrl = res.data.fileUrl;
               file.fileName = res.data.fileName;
               delete file.status;
               delete file.message;

+ 12 - 12
src/lang/cn.js

@@ -57,19 +57,19 @@ export const lang = {
 		noMatchingData: '无匹配数据',
 		selectDate: '选择日期',
 		selectTime: '选择时间',
-		selectDate:'选择日期',
-		selectTime:'选择时间',
-		view:'查看',
-		contractChange:'合同变更',
+		selectDate: '选择日期',
+		selectTime: '选择时间',
+		view: '查看',
+		contractChange: '合同变更',
 	},
-	historyMessage:{
+	historyMessage: {
 		//历史消息,全部,消息类型,发送时间,消息内容
-		name:'历史消息',
-		all:'全部',
-		messageType:'消息类型',
-		sendTime:'发送时间',
-		messageContent:'消息内容',
-		
+		name: '历史消息',
+		all: '全部',
+		messageType: '消息类型',
+		sendTime: '发送时间',
+		messageContent: '消息内容',
+
 	},
 	processApproval: {
 		//流程办理,流程类型,流程标题,发起人
@@ -933,7 +933,7 @@ export const lang = {
 		deviceInformation: "设备信息",
 		switchLanguage: 'switch English',
 		logOut: '退出登录',
-		title: "SANFAN MES制造执行系统管理系统",
+		title: "SANFAN MES制造执行系统",
 		form: {
 			tenantId: "请输入租户ID",
 			username: "请输入账号",

+ 11 - 0
src/main.js

@@ -18,6 +18,14 @@ import {
   handleTree
 } from "@/utils/ruoyi";
 
+// 全局文件上传地址
+let prefix =
+  window.location.protocol.indexOf("https") >= 0 ? "https://" : "http://";
+const uploadUrl =
+  prefix +
+  process.env.VUE_APP_UPLOAD_API +
+  process.env.VUE_APP_UPLOAD_BASE_API + '/open/fileInfo/upload'
+
 const app = createApp(App);
 app.use(router);
 app.use(i18n).mount("#app");
@@ -50,6 +58,9 @@ app.config.globalProperties.deepClone = deepClone;
 app.config.globalProperties.handleTree = handleTree;
 
 app.config.globalProperties.getFile = getFile;
+app.config.globalProperties.uploadUrl = uploadUrl;
+
+
 
 
 

+ 11 - 1
src/utils/axios.js

@@ -18,11 +18,20 @@ import {
 } from '@/utils/auth'
 import CryptoJS from 'crypto-js'
 
+// 全局文件上传地址
+let prefix =
+  window.location.protocol.indexOf("https") >= 0 ? "https://" : "http://";
+const uploadUrl =
+  prefix +
+  process.env.VUE_APP_UPLOAD_API +
+  process.env.VUE_APP_UPLOAD_BASE_API + '/open/fileInfo/upload'
+
 // 是否显示重新登录
 export let isRelogin = {
   show: false
 };
 import 'vant/lib/index.css'
+// 响应体默认返回application/json json数据
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 创建axios实例
 const service = axios.create({
@@ -64,7 +73,8 @@ service.interceptors.request.use(config => {
     config.headers['Authorization'] = encrypted // 让每个请求携带自定义token 请根据实际情况自行修改
     config.headers['randomNumber'] = randomNumber
   }
-  if (config.url === 'https://winfaster.obs.cn-south-1.myhuaweicloud.com') {
+  if (config.url == uploadUrl) {
+    // 用于文件上传的表单数据
     config.headers['Content-Type'] = 'multipart/form-data'
   }
   // get请求映射params参数

+ 1 - 1
src/views/MES/processes/add.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="form" style="padding-bottom: 60px">
-    <van-nav-bar :title="$t('task.name')" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft">
+    <van-nav-bar :title="'工序管理'" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft">
     </van-nav-bar>
     <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit" ref="formDom"></testForm>
   </div>

+ 1 - 1
src/views/MES/processes/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div style="padding-bottom: 60px">
-    <van-nav-bar :title="$t('workOrder.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+    <van-nav-bar :title="'工序管理'" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
       <!-- <template #right> {{$t('common.add')}} </template> -->
     </van-nav-bar>
     <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />

+ 21 - 21
src/views/MES/productionReport/index.vue

@@ -132,28 +132,28 @@ const handleScanCode = () => {
   });
 };
 
-const showScanData = (val) => {
-  proxy.post("/productionTaskDetail/snInfo", { productSn: val }).then((res) => {
-    if (res.data && res.data.productId) {
-      formData.data.productId = res.data.productId;
-      formData.data.productSn = res.data.productSn;
-      formData.data.code = res.data.contractCode;
-      formData.data.productName = res.data.productName;
-      formData.data.productSpec = res.data.productSpec;
-      formData.data.customerName = res.data.customerName;
-    }
-  });
-};
+// const showScanData = (val) => {
+//   proxy.post("/productionTaskDetail/snInfo", { productSn: val }).then((res) => {
+//     if (res.data && res.data.productId) {
+//       formData.data.productId = res.data.productId;
+//       formData.data.productSn = res.data.productSn;
+//       formData.data.code = res.data.contractCode;
+//       formData.data.productName = res.data.productName;
+//       formData.data.productSpec = res.data.productSpec;
+//       formData.data.customerName = res.data.customerName;
+//     }
+//   });
+// };
 
-onMounted(() => {
-  nextTick(() => {
-    window.getVueMessage = (data) => {
-      if (data) {
-        showScanData(data);
-      }
-    };
-  });
-});
+// onMounted(() => {
+//   nextTick(() => {
+//     window.getVueMessage = (data) => {
+//       if (data) {
+//         showScanData(data);
+//       }
+//     };
+//   });
+// });
 </script>
 
 <style lang="scss" scoped>

+ 21 - 21
src/views/MES/reportDetail/index.vue

@@ -132,28 +132,28 @@ const handleScanCode = () => {
   });
 };
 
-const showScanData = (val) => {
-  proxy.post("/productionTaskDetail/snInfo", { productSn: val }).then((res) => {
-    if (res.data && res.data.productId) {
-      formData.data.productId = res.data.productId;
-      formData.data.productSn = res.data.productSn;
-      formData.data.code = res.data.contractCode;
-      formData.data.productName = res.data.productName;
-      formData.data.productSpec = res.data.productSpec;
-      formData.data.customerName = res.data.customerName;
-    }
-  });
-};
+// const showScanData = (val) => {
+//   proxy.post("/productionTaskDetail/snInfo", { productSn: val }).then((res) => {
+//     if (res.data && res.data.productId) {
+//       formData.data.productId = res.data.productId;
+//       formData.data.productSn = res.data.productSn;
+//       formData.data.code = res.data.contractCode;
+//       formData.data.productName = res.data.productName;
+//       formData.data.productSpec = res.data.productSpec;
+//       formData.data.customerName = res.data.customerName;
+//     }
+//   });
+// };
 
-onMounted(() => {
-  nextTick(() => {
-    window.getVueMessage = (data) => {
-      if (data) {
-        showScanData(data);
-      }
-    };
-  });
-});
+// onMounted(() => {
+//   nextTick(() => {
+//     window.getVueMessage = (data) => {
+//       if (data) {
+//         showScanData(data);
+//       }
+//     };
+//   });
+// });
 </script>
 
 <style lang="scss" scoped>

+ 46 - 13
src/views/MES/supplementaryOrder/add.vue

@@ -25,6 +25,7 @@ const formData = reactive({
   data: {
     prodOrderId: "",
     respUserSet: [],
+    fileList: [],
   },
 });
 const formDom = ref(null);
@@ -149,7 +150,7 @@ const formConfig = reactive([
   },
   {
     type: "input",
-    label: "数量",
+    label: "报损数量",
     prop: "quantity",
     itemType: "digit",
   },
@@ -159,6 +160,11 @@ const formConfig = reactive([
     label: "备注",
     prop: "remark",
   },
+  {
+    type: "upload",
+    label: "照片上传",
+    prop: "fileList",
+  },
 ]);
 const rules = {
   type: [{ required: true, message: "请选择类型" }],
@@ -214,7 +220,25 @@ const getDetail = () => {
     .then(
       (res) => {
         formData.data = res.data;
+        formData.data.fileList = [];
         formData.data.respUserSet = res.data.respUserSet.split(",");
+        proxy
+          .post("/fileInfo/getList", { businessIdList: [route.query.id] })
+          .then((res) => {
+            if (
+              res.data[route.query.id] &&
+              res.data[route.query.id].length > 0
+            ) {
+              formData.data.fileList = res.data[route.query.id].map((item) => {
+                return {
+                  ...item,
+                  url: item.fileUrl,
+                };
+              });
+            } else {
+              formData.data.fileList = [];
+            }
+          });
         setTimeout(() => {
           formDom.value.formDataShowLabelOne();
         }, 200);
@@ -229,19 +253,25 @@ const getDetail = () => {
 
 const onClickLeft = () => history.back();
 const onSubmit = () => {
-  if (Number(formData.data.quantity) < 1) {
-    return showFailToast("数量不能为0");
-  }
-  if (Number(formData.data.quantity) > Number(formData.data.productQuantity)) {
-    return showFailToast("数量不可大于物品数量");
+  if (formData.data.fileList && formData.data.fileList.length > 0) {
+    if (Number(formData.data.quantity) < 1) {
+      return showFailToast("数量不能为0");
+    }
+    if (
+      Number(formData.data.quantity) > Number(formData.data.productQuantity)
+    ) {
+      return showFailToast("数量不可大于物品数量");
+    }
+    formData.data.respUserSet = formData.data.respUserSet.join(",");
+    proxy.post("/reportLossesDetails/add", formData.data).then(() => {
+      showSuccessToast(proxy.t("common.addSuccess"));
+      setTimeout(() => {
+        proxy.$router.push("/main/supplementaryOrder");
+      }, 500);
+    });
+  } else {
+    return showFailToast("请上传照片");
   }
-  formData.data.respUserSet = formData.data.respUserSet.join(",");
-  proxy.post("/reportLossesDetails/add", formData.data).then(() => {
-    showSuccessToast(proxy.t("common.addSuccess"));
-    setTimeout(() => {
-      proxy.$router.push("/main/supplementaryOrder");
-    }, 500);
-  });
 };
 
 onMounted(() => {
@@ -250,6 +280,9 @@ onMounted(() => {
     getDetail();
     formOption.readonly = true;
     formOption.hiddenSubmitBtn = true;
+  } else {
+    formData.data.respUserSet = [getUserInfo().userId];
+    formData.data.respUserSetName = getUserInfo().nickName;
   }
 });
 </script>

+ 4 - 1
src/views/MES/supplementaryOrder/index.vue

@@ -54,8 +54,11 @@ const listConfig = ref([
     prop: "materialName",
   },
   {
-    label: "数量",
+    label: "报工数量",
     prop: "quantity",
+    style: {
+      color: "red",
+    },
   },
   {
     label: "备注",

+ 2 - 3
src/views/login.vue

@@ -27,7 +27,7 @@
         </div>
       </van-form>
     </div>
-    <div class="login-btn">
+    <!-- <div class="login-btn">
       <div class="check-warp">
         <div class="check-icon-warp">
           <van-checkbox icon-size="16px" v-model="clause"></van-checkbox>
@@ -40,9 +40,8 @@
         </div>
       </div>
 
-    </div>
+    </div> -->
     <van-dialog v-model:show="langModal" title="选择语言" show-cancel-button @confirm="changeLang">
-
       <van-radio-group v-model="langType">
         <van-radio name="zh-cn" style="height:50px;padding-left: 20px;">简体中文</van-radio>
         <van-radio name="en-us" style="height:50px;padding-left: 20px;">English</van-radio>

+ 81 - 7
src/views/processApproval/components/EhsdContract.vue

@@ -17,20 +17,58 @@
         </testForm>
       </div>
       <div class="common-process-card" v-show="active == 1">
-        <div class="common-title">付款信息</div>
+        <!-- <div class="common-title">付款信息</div> -->
+        <!-- <div class="_title">
+          <div class="line"></div>
+          <div> 付款信息</div>
+        </div> -->
+        <van-field style="border-bottom:1px solid #0084ff;width:45%">
+          <template #input>
+            <div class="_title">
+              <div class="line"></div>
+              <div> 付款信息</div>
+            </div>
+          </template>
+        </van-field>
         <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfigOne" :rules="rules" ref="formDom2">
         </testForm>
       </div>
       <div class="common-process-card" v-show="active == 2">
-        <div class="common-title">商品信息</div>
+        <!-- <div class="common-title">商品信息</div> -->
+
+        <van-field style="border-bottom:1px solid #0084ff;width:45%">
+          <template #input>
+            <div class="_title">
+              <div class="line"></div>
+              <div> 商品信息</div>
+            </div>
+          </template>
+        </van-field>
         <testForm v-model="formData.data" :formOption="formGoodsOption" :formConfig="formEmptyConfig" :rules="rules" ref="formDom3">
         </testForm>
       </div>
       <div class="common-process-card" v-show="active == 3">
-        <div class="common-title">其他收费</div>
+        <!-- <div class="common-title">其他收费</div> -->
+        <!-- <div class="_title">
+          <div class="line"></div>
+          <div> 其他收费</div>
+        </div> -->
+        <van-field style="border-bottom:1px solid #0084ff;width:45%">
+          <template #input>
+            <div class="_title">
+              <div class="line"></div>
+              <div> 其他收费</div>
+            </div>
+          </template>
+        </van-field>
         <testForm v-model="formData.data" :formOption="formProjectOption" :formConfig="formEmptyConfig" :rules="rules" ref="formDom4">
         </testForm>
         <testForm v-model="formData.data" :formOption="formOption" :formConfig="formAmountProjectConfig" :rules="rules" ref="formDom5">
+          <template #templateContent>
+            <div style="width:100%">
+              <span v-html="formData.data.templateContent"></span>
+            </div>
+          </template>
         </testForm>
       </div>
 
@@ -92,7 +130,14 @@ const formOption = reactive({
 const formConfigCode = reactive([
   {
     type: "title",
-    title: "合同类型",
+    title: "基本信息",
+  },
+  {
+    type: "input",
+    label: "合同类型",
+    prop: "code",
+    itemType: "text",
+    readonly: true,
   },
   {
     type: "picker",
@@ -578,6 +623,12 @@ const formGoodsOption = reactive({
           calculatedAmount();
         },
       },
+      {
+        type: "input",
+        label: "备注",
+        prop: "remark",
+        itemType: "textarea",
+      },
     ],
     clickFn: () => {
       if (
@@ -637,6 +688,15 @@ const formEmptyConfig = reactive([]);
 const formAmountProjectConfig = reactive([
   {
     type: "title",
+    title: "合同模板",
+  },
+  {
+    type: "slot",
+    slotName: "templateContent",
+    label: "模板内容",
+  },
+  {
+    type: "title",
     title: "合同总金额",
   },
   {
@@ -811,7 +871,7 @@ const getDict = () => {
       type: 0,
     })
     .then((res) => {
-      formConfigCode[2].data = proxy.handleTree(res.data, "deptId");
+      formConfigCode[3].data = proxy.handleTree(res.data, "deptId");
     });
 
   // 卖方
@@ -1100,7 +1160,7 @@ onMounted(() => {
         }
       }
 
-      if (["10", "20"].includes(route.query.processType)) {
+      if (["10", "20", "30"].includes(route.query.processType)) {
         formOption.readonly = true;
         formGoodsOption.readonly = true;
         formGoodsOption.btnConfig.isNeed = false;
@@ -1214,4 +1274,18 @@ defineExpose({
 });
 onMounted(() => {});
 </script>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+._title {
+  display: flex;
+  align-items: center;
+  font-size: 14px;
+  font-weight: 700;
+  margin-left: -10px;
+  .line {
+    width: 4px;
+    background-color: #0084ff;
+    height: 15px;
+    margin-right: 8px;
+  }
+}
+</style>

+ 8 - 24
src/views/processApproval/index.vue

@@ -1,31 +1,11 @@
 <template>
-  <van-nav-bar
-    :title="$t('processApproval.name')"
-    left-text=""
-    left-arrow
-    @click-left="onClickLeft"
-    @click-right="onClickRight"
-  >
+  <van-nav-bar :title="$t('processApproval.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
   </van-nav-bar>
-  <van-search
-    v-model="req.keyword"
-    :placeholder="$t('common.pleaseEnterKeywords')"
-    @search="onRefresh"
-  />
+  <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
   <van-pull-refresh v-model="loading" @refresh="onRefresh">
     <div class="list">
-      <van-list
-        v-model:loading="loading"
-        :finished="finished"
-        :finished-text="$t('common.noMore')"
-        @load="onLoad"
-        style="margin-bottom: 60px"
-      >
-        <commonList
-          :data="listData"
-          @onClick="toDtl"
-          :config="listConfig"
-        ></commonList>
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+        <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
       </van-list>
     </div>
   </van-pull-refresh>
@@ -60,6 +40,10 @@ const listConfig = ref([
     label: proxy.t("processApproval.processTitle"),
     prop: "title",
   },
+  {
+    label: "发起时间",
+    prop: "createTime",
+  },
 ]);
 const onRefresh = () => {
   req.value.pageNum = 1;

+ 7 - 28
src/views/procurementManagement/procureList/index.vue

@@ -1,36 +1,15 @@
 <template>
-  <van-nav-bar
-    :title="$t('procureList.name')"
-    left-text=""
-    left-arrow
-    @click-left="onClickLeft"
-    @click-right="onClickRight"
-  >
-    <template #right> {{ $t("procureList.purchase") }} </template>
+  <van-nav-bar :title="$t('procureList.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+    <!-- <template #right> {{ $t("procureList.purchase") }} </template> -->
   </van-nav-bar>
-  <van-search
-    v-model="req.keyword"
-    :placeholder="$t('common.pleaseEnterKeywords')"
-    @search="onRefresh"
-  />
+  <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
   <van-pull-refresh v-model="loading" @refresh="onRefresh">
     <div class="list">
-      <van-list
-        v-model:loading="loading"
-        :finished="finished"
-        :finished-text="$t('common.noMore')"
-        @load="onLoad"
-        style="margin-bottom: 60px"
-      >
-        <commonList
-          :data="listData"
-          @onClick="toDtl"
-          :config="listConfig"
-          :isCheckbox="true"
-          @onCheck="onCkeckbox"
-          optionalKey="subcribeId"
-        ></commonList>
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+        <commonList :data="listData" :config="listConfig" :isCheckbox="false" @onCheck="onCkeckbox" optionalKey="subcribeId">
+        </commonList>
       </van-list>
+      <!-- @onClick="toDtl"  -->
     </div>
   </van-pull-refresh>
 </template>

+ 20 - 35
src/views/procurementManagement/subscribe/index.vue

@@ -1,32 +1,12 @@
 <template>
-  <van-nav-bar
-    :title="$t('subscribe.name')"
-    left-text=""
-    left-arrow
-    @click-left="onClickLeft"
-    @click-right="onClickRight"
-  >
-    <template #right> {{$t('subscribe.initiateProcurement')}} </template>
+  <van-nav-bar :title="$t('subscribe.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+    <!-- <template #right> {{$t('subscribe.initiateProcurement')}} </template> -->
   </van-nav-bar>
-  <van-search
-    v-model="req.keyword"
-    :placeholder="$t('common.pleaseEnterKeywords')"
-    @search="onRefresh"
-  />
+  <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
   <van-pull-refresh v-model="loading" @refresh="onRefresh">
     <div class="list">
-      <van-list
-        v-model:loading="loading"
-        :finished="finished"
-        :finished-text="$t('common.noMore')"
-        @load="onLoad"
-        style="margin-bottom: 60px"
-      >
-        <commonList
-          :data="listData"
-          @onClick="toDtl"
-          :config="listConfig"
-        ></commonList>
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+        <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
       </van-list>
     </div>
   </van-pull-refresh>
@@ -41,6 +21,7 @@ const req = ref({
   pageNum: 1,
   type: "1",
   keyword: null,
+  dataType: 0,
 });
 const finished = ref(false);
 const proxy = getCurrentInstance().proxy;
@@ -48,15 +29,19 @@ const listData = ref([]);
 
 const listConfig = ref([
   {
-    label: proxy.t('subscribe.procurementNumber'),
+    label: proxy.t("subscribe.procurementNumber"),
     prop: "subscribeCode",
   },
   {
-    label: proxy.t('subscribe.itemName'),
+    label: "物料编码",
+    prop: "productCustomCode",
+  },
+  {
+    label: "物料名称",
     prop: "productName",
   },
   {
-    label: proxy.t('subscribe.quantity'),
+    label: proxy.t("subscribe.quantity"),
     prop: "count",
   },
 ]);
@@ -74,14 +59,14 @@ const onClickLeft = () => proxy.$router.push("/main/working");
 const onClickRight = () => {
   proxy.$router.push("/main/processDtl?flowKey=subscribe_flow");
 };
-proxy.uploadDdRightBtn(onClickRight,'发起申购')
+proxy.uploadDdRightBtn(onClickRight, "发起申购");
 const toDtl = (row) => {
-  proxy.$router.push({
-    path: "subscribeAdd",
-    query: {
-      id: row.subcribeId,
-    },
-  });
+  // proxy.$router.push({
+  //   path: "subscribeAdd",
+  //   query: {
+  //     id: row.subcribeId,
+  //   },
+  // });
 };
 
 const getList = (type) => {

+ 115 - 122
src/views/product-material/material-library/add copy.vue

@@ -3,59 +3,23 @@
     <van-nav-bar title="物料库" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft"> </van-nav-bar>
     <van-form @submit="onSubmit" label-align="top" style="margin-top: 20px; overflow-y: auto">
       <van-cell-group inset>
-        <van-field
-          v-model="formData.productClassifyName"
-          is-link
-          readonly
-          label="物料分类"
-          placeholder="请选择物料分类"
-          @click="show = true"
-          :rules="[{ required: true, message: '物料分类不能为空' }]"
-          required />
+        <van-field v-model="formData.productClassifyName" is-link readonly label="物料分类" placeholder="请选择物料分类" @click="show = true"
+                   :rules="[{ required: true, message: '物料分类不能为空' }]" required />
         <van-popup v-model:show="show" round position="bottom">
-          <van-cascader
-            title="请选择物料分类"
-            :options="classification"
-            :field-names="fieldNames"
-            @close="show = false"
-            @change="onChange"
-            @finish="onFinish" />
+          <van-cascader title="请选择物料分类" :options="classification" :field-names="fieldNames" @close="show = false" @change="onChange"
+                        @finish="onFinish" />
         </van-popup>
-        <van-field
-          v-model="formData.typeName"
-          is-link
-          readonly
-          label="物料类型"
-          placeholder="选择物料类型"
-          @click="typeModal = true"
-          :rules="[{ required: true, message: '物料类型不能为空' }]"
-          required />
+        <van-field v-model="formData.typeName" is-link readonly label="物料类型" placeholder="选择物料类型" @click="typeModal = true"
+                   :rules="[{ required: true, message: '物料类型不能为空' }]" required />
         <van-popup v-model:show="typeModal" round position="bottom">
           <van-picker :columns="typeList" @cancel="typeModal = false" @confirm="onConfirmType" />
         </van-popup>
-        <van-field
-          v-model="formData.name"
-          name="物料名称"
-          label="物料名称"
-          placeholder="请填写物料名称"
-          :rules="[{ required: true, message: '物料名称不能为空' }]"
-          required />
-        <van-field
-          v-model="formData.spec"
-          name="规格型号"
-          label="规格型号"
-          placeholder="请填写规格型号"
-          :rules="[{ required: true, message: '规格型号不能为空' }]"
-          required />
-        <van-field
-          v-model="formData.unitName"
-          is-link
-          readonly
-          label="单位"
-          placeholder="选择单位"
-          @click="unitModal = true"
-          :rules="[{ required: true, message: '单位不能为空' }]"
-          required />
+        <van-field v-model="formData.name" name="物料名称" label="物料名称" placeholder="请填写物料名称" :rules="[{ required: true, message: '物料名称不能为空' }]"
+                   required />
+        <van-field v-model="formData.spec" name="规格型号" label="规格型号" placeholder="请填写规格型号" :rules="[{ required: true, message: '规格型号不能为空' }]"
+                   required />
+        <van-field v-model="formData.unitName" is-link readonly label="单位" placeholder="选择单位" @click="unitModal = true"
+                   :rules="[{ required: true, message: '单位不能为空' }]" required />
         <van-popup v-model:show="unitModal" round position="bottom">
           <van-picker :columns="unitList" @cancel="unitModal = false" @confirm="onConfirmUnit" />
         </van-popup>
@@ -77,7 +41,7 @@
 import { ref, getCurrentInstance, onMounted } from "vue";
 import { showSuccessToast, showToast } from "vant";
 import { useRoute } from "vue-router";
-import { getUserInfo } from '@/utils/auth';
+import { getUserInfo } from "@/utils/auth";
 const proxy = getCurrentInstance().proxy;
 const route = useRoute();
 const show = ref(false);
@@ -125,11 +89,11 @@ const getDict = () => {
         return {
           text: item.dictValue,
           value: item.dictKey,
-        }
-      })
-    })
-}
-getDict()
+        };
+      });
+    });
+};
+getDict();
 const formData = ref({
   id: null,
   definition: "2",
@@ -157,15 +121,19 @@ const onConfirmUnit = ({ selectedOptions }) => {
 };
 const onChange = ({ selectedOptions }) => {
   if (selectedOptions && selectedOptions.length > 0) {
-    formData.value.productClassifyId = selectedOptions[selectedOptions.length - 1].id;
-    formData.value.productClassifyName = selectedOptions[selectedOptions.length - 1].label;
+    formData.value.productClassifyId =
+      selectedOptions[selectedOptions.length - 1].id;
+    formData.value.productClassifyName =
+      selectedOptions[selectedOptions.length - 1].label;
   }
 };
 const onFinish = ({ selectedOptions }) => {
   show.value = false;
   if (selectedOptions && selectedOptions.length > 0) {
-    formData.value.productClassifyId = selectedOptions[selectedOptions.length - 1].id;
-    formData.value.productClassifyName = selectedOptions[selectedOptions.length - 1].label;
+    formData.value.productClassifyId =
+      selectedOptions[selectedOptions.length - 1].id;
+    formData.value.productClassifyName =
+      selectedOptions[selectedOptions.length - 1].label;
   }
 };
 const fileList = ref([]);
@@ -178,19 +146,24 @@ const afterRead = (file) => {
         (res) => {
           let forms = new FormData();
           forms.append("file", file[i].file);
-          proxy.post("https://winfaster.obs.cn-south-1.myhuaweicloud.com", { ...res.data.uploadBody, file: forms.get("file") }).then(
-            () => {
-              file[i].id = res.data.id;
-              file[i].url = res.data.fileUrl;
-              file[i].fileName = res.data.fileName;
-              delete file[i].status;
-              delete file[i].message;
-            },
-            () => {
-              file[i].status = "failed";
-              file[i].message = "上传失败";
-            }
-          );
+          proxy
+            .post(proxy.uploadUrl, {
+              ...res.data.uploadBody,
+              file: forms.get("file"),
+            })
+            .then(
+              () => {
+                file[i].id = res.data.id;
+                file[i].url = res.data.fileUrl;
+                file[i].fileName = res.data.fileName;
+                delete file[i].status;
+                delete file[i].message;
+              },
+              () => {
+                file[i].status = "failed";
+                file[i].message = "上传失败";
+              }
+            );
         },
         () => {
           file[i].status = "failed";
@@ -205,19 +178,24 @@ const afterRead = (file) => {
       (res) => {
         let forms = new FormData();
         forms.append("file", file.file);
-        proxy.post("https://winfaster.obs.cn-south-1.myhuaweicloud.com", { ...res.data.uploadBody, file: forms.get("file") }).then(
-          () => {
-            file.id = res.data.id;
-            file.url = res.data.fileUrl;
-            file.fileName = res.data.fileName;
-            delete file.status;
-            delete file.message;
-          },
-          () => {
-            file.status = "failed";
-            file.message = "上传失败";
-          }
-        );
+        proxy
+          .post(proxy.uploadUrl, {
+            ...res.data.uploadBody,
+            file: forms.get("file"),
+          })
+          .then(
+            () => {
+              file.id = res.data.id;
+              file.url = res.data.fileUrl;
+              file.fileName = res.data.fileName;
+              delete file.status;
+              delete file.message;
+            },
+            () => {
+              file.status = "failed";
+              file.message = "上传失败";
+            }
+          );
       },
       () => {
         file.status = "failed";
@@ -261,44 +239,59 @@ const treeToList = (arr) => {
   return res;
 };
 onMounted(() => {
-  proxy.post("/productClassify/tree", { parentId: "", name: "", definition: "2" }).then((res) => {
-    classification.value = res.data;
-    let classList = treeToList(res.data);
-    if (route.query.id) {
-      proxy.post("/productInfo/detail", { id: route.query.id }).then((resDetail) => {
-        formData.value.id = route.query.id;
-        formData.value.productClassifyId = resDetail.data.productClassifyId;
-        let data = classList.filter((item) => item.id === resDetail.data.productClassifyId);
-        if (data && data.length > 0) {
-          formData.value.productClassifyName = data[0].label;
-        }
-        formData.value.code = resDetail.data.code;
-        formData.value.customCode = resDetail.data.customCode;
-        formData.value.type = resDetail.data.type;
-        let typeNameList = typeList.value.filter((item) => item.value == resDetail.data.type);
-        if (typeNameList && typeNameList.length > 0) {
-          formData.value.typeName = typeNameList[0].text;
-        }
-        formData.value.name = resDetail.data.name;
-        formData.value.spec = resDetail.data.spec;
-        formData.value.unitName = unitList.value.filter((item) => item.value == resDetail.data.unit)[0].text;
-        formData.value.remark = resDetail.data.remark;
-      });
-      proxy.post("/fileInfo/getList", { businessIdList: [route.query.id] }).then((res) => {
-        if (res.data[route.query.id] && res.data[route.query.id].length > 0) {
-          formData.value.fileList = res.data[route.query.id];
-          fileList.value = res.data[route.query.id].map((item) => {
-            return {
-              ...item,
-              url: item.fileUrl,
-            };
+  proxy
+    .post("/productClassify/tree", { parentId: "", name: "", definition: "2" })
+    .then((res) => {
+      classification.value = res.data;
+      let classList = treeToList(res.data);
+      if (route.query.id) {
+        proxy
+          .post("/productInfo/detail", { id: route.query.id })
+          .then((resDetail) => {
+            formData.value.id = route.query.id;
+            formData.value.productClassifyId = resDetail.data.productClassifyId;
+            let data = classList.filter(
+              (item) => item.id === resDetail.data.productClassifyId
+            );
+            if (data && data.length > 0) {
+              formData.value.productClassifyName = data[0].label;
+            }
+            formData.value.code = resDetail.data.code;
+            formData.value.customCode = resDetail.data.customCode;
+            formData.value.type = resDetail.data.type;
+            let typeNameList = typeList.value.filter(
+              (item) => item.value == resDetail.data.type
+            );
+            if (typeNameList && typeNameList.length > 0) {
+              formData.value.typeName = typeNameList[0].text;
+            }
+            formData.value.name = resDetail.data.name;
+            formData.value.spec = resDetail.data.spec;
+            formData.value.unitName = unitList.value.filter(
+              (item) => item.value == resDetail.data.unit
+            )[0].text;
+            formData.value.remark = resDetail.data.remark;
           });
-        } else {
-          formData.value.fileList = [];
-          fileList.value = [];
-        }
-      });
-    }
-  });
+        proxy
+          .post("/fileInfo/getList", { businessIdList: [route.query.id] })
+          .then((res) => {
+            if (
+              res.data[route.query.id] &&
+              res.data[route.query.id].length > 0
+            ) {
+              formData.value.fileList = res.data[route.query.id];
+              fileList.value = res.data[route.query.id].map((item) => {
+                return {
+                  ...item,
+                  url: item.fileUrl,
+                };
+              });
+            } else {
+              formData.value.fileList = [];
+              fileList.value = [];
+            }
+          });
+      }
+    });
 });
 </script>

+ 148 - 190
src/views/product-material/product-library/add2.vue

@@ -1,124 +1,51 @@
 <template>
-	<div class="form">
-		<van-nav-bar
-			title="产品库"
-			:left-text="$t('common.back')"
-			left-arrow
-			@click-left="onClickLeft"
-		>
-		</van-nav-bar>
-    
-		<van-form
-			@submit="onSubmit"
-			label-align="top"
-			style="margin-top: 20px; overflow-y: auto"
-		>
-			<van-cell-group inset>
-				<van-field
-					v-model="formData.productClassifyName"
-					is-link
-					readonly
-					label="产品分类"
-					placeholder="请选择产品分类"
-					@click="show = true"
-					:rules="[{ required: true, message: '产品分类不能为空' }]"
-					required
-				/>
-				<van-popup v-model:show="show" round position="bottom">
-					<van-cascader
-						title="请选择产品分类"
-						:options="classification"
-						:field-names="fieldNames"
-						@close="show = false"
-						@change="onChange"
-						@finish="onFinish"
-					/>
-				</van-popup>
-				<van-field
-					v-model="formData.typeName"
-					is-link
-					readonly
-					label="产品类型"
-					placeholder="选择产品类型"
-					@click="typeModal = true"
-					:rules="[{ required: true, message: '产品类型不能为空' }]"
-					required
-				/>
-				<van-popup v-model:show="typeModal" round position="bottom">
-					<van-picker
-						:columns="typeList"
-						@cancel="typeModal = false"
-						@confirm="onConfirmType"
-					/>
-				</van-popup>
-				<van-field
-					v-model="formData.name"
-					name="产品名称"
-					label="产品名称"
-					placeholder="请填写产品名称"
-					:rules="[{ required: true, message: '产品名称不能为空' }]"
-					required
-				/>
-				<van-field
-					v-model="formData.spec"
-					name="规格型号"
-					label="规格型号"
-					placeholder="请填写规格型号"
-					:rules="[{ required: true, message: '规格型号不能为空' }]"
-					required
-				/>
-				<van-field
-					v-model="formData.unitName"
-					is-link
-					readonly
-					label="单位"
-					placeholder="选择单位"
-					@click="unitModal = true"
-					:rules="[{ required: true, message: '单位不能为空' }]"
-					required
-				/>
-				<van-popup v-model:show="unitModal" round position="bottom">
-					<van-picker
-						:columns="unitList"
-						@cancel="unitModal = false"
-						@confirm="onConfirmUnit"
-					/>
-				</van-popup>
-				<van-field name="uploader" label="文件上传">
-					<template #input>
-						<van-uploader
-							v-model="fileList"
-							:after-read="afterRead"
-							multiple
-							:max-count="9"
-							:max-size="5 * 1024 * 1024"
-							@oversize="onOversize"
-						/>
-					</template>
-				</van-field>
-				<van-field
-					v-model="formData.remark"
-					rows="3"
-					type="textarea"
-					name="备注"
-					label="备注"
-					placeholder="请填写备注"
-				/>
-			</van-cell-group>
-			<div style="margin: 16px">
-				<van-button round block type="primary" native-type="submit">
-					提交
-				</van-button>
-			</div>
-		</van-form>
-	</div>
+  <div class="form">
+    <van-nav-bar title="产品库" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft">
+    </van-nav-bar>
+
+    <van-form @submit="onSubmit" label-align="top" style="margin-top: 20px; overflow-y: auto">
+      <van-cell-group inset>
+        <van-field v-model="formData.productClassifyName" is-link readonly label="产品分类" placeholder="请选择产品分类" @click="show = true"
+                   :rules="[{ required: true, message: '产品分类不能为空' }]" required />
+        <van-popup v-model:show="show" round position="bottom">
+          <van-cascader title="请选择产品分类" :options="classification" :field-names="fieldNames" @close="show = false" @change="onChange"
+                        @finish="onFinish" />
+        </van-popup>
+        <van-field v-model="formData.typeName" is-link readonly label="产品类型" placeholder="选择产品类型" @click="typeModal = true"
+                   :rules="[{ required: true, message: '产品类型不能为空' }]" required />
+        <van-popup v-model:show="typeModal" round position="bottom">
+          <van-picker :columns="typeList" @cancel="typeModal = false" @confirm="onConfirmType" />
+        </van-popup>
+        <van-field v-model="formData.name" name="产品名称" label="产品名称" placeholder="请填写产品名称" :rules="[{ required: true, message: '产品名称不能为空' }]"
+                   required />
+        <van-field v-model="formData.spec" name="规格型号" label="规格型号" placeholder="请填写规格型号" :rules="[{ required: true, message: '规格型号不能为空' }]"
+                   required />
+        <van-field v-model="formData.unitName" is-link readonly label="单位" placeholder="选择单位" @click="unitModal = true"
+                   :rules="[{ required: true, message: '单位不能为空' }]" required />
+        <van-popup v-model:show="unitModal" round position="bottom">
+          <van-picker :columns="unitList" @cancel="unitModal = false" @confirm="onConfirmUnit" />
+        </van-popup>
+        <van-field name="uploader" label="文件上传">
+          <template #input>
+            <van-uploader v-model="fileList" :after-read="afterRead" multiple :max-count="9" :max-size="5 * 1024 * 1024" @oversize="onOversize" />
+          </template>
+        </van-field>
+        <van-field v-model="formData.remark" rows="3" type="textarea" name="备注" label="备注" placeholder="请填写备注" />
+      </van-cell-group>
+      <div style="margin: 16px">
+        <van-button round block type="primary" native-type="submit">
+          提交
+        </van-button>
+      </div>
+    </van-form>
+  </div>
 </template>
 
 <script setup>
 import { ref, getCurrentInstance, onMounted } from "vue";
 import { showSuccessToast, showToast } from "vant";
 import { useRoute } from "vue-router";
-import { getUserInfo } from '@/utils/auth';
+import { getUserInfo } from "@/utils/auth";
 const proxy = getCurrentInstance().proxy;
 const route = useRoute();
 const show = ref(false);
@@ -154,11 +81,11 @@ const getDict = () => {
         return {
           text: item.dictValue,
           value: item.dictKey,
-        }
-      })
-    })
-}
-getDict()
+        };
+      });
+    });
+};
+getDict();
 const formData = ref({
   id: null,
   definition: "1",
@@ -181,20 +108,24 @@ const onConfirmType = ({ selectedOptions }) => {
 };
 const onConfirmUnit = ({ selectedOptions }) => {
   formData.value.unit = selectedOptions[0].value;
-   formData.value.unitName = selectedOptions[0].text;
+  formData.value.unitName = selectedOptions[0].text;
   unitModal.value = false;
 };
 const onChange = ({ selectedOptions }) => {
   if (selectedOptions && selectedOptions.length > 0) {
-    formData.value.productClassifyId = selectedOptions[selectedOptions.length - 1].id;
-    formData.value.productClassifyName = selectedOptions[selectedOptions.length - 1].label;
+    formData.value.productClassifyId =
+      selectedOptions[selectedOptions.length - 1].id;
+    formData.value.productClassifyName =
+      selectedOptions[selectedOptions.length - 1].label;
   }
 };
 const onFinish = ({ selectedOptions }) => {
   show.value = false;
   if (selectedOptions && selectedOptions.length > 0) {
-    formData.value.productClassifyId = selectedOptions[selectedOptions.length - 1].id;
-    formData.value.productClassifyName = selectedOptions[selectedOptions.length - 1].label;
+    formData.value.productClassifyId =
+      selectedOptions[selectedOptions.length - 1].id;
+    formData.value.productClassifyName =
+      selectedOptions[selectedOptions.length - 1].label;
   }
 };
 const fileList = ref([]);
@@ -207,19 +138,24 @@ const afterRead = (file) => {
         (res) => {
           let forms = new FormData();
           forms.append("file", file[i].file);
-          proxy.post("https://winfaster.obs.cn-south-1.myhuaweicloud.com", { ...res.data.uploadBody, file: forms.get("file") }).then(
-            () => {
-              file[i].id = res.data.id;
-              file[i].url = res.data.fileUrl;
-              file[i].fileName = res.data.fileName;
-              delete file[i].status;
-              delete file[i].message;
-            },
-            () => {
-              file[i].status = "failed";
-              file[i].message = "上传失败";
-            }
-          );
+          proxy
+            .post(proxy.uploadUrl, {
+              ...res.data.uploadBody,
+              file: forms.get("file"),
+            })
+            .then(
+              () => {
+                file[i].id = res.data.id;
+                file[i].url = res.data.fileUrl;
+                file[i].fileName = res.data.fileName;
+                delete file[i].status;
+                delete file[i].message;
+              },
+              () => {
+                file[i].status = "failed";
+                file[i].message = "上传失败";
+              }
+            );
         },
         () => {
           file[i].status = "failed";
@@ -234,19 +170,24 @@ const afterRead = (file) => {
       (res) => {
         let forms = new FormData();
         forms.append("file", file.file);
-        proxy.post("https://winfaster.obs.cn-south-1.myhuaweicloud.com", { ...res.data.uploadBody, file: forms.get("file") }).then(
-          () => {
-            file.id = res.data.id;
-            file.url = res.data.fileUrl;
-            file.fileName = res.data.fileName;
-            delete file.status;
-            delete file.message;
-          },
-          () => {
-            file.status = "failed";
-            file.message = "上传失败";
-          }
-        );
+        proxy
+          .post(proxy.uploadUrl, {
+            ...res.data.uploadBody,
+            file: forms.get("file"),
+          })
+          .then(
+            () => {
+              file.id = res.data.id;
+              file.url = res.data.fileUrl;
+              file.fileName = res.data.fileName;
+              delete file.status;
+              delete file.message;
+            },
+            () => {
+              file.status = "failed";
+              file.message = "上传失败";
+            }
+          );
       },
       () => {
         file.status = "failed";
@@ -290,46 +231,63 @@ const treeToList = (arr) => {
   return res;
 };
 onMounted(() => {
-  proxy.post("/productClassify/tree", { parentId: "", name: "", definition: "1" }).then((res) => {
-    classification.value = res.data;
-    let classList = treeToList(res.data);
-    if (route.query.id) {
-      proxy.post("/productInfo/detail", { id: route.query.id }).then((resDetail) => {
-        formData.value.id = route.query.id;
-        formData.value.productClassifyId = resDetail.data.productClassifyId;
-        let data = classList.filter((item) => item.id === resDetail.data.productClassifyId);
-        if (data && data.length > 0) {
-          formData.value.productClassifyName = data[0].label;
-        }
-        formData.value.code = resDetail.data.code;
-        formData.value.customCode = resDetail.data.customCode;
-        formData.value.type = resDetail.data.type;
-        let typeNameList = typeList.value.filter((item) => item.value == resDetail.data.type);
-        if (typeNameList && typeNameList.length > 0) {
-          formData.value.typeName = typeNameList[0].text;
-        }
-        formData.value.name = resDetail.data.name;
-        formData.value.spec = resDetail.data.spec;
-        formData.value.unit = resDetail.data.unit;
-        formData.value.remark = resDetail.data.remark;
-        console.log(unitList.value.filter((item) => item.value == resDetail.data.unit))
-        formData.value.unitName = unitList.value.filter((item) => item.value == resDetail.data.unit)[0].text;
-      });
-      proxy.post("/fileInfo/getList", { businessIdList: [route.query.id] }).then((res) => {
-        if (res.data[route.query.id] && res.data[route.query.id].length > 0) {
-          formData.value.fileList = res.data[route.query.id];
-          fileList.value = res.data[route.query.id].map((item) => {
-            return {
-              ...item,
-              url: item.fileUrl,
-            };
+  proxy
+    .post("/productClassify/tree", { parentId: "", name: "", definition: "1" })
+    .then((res) => {
+      classification.value = res.data;
+      let classList = treeToList(res.data);
+      if (route.query.id) {
+        proxy
+          .post("/productInfo/detail", { id: route.query.id })
+          .then((resDetail) => {
+            formData.value.id = route.query.id;
+            formData.value.productClassifyId = resDetail.data.productClassifyId;
+            let data = classList.filter(
+              (item) => item.id === resDetail.data.productClassifyId
+            );
+            if (data && data.length > 0) {
+              formData.value.productClassifyName = data[0].label;
+            }
+            formData.value.code = resDetail.data.code;
+            formData.value.customCode = resDetail.data.customCode;
+            formData.value.type = resDetail.data.type;
+            let typeNameList = typeList.value.filter(
+              (item) => item.value == resDetail.data.type
+            );
+            if (typeNameList && typeNameList.length > 0) {
+              formData.value.typeName = typeNameList[0].text;
+            }
+            formData.value.name = resDetail.data.name;
+            formData.value.spec = resDetail.data.spec;
+            formData.value.unit = resDetail.data.unit;
+            formData.value.remark = resDetail.data.remark;
+            console.log(
+              unitList.value.filter((item) => item.value == resDetail.data.unit)
+            );
+            formData.value.unitName = unitList.value.filter(
+              (item) => item.value == resDetail.data.unit
+            )[0].text;
           });
-        } else {
-          formData.value.fileList = [];
-          fileList.value = [];
-        }
-      });
-    }
-  });
+        proxy
+          .post("/fileInfo/getList", { businessIdList: [route.query.id] })
+          .then((res) => {
+            if (
+              res.data[route.query.id] &&
+              res.data[route.query.id].length > 0
+            ) {
+              formData.value.fileList = res.data[route.query.id];
+              fileList.value = res.data[route.query.id].map((item) => {
+                return {
+                  ...item,
+                  url: item.fileUrl,
+                };
+              });
+            } else {
+              formData.value.fileList = [];
+              fileList.value = [];
+            }
+          });
+      }
+    });
 });
 </script>

+ 3 - 3
src/views/working/index.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="working">
     <van-search v-model="keyword" :placeholder="$t('common.pleaseEnterKeywords')" @update:model-value="searchFn" />
-    <van-swipe class="my-swipe" indicator-color="white" style="margin-top:10px">
+    <!-- <van-swipe class="my-swipe" indicator-color="white" style="margin-top:10px">
       <van-swipe-item @click="toWinfaster">
         <img src="../../assets/images/banner1.png" alt="">
       </van-swipe-item>
       <van-swipe-item>2</van-swipe-item>
-    </van-swipe>
+    </van-swipe> -->
 
     <div class="card" v-if="keyword">
       <div class="title">{{$t('common.searchResults')}}</div>
@@ -107,7 +107,7 @@ const colorRgb = (sColor, alpha) => {
 };
 const toRouter = (item) => {
   //获取class为main的滚动条位置
-  if (item.meta && item.meta.title == "生产报工") {
+  if (item.path && item.path == "/main/productionReport") {
     uni.postMessage({
       data: {
         type: "scanCode",