From 1c13bd7a2cd2c8ba69a185da69344c8b59f4e561 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期四, 04 七月 2024 09:29:15 +0800
Subject: [PATCH] 选中求和功能以及还原双击回车才能点击单元格
---
north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue | 224 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 224 insertions(+), 0 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue b/north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue
new file mode 100644
index 0000000..30483a9
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue
@@ -0,0 +1,224 @@
+<script setup>
+import request from "@/utils/request"
+import {onMounted, ref, watch} from "vue";
+import {useI18n} from "vue-i18n"
+import {ElMessage} from "element-plus"
+import {useRouter,useRoute} from "vue-router"
+const { t } = useI18n()
+const router = useRouter()
+const route = useRoute()
+
+
+let basic = ref({
+ basicType : ['',''],
+ input:'',
+ nickname:''
+})
+let options=ref([
+ { "label": t('orderBasicData.order'),
+ "value": "order",
+ "children": [
+ {
+ "label": t('orderBasicData.orderType'),
+ "value": "orderType"
+ },
+ {
+ "label": t('orderBasicData.orderClassify'),
+ "value": "orderClassify"
+ },
+ {
+ "label": t('orderBasicData.icon'),
+ "value": "icon"
+ },
+ {
+ "label": t('orderBasicData.packType'),
+ "value": "packType"
+ },
+ {
+ "label": t('orderBasicData.alType'),
+ "value": "alType"
+ },
+ {
+ "label": t('orderBasicData.saleMan'),
+ "value": "saleMan"
+ }
+ ]
+ },
+ {
+ "label": t('orderBasicData.product'),
+ "value": "product",
+ "children": [
+ {
+ "label": t('orderBasicData.stuffThickness'),
+ "value": "stuffThickness"
+ },
+ {
+ "label": t('orderBasicData.stuffColor'),
+ "value": "stuffColor"
+ },
+ {
+ "label": t('orderBasicData.stuffCraft'),
+ "value": "stuffCraft"
+ },
+ {
+ "label": t('orderBasicData.stuffPosition'),
+ "value": "stuffPosition"
+ },
+ {
+ "label": t('orderBasicData.stuffLowE'),
+ "value": "stuffLowE"
+ },
+ {
+ "label": t('orderBasicData.InterlayerThickness'),
+ "value": "InterlayerThickness"
+ },
+ {
+ "label": t('orderBasicData.InterlayerType'),
+ "value": "InterlayerType"
+ },
+ {
+ "label": t('orderBasicData.InterlayerColor'),
+ "value": "InterlayerColor"
+ },
+ {
+ "label": t('orderBasicData.process'),
+ "value": "process"
+ },
+ {
+ "label": t('orderBasicData.hollowThickness'),
+ "value": "hollowThickness"
+ },
+ {
+ "label": t('orderBasicData.hollowGasType'),
+ "value": "hollowGasType"
+ },
+ {
+ "label": t('orderBasicData.hollowType'),
+ "value": "hollowType"
+ },
+ {
+ "label": t('orderBasicData.hollowGlueDepth'),
+ "value": "hollowGlueDepth"
+ }
+ ]
+ },
+ {
+ "children": [
+ {
+ "label": t('orderBasicData.paymentTerms'),
+ "value": "paymentTerms"
+ },
+ {
+ "label": t('orderBasicData.payMethod'),
+ "value": "payMethod"
+ }
+ ],
+ "label": t('orderBasicData.delivery'),
+ "value": "delivery"
+ }
+])
+
+let props = defineProps({
+ rowIndex:{
+ Object,
+ default: null
+ }
+})
+onMounted(() =>{
+ if(props.rowIndex){
+ basic.value.basicType[0] = props.rowIndex.basicType
+ basic.value.basicType[1] = props.rowIndex.basicCategory
+ basic.value.input = props.rowIndex.basicName
+ basic.value.nickname = props.rowIndex.nickname
+ }
+})
+
+const emit = defineEmits(['gaveParent'])
+const saveBasicData = () =>{
+ if(basic.value.basicType[1]==="hollowThickness"||basic.value.basicType[1]==="stuffThickness"||basic.value.basicType[1]==="InterlayerThickness"){
+ if(!basic.value.input.includes("mm")){
+ basic.value.input=basic.value.input+"mm"
+ }
+ }
+ request.post(`/basicData/addBasicData`, basic.value).then(res => {
+ if (res.data) {
+ ElMessage.success(t('basicData.msg.saveSuccess'))
+ emit('gaveParent', true)
+ }
+ })
+}
+const updateBasicData = () =>{
+ if(basic.value.basicType[1]==="hollowThickness"||basic.value.basicType[1]==="stuffThickness"||basic.value.basicType[1]==="InterlayerThickness"){
+ if(!basic.value.input.includes("mm")){
+ basic.value.input=basic.value.input+"mm"
+ }
+ }
+ let submitArr = props.rowIndex
+ submitArr.basicType = basic.value.basicType[0]
+ submitArr.basicCategory = basic.value.basicType[1]
+ submitArr.basicName = basic.value.input
+ submitArr.nickname = basic.value.nickname
+ request.post(`/basicData/updateBasicData`, submitArr).then(res => {
+ if (res.data) {
+ ElMessage.success(t('basicData.msg.saveSuccess'))
+ emit('gaveParent', true)
+ }
+ })
+
+}
+
+const handleChange = (value) => {
+ const filterArr = options.value.filter((item) =>item.value === value[0]
+ ).map((item) =>item.children.filter((item) =>item.value === value[1]))
+}
+
+
+</script>
+
+<template>
+ <div>
+ <el-row>
+ <el-col :span="4">{{ $t('orderBasicData.basicType') }}:</el-col>
+ <el-col :span="12">
+ <el-cascader
+ v-model="basic.basicType"
+ @change="handleChange"
+ :options="options"
+ clearable
+ placeholder=""
+ :disabled="props.rowIndex"
+ />
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="4">{{ $t('orderBasicData.name') }}:</el-col>
+ <el-col :span="12">
+ <el-input v-model="basic.input"/>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="4">{{ $t('orderBasicData.alias') }}:</el-col>
+ <el-col :span="12">
+ <el-input v-model="basic.nickname"/>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="4"></el-col>
+ <el-col :span="12">
+ <el-button v-show="!props.rowIndex" @click="saveBasicData" type="primary">{{ $t('basicData.insert') }}</el-button>
+ <el-button v-show="props.rowIndex" @click="updateBasicData" type="primary">{{ $t('basicData.update') }}</el-button>
+
+ </el-col>
+ </el-row>
+
+ </div>
+</template>
+
+<style scoped>
+div{
+ text-align: center;
+}
+.el-row{
+ margin-top: 10px;
+}
+</style>
\ No newline at end of file
--
Gitblit v1.8.0