From 37532f5802eae207940b8bd9812ee0b4ca308d65 Mon Sep 17 00:00:00 2001 From: guoyuji <guoyujie@ng.com> Date: 星期二, 27 二月 2024 13:50:33 +0800 Subject: [PATCH] 订单,产品前后端数据提交 --- north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue | 43 +++++++++++++++++++++++++++++-------------- 1 files changed, 29 insertions(+), 14 deletions(-) diff --git a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue index 5eecb7f..9ba0119 100644 --- a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue +++ b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue @@ -6,7 +6,11 @@ import request from "@/utils/request" import deepClone from "@/utils/deepClone" import useUserInfoStore from '@/stores/userInfo' +import SelectProduct from "@/views/sd/product/SelectProduct.vue" +import {changeFilterEvent,filterChanged} from "@/hook" + let dialogTableVisible = ref(false) +let productVisible = ref(false) const userStore = useUserInfoStore() const router = useRouter() const route = useRoute() @@ -51,13 +55,8 @@ saleMan:[] }) let filterData = ref({}) -const filterChanged = ({ option, row, column }) => { - if (option.data) { - return row[column.field].toString().toLowerCase().indexOf(option.data) > -1 - } - return true - //@filter-change="filterChanged" -} +let rowIndex = ref(null) + const gridOptions = reactive({ border: "full",//琛ㄦ牸鍔犺竟妗� keepSource: true,//淇濇寔婧愭暟鎹� @@ -147,7 +146,14 @@ } ], quantity: [ - { type: 'number', min: 0, message: '璇疯緭鍏ュぇ浜庣瓑浜�0鐨勬暟鍊�' } + //type: 'number', min: 0, message: '璇疯緭鍏ュぇ浜庣瓑浜�0鐨勬暟鍊�' , + { + validator ({ cellValue }) { + const regex = /^[1-9]\d*$/ + if (!regex.test(cellValue)) { + return new Error('杈撳叆澶т簬0鐨勬暣鏁�') + } + }} ], width:[ { @@ -289,8 +295,17 @@ }, cellDblclick (params) {//琛ㄦ牸鍐呭鍙屽嚮鎵撳紑浜у搧鐣岄潰 const { row } = params + productVisible.value = true + rowIndex=row + //console.log(row) //alert("鎴戞墦寮�浜嗕骇鍝佺晫闈�") } +} +//鑾峰彇瀛愰〉闈骇鍝佹柟娉� +const getProductRow = (row) => { + rowIndex.productName = row.productName + rowIndex.productId = row.id + productVisible.value = false } //鍒濆鍖栧垽鏂槸鍚︽湁id浼犲叆 @@ -402,7 +417,7 @@ const area = parseFloat((row.width * row.height/1000000).toFixed(2)) return parseFloat((area * row.quantity).toFixed(2)) } - +//璁$畻閲戦挶 const countMoney = (list) => { let countMoney = 0 list.forEach((item)=>{ @@ -458,11 +473,7 @@ titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() } -// 鎵嬪姩瑙﹀彂绛涢�� -const changeFilterEvent = (event, option, $panel) => { - // 鎵嬪姩瑙﹀彂绛涢�� - $panel.changeOption(event, !!option.data, option) -} + @@ -627,6 +638,10 @@ :autosize="{ minRows: 2, maxRows: 20 }" /> </el-dialog> + <el-dialog v-model="productVisible" style="width: 80%;height:75% "> + <select-product :rowIndex="rowIndex" @getProductRow="getProductRow" style="width: 100%;height: 100%" /> + </el-dialog> + </div> </template> -- Gitblit v1.8.0