From fe86d1a770fbbe7b168502e13adc69513b2af8e2 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期一, 08 四月 2024 11:26:25 +0800
Subject: [PATCH] 订单报表部分程序

---
 north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue |  206 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 206 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..3e131b6
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/sd/basicData/CreateBasicData.vue
@@ -0,0 +1,206 @@
+<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:''
+})
+let options=ref([
+  { "label": "璁㈠崟",
+    "value": "order",
+    "children": [
+      {
+        "label": "璁㈠崟绫诲瀷",
+        "value": "orderType"
+      },
+      {
+        "label": "璁㈠崟鍒嗙被",
+        "value": "orderClassify"
+      },
+      {
+        "label": "鍟嗘爣閫夐」",
+        "value": "icon"
+      },
+      {
+        "label": "鍖呰鏂瑰紡",
+        "value": "packType"
+      },
+      {
+        "label": "閾濇潯鏂瑰紡",
+        "value": "alType"
+      },
+      {
+        "label": "涓氬姟鍛�",
+        "value": "saleMan"
+      }
+    ]
+  },
+  {
+    "label": "浜у搧",
+    "value": "product",
+    "children": [
+      {
+        "label": "鏉愭枡鍘氬害",
+        "value": "stuffThickness"
+      },
+      {
+        "label": "鏉愭枡棰滆壊",
+        "value": "stuffColor"
+      },
+      {
+        "label": "宸ヨ壓灞炴��",
+        "value": "stuffCraft"
+      },
+      {
+        "label": "鐜荤拑浣嶇疆",
+        "value": "stuffPosition"
+      },
+      {
+        "label": "lowe",
+        "value": "stuffLowE"
+      },
+      {
+        "label": "澶硅兌鍘氬害",
+        "value": "InterlayerThickness"
+      },
+      {
+        "label": "澶硅兌绫诲瀷",
+        "value": "InterlayerType"
+      },
+      {
+        "label": "澶硅兌棰滆壊",
+        "value": "InterlayerColor"
+      },
+      {
+        "label": "宸ヨ壓娴佺▼",
+        "value": "process"
+      },
+      {
+        "label": "涓┖鍘氬害",
+        "value": "hollowThickness"
+      },
+      {
+        "label": "鍏呮皵鏂瑰紡",
+        "value": "hollowGasType"
+      },
+      {
+        "label": "灏佽兌",
+        "value": "hollowType"
+      },
+      {
+        "label": "榛樿鑳舵繁",
+        "value": "hollowGlueDepth"
+      }
+    ]
+  },
+  {
+    "children": [
+      {
+        "label": "浠樻鏉′欢",
+        "value": "paymentTerms"
+      },
+      {
+        "label": "鏀舵鏂瑰紡",
+        "value": "payMethod"
+      }
+    ],
+    "label": "閫佽揣",
+    "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
+  }
+})
+
+const emit =  defineEmits(['gaveParent'])
+const saveBasicData =  () =>{
+  request.post(`/basicData/addBasicData`, basic.value).then(res => {
+    if (res.data) {
+      ElMessage.success('淇濆瓨鎴愬姛')
+      emit('gaveParent', true)
+    }
+  })
+}
+const updateBasicData =  () =>{
+  let submitArr  = props.rowIndex
+  submitArr.basicType = basic.value.basicType[0]
+  submitArr.basicCategory = basic.value.basicType[1]
+  submitArr.basicName = basic.value.input
+  request.post(`/basicData/updateBasicData`, submitArr).then(res => {
+    if (res.data) {
+      ElMessage.success('淇敼鎴愬姛')
+      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]))
+  console.log(filterArr)
+}
+
+
+</script>
+
+<template>
+  <div>
+    <el-row>
+      <el-col :span="4">鍩虹绫诲瀷:</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">鍚嶇О:</el-col>
+      <el-col :span="12">
+        <el-input v-model="basic.input"/>
+      </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">鏂板</el-button>
+        <el-button v-show="props.rowIndex" @click="updateBasicData" type="primary">淇敼</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