update: 更新支付明细 收入明细 以及所有禁用颜色设置
This commit is contained in:
		
							parent
							
								
									3f3b65c9a7
								
							
						
					
					
						commit
						10848775bc
					
				|  | @ -4,14 +4,14 @@ | ||||||
|       <u-input |       <u-input | ||||||
|         v-model="state.startTime" |         v-model="state.startTime" | ||||||
|         disabled |         disabled | ||||||
|         disabledColor="#ffffff" |          | ||||||
|         placeholder="请选择开始时间" |         placeholder="请选择开始时间" | ||||||
|       ></u-input> |       ></u-input> | ||||||
|       <text>-</text> |       <text>-</text> | ||||||
|       <u-input |       <u-input | ||||||
|         v-model="state.endTime" |         v-model="state.endTime" | ||||||
|         disabled |         disabled | ||||||
|         disabledColor="#ffffff" |          | ||||||
|         placeholder="请选择结束时间" |         placeholder="请选择结束时间" | ||||||
|       ></u-input> |       ></u-input> | ||||||
|       <u-icon |       <u-icon | ||||||
|  |  | ||||||
|  | @ -4,14 +4,14 @@ | ||||||
|       <u-input |       <u-input | ||||||
|         v-model="state.startTime" |         v-model="state.startTime" | ||||||
|         disabled |         disabled | ||||||
|         disabledColor="#ffffff" |          | ||||||
|         placeholder="请选择开始时间" |         placeholder="请选择开始时间" | ||||||
|       ></u-input> |       ></u-input> | ||||||
|       <text>-</text> |       <text>-</text> | ||||||
|       <u-input |       <u-input | ||||||
|         v-model="state.endTime" |         v-model="state.endTime" | ||||||
|         disabled |         disabled | ||||||
|         disabledColor="#ffffff" |          | ||||||
|         placeholder="请选择结束时间" |         placeholder="请选择结束时间" | ||||||
|       ></u-input> |       ></u-input> | ||||||
|       <u-icon |       <u-icon | ||||||
|  |  | ||||||
|  | @ -4,14 +4,14 @@ | ||||||
|       <u-input |       <u-input | ||||||
|         v-model="state.startTime" |         v-model="state.startTime" | ||||||
|         disabled |         disabled | ||||||
|         disabledColor="#ffffff" |          | ||||||
|         placeholder="请选择开始时间" |         placeholder="请选择开始时间" | ||||||
|       ></u-input> |       ></u-input> | ||||||
|       <text>-</text> |       <text>-</text> | ||||||
|       <u-input |       <u-input | ||||||
|         v-model="state.endTime" |         v-model="state.endTime" | ||||||
|         disabled |         disabled | ||||||
|         disabledColor="#ffffff" |          | ||||||
|         placeholder="请选择结束时间" |         placeholder="请选择结束时间" | ||||||
|       ></u-input> |       ></u-input> | ||||||
|       <u-icon |       <u-icon | ||||||
|  |  | ||||||
|  | @ -4,14 +4,14 @@ | ||||||
|       <u-input |       <u-input | ||||||
|         v-model="state.startTime" |         v-model="state.startTime" | ||||||
|         disabled |         disabled | ||||||
|         disabledColor="#ffffff" |          | ||||||
|         placeholder="请选择开始时间" |         placeholder="请选择开始时间" | ||||||
|       ></u-input> |       ></u-input> | ||||||
|       <text>-</text> |       <text>-</text> | ||||||
|       <u-input |       <u-input | ||||||
|         v-model="state.endTime" |         v-model="state.endTime" | ||||||
|         disabled |         disabled | ||||||
|         disabledColor="#ffffff" |          | ||||||
|         placeholder="请选择结束时间" |         placeholder="请选择结束时间" | ||||||
|       ></u-input> |       ></u-input> | ||||||
|       <u-icon |       <u-icon | ||||||
|  |  | ||||||
|  | @ -52,6 +52,7 @@ | ||||||
|               type="number" |               type="number" | ||||||
|               size="small" |               size="small" | ||||||
|               v-model="state.minPrice" |               v-model="state.minPrice" | ||||||
|  |               @change="(e:any) => {handleInput(e, {key: 'minPrice', name: '最低价'})}" | ||||||
|             ></u-input |             ></u-input | ||||||
|           ></view> |           ></view> | ||||||
|           - |           - | ||||||
|  | @ -64,6 +65,7 @@ | ||||||
|               type="number" |               type="number" | ||||||
|               size="small" |               size="small" | ||||||
|               v-model="state.maxPrice" |               v-model="state.maxPrice" | ||||||
|  |               @change="(e:any) => {handleInput(e, {key: 'maxPrice', name: '最高价'})}" | ||||||
|             ></u-input |             ></u-input | ||||||
|           ></view> |           ></view> | ||||||
|         </view> |         </view> | ||||||
|  | @ -144,13 +146,89 @@ | ||||||
|       ></u-action-sheet> |       ></u-action-sheet> | ||||||
|     </block> |     </block> | ||||||
|   </u-popup> |   </u-popup> | ||||||
|  | 
 | ||||||
|  |   <!-- 供应商选择弹框 --> | ||||||
|  |   <SupplierDialog | ||||||
|  |     ref="supplierDialog" | ||||||
|  |     :show="showDialog.showSupplier" | ||||||
|  |     @handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}" | ||||||
|  |     @changeUser="changeUser" | ||||||
|  |     :isShipment="isShipment" | ||||||
|  |   ></SupplierDialog> | ||||||
|  |   <!-- 收货产品弹框 --> | ||||||
|  |   <ProductDialog | ||||||
|  |     :show="showDialog.showProduct" | ||||||
|  |     @handleDialog="(v:boolean) => {handleDialog('showProduct', v)}" | ||||||
|  |     @changeProduct="changeProduct" | ||||||
|  |     ref="productRef" | ||||||
|  |     :isShipment="isShipment" | ||||||
|  |   ></ProductDialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { CustomerApi, GoodsApi, ProfileApi, SupplierApi } from "@/services"; | import { CustomerApi, GoodsApi, ProfileApi, SupplierApi } from "@/services"; | ||||||
|  | import SupplierDialog from "./SupplierDialog.vue"; | ||||||
|  | import ProductDialog from "./ProductDialog.vue"; | ||||||
| import _ from "underscore"; | import _ from "underscore"; | ||||||
|  | import valid from "@/utils/validate"; | ||||||
|  | import { countDots } from "@/utils"; | ||||||
|  | // 供应商选择 | ||||||
|  | const showDialog = < | ||||||
|  |   { | ||||||
|  |     [key: string]: boolean; | ||||||
|  |   } | ||||||
|  | >reactive({ | ||||||
|  |   showSupplier: false, | ||||||
|  |   showProduct: false, | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | const handleDialog = (key: string, v: boolean) => { | ||||||
|  |   showDialog[key] = v; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const changeUser = (obj: any) => { | ||||||
|  |   state.userName = obj.name; // 供应商名称 | ||||||
|  |   state.userId = obj.id; // 供应商Id, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | // 收货产品选择 | ||||||
|  | const changeProduct = (obj: any) => { | ||||||
|  |   if (props.isShipment) { | ||||||
|  |     state.productName = obj.shmProductsName; // 收货产品名称 | ||||||
|  |   } else { | ||||||
|  |     state.productName = obj.reProductsName; // 收货产品名称 | ||||||
|  |   } | ||||||
|  |   state.productId = obj.id; // 收货产品Id, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const handleInput = (e: any, item: any) => { | ||||||
|  |   if (["minPrice", "maxPrice"].indexOf(item.key) > -1) { | ||||||
|  |     const temp = e?.replace(valid.valid_decimal.pattern, ""); | ||||||
|  |     if (countDots(temp).length > 1) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: "请输入正确的" + item.name, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (item.key === "maxPrice" || item.key === "minPrice") { | ||||||
|  |       if (state.minPrice && state.maxPrice && state.minPrice > state.maxPrice) { | ||||||
|  |         uni.showToast({ | ||||||
|  |           title: `最大值应小于最小值`, | ||||||
|  |           icon: "none", | ||||||
|  |         }); | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     setTimeout(() => { | ||||||
|  |       (state as any)[item.key] = temp; | ||||||
|  |     }, 100); | ||||||
|  |   } | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| const props = defineProps<{ | const props = defineProps<{ | ||||||
|   show: boolean; |   show: boolean; | ||||||
|   isShipment: boolean |   isShipment: boolean; | ||||||
| }>(); | }>(); | ||||||
| const emit = defineEmits(["handleDialog", "handleOk"]); | const emit = defineEmits(["handleDialog", "handleOk"]); | ||||||
| const handleClose = () => { | const handleClose = () => { | ||||||
|  | @ -183,17 +261,20 @@ const formAttrList = reactive<any>([ | ||||||
|     name: "供应商", |     name: "供应商", | ||||||
|     childKey: "supplier", |     childKey: "supplier", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       console.log("********"); |       // contrlModalParams.supplier.isShow = true; | ||||||
|       contrlModalParams.supplier.isShow = true; |       // contrlModalParams.supplier.title = "供应商"; | ||||||
|       contrlModalParams.supplier.title = "供应商"; |       handleDialog("showSupplier", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     name: "收货产品", |     name: "收货产品", | ||||||
|     childKey: "product", |     childKey: "product", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.product.isShow = true; |       // contrlModalParams.product.isShow = true; | ||||||
|       contrlModalParams.product.title = "收货产品"; |       // contrlModalParams.product.title = "收货产品"; | ||||||
|  |       handleDialog("showProduct", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | @ -211,16 +292,20 @@ const formAttrList1 = reactive<any>([ | ||||||
|     name: "客户", |     name: "客户", | ||||||
|     childKey: "customer", |     childKey: "customer", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.customer.isShow = true; |       // contrlModalParams.customer.isShow = true; | ||||||
|       contrlModalParams.customer.title = "客户"; |       // contrlModalParams.customer.title = "客户"; | ||||||
|  |       handleDialog("showSupplier", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     name: "出货产品", |     name: "出货产品", | ||||||
|     childKey: "shipmentProduct", |     childKey: "shipmentProduct", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.shipmentProduct.isShow = true; |       // contrlModalParams.shipmentProduct.isShow = true; | ||||||
|       contrlModalParams.shipmentProduct.title = "出货产品"; |       // contrlModalParams.shipmentProduct.title = "出货产品"; | ||||||
|  |       handleDialog("showProduct", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
| ]); | ]); | ||||||
|  | @ -324,7 +409,6 @@ GoodsApi.getShipmentProductList().then((res) => { | ||||||
|   } |   } | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| // 重置 确定 | // 重置 确定 | ||||||
| const resetState = () => { | const resetState = () => { | ||||||
|   state.userId = null; // 供应商ID |   state.userId = null; // 供应商ID | ||||||
|  | @ -336,11 +420,22 @@ const resetState = () => { | ||||||
|   state.minPrice = null; |   state.minPrice = null; | ||||||
|   state.maxPrice = null; |   state.maxPrice = null; | ||||||
|   currentSpl.value = null; |   currentSpl.value = null; | ||||||
|   deliveryMethod.value = null |   deliveryMethod.value = null; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const getFilter = () => { | const getFilter = () => { | ||||||
|   emit("handleOk", { ...state, repairFlag: currentSpl.value, deliveryMethod: deliveryMethod.value }); |   if (state.minPrice && state.maxPrice && state.minPrice > state.maxPrice) { | ||||||
|  |     uni.showToast({ | ||||||
|  |       title: `最大值应小于最小值`, | ||||||
|  |       icon: "none", | ||||||
|  |     }); | ||||||
|  |     return; | ||||||
|  |   } | ||||||
|  |   emit("handleOk", { | ||||||
|  |     ...state, | ||||||
|  |     repairFlag: currentSpl.value, | ||||||
|  |     deliveryMethod: deliveryMethod.value, | ||||||
|  |   }); | ||||||
|   emit("handleDialog", false); |   emit("handleDialog", false); | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -0,0 +1,165 @@ | ||||||
|  | <template> | ||||||
|  |   <u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> | ||||||
|  |     <view class="c-dialog-filter"> | ||||||
|  |       <view class="title">{{ isShipment ? "出货" : "收货" }}产品</view> | ||||||
|  |       <view v-if="isShipment"> | ||||||
|  |         <view v-for="(item, index) in state.list" :key="index"> | ||||||
|  |           <view class="first-title">{{ item.shmCategoryName }}</view> | ||||||
|  |           <view v-for="(cItem, cIndex) in item.childrenList" :key="cIndex"> | ||||||
|  |             <view class="second-title">{{ cItem.shmCategoryName }}</view> | ||||||
|  | 
 | ||||||
|  |             <view class="dialog-product-layout"> | ||||||
|  |               <view v-if="cItem.childrenLists"> | ||||||
|  |                 <text | ||||||
|  |                   v-for="(child, childIndex) in cItem.childrenLists" | ||||||
|  |                   :key="childIndex" | ||||||
|  |                   :class="{ active: state.current === child.childIndex }" | ||||||
|  |                   @click="handleSelect(child)" | ||||||
|  |                   >{{ child.shmProductsName }}</text | ||||||
|  |                 > | ||||||
|  |               </view> | ||||||
|  | 
 | ||||||
|  |               <view v-else style="flex: auto"> | ||||||
|  |                 <u-empty | ||||||
|  |                   mode="data" | ||||||
|  |                   icon="http://cdn.uviewui.com/uview/empty/data.png" | ||||||
|  |                 > | ||||||
|  |                 </u-empty> | ||||||
|  |               </view> | ||||||
|  |             </view> | ||||||
|  |           </view> | ||||||
|  |         </view> | ||||||
|  |       </view> | ||||||
|  |       <view class="dialog-product-layout" v-else> | ||||||
|  |         <text | ||||||
|  |           v-for="(item, index) in state.list" | ||||||
|  |           :class="{ active: state.current === item.id }" | ||||||
|  |           @click="handleSelect(item)" | ||||||
|  |           :key="index" | ||||||
|  |           >{{ isShipment ? item.shmProductsName : item.reProductsName }}</text | ||||||
|  |         > | ||||||
|  |       </view> | ||||||
|  |     </view> | ||||||
|  |   </u-popup> | ||||||
|  | </template> | ||||||
|  | <script setup lang="ts"> | ||||||
|  | import { ReceiveProductApi, GoodsApi } from "@/services"; | ||||||
|  | 
 | ||||||
|  | const props = defineProps<{ | ||||||
|  |   show: boolean; | ||||||
|  |   isShipment: boolean; | ||||||
|  | }>(); | ||||||
|  | const emit = defineEmits(["handleDialog", "changeProduct"]); | ||||||
|  | const handleClose = () => { | ||||||
|  |   emit("handleDialog", false); | ||||||
|  | }; | ||||||
|  | const state = reactive<any>({ | ||||||
|  |   list: [], | ||||||
|  |   current: -1, | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | const handleSelect = (item: any) => { | ||||||
|  |   state.current = item.id; | ||||||
|  |   emit("changeProduct", item); | ||||||
|  |   emit("handleDialog", false); | ||||||
|  | }; | ||||||
|  | const getList = () => { | ||||||
|  |   if (props.isShipment) { | ||||||
|  |     // GoodsApi.getShipmentProductList().then((res) => { | ||||||
|  |     //   if (res.code === 200) { | ||||||
|  |     //     state.list = res.data; | ||||||
|  |     //   } | ||||||
|  |     // }); | ||||||
|  | 
 | ||||||
|  |     GoodsApi.getChildrenList().then((res) => { | ||||||
|  |       if (res.code === 200) { | ||||||
|  |         if (res.code === 200) { | ||||||
|  |           state.list = res.data; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |   } else { | ||||||
|  |     ReceiveProductApi.getAllReProducts().then((res) => { | ||||||
|  |       if (res.code === 200) { | ||||||
|  |         state.list = res.data; | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  | }; | ||||||
|  | onMounted(() => { | ||||||
|  |   getList(); | ||||||
|  | }); | ||||||
|  | </script> | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | .c-dialog-filter { | ||||||
|  |   width: 95vw; | ||||||
|  |   padding: 25rpx; | ||||||
|  |   height: 90vh; | ||||||
|  |   overflow-y: scroll; | ||||||
|  |   .title { | ||||||
|  |     font-weight: 500; | ||||||
|  |     font-size: 32rpx; | ||||||
|  |     color: #000000; | ||||||
|  |     text-align: center; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | .first-title { | ||||||
|  |   font-size: 28rpx; | ||||||
|  |   font-weight: 500; | ||||||
|  | } | ||||||
|  | .second-title { | ||||||
|  |   font-size: 26rpx; | ||||||
|  |   font-weight: 500; | ||||||
|  |   color: rgba(0, 0, 0, 0.7); | ||||||
|  |   margin: 20rpx; | ||||||
|  | } | ||||||
|  | // 产品dialog | ||||||
|  | .dialog-product-layout { | ||||||
|  |   box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); | ||||||
|  |   border-radius: 13rpx; | ||||||
|  |   margin: 30rpx 24rpx; | ||||||
|  |   padding: 20rpx; | ||||||
|  |   display: flex; | ||||||
|  |   justify-content: flex-start; | ||||||
|  |   align-items: center; | ||||||
|  |   flex-flow: row wrap; | ||||||
|  |   max-height: 70vh; | ||||||
|  |   overflow: auto; | ||||||
|  | 
 | ||||||
|  |   text { | ||||||
|  |     font-weight: 400; | ||||||
|  |     font-size: 26rpx; | ||||||
|  |     color: #999999; | ||||||
|  |     background: #ffffff; | ||||||
|  |     border-radius: 6rpx; | ||||||
|  |     border: 1px solid rgba(153, 153, 153, 0.64); | ||||||
|  |     text-align: center; | ||||||
|  |     cursor: pointer; | ||||||
|  |     padding: 0rpx 20rpx; | ||||||
|  |     margin-bottom: 20rpx; | ||||||
|  |     margin-left: 10rpx; | ||||||
|  |     margin-right: 10rpx; | ||||||
|  |   } | ||||||
|  |   .active { | ||||||
|  |     border-color: $u-primary; | ||||||
|  |     color: $u-primary; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .btn-confirm { | ||||||
|  |   box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12); | ||||||
|  |   border-radius: 13rpx 13rpx 0rpx 0rpx; | ||||||
|  |   position: absolute; | ||||||
|  |   bottom: 0rpx; | ||||||
|  |   width: 100%; | ||||||
|  |   left: 0rpx; | ||||||
|  |   padding: 27.56rpx; | ||||||
|  |   .btn { | ||||||
|  |     text-align: center; | ||||||
|  |     ::v-deep button { | ||||||
|  |       width: 80%; | ||||||
|  |       border-radius: 43rpx; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </style> | ||||||
|  | @ -32,7 +32,7 @@ | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|           :disabled="item.type === 'select'" |           :disabled="item.type === 'select'" | ||||||
|           disabledColor="#ffffff" |           :disabledColor="['卡号'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text> |             <text> | ||||||
|  |  | ||||||
|  | @ -31,7 +31,8 @@ | ||||||
|           :clearable="true" |           :clearable="true" | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|           :disabled="item.disabled" |           :disabled="item.disabled || item.type === 'select'" | ||||||
|  |           :disabledColor="['客户','结算时间', '结算方式'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text> |             <text> | ||||||
|  | @ -73,10 +74,7 @@ | ||||||
|       @confirm="(v: any) => {handleTime(v)}" |       @confirm="(v: any) => {handleTime(v)}" | ||||||
|       @cancel="contrlModalParams.isShowSplTime = false" |       @cancel="contrlModalParams.isShowSplTime = false" | ||||||
|     ></u-datetime-picker> |     ></u-datetime-picker> | ||||||
|     <block |     <block v-for="(item, index) in formAttrList" :key="index"> | ||||||
|       v-for="(item, index) in formAttrList" |  | ||||||
|       :key="index" |  | ||||||
|     > |  | ||||||
|       <u-action-sheet |       <u-action-sheet | ||||||
|         v-if="item.type === 'select' && item.key !== 'settlementTime'" |         v-if="item.type === 'select' && item.key !== 'settlementTime'" | ||||||
|         :actions="contrlModalParams[item.childKey].list" |         :actions="contrlModalParams[item.childKey].list" | ||||||
|  | @ -91,21 +89,38 @@ | ||||||
|   <view class="btn-box"> |   <view class="btn-box"> | ||||||
|     <u-button type="primary" text="保存" @click="save()"></u-button> |     <u-button type="primary" text="保存" @click="save()"></u-button> | ||||||
|   </view> |   </view> | ||||||
|  |   <!-- 供应商选择弹框 --> | ||||||
|  |   <SupplierDialog | ||||||
|  |     ref="supplierDialog" | ||||||
|  |     :show="showDialog.showSupplier" | ||||||
|  |     @handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}" | ||||||
|  |     @changeUser="changeUser" | ||||||
|  |     :isShipment="true" | ||||||
|  |   ></SupplierDialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { | import { CustomerApi, FinanceApi, PictureApi } from "@/services"; | ||||||
|   CustomerApi, |  | ||||||
|   DeviceApi, |  | ||||||
|   FinanceApi, |  | ||||||
|   PictureApi, |  | ||||||
|   ProfileApi, |  | ||||||
|   ReceiveApi, |  | ||||||
|   ReceiveProductApi, |  | ||||||
|   SupplierApi, |  | ||||||
| } from "@/services"; |  | ||||||
| import { formatDate } from "@/utils"; | import { formatDate } from "@/utils"; | ||||||
| import { DeviceType, ImagesType, OrderType } from "@/utils/enum"; | import { DeviceType, ImagesType, OrderType } from "@/utils/enum"; | ||||||
| import _ from "underscore"; | import _ from "underscore"; | ||||||
|  | // 供应商选择 | ||||||
|  | const showDialog = < | ||||||
|  |   { | ||||||
|  |     [key: string]: boolean; | ||||||
|  |   } | ||||||
|  | >reactive({ | ||||||
|  |   showSupplier: false, | ||||||
|  |   showProduct: false, | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | const handleDialog = (key: string, v: boolean) => { | ||||||
|  |   showDialog[key] = v; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const changeUser = (obj: any) => { | ||||||
|  |   model1.order.customerName = obj.name; | ||||||
|  |   model1.order.customerId = obj.id; | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| const model1 = reactive<any>({ | const model1 = reactive<any>({ | ||||||
|   order: { |   order: { | ||||||
|  | @ -114,7 +129,7 @@ const model1 = reactive<any>({ | ||||||
|     settlementTime: "", |     settlementTime: "", | ||||||
|   }, |   }, | ||||||
|   supplierList: [], |   supplierList: [], | ||||||
|   customerList: [] |   customerList: [], | ||||||
| }); | }); | ||||||
| const rules = reactive({ | const rules = reactive({ | ||||||
|   "order.supCusName": { |   "order.supCusName": { | ||||||
|  | @ -150,7 +165,7 @@ const rules = reactive({ | ||||||
| }); | }); | ||||||
| const contrlModalParams = reactive<any>({ | const contrlModalParams = reactive<any>({ | ||||||
|   isShowSplTime: false, |   isShowSplTime: false, | ||||||
|   spltime:  Number(new Date()), |   settlementTime: Number(new Date()), | ||||||
|   user: { |   user: { | ||||||
|     isShow: false, |     isShow: false, | ||||||
|     title: "标题", |     title: "标题", | ||||||
|  | @ -189,8 +204,10 @@ const formAttrList = reactive<any>([ | ||||||
|     required: true, |     required: true, | ||||||
|     unit: "", |     unit: "", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.user.isShow = true; |       // contrlModalParams.user.isShow = true; | ||||||
|       contrlModalParams.user.title = "客户"; |       // contrlModalParams.user.title = "客户"; | ||||||
|  |       handleDialog("showSupplier", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | @ -234,18 +251,13 @@ const formAttrList = reactive<any>([ | ||||||
|   }, |   }, | ||||||
| ]); | ]); | ||||||
| // 监听毛重 皮重 | // 监听毛重 皮重 | ||||||
| watch( | watch([() => model1.order.buttonType], ([buttonTypeNew]) => { | ||||||
|   [ |   if (buttonTypeNew === 3) { | ||||||
|     () => model1.order.buttonType, |     contrlModalParams.user.list = model1.supplierList; | ||||||
|   ], |   } else if (buttonTypeNew === 2) { | ||||||
|   ([buttonTypeNew]) => { |     contrlModalParams.user.list = model1.customerList; | ||||||
|     if (buttonTypeNew === 3) { |  | ||||||
|       contrlModalParams.user.list = model1.supplierList; |  | ||||||
|     } else if (buttonTypeNew === 2) { |  | ||||||
|       contrlModalParams.user.list = model1.customerList; |  | ||||||
|     } |  | ||||||
|   } |   } | ||||||
| ); | }); | ||||||
| 
 | 
 | ||||||
| const handleDelete = (e: any) => { | const handleDelete = (e: any) => { | ||||||
|   console.log(model1.order.fileLists); |   console.log(model1.order.fileLists); | ||||||
|  | @ -352,7 +364,7 @@ const save = () => { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const startSave = () => { | const startSave = () => { | ||||||
|   model1.order.paymentType = 1 // 手动添加默认其他付款 |   model1.order.paymentType = 1; // 手动添加默认其他付款 | ||||||
|   FinanceApi.addIncome(model1.order).then((res) => { |   FinanceApi.addIncome(model1.order).then((res) => { | ||||||
|     if (res.code === 200) { |     if (res.code === 200) { | ||||||
|       model1.order.id = res.data; |       model1.order.id = res.data; | ||||||
|  |  | ||||||
|  | @ -33,7 +33,9 @@ | ||||||
|           :clearable="true" |           :clearable="true" | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|           :disabled="item.disabled" |           :disabled="item.disabled || item.type === 'select'" | ||||||
|  |           :disabledColor="['供应商','客户','结算时间', '结算方式'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|  |           @change="(e:any) => {handleInput(e, item)}" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text> |             <text> | ||||||
|  | @ -95,21 +97,60 @@ | ||||||
|   <view class="btn-box"> |   <view class="btn-box"> | ||||||
|     <u-button type="primary" text="保存" @click="save()"></u-button> |     <u-button type="primary" text="保存" @click="save()"></u-button> | ||||||
|   </view> |   </view> | ||||||
|  | 
 | ||||||
|  |   <!-- 供应商选择弹框 --> | ||||||
|  |   <SupplierDialog | ||||||
|  |     ref="supplierDialog" | ||||||
|  |     :show="showDialog.showSupplier" | ||||||
|  |     @handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}" | ||||||
|  |     @changeUser="changeUser" | ||||||
|  |     :isShipment="model1.order.buttonType === 2" | ||||||
|  |   ></SupplierDialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { | import { CustomerApi, FinanceApi, PictureApi, SupplierApi } from "@/services"; | ||||||
|   CustomerApi, | import { countDots, formatDate } from "@/utils"; | ||||||
|   DeviceApi, | import { ImagesType, OrderType } from "@/utils/enum"; | ||||||
|   FinanceApi, |  | ||||||
|   PictureApi, |  | ||||||
|   ProfileApi, |  | ||||||
|   ReceiveApi, |  | ||||||
|   ReceiveProductApi, |  | ||||||
|   SupplierApi, |  | ||||||
| } from "@/services"; |  | ||||||
| import { formatDate } from "@/utils"; |  | ||||||
| import { DeviceType, ImagesType, OrderType } from "@/utils/enum"; |  | ||||||
| import _ from "underscore"; | import _ from "underscore"; | ||||||
|  | import SupplierDialog from "./SupplierDialog.vue"; | ||||||
|  | import valid from "@/utils/validate"; | ||||||
|  | // 供应商选择 | ||||||
|  | const showDialog = < | ||||||
|  |   { | ||||||
|  |     [key: string]: boolean; | ||||||
|  |   } | ||||||
|  | >reactive({ | ||||||
|  |   showSupplier: false, | ||||||
|  |   showProduct: false, | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | const handleDialog = (key: string, v: boolean) => { | ||||||
|  |   showDialog[key] = v; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const changeUser = (obj: any) => { | ||||||
|  |   model1.order.supCusName = obj.name; | ||||||
|  |   model1.order.supCusId = obj.id; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | // 供应商(金额) 客户(杂费 运费)校验 | ||||||
|  | const handleInput = (e: any, item: any) => { | ||||||
|  |   if ( | ||||||
|  |     ["totalPrice", "incidentals", "freight"].indexOf(item.key) > -1 | ||||||
|  |   ) { | ||||||
|  |     const temp = e?.replace(valid.valid_decimal.pattern, ""); | ||||||
|  |     if (countDots(temp).length > 1) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: "请输入正确的" + item.name, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     setTimeout(() => { | ||||||
|  |       model1.order[item.key] = temp; | ||||||
|  |     }, 100); | ||||||
|  |   } | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| const model1 = reactive<any>({ | const model1 = reactive<any>({ | ||||||
|   order: { |   order: { | ||||||
|  | @ -118,7 +159,7 @@ const model1 = reactive<any>({ | ||||||
|     settlementTime: "", |     settlementTime: "", | ||||||
|   }, |   }, | ||||||
|   supplierList: [], |   supplierList: [], | ||||||
|   customerList: [] |   customerList: [], | ||||||
| }); | }); | ||||||
| const rules1 = reactive({ | const rules1 = reactive({ | ||||||
|   "order.supCusName": { |   "order.supCusName": { | ||||||
|  | @ -180,7 +221,7 @@ const rules2 = reactive({ | ||||||
| }); | }); | ||||||
| const contrlModalParams = reactive<any>({ | const contrlModalParams = reactive<any>({ | ||||||
|   isShowSplTime: false, |   isShowSplTime: false, | ||||||
|   spltime:  Number(new Date()), |   settlementTime: Number(new Date()), | ||||||
|   user: { |   user: { | ||||||
|     isShow: false, |     isShow: false, | ||||||
|     title: "标题", |     title: "标题", | ||||||
|  | @ -225,8 +266,10 @@ const formAttrList1 = reactive<any>([ | ||||||
|     required: true, |     required: true, | ||||||
|     unit: "", |     unit: "", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.user.isShow = true; |       // contrlModalParams.user.isShow = true; | ||||||
|       contrlModalParams.user.title = "供应商"; |       // contrlModalParams.user.title = "供应商"; | ||||||
|  |       handleDialog("showSupplier", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | @ -285,8 +328,10 @@ const formAttrList2 = reactive<any>([ | ||||||
|     required: true, |     required: true, | ||||||
|     unit: "", |     unit: "", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.user.isShow = true; |       // contrlModalParams.user.isShow = true; | ||||||
|       contrlModalParams.user.title = "客户"; |       // contrlModalParams.user.title = "客户"; | ||||||
|  |       handleDialog("showSupplier", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | @ -336,19 +381,18 @@ const formAttrList2 = reactive<any>([ | ||||||
|     type: "upload", |     type: "upload", | ||||||
|   }, |   }, | ||||||
| ]); | ]); | ||||||
| // 监听毛重 皮重 | // 监听付款类型 | ||||||
| watch( | watch([() => model1.order.buttonType], ([buttonTypeNew]) => { | ||||||
|   [ |   if (buttonTypeNew === 3) { | ||||||
|     () => model1.order.buttonType, |     contrlModalParams.user.list = model1.supplierList; | ||||||
|   ], |     model1.order.paymentMethodName = ""; | ||||||
|   ([buttonTypeNew]) => { |     model1.order.paymentMethod = ""; | ||||||
|     if (buttonTypeNew === 3) { |   } else if (buttonTypeNew === 2) { | ||||||
|       contrlModalParams.user.list = model1.supplierList; |     contrlModalParams.user.list = model1.customerList; | ||||||
|     } else if (buttonTypeNew === 2) { |     model1.order.supCusName = ""; | ||||||
|       contrlModalParams.user.list = model1.customerList; |     model1.order.supCusId = ""; | ||||||
|     } |  | ||||||
|   } |   } | ||||||
| ); | }); | ||||||
| 
 | 
 | ||||||
| const handleDelete = (e: any) => { | const handleDelete = (e: any) => { | ||||||
|   console.log(model1.order.fileLists); |   console.log(model1.order.fileLists); | ||||||
|  | @ -454,13 +498,13 @@ const save = () => { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const startSave = () => { | const startSave = () => { | ||||||
|   model1.order.paymentType = model1.order.buttonType |   model1.order.paymentType = model1.order.buttonType; | ||||||
|   if (model1.order.buttonType === 2) { |   if (model1.order.buttonType === 2) { | ||||||
|     model1.order.totalPrice = parseInt(model1.order.freight) + parseInt(model1.order.incidentals) |     model1.order.totalPrice = | ||||||
|   }  |       parseInt(model1.order.freight) + parseInt(model1.order.incidentals); | ||||||
|  |   } | ||||||
|   FinanceApi.addPaymentDetails(model1.order).then((res) => { |   FinanceApi.addPaymentDetails(model1.order).then((res) => { | ||||||
|     if (res.code === 200) { |     if (res.code === 200) { | ||||||
|        |  | ||||||
|       model1.order.id = res.data; |       model1.order.id = res.data; | ||||||
|       upload(); |       upload(); | ||||||
|       uni.redirectTo({ |       uni.redirectTo({ | ||||||
|  |  | ||||||
|  | @ -31,6 +31,9 @@ | ||||||
|           :clearable="true" |           :clearable="true" | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|  |           :disabled="item.type === 'select'" | ||||||
|  |           :disabledColor="['收货分类'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|  |           @change="(e:any) => {handleInput(e, item)}" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text> |             <text> | ||||||
|  | @ -62,11 +65,64 @@ | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { GoodsApi } from "@/services"; | import { GoodsApi } from "@/services"; | ||||||
| import { formatDate } from "@/utils"; | import { countDots } from "@/utils"; | ||||||
| import { DeviceType, ImagesType, OrderType } from "@/utils/enum"; | import valid from "@/utils/validate"; | ||||||
| import { onLoad } from "@dcloudio/uni-app"; | import { onLoad } from "@dcloudio/uni-app"; | ||||||
| import _ from "underscore"; | import _ from "underscore"; | ||||||
|  | // 最低价 最高价 常用价格 | ||||||
|  | const handleInput = (e: any, item: any) => { | ||||||
|  |   if (["minPrice", "maxPrice", "commonPrice"].indexOf(item.key) > -1) { | ||||||
|  |     const temp = e?.replace(valid.valid_decimal.pattern, ""); | ||||||
|  |     if (countDots(temp).length > 1) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: "请输入正确的" + item.name, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |     } | ||||||
|  |     if (item.key === "maxPrice") { | ||||||
|  |       if (model1.formData.minPrice > model1.formData.maxPrice) { | ||||||
|  |         uni.showToast({ | ||||||
|  |           title: `${item.name}应小于${model1.formData.maxPrice}`, | ||||||
|  |           icon: "none", | ||||||
|  |         }); | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |     if (item.key === "commonPrice") { | ||||||
|  |       if (model1.formData.minPrice > -1 && model1.formData.maxPrice > -1) { | ||||||
|  |         if ( | ||||||
|  |           temp < model1.formData.minPrice || | ||||||
|  |           temp > model1.formData.maxPrice | ||||||
|  |         ) { | ||||||
|  |           uni.showToast({ | ||||||
|  |             title: `${item.name}应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`, | ||||||
|  |             icon: "none", | ||||||
|  |           }); | ||||||
|  |           return; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|  |     setTimeout(() => { | ||||||
|  |       model1.formData[item.key] = temp; | ||||||
|  |     }, 100); | ||||||
|  |   } | ||||||
|  |   if (item.key === "subtractNum") { | ||||||
|  |     const temp = e?.replace(valid.valid_decimal.pattern, ""); | ||||||
|  |     if ( | ||||||
|  |       model1.order.buttonType === 1 && | ||||||
|  |       (parseInt(temp) > 100 || parseInt(temp) < 0) | ||||||
|  |     ) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: `${item.name}正确范围是0-100`, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |     } | ||||||
|  |     setTimeout(() => { | ||||||
|  |       model1.order[item.key] = temp; | ||||||
|  |     }, 100); | ||||||
|  |   } | ||||||
|  | }; | ||||||
| const model1 = reactive<any>({ | const model1 = reactive<any>({ | ||||||
|   formData: {}, |   formData: {}, | ||||||
| }); | }); | ||||||
|  | @ -74,7 +130,7 @@ const rules = ref({ | ||||||
|   "formData.reProductsName": { |   "formData.reProductsName": { | ||||||
|     type: "string", |     type: "string", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入货产品", |     message: "请输入收货产品", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "formData.reCategoryName": { |   "formData.reCategoryName": { | ||||||
|  | @ -83,28 +139,28 @@ const rules = ref({ | ||||||
|     message: "请选择收货分类", |     message: "请选择收货分类", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "formData.substationName": { |   // "formData.substationName": { | ||||||
|     type: "string", |   //   type: "string", | ||||||
|     required: true, |   //   required: true, | ||||||
|     message: "请输入所属分站", |   //   message: "请输入所属分站", | ||||||
|     trigger: ["blur", "change"], |   //   trigger: ["blur", "change"], | ||||||
|   }, |   // }, | ||||||
|   "formData.minPrice": { |   "formData.minPrice": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入最低价", |     message: "最低价为空或输入错误", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "formData.maxPrice": { |   "formData.maxPrice": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入最高价", |     message: "最高价为空或输入错误", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "formData.commonPrice": { |   "formData.commonPrice": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入常用价格", |     message: "常用价格为空或输入错误", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
|  | @ -136,13 +192,13 @@ const formAttrList = reactive<any>([ | ||||||
|       contrlModalParams.reCategory.title = "收货分类"; |       contrlModalParams.reCategory.title = "收货分类"; | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   // { | ||||||
|     name: "所属分站", |   //   name: "所属分站", | ||||||
|     key: "substationName", |   //   key: "substationName", | ||||||
|     type: "input", |   //   type: "input", | ||||||
|     required: true, |   //   required: true, | ||||||
|     unit: "", |   //   unit: "", | ||||||
|   }, |   // }, | ||||||
|   { |   { | ||||||
|     name: "最低价", |     name: "最低价", | ||||||
|     key: "minPrice", |     key: "minPrice", | ||||||
|  | @ -193,6 +249,24 @@ const check = () => { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const save = () => { | const save = () => { | ||||||
|  |   if (model1.formData.minPrice > model1.formData.maxPrice) { | ||||||
|  |     uni.showToast({ | ||||||
|  |       title: `最低价应小于${model1.formData.maxPrice}`, | ||||||
|  |       icon: "none", | ||||||
|  |     }); | ||||||
|  |     return; | ||||||
|  |   } | ||||||
|  |   if (model1.formData.minPrice > -1 && model1.formData.maxPrice > -1) { | ||||||
|  |     const temp = model1.formData.commonPrice; | ||||||
|  |     if (temp < model1.formData.minPrice || temp > model1.formData.maxPrice) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: `常用价格应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   console.log(model1.formData); | ||||||
|   check().then((res) => { |   check().then((res) => { | ||||||
|     if (res) { |     if (res) { | ||||||
|       startSave(); |       startSave(); | ||||||
|  | @ -236,13 +310,16 @@ onMounted(() => { | ||||||
| onLoad((option) => { | onLoad((option) => { | ||||||
|   // 接收传递的标题参数 |   // 接收传递的标题参数 | ||||||
|   const title = (option as any).title; |   const title = (option as any).title; | ||||||
|   model1.formData = JSON.parse((option as any).item); |   if ((option as any).item) { | ||||||
|   if (model1.formData.cardCode) { |     model1.formData = JSON.parse((option as any).item); | ||||||
|     model1.formData.stockCardName = model1.formData.cardCode; |     if (model1.formData.cardCode) { | ||||||
|  |       model1.formData.stockCardName = model1.formData.cardCode; | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   // 设置页面标题 |   // 设置页面标题 | ||||||
|   uni.setNavigationBarTitle({ |   uni.setNavigationBarTitle({ | ||||||
|     title: title, |     title: title || '新增收货产品', | ||||||
|   }); |   }); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|       :errorType="'border-bottom'" |       :errorType="'border-bottom'" | ||||||
|     > |     > | ||||||
|       <u-form-item |       <u-form-item | ||||||
|       :prop="`formData.${item.key}`" |         :prop="`formData.${item.key}`" | ||||||
|         :label="item.name" |         :label="item.name" | ||||||
|         :required="item.required" |         :required="item.required" | ||||||
|         v-for="(item, index) in formAttrList" |         v-for="(item, index) in formAttrList" | ||||||
|  | @ -35,6 +35,8 @@ | ||||||
|           :clearable="true" |           :clearable="true" | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|  |           :disabled="item.type === 'cascader'" | ||||||
|  |           :disabledColor="['出货分类'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text> |             <text> | ||||||
|  | @ -227,17 +229,19 @@ onMounted(() => { | ||||||
| onLoad((option) => { | onLoad((option) => { | ||||||
|   // 接收传递的标题参数 |   // 接收传递的标题参数 | ||||||
|   const title = (option as any).title; |   const title = (option as any).title; | ||||||
|   model1.formData = JSON.parse((option as any).item) || {}; |   if ((option as any).item) { | ||||||
|   if (option) { |     model1.formData = JSON.parse((option as any).item) || {}; | ||||||
|     if (model1.formData.shmCategoryName) { |     if (option) { | ||||||
|       model1.formData.reCategoryName = model1.formData.shmCategoryName; |       if (model1.formData.shmCategoryName) { | ||||||
|  |         model1.formData.reCategoryName = model1.formData.shmCategoryName; | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // 设置页面标题 |   // 设置页面标题 | ||||||
|   if (title) { |   if (title) { | ||||||
|     uni.setNavigationBarTitle({ |     uni.setNavigationBarTitle({ | ||||||
|       title: title, |       title: title || "新增出货产品", | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | @ -31,6 +31,8 @@ | ||||||
|           :clearable="true" |           :clearable="true" | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|  |           :disabled="item.type === 'select'" | ||||||
|  |           :disabledColor="['上级菜单'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text> |             <text> | ||||||
|  | @ -61,8 +63,6 @@ | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { GoodsApi } from "@/services"; | import { GoodsApi } from "@/services"; | ||||||
| import { formatDate } from "@/utils"; |  | ||||||
| import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum"; |  | ||||||
| import { onLoad } from "@dcloudio/uni-app"; | import { onLoad } from "@dcloudio/uni-app"; | ||||||
| import _ from "underscore"; | import _ from "underscore"; | ||||||
| 
 | 
 | ||||||
|  | @ -104,8 +104,12 @@ const formAttrList = reactive<any>([ | ||||||
|     required: true, |     required: true, | ||||||
|     childKey: "parent", |     childKey: "parent", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|  |       // 若是编辑并且是父菜单则不可编辑分类 | ||||||
|  |       if (model1.formData.id && model1.formData.parentId === 0) { | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|       contrlModalParams.parent.isShow = true; |       contrlModalParams.parent.isShow = true; | ||||||
|       contrlModalParams.parent.title = "库存卡类型"; |       contrlModalParams.parent.title = "出货分类"; | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | @ -150,7 +154,11 @@ const save = () => { | ||||||
| }; | }; | ||||||
| const startSave = () => { | const startSave = () => { | ||||||
|   if (model1.formData.id) { |   if (model1.formData.id) { | ||||||
|     GoodsApi.editReceiveCategory(model1.formData).then((res) => { |     GoodsApi.editShipmentCategory({ | ||||||
|  |       id: model1.formData.id, | ||||||
|  |       shmCategoryName: model1.formData.name, | ||||||
|  |       parentId: model1.formData.parentId, | ||||||
|  |     }).then((res) => { | ||||||
|       if (res.code === 200) { |       if (res.code === 200) { | ||||||
|         uni.redirectTo({ |         uni.redirectTo({ | ||||||
|           url: "/pagesApp/shipmentType", // 要跳转到的页面路径 |           url: "/pagesApp/shipmentType", // 要跳转到的页面路径 | ||||||
|  | @ -169,8 +177,34 @@ const startSave = () => { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| onLoad((option) => { | onLoad((option) => { | ||||||
|  |   GoodsApi.allShmCategory().then((res: any) => { | ||||||
|  |     if (res.code === 200) { | ||||||
|  |       contrlModalParams.parent.list = [ | ||||||
|  |         { | ||||||
|  |           id: 0, | ||||||
|  |           name: "主分类", | ||||||
|  |         }, | ||||||
|  |       ].concat( | ||||||
|  |         res.data.map((item: any) => { | ||||||
|  |           return { ...item, name: item.shmCategoryName }; | ||||||
|  |         }) | ||||||
|  |       ); | ||||||
|  |     } | ||||||
|  |   }); | ||||||
|   // 接收传递的标题参数 |   // 接收传递的标题参数 | ||||||
|   const title = (option as any).title; |   const title = (option as any).title; | ||||||
|  |   const obj = JSON.parse((option as any).item); | ||||||
|  |   model1.formData = obj; | ||||||
|  |   model1.formData.shmCategoryName = obj.shmCategoryName; | ||||||
|  |   if (obj.parentId === 0) { | ||||||
|  |     model1.formData.parentName = "主菜单"; | ||||||
|  |   } else { | ||||||
|  |     GoodsApi.getShipmentCategoryById({ id: obj.parentId }).then((res: any) => { | ||||||
|  |       if (res.code === 200) { | ||||||
|  |         model1.formData.parentName = res.data.shmCategoryName; | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|   // 设置页面标题 |   // 设置页面标题 | ||||||
|   uni.setNavigationBarTitle({ |   uni.setNavigationBarTitle({ | ||||||
|     title: title, |     title: title, | ||||||
|  |  | ||||||
|  | @ -32,7 +32,7 @@ | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|           :disabled="item.type === 'selectCustom'" |           :disabled="item.type === 'selectCustom'" | ||||||
|           disabledColor="#ffffff" |           :disabledColor="['类型'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text> |             <text> | ||||||
|  |  | ||||||
|  | @ -33,7 +33,7 @@ | ||||||
|           border="none" |           border="none" | ||||||
|           @change="(e:any) => {handleInput(e, item)}" |           @change="(e:any) => {handleInput(e, item)}" | ||||||
|           :disabled="item.type === 'select'" |           :disabled="item.type === 'select'" | ||||||
|           disabledColor="#ffffff" |           :disabledColor="['卡号', '供应商分类'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text> |             <text> | ||||||
|  |  | ||||||
|  | @ -35,7 +35,7 @@ | ||||||
|           :maxlength="item.key === 'password' ? 6 : -1" |           :maxlength="item.key === 'password' ? 6 : -1" | ||||||
|           @change="(e:any) => {handleInput(e, item)}" |           @change="(e:any) => {handleInput(e, item)}" | ||||||
|           :disabled="item.type === 'select'" |           :disabled="item.type === 'select'" | ||||||
|           disabledColor="#ffffff" |           :disabledColor="['性别', '用户角色'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text> |             <text> | ||||||
|  |  | ||||||
|  | @ -139,7 +139,11 @@ | ||||||
| import { ReceiveApi } from "@/services"; | import { ReceiveApi } from "@/services"; | ||||||
| import { ScaleStatus } from "@/utils/enum"; | import { ScaleStatus } from "@/utils/enum"; | ||||||
| import PageView from "@/components/PageView/index.vue"; | import PageView from "@/components/PageView/index.vue"; | ||||||
| import { formatDate, getCurrentMonthStartAndEnd, filterNullUndefined } from "@/utils"; | import { | ||||||
|  |   formatDate, | ||||||
|  |   getCurrentMonthStartAndEnd, | ||||||
|  |   filterNullUndefined, | ||||||
|  | } from "@/utils"; | ||||||
| import TimeDialog from "./components/TimeDialog.vue"; | import TimeDialog from "./components/TimeDialog.vue"; | ||||||
| import FilterDialog from "./components/FilterDialog.vue"; | import FilterDialog from "./components/FilterDialog.vue"; | ||||||
| const showDialog = < | const showDialog = < | ||||||
|  | @ -165,10 +169,14 @@ const state = reactive({ | ||||||
|   startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"), |   startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"), | ||||||
|   endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"), |   endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"), | ||||||
|   name: "本月", |   name: "本月", | ||||||
|   currentScaleStatus: undefined, |   currentScaleStatus: -1, | ||||||
|   currentSortName: undefined, |   currentSortName: undefined, | ||||||
|   isShowStatus: false, |   isShowStatus: false, | ||||||
|   statusList: [ |   statusList: [ | ||||||
|  |     { | ||||||
|  |       name: "全部", | ||||||
|  |       key: -1, | ||||||
|  |     }, | ||||||
|     { |     { | ||||||
|       name: "待定价", |       name: "待定价", | ||||||
|       key: 0, |       key: 0, | ||||||
|  | @ -351,7 +359,7 @@ const getList = (v?: boolean) => { | ||||||
|     startTime: state.startTime + " 00:00:00", |     startTime: state.startTime + " 00:00:00", | ||||||
|     endTime: state.endTime + " 23:59:59", |     endTime: state.endTime + " 23:59:59", | ||||||
|   }; |   }; | ||||||
|   if (state.currentScaleStatus !== undefined) { |   if (state.currentScaleStatus > -1) { | ||||||
|     params.scaleStatus = state.currentScaleStatus; |     params.scaleStatus = state.currentScaleStatus; | ||||||
|   } |   } | ||||||
|   if (state.currentSortName !== undefined) { |   if (state.currentSortName !== undefined) { | ||||||
|  | @ -361,7 +369,10 @@ const getList = (v?: boolean) => { | ||||||
|     params.receiptNumber = keyword.value; |     params.receiptNumber = keyword.value; | ||||||
|   } |   } | ||||||
|   pageList.isLoading = true; |   pageList.isLoading = true; | ||||||
|   ReceiveApi.getOrderPage({ ...params, ...filterNullUndefined(state.params) }).then((res) => { |   ReceiveApi.getOrderPage({ | ||||||
|  |     ...params, | ||||||
|  |     ...filterNullUndefined(state.params), | ||||||
|  |   }).then((res) => { | ||||||
|     if (res.code === 200) { |     if (res.code === 200) { | ||||||
|       pageList.isLoading = false; |       pageList.isLoading = false; | ||||||
|       (pageList as any).list = (pageList as any).list = pageList.list.concat( |       (pageList as any).list = (pageList as any).list = pageList.list.concat( | ||||||
|  | @ -420,7 +431,6 @@ onMounted(() => { | ||||||
|     font-size: 26rpx; |     font-size: 26rpx; | ||||||
|     color: #000000; |     color: #000000; | ||||||
|     margin: 30rpx 0rpx 0rpx 30rpx; |     margin: 30rpx 0rpx 0rpx 30rpx; | ||||||
|      |  | ||||||
|   } |   } | ||||||
|   .box + .box { |   .box + .box { | ||||||
|     margin-top: 30rpx; |     margin-top: 30rpx; | ||||||
|  |  | ||||||
|  | @ -32,17 +32,36 @@ | ||||||
|           </view> |           </view> | ||||||
|           <view class="op-box"> |           <view class="op-box"> | ||||||
|             <view class="btn" @click="edit(item)"> 编辑 </view> |             <view class="btn" @click="edit(item)"> 编辑 </view> | ||||||
|             <view class="btn" @click="update(item)"> 删除 </view> |             <view class="btn" @click="handleModal(true, item.id)"> 删除 </view> | ||||||
|           </view> |           </view> | ||||||
|         </view> |         </view> | ||||||
|       </view> |       </view> | ||||||
|     </page-view> |     </page-view> | ||||||
|   </view> |   </view> | ||||||
|  |   <SmallModal | ||||||
|  |     :title="'确认删除吗?'" | ||||||
|  |     :content="'确认删除后,不能恢复!'" | ||||||
|  |     :okText="'确认删除'" | ||||||
|  |     :isMain="true" | ||||||
|  |     :show="isShowCancelModal" | ||||||
|  |     @handleModal="(v:boolean) => {handleModal(v, deleteId)}" | ||||||
|  |     @handleOk="handleOk()" | ||||||
|  |   /> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { GoodsApi } from "@/services"; | import { GoodsApi } from "@/services"; | ||||||
| import { UsersType } from "@/utils/enum"; | import { UsersType } from "@/utils/enum"; | ||||||
| import PageView from "@/components/PageView/index.vue"; | import PageView from "@/components/PageView/index.vue"; | ||||||
|  | import SmallModal from "@/components/Modal/smallModal.vue"; | ||||||
|  | const isShowCancelModal = ref(false); | ||||||
|  | const deleteId = ref(0); | ||||||
|  | const handleModal = (v: boolean, id: number) => { | ||||||
|  |   isShowCancelModal.value = v; | ||||||
|  |   deleteId.value = id; | ||||||
|  | }; | ||||||
|  | const handleOk = () => { | ||||||
|  |   update({id: deleteId.value}) | ||||||
|  | }; | ||||||
| const state = reactive<any>({ | const state = reactive<any>({ | ||||||
|   name: "", |   name: "", | ||||||
|   supplierTypeId: -1, |   supplierTypeId: -1, | ||||||
|  | @ -53,6 +72,7 @@ const pageList: PageResult<{ | ||||||
|   reProductsName: string; |   reProductsName: string; | ||||||
|   minPrice: number; |   minPrice: number; | ||||||
|   maxPrice: number; |   maxPrice: number; | ||||||
|  |   id: number | ||||||
| }> = reactive({ | }> = reactive({ | ||||||
|   isLoading: false, |   isLoading: false, | ||||||
|   noMoreData: false, |   noMoreData: false, | ||||||
|  |  | ||||||
|  | @ -31,7 +31,9 @@ | ||||||
|           :clearable="true" |           :clearable="true" | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|           :disabled="item.disabled" |           :disabled="item.disabled || item.type === 'select'" | ||||||
|  |           :disabledColor="['补单时间','站点磅秤','供应商','收货产品'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|  |           @change="(e:any) => {handleInput(e, item)}" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text v-if="item.key === 'subtractNum'"> |             <text v-if="item.key === 'subtractNum'"> | ||||||
|  | @ -92,6 +94,23 @@ | ||||||
|   <view class="btn-box"> |   <view class="btn-box"> | ||||||
|     <u-button type="primary" text="保存" @click="save()"></u-button> |     <u-button type="primary" text="保存" @click="save()"></u-button> | ||||||
|   </view> |   </view> | ||||||
|  | 
 | ||||||
|  |   <!-- 供应商选择弹框 --> | ||||||
|  |   <SupplierDialog | ||||||
|  |     ref="supplierDialog" | ||||||
|  |     :show="showDialog.showSupplier" | ||||||
|  |     @handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}" | ||||||
|  |     @changeUser="changeUser" | ||||||
|  |     :isShipment="false" | ||||||
|  |   ></SupplierDialog> | ||||||
|  |   <!-- 收货产品弹框 --> | ||||||
|  |   <ProductDialog | ||||||
|  |     :show="showDialog.showProduct" | ||||||
|  |     @handleDialog="(v:boolean) => {handleDialog('showProduct', v)}" | ||||||
|  |     @changeProduct="changeProduct" | ||||||
|  |     ref="productRef" | ||||||
|  |     :isShipment="false" | ||||||
|  |   ></ProductDialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { | import { | ||||||
|  | @ -102,16 +121,105 @@ import { | ||||||
|   ReceiveProductApi, |   ReceiveProductApi, | ||||||
|   SupplierApi, |   SupplierApi, | ||||||
| } from "@/services"; | } from "@/services"; | ||||||
| import { formatDate } from "@/utils"; | import { countDots, formatDate } from "@/utils"; | ||||||
| import { DeviceType, ImagesType, OrderType } from "@/utils/enum"; | import { DeviceType, ImagesType, OrderType } from "@/utils/enum"; | ||||||
| import _ from "underscore"; | import _ from "underscore"; | ||||||
|  | import SupplierDialog from "./components/SupplierDialog.vue"; | ||||||
|  | import ProductDialog from "./components/ProductDialog.vue"; | ||||||
|  | import valid from "@/utils/validate"; | ||||||
|  | // 供应商选择 | ||||||
|  | const showDialog = < | ||||||
|  |   { | ||||||
|  |     [key: string]: boolean; | ||||||
|  |   } | ||||||
|  | >reactive({ | ||||||
|  |   showSupplier: false, | ||||||
|  |   showProduct: false, | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | const handleDialog = (key: string, v: boolean) => { | ||||||
|  |   showDialog[key] = v; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const changeUser = (obj: any) => { | ||||||
|  |   model1.order.userName = obj.name; // 供应商名称 | ||||||
|  |   model1.order.userId = obj.id; // 供应商Id, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | // 收货产品选择 | ||||||
|  | const changeProduct = (obj: any) => { | ||||||
|  |   model1.order.productName = obj.reProductsName; // 收货产品名称 | ||||||
|  |   model1.order.productId = obj.id; // 收货产品Id, | ||||||
|  |   model1.order.price = obj.commonPrice; // 设置常用价格 | ||||||
|  |   model1.order.minPrice = obj.minPrice; // 保存最大最小值 | ||||||
|  |   model1.order.maxPrice = obj.maxPrice; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | // 毛重 皮重 杂质扣除校验 净重 单价 预估总价 货款金额 | ||||||
|  | const handleInput = (e: any, item: any) => { | ||||||
|  |   if ( | ||||||
|  |     ["grossWeight", "tare", "price", "balanceTotalPrice"].indexOf(item.key) > -1 | ||||||
|  |   ) { | ||||||
|  |     const temp = e?.replace(valid.valid_decimal.pattern, ""); | ||||||
|  |     if (countDots(temp).length > 1) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: "请输入正确的" + item.name, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |     } | ||||||
|  |     if (item.key === "price") { | ||||||
|  |       if (model1.order.minPrice && model1.order.maxPrice) { | ||||||
|  |         if (temp < model1.order.minPrice || temp > model1.order.maxPrice) { | ||||||
|  |           uni.showToast({ | ||||||
|  |             title: `${item.name}应在${model1.order.minPrice}-${model1.order.maxPrice}之间`, | ||||||
|  |             icon: "none", | ||||||
|  |           }); | ||||||
|  |           return; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (item.key === "tare") { | ||||||
|  |       if ( | ||||||
|  |         parseFloat(model1.order.tare) > parseFloat(model1.order.grossWeight) | ||||||
|  |       ) { | ||||||
|  |         uni.showToast({ | ||||||
|  |           title: `毛重需大于皮重`, | ||||||
|  |           icon: "none", | ||||||
|  |         }); | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     setTimeout(() => { | ||||||
|  |       model1.order[item.key] = temp; | ||||||
|  |     }, 100); | ||||||
|  |   } | ||||||
|  |   if (item.key === "subtractNum") { | ||||||
|  |     const temp = e?.replace(valid.valid_decimal.pattern, ""); | ||||||
|  |     if ( | ||||||
|  |       model1.order.buttonType === 1 && | ||||||
|  |       (parseInt(temp) > 100 || parseInt(temp) < 0) | ||||||
|  |     ) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: `${item.name}正确范围是0-100`, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |     } | ||||||
|  |     setTimeout(() => { | ||||||
|  |       model1.order[item.key] = temp; | ||||||
|  |     }, 100); | ||||||
|  |   } | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| const model1 = reactive<any>({ | const model1 = reactive<any>({ | ||||||
|   order: { |   order: { | ||||||
|     buttonType: 0, |     buttonType: 0, | ||||||
|     fileLists: [], |     fileLists: [], | ||||||
|     splTime:'', |     splTime: "", | ||||||
|     subtractType: 1, |     subtractType: 1, | ||||||
|  |     netWeight: 0, | ||||||
|  |     totalPrice: 0 | ||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
| const rules = reactive({ | const rules = reactive({ | ||||||
|  | @ -140,33 +248,33 @@ const rules = reactive({ | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "order.grossWeight": { |   "order.grossWeight": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入毛重", |     message: "毛重为空或输入错误", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "order.tare": { |   "order.tare": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入皮重", |     message: "皮重为空或输入错误", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "order.price": { |   "order.price": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入单价", |     message: "单价为空或输入错误", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "order.balanceTotalPrice": { |   "order.balanceTotalPrice": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入货款金额", |     message: "货款金额为空或输入错误", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
| const contrlModalParams = reactive<any>({ | const contrlModalParams = reactive<any>({ | ||||||
|   isShowSplTime: false, |   isShowSplTime: false, | ||||||
|   spltime:  Number(new Date()), |   spltime: Number(new Date()), | ||||||
|   device: { |   device: { | ||||||
|     isShow: false, |     isShow: false, | ||||||
|     title: "标题", |     title: "标题", | ||||||
|  | @ -215,8 +323,10 @@ const formAttrList = reactive<any>([ | ||||||
|     required: true, |     required: true, | ||||||
|     unit: "", |     unit: "", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.user.isShow = true; |       // contrlModalParams.user.isShow = true; | ||||||
|       contrlModalParams.user.title = "供应商"; |       // contrlModalParams.user.title = "供应商"; | ||||||
|  |       handleDialog("showSupplier", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | @ -233,8 +343,10 @@ const formAttrList = reactive<any>([ | ||||||
|     required: true, |     required: true, | ||||||
|     unit: "", |     unit: "", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.product.isShow = true; |       // contrlModalParams.product.isShow = true; | ||||||
|       contrlModalParams.product.title = "收货产品"; |       // contrlModalParams.product.title = "收货产品"; | ||||||
|  |       handleDialog("showProduct", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | @ -267,7 +379,7 @@ const formAttrList = reactive<any>([ | ||||||
|     key: "netWeight", |     key: "netWeight", | ||||||
|     type: "input", |     type: "input", | ||||||
|     unit: "KG", |     unit: "KG", | ||||||
|     disabled: true |     disabled: true, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     name: "单价", |     name: "单价", | ||||||
|  | @ -281,7 +393,7 @@ const formAttrList = reactive<any>([ | ||||||
|     key: "totalPrice", |     key: "totalPrice", | ||||||
|     type: "input", |     type: "input", | ||||||
|     unit: "元", |     unit: "元", | ||||||
|     disabled: true |     disabled: true, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     name: "货款金额", |     name: "货款金额", | ||||||
|  | @ -317,7 +429,7 @@ watch( | ||||||
|       预估总价: 结算单价*结算重量 |       预估总价: 结算单价*结算重量 | ||||||
|       实际收入:实际结算金额-运费-杂费 |       实际收入:实际结算金额-运费-杂费 | ||||||
|      */ |      */ | ||||||
|     model1.order.netWeight = (grossWeightNew || 0) - (tareNew || 0); |     model1.order.netWeight = ((parseFloat(grossWeightNew) || 0) - (parseFloat(tareNew) || 0)).toFixed(2); | ||||||
|     if (model1.order.buttonType === 0) { |     if (model1.order.buttonType === 0) { | ||||||
|       if (model1.order.subtractNum) { |       if (model1.order.subtractNum) { | ||||||
|         model1.order.netWeight = |         model1.order.netWeight = | ||||||
|  | @ -331,6 +443,8 @@ watch( | ||||||
|     } |     } | ||||||
|     model1.order.totalPrice = |     model1.order.totalPrice = | ||||||
|       (model1.order.price || 0) * (model1.order.netWeight || 0); |       (model1.order.price || 0) * (model1.order.netWeight || 0); | ||||||
|  |       // 货款金额默认=预估总价,当系统自动算出预估总价时,值需同步 | ||||||
|  |     model1.order.balanceTotalPrice = model1.order.totalPrice; | ||||||
|   } |   } | ||||||
| ); | ); | ||||||
| 
 | 
 | ||||||
|  | @ -448,6 +562,19 @@ const check = () => { | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
| const save = () => { | const save = () => { | ||||||
|  |   if (model1.order.carNumber) { | ||||||
|  |     if (!valid.carNo.pattern.test(model1.order.carNumber)) { | ||||||
|  |       uni.showToast({ icon: "none", title: "请输入正确的车牌号" }); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   if (parseFloat(model1.order.tare) > parseFloat(model1.order.grossWeight)) { | ||||||
|  |     uni.showToast({ | ||||||
|  |       title: `毛重需大于皮重`, | ||||||
|  |       icon: "none", | ||||||
|  |     }); | ||||||
|  |     return; | ||||||
|  |   } | ||||||
|   check().then((res) => { |   check().then((res) => { | ||||||
|     if (res) { |     if (res) { | ||||||
|       startSave(); |       startSave(); | ||||||
|  |  | ||||||
|  | @ -30,22 +30,41 @@ | ||||||
|           </view> |           </view> | ||||||
|           <view class="op-box"> |           <view class="op-box"> | ||||||
|             <view class="btn" @click="edit(item)"> 编辑 </view> |             <view class="btn" @click="edit(item)"> 编辑 </view> | ||||||
|             <view class="btn" @click="deleteType(item)"> 删除 </view> |             <view class="btn" @click="handleModal(true, item.id)" > 删除 </view> | ||||||
|           </view> |           </view> | ||||||
|         </view> |         </view> | ||||||
|       </view> |       </view> | ||||||
|     </page-view> |     </page-view> | ||||||
|   </view> |   </view> | ||||||
|  | 
 | ||||||
|  |   <SmallModal | ||||||
|  |     :title="'确认删除吗?'" | ||||||
|  |     :content="'确认删除后,不能恢复!'" | ||||||
|  |     :okText="'确认删除'" | ||||||
|  |     :isMain="true" | ||||||
|  |     :show="isShowCancelModal" | ||||||
|  |     @handleModal="(v:boolean) => {handleModal(v, deleteId)}" | ||||||
|  |     @handleOk="handleOk()" | ||||||
|  |   /> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { GoodsApi } from "@/services"; | import { GoodsApi } from "@/services"; | ||||||
| import { StockCardType } from "@/utils/enum"; |  | ||||||
| import PageView from "@/components/PageView/index.vue"; | import PageView from "@/components/PageView/index.vue"; | ||||||
|  | import SmallModal from "@/components/Modal/smallModal.vue"; | ||||||
|  | const isShowCancelModal = ref(false); | ||||||
|  | const deleteId = ref(0); | ||||||
|  | const handleModal = (v: boolean, id: number) => { | ||||||
|  |   isShowCancelModal.value = v; | ||||||
|  |   deleteId.value = id; | ||||||
|  | }; | ||||||
|  | const handleOk = () => { | ||||||
|  |   deleteType({id: deleteId.value}) | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| const state = reactive<any>({ | const state = reactive<any>({ | ||||||
|   name: "", |   name: "", | ||||||
| }); | }); | ||||||
| const pageList: PageResult<{ reCategoryName: string }> = reactive({ | const pageList: PageResult<{ reCategoryName: string, id: number }> = reactive({ | ||||||
|   isLoading: false, |   isLoading: false, | ||||||
|   noMoreData: false, |   noMoreData: false, | ||||||
|   total: 0, |   total: 0, | ||||||
|  |  | ||||||
|  | @ -178,10 +178,14 @@ const state = reactive({ | ||||||
|   startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"), |   startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"), | ||||||
|   endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"), |   endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"), | ||||||
|   name: "本月", |   name: "本月", | ||||||
|   currentScaleStatus: undefined, |   currentScaleStatus: -1, | ||||||
|   currentSortName: undefined, |   currentSortName: undefined, | ||||||
|   isShowStatus: false, |   isShowStatus: false, | ||||||
|   statusList: [ |   statusList: [ | ||||||
|  |   { | ||||||
|  |       name: "全部", | ||||||
|  |       key: -1, | ||||||
|  |     }, | ||||||
|     { |     { | ||||||
|       name: "待出货", |       name: "待出货", | ||||||
|       key: 0, |       key: 0, | ||||||
|  | @ -382,7 +386,7 @@ const getList = (v?: boolean) => { | ||||||
|     startTime: state.startTime + " 00:00:00", |     startTime: state.startTime + " 00:00:00", | ||||||
|     endTime: state.endTime + " 23:59:59", |     endTime: state.endTime + " 23:59:59", | ||||||
|   }; |   }; | ||||||
|   if (state.currentScaleStatus !== undefined) { |   if (state.currentScaleStatus > -1) { | ||||||
|     params.scaleStatus = state.currentScaleStatus; |     params.scaleStatus = state.currentScaleStatus; | ||||||
|   } |   } | ||||||
|   if (state.currentSortName !== undefined) { |   if (state.currentSortName !== undefined) { | ||||||
|  |  | ||||||
|  | @ -34,17 +34,36 @@ | ||||||
|           </view> |           </view> | ||||||
|           <view class="op-box"> |           <view class="op-box"> | ||||||
|             <view class="btn" @click="edit(item)"> 编辑 </view> |             <view class="btn" @click="edit(item)"> 编辑 </view> | ||||||
|             <view class="btn" @click="update(item)"> 删除 </view> |             <view class="btn" @click="handleModal(true, item.id)"> 删除 </view> | ||||||
|           </view> |           </view> | ||||||
|         </view> |         </view> | ||||||
|       </view> |       </view> | ||||||
|     </page-view> |     </page-view> | ||||||
|   </view> |   </view> | ||||||
|  |   <SmallModal | ||||||
|  |     :title="'确认删除吗?'" | ||||||
|  |     :content="'确认删除后,不能恢复!'" | ||||||
|  |     :okText="'确认删除'" | ||||||
|  |     :isMain="true" | ||||||
|  |     :show="isShowCancelModal" | ||||||
|  |     @handleModal="(v:boolean) => {handleModal(v, deleteId)}" | ||||||
|  |     @handleOk="handleOk()" | ||||||
|  |   /> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { GoodsApi } from "@/services"; | import { GoodsApi } from "@/services"; | ||||||
| import { UsersType } from "@/utils/enum"; | 
 | ||||||
| import PageView from "@/components/PageView/index.vue"; | import PageView from "@/components/PageView/index.vue"; | ||||||
|  | import SmallModal from "@/components/Modal/smallModal.vue"; | ||||||
|  | const isShowCancelModal = ref(false); | ||||||
|  | const deleteId = ref(0); | ||||||
|  | const handleModal = (v: boolean, id: number) => { | ||||||
|  |   isShowCancelModal.value = v; | ||||||
|  |   deleteId.value = id; | ||||||
|  | }; | ||||||
|  | const handleOk = () => { | ||||||
|  |   update({id: deleteId.value}) | ||||||
|  | }; | ||||||
| const state = reactive<any>({ | const state = reactive<any>({ | ||||||
|   name: "", |   name: "", | ||||||
|   supplierTypeId: -1, |   supplierTypeId: -1, | ||||||
|  | @ -55,6 +74,7 @@ const pageList: PageResult<{ | ||||||
|   shmProductsName: string; |   shmProductsName: string; | ||||||
|   parentName: string; |   parentName: string; | ||||||
|   shmCategoryName: string; |   shmCategoryName: string; | ||||||
|  |   id: number | ||||||
| }> = reactive({ | }> = reactive({ | ||||||
|   isLoading: false, |   isLoading: false, | ||||||
|   noMoreData: false, |   noMoreData: false, | ||||||
|  | @ -103,7 +123,7 @@ const getList = (v?: boolean) => { | ||||||
|   let params: any = { |   let params: any = { | ||||||
|     pageSize: pageList.pageSize, |     pageSize: pageList.pageSize, | ||||||
|     pageNum: pageList.pageNum, |     pageNum: pageList.pageNum, | ||||||
|     name: state.name, |     shmProductsName: state.name, | ||||||
|   }; |   }; | ||||||
|   GoodsApi.getShipmentProductByPage(params).then((res: any) => { |   GoodsApi.getShipmentProductByPage(params).then((res: any) => { | ||||||
|     if (res.code === 200) { |     if (res.code === 200) { | ||||||
|  |  | ||||||
|  | @ -31,7 +31,9 @@ | ||||||
|           :clearable="true" |           :clearable="true" | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|           :disabled="item.disabled" |           :disabled="item.disabled || item.type === 'select'" | ||||||
|  |           :disabledColor="['补单时间','过磅设备','客户','出货产品'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" | ||||||
|  |           @change="(e:any) => {handleInput(e, item)}" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             <text v-if="item.key === 'subtractNum'"> |             <text v-if="item.key === 'subtractNum'"> | ||||||
|  | @ -92,6 +94,23 @@ | ||||||
|   <view class="btn-box"> |   <view class="btn-box"> | ||||||
|     <u-button type="primary" text="保存" @click="save()"></u-button> |     <u-button type="primary" text="保存" @click="save()"></u-button> | ||||||
|   </view> |   </view> | ||||||
|  | 
 | ||||||
|  |   <!-- 客户选择弹框 --> | ||||||
|  |   <SupplierDialog | ||||||
|  |     ref="supplierDialog" | ||||||
|  |     :show="showDialog.showSupplier" | ||||||
|  |     @handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}" | ||||||
|  |     @changeUser="changeUser" | ||||||
|  |     :isShipment="true" | ||||||
|  |   ></SupplierDialog> | ||||||
|  |   <!-- 出货产品弹框 --> | ||||||
|  |   <ProductDialog | ||||||
|  |     :show="showDialog.showProduct" | ||||||
|  |     @handleDialog="(v:boolean) => {handleDialog('showProduct', v)}" | ||||||
|  |     @changeProduct="changeProduct" | ||||||
|  |     ref="productRef" | ||||||
|  |     :isShipment="true" | ||||||
|  |   ></ProductDialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { | import { | ||||||
|  | @ -99,14 +118,69 @@ import { | ||||||
|   DeviceApi, |   DeviceApi, | ||||||
|   GoodsApi, |   GoodsApi, | ||||||
|   PictureApi, |   PictureApi, | ||||||
|   ProfileApi, |  | ||||||
|   ReceiveApi, |  | ||||||
|   ReceiveProductApi, |  | ||||||
|   ShipmentApi, |   ShipmentApi, | ||||||
| } from "@/services"; | } from "@/services"; | ||||||
| import { formatDate } from "@/utils"; | import { countDots, formatDate } from "@/utils"; | ||||||
| import { DeviceType, ImagesType, OrderType } from "@/utils/enum"; | import { DeviceType, ImagesType, OrderType } from "@/utils/enum"; | ||||||
| import _ from "underscore"; | import _ from "underscore"; | ||||||
|  | import SupplierDialog from "./components/SupplierDialog.vue"; | ||||||
|  | import ProductDialog from "./components/ProductDialog.vue"; | ||||||
|  | import valid from "@/utils/validate"; | ||||||
|  | // 供应商选择 | ||||||
|  | const showDialog = < | ||||||
|  |   { | ||||||
|  |     [key: string]: boolean; | ||||||
|  |   } | ||||||
|  | >reactive({ | ||||||
|  |   showSupplier: false, | ||||||
|  |   showProduct: false, | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | const handleDialog = (key: string, v: boolean) => { | ||||||
|  |   showDialog[key] = v; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const changeUser = (obj: any) => { | ||||||
|  |   model1.order.userName = obj.name; // 供应商名称 | ||||||
|  |   model1.order.userId = obj.id; // 供应商Id, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | // 收货产品选择 | ||||||
|  | const changeProduct = (obj: any) => { | ||||||
|  |   model1.order.productName = obj.shmProductsName; // 收货产品名称 | ||||||
|  |   model1.order.productId = obj.id; // 收货产品Id, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | // 单价 毛重 杂质扣除校验 | ||||||
|  | const handleInput = (e: any, item: any) => { | ||||||
|  |   if (item.key === "grossWeight" || item.key === "tare") { | ||||||
|  |     const temp = e?.replace(valid.valid_decimal.pattern, ""); | ||||||
|  |     if (countDots(temp).length > 1) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: "请输入正确的" + item.name, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |     setTimeout(() => { | ||||||
|  |       model1.order[item.key] = temp; | ||||||
|  |     }, 100); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   if (item.key === "number" ) { | ||||||
|  |     const temp = e?.replace(valid.valid_number, ""); | ||||||
|  |     if (countDots(temp).length > 1) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: "请输入正确的" + item.name, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |     setTimeout(() => { | ||||||
|  |       model1.order[item.key] = temp; | ||||||
|  |     }, 100); | ||||||
|  |   } | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| const model1 = reactive<any>({ | const model1 = reactive<any>({ | ||||||
|   order: { |   order: { | ||||||
|  | @ -114,6 +188,7 @@ const model1 = reactive<any>({ | ||||||
|     fileLists: [], |     fileLists: [], | ||||||
|     splTime: "", |     splTime: "", | ||||||
|     subtractType: 1, |     subtractType: 1, | ||||||
|  |     netWeight: 0 | ||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
| const rules = reactive({ | const rules = reactive({ | ||||||
|  | @ -142,19 +217,19 @@ const rules = reactive({ | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "order.number": { |   "order.number": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入数量", |     message: "请输入数量", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "order.grossWeight": { |   "order.grossWeight": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入毛重", |     message: "请输入毛重", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|   }, |   }, | ||||||
|   "order.tare": { |   "order.tare": { | ||||||
|     type: "string", |     type: "number", | ||||||
|     required: true, |     required: true, | ||||||
|     message: "请输入皮重", |     message: "请输入皮重", | ||||||
|     trigger: ["blur", "change"], |     trigger: ["blur", "change"], | ||||||
|  | @ -162,7 +237,7 @@ const rules = reactive({ | ||||||
| }); | }); | ||||||
| const contrlModalParams = reactive<any>({ | const contrlModalParams = reactive<any>({ | ||||||
|   isShowSplTime: false, |   isShowSplTime: false, | ||||||
|   spltime:  Number(new Date()), |   spltime: Number(new Date()), | ||||||
|   device: { |   device: { | ||||||
|     isShow: false, |     isShow: false, | ||||||
|     title: "标题", |     title: "标题", | ||||||
|  | @ -211,8 +286,10 @@ const formAttrList = reactive<any>([ | ||||||
|     required: true, |     required: true, | ||||||
|     unit: "", |     unit: "", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.user.isShow = true; |       // contrlModalParams.user.isShow = true; | ||||||
|       contrlModalParams.user.title = "客户"; |       // contrlModalParams.user.title = "客户"; | ||||||
|  |       handleDialog("showSupplier", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | @ -223,8 +300,10 @@ const formAttrList = reactive<any>([ | ||||||
|     required: true, |     required: true, | ||||||
|     unit: "", |     unit: "", | ||||||
|     fn: () => { |     fn: () => { | ||||||
|       contrlModalParams.product.isShow = true; |       // contrlModalParams.product.isShow = true; | ||||||
|       contrlModalParams.product.title = "收货产品"; |       // contrlModalParams.product.title = "收货产品"; | ||||||
|  |       handleDialog("showProduct", true); | ||||||
|  |       uni.hideKeyboard(); | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | @ -318,10 +397,7 @@ const formAttrList = reactive<any>([ | ||||||
| 
 | 
 | ||||||
| // 监听毛重 皮重 | // 监听毛重 皮重 | ||||||
| watch( | watch( | ||||||
|   [ |   [() => model1.order.grossWeight, () => model1.order.tare], | ||||||
|     () => model1.order.grossWeight, |  | ||||||
|     () => model1.order.tare, |  | ||||||
|   ], |  | ||||||
|   ([grossWeightNew, tareNew]) => { |   ([grossWeightNew, tareNew]) => { | ||||||
|     /** |     /** | ||||||
|      * 过磅净重: 毛重-皮重 |      * 过磅净重: 毛重-皮重 | ||||||
|  | @ -374,7 +450,6 @@ const handleDelete = (e: any) => { | ||||||
| const handleSelect = (key: string, v: any) => { | const handleSelect = (key: string, v: any) => { | ||||||
|   contrlModalParams[key].isShow = false; |   contrlModalParams[key].isShow = false; | ||||||
|   if (key === "user") { |   if (key === "user") { | ||||||
|     debugger; |  | ||||||
|     model1.order.userName = v.name; |     model1.order.userName = v.name; | ||||||
|     model1.order.userId = v.id; |     model1.order.userId = v.id; | ||||||
|   } else if (key === "product") { |   } else if (key === "product") { | ||||||
|  | @ -429,7 +504,7 @@ const upload = () => { | ||||||
| /** | /** | ||||||
|  * 校验 |  * 校验 | ||||||
|  */ |  */ | ||||||
|  const form = ref(); | const form = ref(); | ||||||
| const check = () => { | const check = () => { | ||||||
|   return new Promise((resolve) => { |   return new Promise((resolve) => { | ||||||
|     form.value |     form.value | ||||||
|  | @ -438,7 +513,6 @@ const check = () => { | ||||||
|         resolve(res); |         resolve(res); | ||||||
|       }) |       }) | ||||||
|       .catch((errors: any) => { |       .catch((errors: any) => { | ||||||
|         debugger |  | ||||||
|         resolve(false); |         resolve(false); | ||||||
|         uni.showToast({ |         uni.showToast({ | ||||||
|           icon: "none", |           icon: "none", | ||||||
|  | @ -449,6 +523,18 @@ const check = () => { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const save = () => { | const save = () => { | ||||||
|  |   if (model1.order.carNumber) { | ||||||
|  |     if (!valid.carNo.pattern.test(model1.order.carNumber)) { | ||||||
|  |       uni.showToast({ icon: "none", title: "请输入正确的车牌号" }); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   if (model1.order.phone) { | ||||||
|  |     if (!valid.mobile.pattern.test(model1.order.phone)) { | ||||||
|  |       uni.showToast({ icon: "none", title: "请输入正确的手机号" }); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|   check().then((res) => { |   check().then((res) => { | ||||||
|     if (res) { |     if (res) { | ||||||
|       startSave(); |       startSave(); | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <template> | <template> | ||||||
|   <view class="c-card"> |   <view class="c-card"> | ||||||
|     <view class="search"> |     <view class="search"> | ||||||
|       <u-search |       <!-- <u-search | ||||||
|         placeholder="请输入出货分类" |         placeholder="请输入出货分类" | ||||||
|         v-model="state.name" |         v-model="state.name" | ||||||
|         :showAction="false" |         :showAction="false" | ||||||
|  | @ -9,44 +9,86 @@ | ||||||
|         :borderColor="'rgba(0, 0, 0, 0.1)'" |         :borderColor="'rgba(0, 0, 0, 0.1)'" | ||||||
|         :placeholderColor="'#C1C1C1'" |         :placeholderColor="'#C1C1C1'" | ||||||
|         @search="handleSearch()" |         @search="handleSearch()" | ||||||
|       ></u-search> |       ></u-search> --> | ||||||
|  |         | ||||||
|       <view class="btn" @click="add"> 新增 </view> |       <view class="btn" @click="add"> 新增 </view> | ||||||
|     </view> |     </view> | ||||||
|     <page-view |     <view class="collapse-box box"> | ||||||
|       @loadList=" |       <view v-for="(item, index) in pageList.list" :key="index"> | ||||||
|         (v) => { |         <view class="item"> | ||||||
|           getList(v); |  | ||||||
|         } |  | ||||||
|       " |  | ||||||
|       :noMoreData="pageList.noMoreData" |  | ||||||
|       :list="pageList.list" |  | ||||||
|       :height="100" |  | ||||||
|       :isLoading="pageList.isLoading" |  | ||||||
|     > |  | ||||||
|       <view class="box"> |  | ||||||
|         <view v-for="(item, index) in pageList.list" :key="index"> |  | ||||||
|           <view> |           <view> | ||||||
|             <view>{{ item.reCategoryName }}</view> |             <view>{{ item.shmCategoryName }}</view> | ||||||
|           </view> |           </view> | ||||||
|           <view class="op-box"> |           <view class="op-box"> | ||||||
|             <view class="btn" @click="edit(item)"> 编辑 </view> |             <view style="display: flex" @click="edit(item)"> | ||||||
|             <view class="btn" @click="deleteType(item)"> 删除 </view> |               <up-icon name="edit-pen" color="#909399"></up-icon> | ||||||
|  |             </view> | ||||||
|  |             <view | ||||||
|  |               class="ml-20" | ||||||
|  |               style="display: flex" | ||||||
|  |               @click="handleModal(true, item.id)" | ||||||
|  |               v-if="!item.childrenList" | ||||||
|  |             > | ||||||
|  |               <up-icon name="trash" color="#909399"></up-icon> | ||||||
|  |             </view> | ||||||
|  |             <view class="ml-20" style="display: flex" | ||||||
|  |               ><up-icon | ||||||
|  |                 :name="item.show ? 'arrow-up' : 'arrow-down'" | ||||||
|  |                 color="#909399" | ||||||
|  |                 @click="item.show = !item.show" | ||||||
|  |               ></up-icon | ||||||
|  |             ></view> | ||||||
|           </view> |           </view> | ||||||
|         </view> |         </view> | ||||||
|  | 
 | ||||||
|  |         <view class="box" v-if="item.show"> | ||||||
|  |           <view | ||||||
|  |             v-for="(cItem, index) in item.childrenList" | ||||||
|  |             :key="index" | ||||||
|  |             class="item" | ||||||
|  |           > | ||||||
|  |             <view> | ||||||
|  |               <view>{{ cItem.shmCategoryName }}</view> | ||||||
|  |             </view> | ||||||
|  |             <view class="op-box"> | ||||||
|  |               <view class="btn" @click="edit(cItem)"> 编辑 </view> | ||||||
|  |               <view class="btn" @click="handleModal(true, cItem.id)"> 删除 </view> | ||||||
|  |             </view> | ||||||
|  |           </view> | ||||||
|  |           <view class="no-data" v-if="!item.childrenList">暂无数据</view> | ||||||
|  |         </view> | ||||||
|       </view> |       </view> | ||||||
|     </page-view> |     </view> | ||||||
|   </view> |   </view> | ||||||
|  |   <SmallModal | ||||||
|  |     :title="'确认删除吗?'" | ||||||
|  |     :content="'确认删除后,不能恢复!'" | ||||||
|  |     :okText="'确认删除'" | ||||||
|  |     :isMain="true" | ||||||
|  |     :show="isShowCancelModal" | ||||||
|  |     @handleModal="(v:boolean) => {handleModal(v, deleteId)}" | ||||||
|  |     @handleOk="handleOk()" | ||||||
|  |   /> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { GoodsApi } from "@/services"; | import { GoodsApi } from "@/services"; | ||||||
| import PageView from "@/components/PageView/index.vue"; | import SmallModal from "@/components/Modal/smallModal.vue"; | ||||||
|  | const isShowCancelModal = ref(false); | ||||||
|  | const deleteId = ref(0); | ||||||
|  | const handleModal = (v: boolean, id: number) => { | ||||||
|  |   isShowCancelModal.value = v; | ||||||
|  |   deleteId.value = id; | ||||||
|  | }; | ||||||
|  | const handleOk = () => { | ||||||
|  |   deleteType({id: deleteId.value}) | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| const keyword = ref(""); | const pageList: PageResult<{ | ||||||
| 
 |   shmCategoryName: string; | ||||||
| const state = reactive<any>({ |   id: number; | ||||||
|   name: "", |   childrenList: any; | ||||||
| }); |   show?: boolean; | ||||||
| const pageList: PageResult<{ reCategoryName: string }> = reactive({ | }> = reactive({ | ||||||
|   isLoading: false, |   isLoading: false, | ||||||
|   noMoreData: false, |   noMoreData: false, | ||||||
|   total: 0, |   total: 0, | ||||||
|  | @ -74,43 +116,17 @@ const edit = (item: any) => { | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
| const deleteType = (item: any) => { | const deleteType = (item: any) => { | ||||||
|   GoodsApi.editReceiveCategory({ isDeleted: true, id: item.id }).then((res) => { |   GoodsApi.deleteById({ id: item.id }).then((res) => { | ||||||
|     if (res.code === 200) { |     if (res.code === 200) { | ||||||
|       getList(); |       getList(); | ||||||
|     } |     } | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
| const handleSearch = () => { |  | ||||||
|   resetPageList() |  | ||||||
|   getList(); |  | ||||||
| }; |  | ||||||
| 
 | 
 | ||||||
| const getList = (v?: boolean) => { | const getList = (v?: boolean) => { | ||||||
|   if (v) { |   GoodsApi.getShipmentCategory().then((res) => { | ||||||
|     if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) { |  | ||||||
|       pageList.pageNum++; |  | ||||||
|       if (Math.ceil(pageList.total / pageList.pageSize) <= pageList.pageNum) { |  | ||||||
|         pageList.noMoreData = true; |  | ||||||
|       } |  | ||||||
|     } else { |  | ||||||
|       pageList.noMoreData = true; |  | ||||||
|       return; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   let params: any = { |  | ||||||
|     pageSize: pageList.pageSize, |  | ||||||
|     pageNum: pageList.pageNum, |  | ||||||
|     reCategoryName: state.name, |  | ||||||
|   }; |  | ||||||
|   if (state.supplierTypeId > -1) { |  | ||||||
|     params.supplierTypeId = state.supplierTypeId; |  | ||||||
|   } |  | ||||||
|   GoodsApi.getPage(params).then((res) => { |  | ||||||
|     if (res.code === 200) { |     if (res.code === 200) { | ||||||
|       (pageList as any).list = (pageList as any).list.concat( |       (pageList as any).list = res.data; | ||||||
|         (res.data as any).list |  | ||||||
|       ); |  | ||||||
|       pageList.total = (res.data as any).total; |  | ||||||
|     } |     } | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  | @ -137,6 +153,9 @@ onMounted(() => { | ||||||
|       padding: 6rpx 30rpx; |       padding: 6rpx 30rpx; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |   .collapse-box { | ||||||
|  |     margin-top: 30rpx; | ||||||
|  |   } | ||||||
|   .box { |   .box { | ||||||
|     background: #ffffff; |     background: #ffffff; | ||||||
|     box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); |     box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); | ||||||
|  | @ -146,8 +165,7 @@ onMounted(() => { | ||||||
|     font-size: 26rpx; |     font-size: 26rpx; | ||||||
|     color: #000000; |     color: #000000; | ||||||
|     line-height: 41rpx; |     line-height: 41rpx; | ||||||
|     margin-top: 30rpx; |     .item { | ||||||
|     > view { |  | ||||||
|       display: flex; |       display: flex; | ||||||
|       align-items: center; |       align-items: center; | ||||||
|       justify-content: space-between; |       justify-content: space-between; | ||||||
|  | @ -170,6 +188,12 @@ onMounted(() => { | ||||||
|     > view + view { |     > view + view { | ||||||
|       border-top: 1px solid rgba(233, 233, 233, 0.76); |       border-top: 1px solid rgba(233, 233, 233, 0.76); | ||||||
|     } |     } | ||||||
|  |     .no-data { | ||||||
|  |       color: #606266; | ||||||
|  |       font-size: 12px; | ||||||
|  |       text-align: center; | ||||||
|  |       padding: 20rpx; | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -35,8 +35,13 @@ | ||||||
|           border="none" |           border="none" | ||||||
|           :value="(model1.order as any)[item.key]" |           :value="(model1.order as any)[item.key]" | ||||||
|           @change="(e:any) => {handleInput(e, item)}" |           @change="(e:any) => {handleInput(e, item)}" | ||||||
|  |           :disabled="item.disabled || item.type === 'select'" | ||||||
|  |           :disabledColor="item.name === '收货产品'?'#ffffff':'#f5f7fa'" | ||||||
|  | 
 | ||||||
|         > |         > | ||||||
|  |         | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|  |    | ||||||
|             <text v-if="item.key === 'subtractNum'"> |             <text v-if="item.key === 'subtractNum'"> | ||||||
|               {{ model1.order.buttonType === 0 ? item.unit : "%" }} |               {{ model1.order.buttonType === 0 ? item.unit : "%" }} | ||||||
|             </text> |             </text> | ||||||
|  | @ -45,18 +50,6 @@ | ||||||
|             </text> |             </text> | ||||||
|           </template> |           </template> | ||||||
|         </up-input> |         </up-input> | ||||||
|         <!-- 自定义selectui --> |  | ||||||
|         <u-input |  | ||||||
|           v-if="item.type === 'selectCustom'" |  | ||||||
|           v-model="(model1.order as any)[item.key]" |  | ||||||
|           :placeholder="`请选择${item.name}`" |  | ||||||
|           :clearable="true" |  | ||||||
|           :customStyle="{}" |  | ||||||
|           border="none" |  | ||||||
|           disabled |  | ||||||
|           disabledColor="#ffffff" |  | ||||||
|         > |  | ||||||
|         </u-input> |  | ||||||
|         <!-- @afterRead="afterRead" |         <!-- @afterRead="afterRead" | ||||||
|           @delete="deletePic" --> |           @delete="deletePic" --> | ||||||
|         <uni-file-picker |         <uni-file-picker | ||||||
|  | @ -85,7 +78,7 @@ | ||||||
|         </u-radio-group> |         </u-radio-group> | ||||||
|         <template |         <template | ||||||
|           #right |           #right | ||||||
|           v-if="item.type === 'select' || item.type === 'selectCustom'" |           v-if="item.type === 'select'" | ||||||
|         > |         > | ||||||
|           <u-icon name="arrow-right"></u-icon> |           <u-icon name="arrow-right"></u-icon> | ||||||
|         </template> |         </template> | ||||||
|  | @ -165,19 +158,34 @@ const changeUser = (obj: any) => { | ||||||
| const changeProduct = (obj: any) => { | const changeProduct = (obj: any) => { | ||||||
|   model1.order.productName = obj.reProductsName; // 收货产品名称 |   model1.order.productName = obj.reProductsName; // 收货产品名称 | ||||||
|   model1.order.productId = obj.id; // 收货产品Id, |   model1.order.productId = obj.id; // 收货产品Id, | ||||||
|  |   model1.order.price = obj.commonPrice; // 设置常用价格 | ||||||
|  |   model1.order.minPrice = obj.minPrice; // 保存最大最小值 | ||||||
|  |   model1.order.maxPrice = obj.maxPrice; | ||||||
| }; | }; | ||||||
| // 单价 毛重 杂质扣除校验 | // 单价 毛重 杂质扣除校验 | ||||||
| const handleInput = (e: any, item: any) => { | const handleInput = (e: any, item: any) => { | ||||||
|   if (item.key === "price" || item.key === "grossWeight") { |   if (item.key === "price" || item.key === "grossWeight") { | ||||||
|     const tempPrice = e?.replace(valid.valid_decimal.pattern, ""); |     const temp = e?.replace(valid.valid_decimal.pattern, ""); | ||||||
|     if (countDots(tempPrice).length > 1) { |     if (countDots(temp).length > 1) { | ||||||
|       uni.showToast({ |       uni.showToast({ | ||||||
|         title: "请输入正确的" + item.name, |         title: "请输入正确的" + item.name, | ||||||
|         icon: "none", |         icon: "none", | ||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|  |     if (item.key === "price") { | ||||||
|  |       if (model1.order.minPrice && model1.order.maxPrice) { | ||||||
|  |         if (temp < model1.order.minPrice || temp > model1.order.maxPrice) { | ||||||
|  |           uni.showToast({ | ||||||
|  |             title: `${item.name}应在${model1.order.minPrice}-${model1.order.maxPrice}之间`, | ||||||
|  |             icon: "none", | ||||||
|  |           }); | ||||||
|  |           return; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     setTimeout(() => { |     setTimeout(() => { | ||||||
|       model1.order[item.key] = tempPrice; |       model1.order[item.key] = temp; | ||||||
|     }, 100); |     }, 100); | ||||||
|   } |   } | ||||||
|   if (item.key === "subtractNum") { |   if (item.key === "subtractNum") { | ||||||
|  | @ -273,7 +281,7 @@ const formAttrList = reactive<ComType>([ | ||||||
|   { |   { | ||||||
|     name: "供应商", |     name: "供应商", | ||||||
|     key: "userName", |     key: "userName", | ||||||
|     type: "selectCustom", |     type: "select", | ||||||
|     unit: "", |     unit: "", | ||||||
|     childKey: "userSelect", |     childKey: "userSelect", | ||||||
|     required: true, |     required: true, | ||||||
|  | @ -291,7 +299,7 @@ const formAttrList = reactive<ComType>([ | ||||||
|   { |   { | ||||||
|     name: "收货产品", |     name: "收货产品", | ||||||
|     key: "productName", |     key: "productName", | ||||||
|     type: "selectCustom", |     type: "select", | ||||||
|     unit: "", |     unit: "", | ||||||
|     childKey: "productSelect", |     childKey: "productSelect", | ||||||
|     required: true, |     required: true, | ||||||
|  | @ -315,6 +323,7 @@ const formAttrList = reactive<ComType>([ | ||||||
|     type: "input", |     type: "input", | ||||||
|     unit: "KG", |     unit: "KG", | ||||||
|     required: true, |     required: true, | ||||||
|  |     disabled: true | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|     name: "扣杂", |     name: "扣杂", | ||||||
|  | @ -494,6 +503,19 @@ const save = () => { | ||||||
|     }); |     }); | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|  |   if (model1.order.minPrice && model1.order.maxPrice) { | ||||||
|  |     if ( | ||||||
|  |       parseInt(model1.order.price + "") < model1.order.minPrice || | ||||||
|  |       parseInt(model1.order.price + "") > model1.order.maxPrice | ||||||
|  |     ) { | ||||||
|  |       uni.showToast({ | ||||||
|  |         title: `单价应在${model1.order.minPrice}-${model1.order.maxPrice}之间`, | ||||||
|  |         icon: "none", | ||||||
|  |       }); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|   if ( |   if ( | ||||||
|     model1.order.grossWeight?.toString() && |     model1.order.grossWeight?.toString() && | ||||||
|     model1.order.grossWeight?.toString()[ |     model1.order.grossWeight?.toString()[ | ||||||
|  | @ -534,11 +556,15 @@ const updateOrder = () => { | ||||||
|    * 有皮重 scaleState = 1 带过皮 |    * 有皮重 scaleState = 1 带过皮 | ||||||
|      零皮重 scaleState = 2 带审核 |      零皮重 scaleState = 2 带审核 | ||||||
|    */ |    */ | ||||||
|   if (model1.order.weighingMethod === 0) { |   // 若是补单数据 则不做此判断 | ||||||
|     model1.order.scaleStatus = 1; |   if (!model1.order.repairFlag) { | ||||||
|   } else if (model1.order.weighingMethod === 1) { |     if (model1.order.weighingMethod === 0) { | ||||||
|     model1.order.scaleStatus = 2; |       model1.order.scaleStatus = 1; | ||||||
|  |     } else if (model1.order.weighingMethod === 1) { | ||||||
|  |       model1.order.scaleStatus = 2; | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   // |   // | ||||||
|   /** |   /** | ||||||
|    * buttonType |    * buttonType | ||||||
|  |  | ||||||
|  | @ -214,7 +214,9 @@ const state = reactive<{ | ||||||
|   order: Order; |   order: Order; | ||||||
|   [attrName: string]: any; |   [attrName: string]: any; | ||||||
| }>({ | }>({ | ||||||
|   order: {}, |   order: { | ||||||
|  |     carNumber: '' | ||||||
|  |   }, | ||||||
|   sheetList: [ |   sheetList: [ | ||||||
|     { |     { | ||||||
|       key: "paySelect", |       key: "paySelect", | ||||||
|  | @ -281,7 +283,7 @@ const getIsShow = () => { | ||||||
|   return state.order.scaleStatus === 3 || state.order.scaleStatus === 4; |   return state.order.scaleStatus === 3 || state.order.scaleStatus === 4; | ||||||
| }; | }; | ||||||
| const handleScenePhoto = (id: any) => { | const handleScenePhoto = (id: any) => { | ||||||
|   uni.redirectTo({ |   uni.navigateTo({ | ||||||
|     url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, // 要跳转到的页面路径 |     url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, // 要跳转到的页面路径 | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  | @ -367,7 +369,7 @@ const handleUpdateOrder = () => { | ||||||
| }; | }; | ||||||
| // 重新过皮 | // 重新过皮 | ||||||
| const handleReWeight = () => { | const handleReWeight = () => { | ||||||
|   ReceiveApi.reTare({ id: state.order.id }).then((res) => { |   ReceiveApi.reTare({ id: state.order.id, userId: state.order.userId, deviceId: state.order.deviceId }).then((res) => { | ||||||
|     if (res.code === 200) { |     if (res.code === 200) { | ||||||
|       uni.redirectTo({ |       uni.redirectTo({ | ||||||
|         url: "/pagesReceive/pricing?scaleStatus=1", // 要跳转到的页面路径 |         url: "/pagesReceive/pricing?scaleStatus=1", // 要跳转到的页面路径 | ||||||
|  | @ -385,7 +387,7 @@ onLoad((option) => { | ||||||
|     ReceiveApi.getDetailById({ id: state.order.id }).then((res) => { |     ReceiveApi.getDetailById({ id: state.order.id }).then((res) => { | ||||||
|       if (res.code === 200) { |       if (res.code === 200) { | ||||||
|         state.order = res.data; |         state.order = res.data; | ||||||
|         gridList1.map((item) => { |         gridList1.map((item:any) => { | ||||||
|           if (item.name === "扣杂" || item.name === "扣点") { |           if (item.name === "扣杂" || item.name === "扣点") { | ||||||
|             if (state.order.buttonType === 0) { |             if (state.order.buttonType === 0) { | ||||||
|               item.name = "扣杂"; |               item.name = "扣杂"; | ||||||
|  | @ -396,8 +398,17 @@ onLoad((option) => { | ||||||
|               item.enName = "points"; |               item.enName = "points"; | ||||||
|               item.unit = "%"; |               item.unit = "%"; | ||||||
|             } |             } | ||||||
|  |           }  | ||||||
|  |           if (item.name === "货款金额") { | ||||||
|  |             if (state.order[item.enName as string]) { | ||||||
|  |               item.num = state.order[item.enName as string]; | ||||||
|  |             } else { | ||||||
|  |               item.num = state.order['totalPrice']; | ||||||
|  |             } | ||||||
|  |           } else { | ||||||
|  |             item.num = state.order[item.enName as string]; | ||||||
|           } |           } | ||||||
|           item.num = state.order[item.enName as string]; |            | ||||||
|         }); |         }); | ||||||
|       } |       } | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  | @ -32,7 +32,7 @@ | ||||||
|             :clearable="true" |             :clearable="true" | ||||||
|             :customStyle="{}" |             :customStyle="{}" | ||||||
|             border="none" |             border="none" | ||||||
|             :disabled="item.disabled" |             :disabled="item.disabled || item.type === 'select'" | ||||||
|             @change="(e:any) => {handleInput(e, item)}" |             @change="(e:any) => {handleInput(e, item)}" | ||||||
|           > |           > | ||||||
|             <template #suffix> |             <template #suffix> | ||||||
|  | @ -96,6 +96,9 @@ | ||||||
|             :customStyle="{}" |             :customStyle="{}" | ||||||
|             border="none" |             border="none" | ||||||
|             @change="(e:any) => {handleInput(e, item)}" |             @change="(e:any) => {handleInput(e, item)}" | ||||||
|  |             :disabled="item.disabled || item.type === 'select'" | ||||||
|  |             :disabledColor="item.name === '结算方式'?'#ffffff':'#f5f7fa'" | ||||||
|  |              | ||||||
|           > |           > | ||||||
|             <template #suffix> |             <template #suffix> | ||||||
|               <text v-if="item.key === 'subtractNum'"> |               <text v-if="item.key === 'subtractNum'"> | ||||||
|  | @ -458,6 +461,10 @@ watch( | ||||||
|         (model1.order.unitPrice || 0) * (model1.order.settlementWeight || 0) |         (model1.order.unitPrice || 0) * (model1.order.settlementWeight || 0) | ||||||
|       ).toFixed(2) |       ).toFixed(2) | ||||||
|     ); |     ); | ||||||
|  |     if (!model1.order.totalPrice) { | ||||||
|  |       model1.order.totalPrice =  model1.order.estimatePrice; | ||||||
|  |     } | ||||||
|  |      | ||||||
|     model1.order.realIncome = |     model1.order.realIncome = | ||||||
|       (model1.order.totalPrice || 0) - |       (model1.order.totalPrice || 0) - | ||||||
|       (model1.order.freight || 0) - |       (model1.order.freight || 0) - | ||||||
|  |  | ||||||
|  | @ -32,25 +32,14 @@ | ||||||
|           :clearable="true" |           :clearable="true" | ||||||
|           :customStyle="{}" |           :customStyle="{}" | ||||||
|           border="none" |           border="none" | ||||||
|           :disabled="item.disabled" |           :disabled="item.disabled || item.type === 'select'" | ||||||
|  |           :disabledColor="item.name === '出货产品'?'#ffffff':'#f5f7fa'" | ||||||
|           @change="(e:any) => {handleInput(e, item)}" |           @change="(e:any) => {handleInput(e, item)}" | ||||||
|         > |         > | ||||||
|           <template #suffix> |           <template #suffix> | ||||||
|             {{ item.unit }} |             {{ item.unit }} | ||||||
|           </template> |           </template> | ||||||
|         </u-input> |         </u-input> | ||||||
|         <!-- 自定义selectui --> |  | ||||||
|         <u-input |  | ||||||
|           v-if="item.type === 'selectCustom'" |  | ||||||
|           v-model="(model1.order as any)[item.key]" |  | ||||||
|           :placeholder="`请选择${item.name}`" |  | ||||||
|           :clearable="true" |  | ||||||
|           :customStyle="{}" |  | ||||||
|           border="none" |  | ||||||
|           disabled |  | ||||||
|           disabledColor="#ffffff" |  | ||||||
|         > |  | ||||||
|         </u-input> |  | ||||||
|         <!-- @afterRead="afterRead" |         <!-- @afterRead="afterRead" | ||||||
|           @delete="deletePic" --> |           @delete="deletePic" --> | ||||||
|         <!-- <u-upload |         <!-- <u-upload | ||||||
|  | @ -82,7 +71,7 @@ | ||||||
|               |               | ||||||
|           <u-radio activeColor="#00DCEE" label="自提" :name="1"></u-radio> |           <u-radio activeColor="#00DCEE" label="自提" :name="1"></u-radio> | ||||||
|         </u-radio-group> |         </u-radio-group> | ||||||
|         <template #right v-if="item.type === 'select' || item.type === 'selectCustom'"> |         <template #right v-if="item.type === 'select'"> | ||||||
|           <u-icon name="arrow-right"></u-icon> |           <u-icon name="arrow-right"></u-icon> | ||||||
|         </template> |         </template> | ||||||
|       </u-form-item> |       </u-form-item> | ||||||
|  | @ -212,7 +201,7 @@ const formAttrList = reactive<ComType>([ | ||||||
|   { |   { | ||||||
|     name: "客户", |     name: "客户", | ||||||
|     key: "userName", |     key: "userName", | ||||||
|     type: "selectCustom", |     type: "select", | ||||||
|     required: true, |     required: true, | ||||||
|     childKey: "userSelect", |     childKey: "userSelect", | ||||||
|     unit: "", |     unit: "", | ||||||
|  | @ -225,7 +214,7 @@ const formAttrList = reactive<ComType>([ | ||||||
|   { |   { | ||||||
|     name: "出货产品", |     name: "出货产品", | ||||||
|     key: "productName", |     key: "productName", | ||||||
|     type: "selectCustom", |     type: "select", | ||||||
|     required: true, |     required: true, | ||||||
|     childKey: "productSelect", |     childKey: "productSelect", | ||||||
|     unit: "", |     unit: "", | ||||||
|  |  | ||||||
|  | @ -548,7 +548,7 @@ const handleUpdateOrder = () => { | ||||||
| 
 | 
 | ||||||
| // 重新过毛 | // 重新过毛 | ||||||
| const handleReWeight = () => { | const handleReWeight = () => { | ||||||
|   ShipmentApi.reGrossWeight({ id: state.order.id }).then((res) => { |   ShipmentApi.reGrossWeight({ id: state.order.id, userId: state.order.userId, deviceId: state.order.deviceId }).then((res) => { | ||||||
|     if (res.code === 200) { |     if (res.code === 200) { | ||||||
|       uni.navigateTo({ |       uni.navigateTo({ | ||||||
|         url: "/pagesShipment/shipmenting?scaleStatus=1", // 要跳转到的页面路径 |         url: "/pagesShipment/shipmenting?scaleStatus=1", // 要跳转到的页面路径 | ||||||
|  |  | ||||||
|  | @ -126,7 +126,7 @@ export const getShipmentCategory = () => { | ||||||
| // 出货分类根据id查询
 | // 出货分类根据id查询
 | ||||||
| export const getShipmentCategoryById = (data: any) => { | export const getShipmentCategoryById = (data: any) => { | ||||||
|   return http({ |   return http({ | ||||||
|     method: 'POST', |     method: 'GET', | ||||||
|     url: '/api/shmcategory/selectShCyById', |     url: '/api/shmcategory/selectShCyById', | ||||||
|     data, |     data, | ||||||
|   }) |   }) | ||||||
|  | @ -211,4 +211,12 @@ export const getChildrenList = () => { | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // 出货父类分类查询
 | ||||||
|  | export const allShmCategory = () => { | ||||||
|  |   return http({ | ||||||
|  |     method: 'GET', | ||||||
|  |     url: '/api/shmcategory/allShmCategory', | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -27,6 +27,9 @@ body { | ||||||
| .l-h-28 { | .l-h-28 { | ||||||
|   line-height: 28px; |   line-height: 28px; | ||||||
| } | } | ||||||
|  | .ml-20 { | ||||||
|  |   margin-left: 20rpx; | ||||||
|  | } | ||||||
| .mt-30 { | .mt-30 { | ||||||
|   margin-top: 30rpx; |   margin-top: 30rpx; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 admin
						admin