瀏覽代碼

报价单

cz 1 年之前
父節點
當前提交
55efcce0cb

+ 6 - 0
src/router/index.js

@@ -447,6 +447,12 @@ const routes = [{
 				name: '生产报工添加',
 				component: () => import('../views/MES/productionReport/add.vue')
 			},
+			{
+				path: 'reportDetail',
+				name: '报工明细',
+				component: () => import('../views/MES/reportDetail/index.vue')
+			},
+
 			// {
 			// 	path: 'reportWorkAdd',
 			// 	name: '生产报工新增',

+ 5 - 0
src/router/routerLXF.js

@@ -140,6 +140,11 @@ export function routesLXF() {
       component: () => import("../views/salesContract/priceSheet/index.vue"),
     },
     {
+      path: "priceSheetAdd",
+      name: "报价单详情",
+      component: () => import("../views/salesContract/priceSheet/add.vue"),
+    },
+    {
       path: "contract",
       name: "销售合同",
       component: () => import("../views/salesContract/contract/index.vue"),

+ 4 - 1
src/views/MES/productionReport/add.vue

@@ -24,12 +24,14 @@
         </van-field>
         <van-field v-model="formData.quantity" readonly label="数量" />
       </van-cell-group>
+      <div style="height:20px"></div>
       <TitleInfo :title="'原材料信息'"></TitleInfo>
       <van-cell-group inset>
         <van-field v-model="formData.rawMaterialCode" readonly label="编码" />
         <van-field v-model="formData.rawMaterialName" readonly label="名称" />
         <van-field v-model="formData.materialSize" readonly label="尺寸cm" />
       </van-cell-group>
+      <div style="height:20px"></div>
       <TitleInfo :title="'包材信息'"></TitleInfo>
       <div style="padding:10px 10px;background:#fff">
         <table border class="table">
@@ -49,6 +51,7 @@
           </tbody>
         </table>
       </div>
+      <div style="height:20px"></div>
       <TitleInfo :title="'报工'"></TitleInfo>
       <van-cell-group inset>
         <van-field v-model="formData.finishQuantity" readonly label="已报工数量" />
@@ -116,7 +119,7 @@ const onSubmit = () => {
     proxy.post("/productionReportingDetail/add", submitData.value).then(
       (res) => {
         setTimeout(() => {
-          showSuccessToast(proxy.$t("common.addSuccess"));
+          showSuccessToast("报工成功");
           proxy.$router.push("/main/working");
         }, 500);
       },

+ 163 - 0
src/views/MES/reportDetail/index.vue

@@ -0,0 +1,163 @@
+<template>
+  <div style="padding-bottom: 60px">
+    <van-nav-bar :title="'报工明细'" left-text="" left-arrow @click-left="onClickLeft" @click-right="handleScanCode">
+      <!-- <template #right> 扫码 </template> -->
+    </van-nav-bar>
+    <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" :config="listConfig" :showMore="false"></commonList>
+        </van-list>
+      </div>
+    </van-pull-refresh>
+    <!-- <div style="padding:20px">
+      <van-button type="success" style="width:100%;height:200px;font-size:36px" @click="handleScanCode">扫码</van-button>
+
+    </div> -->
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance, onMounted, nextTick } from "vue";
+import commonList from "@/components/common-list.vue";
+import { useRoute } from "vue-router";
+const loading = ref(false);
+const router = useRoute();
+const req = ref({
+  pageNum: 1,
+  keyword: null,
+});
+const finished = ref(false);
+const proxy = getCurrentInstance().proxy;
+const listData = ref([]);
+
+const listConfig = ref([
+  {
+    label: "任务编号",
+    prop: "orderCode",
+  },
+  {
+    label: "报工数量",
+    prop: "quantity",
+  },
+
+  {
+    label: "报工人",
+    prop: "createUserName",
+  },
+  {
+    label: "报工时间",
+    prop: "createTime",
+  },
+  {
+    label: "工序名称",
+    prop: "processesName",
+  },
+]);
+const onRefresh = () => {
+  req.value.pageNum = 1;
+  finished.value = false;
+  getList("refresh");
+};
+const onLoad = () => {
+  getList();
+};
+
+const onClickLeft = () => proxy.$router.push("/main/working");
+
+const onClickRight = () => {
+  proxy.$router.push("/main/taskAdd");
+};
+proxy.uploadDdRightBtn(onClickRight, proxy.t("common.add"));
+// const toDtl = (row) => {
+//   proxy.$router.push({
+//     path: "taskDtl",
+//     query: {
+//       id: row.id,
+//     },
+//   });
+// };
+
+const getList = (type) => {
+  loading.value = true;
+  proxy
+    .post("/productionReportingDetail/page", req.value)
+    .then((res) => {
+      // const data = res.data.rows.map((x) => ({
+      //   ...x,
+      //   time: x.startDate + " ~ " + x.stopDate,
+      //   statusName:
+      //     x.status == 0
+      //       ? "未开始"
+      //       : x.status == 1
+      //       ? "进行中"
+      //       : x.status == 2
+      //       ? "完成"
+      //       : "",
+      // }));
+      // if (type === "refresh") {
+      //   listData.value = data;
+      // } else {
+      //   listData.value = listData.value.concat(data);
+      // }
+      listData.value =
+        type === "refresh"
+          ? res.data.rows
+          : listData.value.concat(res.data.rows);
+      if (req.value.pageNum * 10 >= res.data.total) {
+        finished.value = true;
+      }
+      req.value.pageNum++;
+      loading.value = false;
+    })
+    .catch((err) => {
+      loading.value = false;
+    });
+};
+
+getList();
+
+const handleScanCode = () => {
+  // proxy.$router.push({
+  //   path: "/main/productionReportAdd",
+  //   query: {
+  //     id: "contract_flow",
+  //   },
+  // });
+  uni.postMessage({
+    data: {
+      type: "scanCode",
+    },
+  });
+};
+
+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);
+      }
+    };
+  });
+});
+</script>
+
+<style lang="scss" scoped>
+.list {
+  min-height: 70vh;
+}
+</style>

+ 158 - 162
src/views/main.vue

@@ -1,125 +1,122 @@
 <template>
-	<div class="main" id="main">
-		<!-- <KeepAlive>
+  <div class="main" id="main">
+    <!-- <KeepAlive>
 			<router-view />
     	</KeepAlive> -->
-		<router-view v-slot="{ Component, route }">
-			<keep-alive  include="working">
-				<component v-if="!route.meta.link" :is="Component" :key="route.fullPath"/>
-			</keep-alive>
-		</router-view>
-		
-	</div>
-	<van-tabbar v-model="tabType" v-if="routerName != '/main/processDtl'" :style="isIos() ? 'height:65px' : ''">
-		<van-tabbar-item to="/main/message" :badge="msgCount" :style="isIos() ? 'padding-bottom:15px' : ''">
-			{{$t('common.message')}}
-			<template #icon="props">
-				<i class="icon iconfont icon-btn_shengc_gray1 footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
-			</template>
-		</van-tabbar-item>
-		<van-tabbar-item to="/main/working" :style="isIos() ? 'padding-bottom:15px' : ''">
-			{{$t('common.workbench')}}
-			<template #icon="props">
-				<i class="icon iconfont icon-btn_gongz footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
-			</template>
-		</van-tabbar-item>
-		<van-tabbar-item
-			:style="isIos() ? 'padding-bottom:15px' : ''"
-			:to="tenantId == 'smt' ? '/main/xiamenList' : '/main/equipment'"
-			>{{$t('common.things')}}
-			<template #icon="props">
-				<i class="icon iconfont icon-btn_wulw footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
-			</template>
-		</van-tabbar-item>
-		<van-tabbar-item icon="setting-o" to="/main/home" :style="isIos() ? 'padding-bottom:15px' : ''">
-			{{$t('common.mine')}}
-			<template #icon="props">
-				<i class="icon iconfont icon-btn_mine footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
-			</template>
-		</van-tabbar-item>
-	</van-tabbar>
+    <router-view v-slot="{ Component, route }">
+      <keep-alive include="working">
+        <component v-if="!route.meta.link" :is="Component" :key="route.fullPath" />
+      </keep-alive>
+    </router-view>
+
+  </div>
+  <van-tabbar v-model="tabType" v-if="routerName != '/main/processDtl'" :style="isIos() ? 'height:65px' : ''">
+    <van-tabbar-item to="/main/message" :badge="msgCount" :style="isIos() ? 'padding-bottom:15px' : ''">
+      {{$t('common.message')}}
+      <template #icon="props">
+        <i class="icon iconfont icon-btn_shengc_gray1 footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
+      </template>
+    </van-tabbar-item>
+    <van-tabbar-item to="/main/working" :style="isIos() ? 'padding-bottom:15px' : ''">
+      {{$t('common.workbench')}}
+      <template #icon="props">
+        <i class="icon iconfont icon-btn_gongz footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
+      </template>
+    </van-tabbar-item>
+    <!-- <van-tabbar-item :style="isIos() ? 'padding-bottom:15px' : ''"
+                     :to="tenantId == 'smt' ? '/main/xiamenList' : '/main/equipment'">{{$t('common.things')}}
+      <template #icon="props">
+        <i class="icon iconfont icon-btn_wulw footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
+      </template>
+    </van-tabbar-item> -->
+    <van-tabbar-item icon="setting-o" to="/main/home" :style="isIos() ? 'padding-bottom:15px' : ''">
+      {{$t('common.mine')}}
+      <template #icon="props">
+        <i class="icon iconfont icon-btn_mine footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
+      </template>
+    </van-tabbar-item>
+  </van-tabbar>
 </template>
 <script setup>
-import { ref, getCurrentInstance, watch } from 'vue'
-import { getUserInfo,getToken } from '@/utils/auth'
-import { useRouter } from 'vue-router'
-import { lang } from '@/lang/cn'
-import * as dd from 'dingtalk-jsapi'
-import '@/assets/icon/iconfont.css'
-import 'vant/lib/index.css'
-import axios from 'axios'
-import { uploadDdRightBtn } from '@/utils/ddAdapter'
-import { showDialog,showNotify } from 'vant'
-const tenantId = getUserInfo().tenantId
-const proxy = getCurrentInstance().proxy
-const tabType = ref('home')
-const msgCount = ref(0)
+import { ref, getCurrentInstance, watch } from "vue";
+import { getUserInfo, getToken } from "@/utils/auth";
+import { useRouter } from "vue-router";
+import { lang } from "@/lang/cn";
+import * as dd from "dingtalk-jsapi";
+import "@/assets/icon/iconfont.css";
+import "vant/lib/index.css";
+import axios from "axios";
+import { uploadDdRightBtn } from "@/utils/ddAdapter";
+import { showDialog, showNotify } from "vant";
+const tenantId = getUserInfo().tenantId;
+const proxy = getCurrentInstance().proxy;
+const tabType = ref("home");
+const msgCount = ref(0);
 const socketInit = () => {
-	window.ws = new WebSocket(
-		'ws://'+ process.env.VUE_APP_IP + process.env.VUE_APP_WS_API +'/webStock/' +
-			getToken()
-		// 'ws://192.168.1.97:8300/webStock/' + window.localStorage.getItem('token')
-	)
-	//申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
-	window.ws.onopen = function () {
-		//当WebSocket创建成功时,触发onopen事件
-		console.log('open')
-	}
-	window.ws.onmessage = function (e) {
-		//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
-		//在data.value前面插入
-		const res = JSON.parse(e.data)
-		console.log(res)
-		
-		
-		if(res.type == 1) {
-			
-			if(res.list.length > 0) {
-				showDialog({
-					title: res.list[0].title,
-					message: res.list[0].businessData,
-				}).then(() => {
-					proxy.post('/pushInfo/read', {
-						idList: [res.list[0].id],
-					}).then((res) => {
-						if(res.code == 200) {
-							showNotify({ type: 'primary', message: '确认已读' });
-						}
-					})
-				})
-			}
-		}
-		if(res.type == 2) {
-			msgCount.value = res.count * 1
-		}
-		if(res.type == 3) {
-			// ElNotification({
-			// 	title: '提示',
-			// 	message: res.title,
-			// 	position: 'bottom-right',
-			// 	duration:0,
-			// })
-		}
-		
-	}
-	window.ws.onclose = function (e) {
-		//当客户端收到服务端发送的关闭连接请求时,触发onclose事件
-		console.log('close')
-	}
-	window.ws.onerror = function (e) {
-		//如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
-		console.log(e)
-	}
-}
-socketInit()
+  window.ws = new WebSocket(
+    "ws://" +
+      process.env.VUE_APP_IP +
+      process.env.VUE_APP_WS_API +
+      "/webStock/" +
+      getToken()
+    // 'ws://192.168.1.97:8300/webStock/' + window.localStorage.getItem('token')
+  );
+  //申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
+  window.ws.onopen = function () {
+    //当WebSocket创建成功时,触发onopen事件
+    console.log("open");
+  };
+  window.ws.onmessage = function (e) {
+    //当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
+    //在data.value前面插入
+    const res = JSON.parse(e.data);
+    if (res.type == 1) {
+      if (res.list.length > 0) {
+        showDialog({
+          title: res.list[0].title,
+          message: res.list[0].businessData,
+        }).then(() => {
+          proxy
+            .post("/pushInfo/read", {
+              idList: [res.list[0].id],
+            })
+            .then((res) => {
+              if (res.code == 200) {
+                showNotify({ type: "primary", message: "确认已读" });
+              }
+            });
+        });
+      }
+    }
+    if (res.type == 2) {
+      msgCount.value = res.count * 1;
+    }
+    if (res.type == 3) {
+      // ElNotification({
+      // 	title: '提示',
+      // 	message: res.title,
+      // 	position: 'bottom-right',
+      // 	duration:0,
+      // })
+    }
+  };
+  window.ws.onclose = function (e) {
+    //当客户端收到服务端发送的关闭连接请求时,触发onclose事件
+    console.log("close");
+  };
+  window.ws.onerror = function (e) {
+    //如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
+    console.log(e);
+  };
+};
+socketInit();
 
 //判断是否是ios系统
 const isIos = () => {
-	const u = navigator.userAgent
-	const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) //ios终端
-	return isIOS
-}
-
+  const u = navigator.userAgent;
+  const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
+  return isIOS;
+};
 
 //判断是否为开发环境.如果是开发环境,则同步前后台中文配置表
 // const isDev = process.env.NODE_ENV === 'development'
@@ -137,68 +134,67 @@ const isIos = () => {
 // 		} catch (error) {}
 // 	}
 // }
-const corpId = window.localStorage.getItem('corpId')
-let routerName = ref(null)
+const corpId = window.localStorage.getItem("corpId");
+let routerName = ref(null);
 //监听路由变化
-const router = useRouter()
+const router = useRouter();
 //获取当前path
-routerName.value = router.currentRoute.value.path
+routerName.value = router.currentRoute.value.path;
 watch(router.currentRoute, (to, from) => {
-	routerName.value = to.path
-	console.log('routerName', routerName.value)
-	//滚动条回到顶部
-	document.documentElement.scrollTop = 0
-	if (!corpId) return
-	dd.biz.navigation.setTitle({
-		title: router.currentRoute.value.name,
-		onSuccess: function (result) {},
-		onFail: function (err) {},
-	})
-	//设置右侧按钮
-	proxy.uploadDdRightBtn(function () {}, ' ')
+  routerName.value = to.path;
+  //滚动条回到顶部
+  document.documentElement.scrollTop = 0;
+  if (!corpId) return;
+  dd.biz.navigation.setTitle({
+    title: router.currentRoute.value.name,
+    onSuccess: function (result) {},
+    onFail: function (err) {},
+  });
+  //设置右侧按钮
+  proxy.uploadDdRightBtn(function () {}, " ");
 
-	//获取元素的绑定事件
-	setTimeout(() => {
-		if (!corpId) {
-			return
-		}
-		let el = document.getElementsByClassName('van-nav-bar__content')[0]
-		if (el) {
-			//删除el元素
-			el.parentNode.removeChild(el)
-		}
-	}, 10)
-})
+  //获取元素的绑定事件
+  setTimeout(() => {
+    if (!corpId) {
+      return;
+    }
+    let el = document.getElementsByClassName("van-nav-bar__content")[0];
+    if (el) {
+      //删除el元素
+      el.parentNode.removeChild(el);
+    }
+  }, 10);
+});
 </script>
 <style lang="scss">
 .main {
-	position: absolute;
-	top: 0;
-	left: 0;
-	right: 0;
-	bottom: 0;
-	padding-bottom:65px;
-	overflow-y: auto;
-	
-	padding-top:46px;
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  padding-bottom: 65px;
+  overflow-y: auto;
+
+  padding-top: 46px;
 }
-.footer-icon{
-	font-size: 20px;
-	color: #BBBBBB;
+.footer-icon {
+  font-size: 20px;
+  color: #bbbbbb;
 }
-.footer-icon-active{
-	color: #3E7BFA;
+.footer-icon-active {
+  color: #3e7bfa;
 }
-.footer-icon{
-	font-size: 20px;
-	color: #BBBBBB;
+.footer-icon {
+  font-size: 20px;
+  color: #bbbbbb;
 }
-.footer-icon-active{
-	color: #3E7BFA;
+.footer-icon-active {
+  color: #3e7bfa;
 }
 </style>
 <style>
-.van-pull-refresh{
-    flex: 1;
+.van-pull-refresh {
+  flex: 1;
 }
 </style>

+ 226 - 0
src/views/salesContract/priceSheet/add.vue

@@ -0,0 +1,226 @@
+<template>
+  <div class="form" style="padding-bottom: 60px">
+    <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">
+      <TitleInfo :title="'基本信息'"></TitleInfo>
+      <van-cell-group inset>
+        <van-field v-model="formData.code" readonly label="报价单号" />
+        <van-field v-model="formData.typeName" readonly label="报价类型" />
+        <van-field v-model="formData.companyName" readonly label="报价公司" />
+      </van-cell-group>
+      <!-- <van-field readonly label="产品图 / 设计图">
+          <template #input>
+            <div style="display:flex;">
+              <div style="margin-right:20px">
+                <img v-if="formData.productUrl" :src="formData.productUrl" alt="" class="pic"
+                     @click="onPreviewFile(formData.productImgName,formData.productUrl)">
+              </div>
+              <div>
+                <img v-if="formData.productUrlOne" :src="formData.productUrlOne" alt="" class="pic"
+                     @click="onPreviewFile(formData.productImgNameOne,formData.productUrlOne)">
+              </div>
+            </div>
+          </template>
+        </van-field> -->
+      <div style="height:20px"></div>
+      <TitleInfo :title="'贸易信息'"></TitleInfo>
+      <van-cell-group inset>
+        <van-field v-model="formData.buyCorporationName" readonly label="客户名称" />
+        <van-field v-model="formData.address" readonly label="地址" />
+        <van-field v-model="formData.buyPostalCode" readonly label="邮编" />
+        <van-field v-model="formData.buyAddress" readonly label="详细地址" />
+        <van-field v-model="formData.buyContactName" readonly label="联系人" />
+        <van-field v-model="formData.buyContactNumber" readonly label="联系人电话" />
+      </van-cell-group>
+      <div style="height:20px"></div>
+      <TitleInfo :title="'商品信息'"></TitleInfo>
+      <van-collapse v-model="activeNames">
+        <van-collapse-item v-for="(product,index) in formData.quotationProductList" :name="index" :key="index">
+          <template #title>
+            <div>商品名称:{{product.productName}}</div>
+            <div>商品编码:{{product.productCode}}</div>
+            <div>尺寸(cm):{{product.size}}</div>
+            <div style="display:flex;">
+              <span>数量:{{product.quantity}}</span><span style="margin-left:15px">单价:{{product.price}}</span><span
+                    style="margin-left:15px">小计:{{product.amount}}</span>
+            </div>
+          </template>
+          <div style="background:#fff">
+            <div style="display:flex;margin-left:-10px;align-items:center">
+              <TitleInfo :title="'BOM单:'"></TitleInfo>
+              <div>(表格可向右滑动)</div>
+            </div>
+            <table border class="table">
+              <thead>
+                <tr>
+                  <th style="width:90px;">物料编码</th>
+                  <th style="min-width:200px">物料名称</th>
+                  <th style="min-width:100px">尺寸(cm)</th>
+                  <th style="width:50px">数量</th>
+                  <th style="width:50px">总量</th>
+                  <th style="width:50px">单价</th>
+                  <th style="width:50px">小计</th>
+                  <th style="min-width:150px">备注</th>
+                </tr>
+              </thead>
+              <tbody v-if="product.quotationProductBomList && product.quotationProductBomList.length>0">
+                <tr v-for="(item,sonIndex) in product.quotationProductBomList" :key="sonIndex">
+                  <td>{{item.productCode}}</td>
+                  <td>{{item.productName}}</td>
+                  <td>{{item.size}}</td>
+                  <td>{{item.quantity}}</td>
+                  <td>{{item.allQuantity}}</td>
+                  <td>{{item.price}}</td>
+                  <td>{{item.amount}}</td>
+                  <td>{{item.remark}}</td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </van-collapse-item>
+      </van-collapse>
+      <div style="height:20px"></div>
+      <TitleInfo :title="'报价总金额'"></TitleInfo>
+      <van-cell-group inset>
+        <van-field v-model="formData.amount" readonly label="报价总金额" />
+      </van-cell-group>
+    </van-form>
+  </div>
+</template>
+
+<script setup>
+import { ref, getCurrentInstance, onMounted } from "vue";
+import { showSuccessToast, showFailToast } from "vant";
+import { useRoute } from "vue-router";
+import TitleInfo from "@/components/TitleInfo/index.vue";
+
+const proxy = getCurrentInstance().proxy;
+const route = useRoute();
+const showPicker = ref(false);
+const activeNames = ref([]);
+const formData = ref({
+  productName: "",
+  waitQuantity: "",
+  productionPlanId: "",
+  productionPlanIdName: "",
+  personLiableId: "",
+  personLiableName: "",
+  status: "",
+  quantity: "",
+  dueDate: "",
+});
+const submitData = ref({});
+
+const columns = ref([]);
+
+const getDict = () => {};
+
+const onConfirm = ({ selectedOptions }) => {
+  formData.value.finishQuantity = selectedOptions[0].finishQuantity;
+  submitData.value.productionProcessesId = selectedOptions[0].value;
+  submitData.value.productionProcessesIdName = selectedOptions[0].text;
+  showPicker.value = false;
+};
+
+const onClickLeft = () => history.back();
+
+const onSubmit = () => {
+  if (Number(submitData.value.quantity) < 1) {
+    return showFailToast("报工数量不能为0");
+  }
+  if (
+    Number(formData.value.finishQuantity) + Number(submitData.value.quantity) >
+    Number(formData.value.quantity)
+  ) {
+    return showFailToast("已报工数量加报工数量不可大于生产数量");
+  } else {
+    proxy.post("/productionReportingDetail/add", submitData.value).then(
+      (res) => {
+        setTimeout(() => {
+          showSuccessToast("报工成功");
+          proxy.$router.push("/main/working");
+        }, 500);
+      },
+      (err) => {
+        return showFailToast(err.message);
+      }
+    );
+  }
+};
+const getDetail = () => {
+  proxy.post("/saleQuotation/detail", { id: route.query.id }).then(
+    (res) => {
+      res.data.typeName = res.data.type == "1" ? "内销" : "外销";
+      res.data.address = `${res.data.buyCountryName} ${res.data.buyProvinceName} ${res.data.buyCityName}`;
+      formData.value = res.data;
+      for (let i = 0; i < formData.value.quotationProductList.length; i++) {
+        const iele = formData.value.quotationProductList[i];
+        iele.size = `${iele.productLength} * ${iele.productWidth} * ${iele.productHeight}`;
+        for (let j = 0; j < iele.quotationProductBomList.length; j++) {
+          const jele = iele.quotationProductBomList[j];
+          jele.allQuantity = iele.quantity * jele.quantity;
+          jele.size = `${jele.productLength} * ${jele.productWidth} * ${jele.productHeight}`;
+        }
+      }
+    },
+    (err) => {
+      onClickLeft();
+    }
+  );
+};
+onMounted(() => {
+  if (route.query && route.query.id) {
+    getDetail();
+  }
+  getDict();
+});
+
+const onPreviewFile = (name, url) => {
+  uni.postMessage({
+    data: {
+      type: "file",
+      url: url,
+      name: name,
+    },
+  });
+};
+</script>
+<style lang="scss" scoped>
+.row {
+  display: flex;
+  padding: 5px 10px 0 10px;
+  justify-content: space-between;
+  align-items: center;
+  .title {
+    flex: 1;
+  }
+  .delete {
+    width: 20px;
+    cursor: pointer;
+    text-align: center;
+  }
+}
+
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+  width: 100%;
+  border-color: #ebeef5;
+  color: #606266;
+  thead tr th {
+    padding: 6px 0px 6px 4px;
+    text-align: left;
+  }
+  td {
+    text-align: left;
+    padding: 6px 0px 6px 4px;
+  }
+}
+.pic {
+  width: 50px;
+  height: 50px;
+  object-fit: contain;
+  vertical-align: middle;
+}
+</style>

+ 20 - 35
src/views/salesContract/priceSheet/index.vue

@@ -1,11 +1,12 @@
 <template>
-  <van-nav-bar :title="$t('priceSheet.name')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
-    <template #right>{{ $t("common.add") }}</template>
+  <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" />
   <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="getList('load')" style="margin-bottom: 60px">
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="getList('load')"
+                style="margin-bottom: 60px">
         <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
       </van-list>
     </div>
@@ -69,27 +70,13 @@ const getList = (type) => {
   proxy
     .post("/saleQuotation/page", req.value)
     .then((res) => {
-      if (res.data.rows && res.data.rows.length > 0) {
-        res.data.rows = res.data.rows.map((item) => {
-          let statusText = "";
-          if (item.status) {
-            let list = status.value.filter((itemStatus) => itemStatus.value == item.status);
-            if (list && list.length > 0) {
-              statusText = list[0].label;
-            }
-          }
-          return {
-            ...item,
-            currencyAmount: item.currency + " " + item.amount,
-            statusText: statusText,
-          };
-        });
-      }
-      console.log(type);
-      listData.value = type === "refresh" ? res.data.rows : listData.value.concat(res.data.rows);
+      listData.value =
+        type === "refresh"
+          ? res.data.rows
+          : listData.value.concat(res.data.rows);
       if (req.value.pageNum * 10 >= res.data.total) {
         finished.value = true;
-      }else{
+      } else {
         finished.value = false;
       }
       req.value.pageNum++;
@@ -101,34 +88,32 @@ const getList = (type) => {
 };
 const toDtl = (row) => {
   proxy.$router.push({
-    path: "/main/processDtl",
+    path: "/main/priceSheetAdd",
     query: {
-      flowKey: "sale_quotation_flow",
-      id: row.flowId,
-      processType: 20,
+      id: row.id,
     },
   });
 };
 const listConfig = ref([
   {
-    label: proxy.t("priceSheet.sellCorporation"),
-    prop: "sellCorporationName",
+    label: "报价单号",
+    prop: "code",
   },
   {
-    label: proxy.t("priceSheet.code"),
-    prop: "code",
+    label: "报价子公司",
+    prop: "companyName",
   },
   {
-    label: proxy.t("priceSheet.buyCorporation"),
+    label: "客户名称",
     prop: "buyCorporationName",
   },
   {
-    label: proxy.t("priceSheet.amount"),
-    prop: "currencyAmount",
+    label: "报价时间",
+    prop: "quotationTime",
   },
   {
-    label: proxy.t("priceSheet.status"),
-    prop: "statusText",
+    label: "报价金额",
+    prop: "amount",
   },
 ]);
 </script>