From c9120bd88aa705d24d81b81cb41022dfdec02c86 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期五, 19 一月 2024 15:40:53 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Select.vue |  377 +++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 289 insertions(+), 88 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Select.vue b/north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Select.vue
index 11161c1..29b29e8 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Select.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Select.vue
@@ -28,24 +28,24 @@
         </el-col>
       </el-row>
     </el-header>
+
     <el-main style="padding-top: 5px;height:100%">
       <vxe-grid
-
           max-height="600"
           @filter-change="filterChanged"
           class="mytable-scrollbar"
           ref="xGrid"
           v-bind="gridOptions"
           v-on="gridEvents"
+          @cell-dblclick="cellClickEvent"
       >
 
-        <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
         <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
-        <template #content="{ row}">
+        <template #content="{ row }">
           <ul class="expand-wrapper">
-            <li v-for="(item,key,index) in row">
-              <span style="font-weight: bold">{{ key + ':  ' }}</span>
-              <span>{{ item }}</span>
+            <li  v-for="(item,index) in gridOptions.columns" v-show="item.field!==undefined ">
+              <span style="font-weight: bold">{{item.title+':  '}}</span>
+              <span>{{ row[item.field] }}</span>
             </li>
           </ul>
         </template>
@@ -53,8 +53,8 @@
         <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
         <template #button_slot="{ row }">
           <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">缂栬緫</el-button>
-<!--          <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">鍒犻櫎</el-button>-->
-<!--          <el-button @click="cellClickEvent" link type="primary" size="small">璇︽儏</el-button>-->
+          <!--          <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">鍒犻櫎</el-button>-->
+          <!--          <el-button @click="cellClickEvent" link type="primary" size="small">璇︽儏</el-button>-->
         </template>
 
 
@@ -67,23 +67,49 @@
         </template>
       </vxe-grid>
 
+      <!--      璇︽儏妗� 閮ㄥ垎1-->
+      <vxe-modal v-model="showDetails" title="鏌ョ湅璇︽儏" width="600" height="80%" :mask="false" :lock-view="false"
+                 resize>
+        <el-container>
+          <el-header height="35px"
+                     style="margin: 0;padding: 0">
 
-      <vxe-modal v-model="showDetails" title="鏌ョ湅璇︽儏" width="600" height="400" :mask="false" :lock-view="false" resize>
-        <template #default>
-          <vxe-table
-              border="inner"
-              auto-resize
-              show-overflow
-              height="auto"
-              :row-config="{isHover: true}"
-              :show-header="false"
-              :sync-resize="showDetails"
-              :data="detailData">
-            <vxe-column field="label" width="40%"></vxe-column>
-            <vxe-column field="value"></vxe-column>
-          </vxe-table>
-        </template>
+            <el-input v-model="showCGDH" placeholder="閲囪喘鍗曞彿" disabled>
+              <template #prepend>閲囪喘鍗曞彿锛�</template>
+            </el-input>
+          </el-header>
+          <el-main>
+            <template #default>
+              <vxe-table
+                  border="inner"
+                  auto-resize
+                  show-overflow
+                  max-height="400"
+                  :row-config="{isHover: true}"
+                  :show-header="false"
+                  :sync-resize="showDetails"
+                  :data="detailData">
+                <vxe-column field="label" width="30%" class-name="v-column-label"></vxe-column>
+                <vxe-column field="value"></vxe-column>
+              </vxe-table>
+            </template>
+          </el-main>
+          <el-footer height="40px">
+            <el-row>
+              <el-col :offset="20" :span="4">
+                <el-button
+                    id="Sure"
+                    type="primary"
+                    @click="logicExecute('缂栬緫')"
+                >缂栬緫
+                </el-button>
+              </el-col>
+
+            </el-row>
+          </el-footer>
+        </el-container>
       </vxe-modal>
+      <!--      璇︽儏妗� 閮ㄥ垎1 缁撴潫-->
 
 
     </el-main>
@@ -97,7 +123,9 @@
 import {useRouter} from 'vue-router'
 import {Search} from "@element-plus/icons-vue";
 import dayjs from "dayjs";
-import {VXETable} from "vxe-table";
+import {ElMessage} from "element-plus";
+
+
 
 let router = useRouter()
 const getTableRow = (row, type) => {
@@ -110,8 +138,7 @@
     case 'delete': {
 
 
-
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅'+row.id)
+      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅' + row.id)
       break
     }
   }
@@ -128,7 +155,8 @@
           break
         }
         case 'AddNo': {//鏃犲崟鏂板
-          openAlert({type: 'alert', content: '鐐瑰嚮浜嗘棤鍗曟柊澧�', status: 'success'})
+
+          MessageShow('鐐瑰嚮浜嗘棤鍗曟柊澧�', 'success');
           break
         }
 
@@ -148,36 +176,19 @@
   },
 }
 
-const openAlert = (options) => {
-  if(options.type==='message'){
-    VXETable.modal.message(options)
-  }else{
-    VXETable.modal.alert(options)
-  }
-
-}
-const closeAlert = (id) => {
-  VXETable.modal.close(id)
-}
-
-const confirmEvent = async () => {
-  const type = await VXETable.modal.confirm('鎮ㄧ‘瀹氳鍒犻櫎鍚楋紵')
-  VXETable.modal.message({ content: `鐐瑰嚮浜� ${type}` })
-}
-
-const BtnSearchPurchaseOrder =()=>{
+const BtnSearchPurchaseOrder = () => {
   for (let i = 1; i < 6; i++) {
     const randomInt = Math.floor(Math.random() * 999) + 1000;//4浣嶆暟闅忔満鏁�
     const randomSumInt = Math.floor(Math.random() * 99) + 10;//2浣嶆暟闅忔満鏁�
     const randomOrderInt = Math.floor(Math.random() * 99) + 100;//3浣嶆暟闅忔満鏁�
     const t = i % 2 === 0 ? 5 : 6;
-    const s = i % 2 === 0 ? '鍏ュ簱':i % 3 === 0 ? '寰呭鏍�' : i % 5 === 0 ? '宸查噰璐�' :'閫�搴�';
+    const s = i % 2 === 0 ? '鍏ュ簱' : i % 3 === 0 ? '寰呭鏍�' : i % 5 === 0 ? '宸查噰璐�' : '閫�搴�';
     const CGNo = 'NGCG231200' + randomOrderInt;//閲囪喘缂栧彿
     const wlNo = 'NGWL1000' + randomInt;
     const xh = 'NGXH' + randomSumInt;
     const wlmc = 'WLMC' + randomInt;
     const gys = '渚涘簲鍟�' + randomSumInt;
-    const xhdh='NG231200'+randomOrderInt;
+    const xhdh = 'NG231200' + randomOrderInt;
     const w = i % 2 === 0 ? '3300' : i % 3 === 0 ? '3660' : i % 4 === 0 ? '2250' : '2580';
     const h = i % 2 === 0 ? '2440' : i % 3 === 0 ? '2440' : i % 4 === 0 ? '2000' : '2300';
     const dw = i % 2 === 0 ? '鐗�' : i % 3 === 0 ? '骞崇背' : i % 4 === 0 ? '鍖�' : '鍚�';
@@ -192,12 +203,12 @@
       w: w,
       g: h,
       dw: dw,
-      cgzt:s,
-      rq:dayjs(now).format('YYYY-MM-DD'),
-      yl:randomSumInt,
-      sl:randomOrderInt,
-      xsdh:xhdh,
-      je:randomInt,
+      cgzt: s,
+      rq: dayjs(now).format('YYYY-MM-DD'),
+      yl: randomSumInt,
+      sl: randomOrderInt,
+      xsdh: xhdh,
+      je: randomInt,
       6: '139xxxxxxxx',
 
     })
@@ -205,6 +216,26 @@
 
 }
 
+
+//椤甸潰閫昏緫浠g爜鎵ц
+function logicExecute(type) {
+  const $grid = xGrid.value
+  switch (type) {
+    case '缂栬緫':
+      //MessageShow('鎿嶄綔鎴愬姛锛�', 'success');
+      //缂栬緫閫昏緫浠g爜TODO
+      router.push({path: '/main/purchaseOrder/CreatePurchaseOrder'})
+      break;
+    case '閫�璐�':
+      //鍗曢��璐ч�昏緫浠g爜TODO
+      MessageShow('鎿嶄綔鎴愬姛锛�', 'success');
+      break;
+    default:
+      MessageShow('鏈煡鎿嶄綔锛�', 'error');
+      break;
+  }
+  return true;
+}
 
 
 //缁勪欢鎺ユ敹鍙傛暟
@@ -237,36 +268,122 @@
     showStatus: true
   },
   columns: [
+    {type: 'expand', title: '', fixed: "left", slots: {content: 'content'}, width: 50},//璇︽儏
     {title: '鎿嶄綔', width: '8%', slots: {default: 'button_slot'}, fixed: "left"},
+    /* {type: 'checkbox',fixed:"left", title: '', width: 50 },*/
     {type: 'seq', fixed: "left", title: ' ', width: 50},
-    { type: 'checkbox',fixed:"left", title: '', width: 50 },
-    {type: 'expand', title:'璇︽儏', fixed: "left", slots: {content: 'content'}, width: 50},
-    {field: 'cgdh', width: '10%', title: '閲囪喘鍗曞彿', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+
+
+    {
+      field: 'cgdh',
+      width: '10%',
+      title: '閲囪喘鍗曞彿',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
     {field: 'cgzt', width: '10%', title: '鐘舵��', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'gys', width: '10%',title: '渚涘簲鍟�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'wlbh', width: '10%',title: '鐗╂枡缂栧彿', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'wlmc', width: '10%', title: '鐗╂枡鍚嶇О', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'w', width: '8%',title: '瀹藉害', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'g', width: '8%',title: '楂樺害', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'h', width: '8%',title: '鍘氬害', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'xh', width: '8%',title: '鍨嬪彿', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'dw', width: '8%',title: '鍗曚綅', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: '6', width: '12%',title: '涓嶅惈绋庡崟浠�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'sl', width: '8%',title: '鏁伴噺', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'sl', width: '12%',title: '宸查噰璐暟閲�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'je', width: '8%',title: '閲戦', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'je', width: '12%',title: '涓嶅惈绋庨噾棰�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: '6', width: '8%',title: '绋庣巼', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'sl', width: '8%',title: '搴撳瓨', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'yl', width: '10%',title: '鍛ㄧ敤閲�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'yl', width: '10%',title: '鏈堢敤閲�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'cgzt', width: '10%',title: '鍗曟嵁鐘舵��', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'xsdh', width: '10%',title: '閿�鍞崟鍙�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: 'rq', width: '10%',title: '鍒跺崟鏃ユ湡', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {
+      field: 'gys',
+      width: '10%',
+      title: '渚涘簲鍟�',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {
+      field: 'wlbh',
+      width: '10%',
+      title: '鐗╂枡缂栧彿',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {
+      field: 'wlmc',
+      width: '10%',
+      title: '鐗╂枡鍚嶇О',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {field: 'w', width: '8%', title: '瀹藉害', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'g', width: '8%', title: '楂樺害', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'h', width: '8%', title: '鍘氬害', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'xh', width: '8%', title: '鍨嬪彿', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'dw', width: '8%', title: '鍗曚綅', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {
+      field: '6',
+      width: '12%',
+      title: '涓嶅惈绋庡崟浠�',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {field: 'sl', width: '8%', title: '鏁伴噺', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {
+      field: 'sl',
+      width: '12%',
+      title: '宸查噰璐暟閲�',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {field: 'je', width: '8%', title: '閲戦', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {
+      field: 'je',
+      width: '12%',
+      title: '涓嶅惈绋庨噾棰�',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {field: '6', width: '8%', title: '绋庣巼', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'sl', width: '8%', title: '搴撳瓨', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'yl', width: '10%', title: '鍛ㄧ敤閲�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {field: 'yl', width: '10%', title: '鏈堢敤閲�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+    {
+      field: 'cgzt',
+      width: '10%',
+      title: '鍗曟嵁鐘舵��',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {
+      field: 'xsdh',
+      width: '10%',
+      title: '閿�鍞崟鍙�',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {
+      field: 'rq',
+      width: '10%',
+      title: '鍒跺崟鏃ユ湡',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
     {field: '6', width: '10%', title: '鍒跺崟浜�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: '6', width: '10%',title: '閲囪喘閮ㄩ棬', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: '6', width: '10%',title: '閲囪喘缁勭粐', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
-    {field: '6', width: '10%',title: '澶囨敞', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
+    {
+      field: '6',
+      width: '10%',
+      title: '閲囪喘閮ㄩ棬',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {
+      field: '6',
+      width: '10%',
+      title: '閲囪喘缁勭粐',
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'},
+      sortable: true
+    },
+    {field: '6', width: '10%', title: '澶囨敞', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
   ],//琛ㄥご鍙傛暟
   toolbarConfig: {
     buttons: [/*{type:'text'},
@@ -281,7 +398,7 @@
 
         'code':'AddNo'
       }*/
-      ],
+    ],
     import: false,
     export: true,
     print: true,
@@ -309,14 +426,47 @@
 
 })
 
-/*const showDetails = ref(false)
-const detailData = ref([])
-const cellClickEvent = ({ row }) => {
-  detailData.value = ['閲囪喘鍗曞彿', 'wlbh', 'wlmc', 'gys', 'h', 'k', 'g'].map(field => {
-    return { label: field, value: row[field] }
+//璇︽儏妗� 閮ㄥ垎2
+const showCGDH = ref();
+const showDetails = ref(false);
+let detailData = [];
+const cellClickEvent = ({row}) => {
+  if(isQueryColumnId===false){
+    queryColumnId();
+  }
+
+  detailData = list.map(field => {
+    return {label: queryColumnsTitle(field), value: row[field]}
   })
-  showDetails.value = true
-}*/
+
+  showDetails.value = true;
+  showCGDH.value = row['cgdh'];
+}
+
+//鑾峰彇琛ㄥ垪
+let list = [];
+let columnIndex = 3;//鍒楁爣澶翠粠绗嚑鍒楀紑濮嬬殑
+let isQueryColumnId = false;
+const queryColumnId = () => {
+  while (columnIndex < gridOptions.columns.length) {
+    list.push(gridOptions.columns[columnIndex].field);
+    columnIndex++;
+  }
+  isQueryColumnId = true;
+  return list;
+}
+
+//鑾峰彇琛ㄥ垪鍚�
+function queryColumnsTitle(cn) {
+  let i = 0;
+  while (i < gridOptions.columns.length + 1) {
+    if (gridOptions.columns[i].field === cn) {
+      return gridOptions.columns[i].title;
+    }
+    i++;
+  }
+}
+//璇︽儏妗� 閮ㄥ垎2 缁撴潫
 
 
 const now = new Date()
@@ -353,9 +503,60 @@
   },
 ]
 
+
+//鎻愮ず淇℃伅
+//淇℃伅鍐呭锛屾樉绀烘柟寮忥紝鏄剧ず鏍囬锛岀被鍨�
+const MessageShow = (content, type = 'success') => {
+  ElMessage({
+    message: content,
+    type: type,
+    showClose: true,
+  })
+}
+
+//鎿嶄綔纭绫讳俊鎭細鎿嶄綔绫诲瀷锛屾彁绀哄唴瀹癸紝鎻愮ず鏍囧ご锛屾彁绀虹被鍨�
+const MessageConfirmShow = (czType, content, title = '鎿嶄綔纭鎻愮ず', type = 'warning') => {
+  ElMessageBox.confirm(
+      content,
+      title,
+      {
+        cancelButtonText: '鍙栨秷',
+        confirmButtonText: '纭畾',
+        type: type,
+        center: true,
+      }
+  )
+      //鐐瑰嚮浜嗙‘瀹�
+      .then(() => {
+
+        logicExecute(czType);
+
+        return true;
+      })
+      //鐐瑰嚮浜嗗彇娑�
+      .catch(() => {
+        return false;
+      })
+}
+
+//寮圭獥淇℃伅
+const MessageAlertShow = (content, title, type = 'info') => {
+
+  ElMessageBox.alert(content, title, {
+    // 绂佹鑷姩瀵圭劍
+    //autofocus: false,
+    confirmButtonText: 'OK',
+    /*callback: (action: Action) => {
+      MessageShow(`action: ${action}`,type)
+    },*/
+  })
+}
+
 </script>
 
 
 <style scoped>
-
+:deep(.v-column-label div span) {
+  font-weight: bold;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.8.0