From a660db06773007b1be690e0674829c00a57aeb7b Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 24 十二月 2025 16:21:23 +0800
Subject: [PATCH] 订单首页流程卡新增楼层编号显示

---
 north-glass-erp/northglass-erp/src/views/pp/productionBasicData/SelectProductionBasicData.vue |  304 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 304 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/productionBasicData/SelectProductionBasicData.vue b/north-glass-erp/northglass-erp/src/views/pp/productionBasicData/SelectProductionBasicData.vue
new file mode 100644
index 0000000..ec2e63b
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/pp/productionBasicData/SelectProductionBasicData.vue
@@ -0,0 +1,304 @@
+<script setup>
+
+import {reactive, ref} from "vue";
+import {useRouter} from  'vue-router'
+import request from "@/utils/request";
+import deepClone from "@/utils/deepClone";
+import {ElMessage} from "element-plus";
+import { useI18n } from 'vue-i18n'
+import {changeFilterEvent, filterChanged} from "@/hook"
+import  useUserInfoStore from '@/stores/userInfo'
+
+//璇█鑾峰彇
+const { t } = useI18n()
+const userStore = useUserInfoStore()
+let router=useRouter()
+//瀹氫箟鏁版嵁杩斿洖缁撴灉
+let produceList = ref([])
+//瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
+const titleSelectJson = ref({
+  processType: [],
+
+})
+const size = ref<'default' | 'large' | 'small'>('default')
+
+const value1 = ref('')
+let dialogTableVisible = ref(false)
+
+const getBasicData = ref({
+  id: '',
+  basic_type: '',
+  basic_name: '',
+  d_basic_name: '',
+})
+const getTableRow = (row,type) =>{
+  switch (type) {
+    case 'edit' :{
+      request.post(`/basicDataProduce/openSelectId/${row.id}`).then((res) => {
+        if (res.code == 200) {
+
+          getBasicData.value = res.data.data[0]
+          dialogTableVisible.value=true
+          //router.push({path: '/main/productionBasicData/SelectProductionBasicData', query: {random:Math.random()}})
+        } else {
+
+          ElMessage.warning(res.msg)
+
+        }
+      })
+      break
+    }
+    case 'delete':{
+      request.post(`/basicDataProduce/deleteBasic/${row.id}`).then((res) => {
+        if (res.code == 200) {
+          ElMessage.success(t('workOrder.deleteOk'))
+          router.push({path: '/main/productionBasicData/SelectProductionBasicData', query: {random:Math.random()}})
+        } else {
+
+          ElMessage.warning(res.msg)
+
+        }
+      })
+      break
+    }
+    case  'setType':{
+      break
+    }
+  }
+}
+
+//琛ㄥ熬姹傚拰
+const sumNum = (list, field) => {
+  let count = 0
+  list.forEach(item => {
+    count += Number(item[field])
+  })
+  return count.toFixed(2)
+}
+
+const hasDecimal = (value) => {
+  const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+  return regex.test(value); // 杩斿洖true/false
+}
+
+//棣栨鍔犺浇
+request.post(`/basicDataProduce/selectBasic`).then((res) => {
+  if (res.code == 200) {
+    produceList = produceList.value.concat(deepClone(res.data.data))
+    titleSelectJson.value.processType = res.data.process;
+    xGrid.value.reloadData(produceList)
+    gridOptions.loading = false
+  } else {
+    ElMessage.warning(res.msg)
+  }
+})
+
+//瀛愮粍浠舵帴鏀跺弬鏁�
+const xGrid = ref()
+const gridOptions = reactive({
+  border:  "full",//琛ㄦ牸鍔犺竟妗�
+  keepSource: true,//淇濇寔婧愭暟鎹�
+  align: 'center',//鏂囧瓧灞呬腑
+  stripe:true,//鏂戦┈绾�
+  rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  id: 'CustomerList',
+  showFooter: true,//鏄剧ず鑴�
+  printConfig: {},
+  importConfig: {},
+  exportConfig: {},
+  scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
+  showOverflow:true,
+  columnConfig: {
+    resizable: true,
+    useKey: true
+  },
+  filterConfig: {   //绛涢�夐厤缃」
+    //remote: true
+  },
+  customConfig: {
+    storage: true
+  },
+  editConfig: {
+    trigger: 'click',
+    mode: 'row',
+    showStatus: true
+  },//琛ㄥご鍙傛暟
+  columns:[
+    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
+    {title: t('basicData.operate'), width: 140, slots: { default: 'button_slot' },fixed:"left"},
+    {field: 'id', width: 60, title: t('productionBasicData.id'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged,},
+    {field: 'basic_type',width: 370, title: t('machine.type'), showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged},
+    {field: 'basic_name', width: 330,title: t('orderBasicData.name'), filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged},
+    {field: 'd_basic_name',width: 330, title: t('productionBasicData.basicName')},
+  ],
+  //琛ㄥご鎸夐挳
+  toolbarConfig: {
+    // buttons: [{
+    //
+    // }],
+    // import: false,
+    // export: true,
+    // print: true,
+    zoom: true,
+    custom: true
+  },
+  data:  [
+
+  ],//table body瀹為檯鏁版嵁
+  //鑴氶儴姹傚拰
+  footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+    let footList=['','','','']
+    return[
+      columns.map((column, columnIndex) => {
+        if (columnIndex === 0) {
+          return t('basicData.total')
+        }
+        if (footList.includes(column.field)) {
+          return sumNum(data, column.field)
+        }
+        return ''
+      })
+    ]
+  }
+
+})
+
+const updateBasic = () => {
+  let id = getBasicData.value.id
+  let process = getBasicData.value.d_basic_name
+  let name = getBasicData.value.basic_name
+  let type = getBasicData.value.basic_type
+  request.post(`/basicDataProduce/updateBasic/${id}/${process}/${name}/${type}`).then((res) => {
+    if (res.code == 200) {
+      ElMessage.success(t('processCard.modifySuccessfully'))
+      router.push({path: '/main/productionBasicData/SelectProductionBasicData', query: {random:Math.random()}})
+    } else {
+
+      ElMessage.warning(res.msg)
+    }
+  })
+}
+
+
+</script>
+
+<template>
+  <div  style="width: 100%;height: 100%">
+    <div class="main-table">
+      <vxe-grid
+          height="100%"
+          class="mytable-scrollbar"
+          ref="xGrid"
+          v-bind="gridOptions"
+
+      >
+        <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
+        <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+        <template #content="{ row }">
+          <ul class="expand-wrapper">
+            <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
+              <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
+              <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
+              <span v-else>{{ row[item.field] }}</span>
+
+            </li>
+          </ul>
+        </template>
+
+        <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+        <template #button_slot="{ row }">
+          <!--        <el-button @click="getTableRow(row,'edit');" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>-->
+          <el-button @click="getTableRow(row,'edit')"
+                     v-if="userStore.user.permissions.indexOf('selectProductionBasicData.edit') > -1"
+                     link
+                     type="primary"
+                     size="small">
+            {{ $t('basicData.edit') }}
+          </el-button>
+          <el-popconfirm   @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')">
+            <template #reference>
+              <el-button  link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
+            </template>
+          </el-popconfirm>
+        </template>
+
+        <template #num1_filter="{ column, $panel }">
+          <div>
+            <div v-for="(option, index) in column.filters" :key="index">
+              <input type="text" v-model="option.data"
+                     @keyup.enter.native="$panel.confirmFilter()"
+                     @input="changeFilterEvent($event, option, $panel)"/>
+            </div>
+          </div>
+        </template>
+
+
+      </vxe-grid>
+    </div>
+
+    <el-dialog v-model="dialogTableVisible" :title="$t('productionBasicData.basicDataEdit')">
+      <el-row>
+        <el-col :span="2">
+          <el-text>{{$t('productionBasicData.id')}}锛�</el-text>
+        </el-col>
+        <el-col :span="3">
+          <el-input v-model="getBasicData.id"  readonly autocomplete="off"  style="width: 220px"/>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="2">
+          <el-text>{{$t('machine.type')}}锛�</el-text>
+        </el-col>
+        <el-col :span="3">
+          <el-input v-model="getBasicData.basic_type" readonly  autocomplete="off"  style="width: 220px"/>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="2">
+          <el-text>{{$t('orderBasicData.name')}}锛�</el-text>
+        </el-col>
+        <el-col :span="3">
+          <el-input v-model="getBasicData.basic_name"  autocomplete="off"  style="width: 220px"/>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="2">
+          <el-text>{{$t('productionBasicData.basicName')}}锛�</el-text>
+        </el-col>
+        <el-col :span="3">
+<!--          <el-input v-model="getBasicData.d_basic_name"  autocomplete="off"  style="width: 220px"/>-->
+          <el-select  v-model="getBasicData.d_basic_name" clearable placeholder="" style="width: 220px"
+                   >
+            <el-option
+                v-for="item in titleSelectJson['processType']"
+                :key="item.id"
+                :label="item.basic_name"
+                :value="item.basic_name"
+            />
+          </el-select>
+        </el-col>
+      </el-row>
+
+      <template #footer>
+      <span class="dialog-footer">
+        <el-button @click="dialogTableVisible = false">{{$t('basicData.cancelButtonText')}}</el-button>
+        <el-button type="primary" @click="updateBasic">
+          {{$t('basicData.update')}}
+        </el-button>
+      </span>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<style scoped>
+.head{
+  width: 100%;
+  height: 35px;
+}
+
+.main-table{
+  width: 100%;
+  height: calc(100% - 0px);
+}
+</style>
\ No newline at end of file

--
Gitblit v1.8.0