Ver código fonte

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

cz 2 anos atrás
pai
commit
3c34655cee

+ 13 - 0
src/components/byForm/index.vue

@@ -31,6 +31,7 @@
           v-model="formData[i.prop]"
           :placeholder="i.placeholder || '请输入'"
           @input="(e) => commonsEmit(e, i)"
+          @change="(e) => commonsEmitChange(e, i)"
           :type="i.itemType ? i.itemType : 'text'"
           :disabled="i.disabled ? i.disabled : false"
           :max="i.max"
@@ -334,6 +335,15 @@ const commonsEmit = (prop, item) => {
   }
   emit("update:modelValue", formData.value);
 };
+const commonsEmitChange = (prop, item) => {
+  if (item.type == 'input') {
+    formData.value[item.prop] = prop.trim();
+  }
+  if (item.fn) {
+    item.fn(prop);
+  }
+  emit("update:modelValue", formData.value);
+};
 const loadInit = () => {
   const v = this;
   for (let i = 0; i < proxy.formConfig.length; i++) {
@@ -470,6 +480,9 @@ const handleSubmit = async (onSubmit) => {
         if (item.type == "json") {
           form[item.prop] = JSON.stringify(form[item.prop]);
         }
+        if (item.type == 'input') {
+          form[item.prop] = form[item.prop].trim();
+        }
       });
       emit("update:modelValue", form);
       onSubmit();

+ 2 - 0
src/layout/components/AppMain.vue

@@ -3,6 +3,7 @@
     <router-view v-slot="{ Component, route }">
       <transition name="fade-transform" mode="out-in">
         <keep-alive :include="tagsViewStore.cachedViews">
+          
           <component v-if="!route.meta.link" :is="Component" :key="route.path"/>
         </keep-alive>
       </transition>
@@ -16,6 +17,7 @@ import iframeToggle from "./IframeToggle/index"
 import useTagsViewStore from '@/store/modules/tagsView'
 
 const tagsViewStore = useTagsViewStore()
+console.log(tagsViewStore)
 </script>
 
 <style lang="scss" scoped>

+ 2 - 1
src/main.js

@@ -44,7 +44,7 @@ import {
   selectDictLabels
 } from '@/utils/ruoyi'
 
-import { dictDataEcho, dictValueLabel, moneyFormat, calculationWeek, getDict, getPdf } from '@/utils/util'
+import { dictDataEcho, dictValueLabel, moneyFormat, calculationWeek, getDict, getPdf, translateIntoEnglish } from '@/utils/util'
 
 // 分页组件
 import Pagination from '@/components/Pagination'
@@ -81,6 +81,7 @@ app.config.globalProperties.moneyFormat = moneyFormat
 app.config.globalProperties.calculationWeek = calculationWeek
 app.config.globalProperties.getDict = getDict
 app.config.globalProperties.getPdf = getPdf
+app.config.globalProperties.translateIntoEnglish = translateIntoEnglish
 
 
 // 全局组件挂载

+ 113 - 0
src/utils/ACapital.js

@@ -0,0 +1,113 @@
+;(function (s) {
+  //参数
+  var NumtoEnglish = {},
+    n = '',
+    xiao = '',
+    zheng = '',
+    regxinteger = /^([0-9]{1,}([.][0-9]*)?)$/
+  //数字英文写法
+  NumtoEnglish.tally = {
+    arr1: ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'],
+    arr2: ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'],
+    arr3: ['twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'],
+    arr4: ['hundred', 'thousand', 'million', 'billion', 'trillion', 'quadrillion'],
+  }
+  //转换整数部分
+  NumtoEnglish.Convert_integer = function (n) {
+    try {
+      var fenge = this.toThousands(n).split(',')
+      var result = ''
+      for (var i = 0; i < fenge.length; i++) {
+        if (fenge[i].length == 3) {
+          result += this.tally.arr1[fenge[i].substring(0, 1)] + ' ' //百位
+          result += this.tally.arr4[0]
+          if (this.doubledight(fenge[i].substring(1)) != '') {
+            result += ' and ' + this.doubledight(fenge[i].substring(1))
+          }
+        } else if (fenge[i].length == 2) {
+          result += this.doubledight(fenge[i]) //十位
+        } else if (fenge[i].length == 1) {
+          result += this.tally.arr1[fenge[i]] //个位
+        }
+        //添加千分位单位(数字超过1000,每三位数字分配一个单位)
+        if (i < fenge.length - 1) {
+          result += ' ' + this.tally.arr4[fenge.length - 1 - i] + ' '
+        }
+      }
+      return result
+    } catch (ex) {
+      console.error(ex)
+    }
+  }
+  //转换小数部分
+  NumtoEnglish.Convert_decimal = function (n) {
+    var d = n.split('')
+    var result = ''
+    if (d.length > 0) {
+      for (let i = 0; i < d.length; i++) {
+        result += this.Convert_integer(d[i]) + ' '
+      }
+
+      //d.forEach(a => {
+      //   result += this.Convert_integer(a) + " ";
+      //});
+    }
+    return result
+  }
+  //组合两位数
+  NumtoEnglish.doubledight = function (n) {
+    var result = ''
+    if (parseInt(n) != 0) {
+      var dd = n.split('')
+      if (dd[0] < 1) {
+        result = this.tally.arr1[dd[1]]
+      } else if (dd[0] == 1) {
+        result = this.tally.arr2[dd[1]]
+      } else {
+        if (this.tally.arr1[dd[1]] !== 'zero') {
+          result = this.tally.arr3[dd[0] - 2] + '-' + this.tally.arr1[dd[1]]
+        } else {
+          result = this.tally.arr3[dd[0] - 2]
+        }
+      }
+    }
+    return result
+  }
+
+  //转换千分位显示,例:1000000 = 1,000,000
+  NumtoEnglish.toThousands = function (num) {
+    var num = (num || 0).toString(),
+      result = ''
+    while (num.length > 3) {
+      result = ',' + num.slice(-3) + result
+      num = num.slice(0, num.length - 3)
+    }
+    if (num) {
+      result = num + result
+    }
+    return result
+  }
+
+  //扩展String方法
+  s.prototype.toEnglish = function () {
+    n = this
+    if (!regxinteger.test(parseInt(n))) {
+      return 'Error:Must in digital format'
+    }
+
+    //分割整数和小数(如果有小数的话)
+    var NumList = n.toString().split('.'),
+      zheng = NumtoEnglish.Convert_integer(NumList[0]) //整数部分
+    //如果分割长度是2,说明是小数
+    if (NumList.length == 2) {
+      if (NumList[1].length <= 2) {
+        xiao = NumtoEnglish.Convert_decimal(NumList[1])
+      } else {
+        //如果小数超过2位,不转换,返回原数据
+        return n
+      }
+    }
+    //返回转换结果
+    return zheng + (xiao == '' ? '' : ' point ' + xiao)
+  }
+})(String)

+ 29 - 2
src/utils/util.js

@@ -1,8 +1,9 @@
 import moment from "moment";
 import { post, get } from "@/utils/request";
 import Cookies from "js-cookie";
-import html2canvas from 'html2canvas'
-import JsPDF from 'jspdf'
+import html2canvas from "html2canvas";
+import JsPDF from "jspdf";
+import * as toEnglish from "./ACapital.js";
 
 //根据value值回显字典label值
 export function dictDataEcho(value, arr) {
@@ -192,3 +193,29 @@ export function getPdf(title) {
     });
   }, 1000);
 }
+
+export function currencyPrefix(key) {
+  if (["¥", "¥", "1"].includes(key)) {
+    return "SAY RMB ";
+  } else if (["$", "2"].includes(key)) {
+    return "SAY US DOLLARS ";
+  } else if (["€", "3"].includes(key)) {
+    return "SAY EURO ";
+  } else {
+    return "SAY RMB ";
+  }
+}
+
+export function translateIntoEnglish(money, currencyType) {
+  let text = "";
+  if (money) {
+    text = currencyPrefix(currencyType);
+    if (!/^\d+$/.test(Number(money))) {
+      text = text + parseFloat(money).toFixed(2).toEnglish().toUpperCase();
+    } else {
+      text = text + parseFloat(money).toFixed(2).toEnglish().toUpperCase() + " ONLY";
+    }
+  }
+  text = text.split(" POINT ZERO ZERO ").join("");
+  return text;
+}

+ 1 - 1
src/views/process/processApproval/index.vue

@@ -128,7 +128,7 @@
   </div>
 </template>
 
-<script setup>
+<script setup name='ProcessApproval'>
 import { useRouter, useRoute } from "vue-router";
 //申购发起
 import SendSubscribe from "@/components/process/SendSubscribe";

+ 137 - 0
src/views/salesMange/saleContract/contract/index.vue

@@ -34,6 +34,109 @@
         </template>
       </byTable>
     </div>
+
+    <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="860" v-loading="loadingPrint">
+      <div id="pdfDom" style="width: 800px; padding: 16px; font-size: 12px !important">
+        <div style="font-size: 18px; text-align: center">{{ printDetails.sellCorporationNameEn }}</div>
+        <div style="text-align: center">
+          {{ printDetails.sellCountryName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCityName }},{{ printDetails.sellDetailedAddress }}
+        </div>
+        <div style="font-size: 14px; color: #409eff; text-align: center; padding-top: 16px">PROFORMA INVOICE</div>
+        <div style="padding-top: 8px">
+          <div>PI NO. : {{ printDetails.contractCode }}</div>
+          <div>PI DATE: {{ printDetails.createTimeEn }}</div>
+        </div>
+        <div style="border: 1px solid #999; display: flex">
+          <div style="width: 50%; border-right: 1px solid #999">
+            <div style="color: #409eff">VENDOR:</div>
+            <div>{{ printDetails.sellCorporationNameEn }}</div>
+            <div style="padding: 16px 0">
+              {{ printDetails.sellCountryName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCityName }},{{ printDetails.sellDetailedAddress }}
+            </div>
+            <div>{{ printDetails.sellContactName }},{{ printDetails.sellContactNumber }}</div>
+          </div>
+          <div style="width: 50%">
+            <div style="color: #409eff">BUYER:</div>
+            <div>{{ printDetails.buyCorporationName }}</div>
+            <div style="padding: 16px 0">
+              {{ printDetails.buyCountryName }},{{ printDetails.buyProvinceName }},{{ printDetails.buyCityName }},{{ printDetails.buyDetailedAddress }}
+            </div>
+            <div>{{ printDetails.buyContactName }},{{ printDetails.buyContactNumber }}</div>
+          </div>
+        </div>
+        <div style="height: 16px"></div>
+        <div style="border: 1px solid #999">
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">COUNTRY OF ORIGIN:</div>
+            </div>
+            <div style="width: 34%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">COUNTRY OF DESTINATION:</div>
+            </div>
+            <div style="width: 33%; border-bottom: 1px solid #999">
+              <div style="color: #409eff">PLACE OF DISCHARGE:</div>
+            </div>
+          </div>
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">TERMS OF DELIVERY:</div>
+            </div>
+            <div style="width: 34%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">CURRENCY:</div>
+            </div>
+            <div style="width: 33%; border-bottom: 1px solid #999">
+              <div style="color: #409eff">EXPORT BY/VIA:</div>
+            </div>
+          </div>
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-right: 1px solid #999">
+              <div style="color: #409eff">DELIVERY TIME:</div>
+            </div>
+            <div style="width: 67%">
+              <div style="color: #409eff">TERMS OF PAYMENT:</div>
+            </div>
+          </div>
+        </div>
+        <div style="height: 16px"></div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: 50px; text-align: center">NO.</div>
+          <div class="contentRow" style="width: calc(100% - 450px); text-align: center">COMMODITY, SPECIFICATION</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT</div>
+          <div class="contentRow" style="width: 100px; text-align: center">QUANTITY</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT PRICE</div>
+          <div class="contentRow" style="width: 100px; text-align: center">TOTAL PRICE</div>
+        </div>
+        <div v-if="printDetails.productInfoList && printDetails.productInfoList.length > 0">
+          <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.productInfoList" :key="item.productId">
+            <div class="contentRow" style="width: 50px; text-align: center">{{ index + 1 }}</div>
+            <div class="contentRow" style="width: calc(100% - 450px); text-align: center">{{ item.productName }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.productUnit }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.productQuantity }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.productPrice }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.amount }}</div>
+          </div>
+        </div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: calc(100% - 400px); text-align: center">SUBTOTAL: </div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
+          <div class="contentRow" style="width: 100px; text-align: center">168</div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
+          <div class="contentRow" style="width: 100px; text-align: center">1200</div>
+        </div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: calc(100% - 100px); text-align: right;">FREIGHT COST: </div>
+          <div class="contentRow" style="width: 100px; text-align: center">1200</div>
+        </div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: calc(100% - 100px); text-align: right;">TOTAL PRICE: </div>
+          <div class="contentRow" style="width: 100px; text-align: center">1200</div>
+        </div>
+      </div>
+      <template #footer>
+        <el-button @click="openPrint = false" size="large">取消</el-button>
+        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -237,6 +340,17 @@ const config = computed(() => {
         return [
           {
             attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickPrint(row);
+            },
+          },
+          {
+            attrs: {
               label: "作废",
               type: "primary",
               text: true,
@@ -327,6 +441,19 @@ const newContract = () => {
     },
   });
 };
+const openPrint = ref(true);
+const loadingPrint = ref(false);
+const printDetails = ref({});
+const clickPrint = (row) => {
+  loadingPrint.value = true;
+  openPrint.value = true;
+  proxy.post("/contract/getContractPdfInfo", { id: row.id }).then((res) => {
+    printDetails.value = res;
+  });
+};
+const clickDownload = () => {
+  proxy.getPdf("外销合同PDF文件");
+};
 </script>
 
 <style lang="scss" scoped>
@@ -336,4 +463,14 @@ const newContract = () => {
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid #999;
+  border-left: 1px solid #999;
+}
+.contentRow {
+  border-right: 1px solid #999;
+  line-height: 24px;
+  padding-left: 4px;
+}
 </style>

+ 370 - 0
src/views/system/role2/index - 副本.vue

@@ -0,0 +1,370 @@
+<template>
+	<div class="role">
+        <div class="tree">
+            <treeList
+                :data="treeListData"
+                v-model="sourceList.pagination.tenantId"
+                node-key="id"
+                @change="treeChange"
+            >
+            </treeList>
+        </div>
+		<div class="content">
+			<byTable
+				:source="sourceList.data"
+				:pagination="sourceList.pagination"
+				:config="config"
+				:loading="loading"
+				highlight-current-row
+				:selectConfig="selectConfig"
+				:table-events="{
+					//element talbe事件都能传
+					'select': select,
+				}"
+				:action-list="[
+					{
+						text: '权限配置',
+						plain: true,
+						//type: 'warning',
+						action: () => openRoomModal(),
+						disabled:selection.data.length != 1,
+					},
+					{
+						text: '添加角色',
+						action: () => openModal('add'),
+						disabled:!sourceList.pagination.tenantId
+					},
+				]"
+				@get-list="getList"
+			>
+				<template #slotName="{ item }">
+					{{ item.createTime }}
+				</template>
+			</byTable>
+		</div>
+		<el-dialog
+			:title="modalType == 'add' ? '新增' : '编辑'"
+			v-model="dialogVisible"
+			width="500"
+			v-loading="loading"
+		>
+			<byForm
+				:formConfig="formConfig"
+				:formOption="formOption"
+				v-model="formData.data"
+				:rules="rules"
+				ref="byform"
+			>
+				
+			</byForm>
+			<template #footer>
+				<el-button @click="dialogVisible = false" size="large"
+					>取 消</el-button
+				>
+				<el-button
+					type="primary"
+					@click="submitForm('byform')"
+					size="large"
+					:loading="submitLoading">
+					确 定
+				</el-button>
+			</template>
+		</el-dialog>
+		<el-dialog
+			title="权限配置"
+			v-model="roomDialogVisible"
+			width="500"
+			:before-close="handleClose"
+			v-loading="loading">
+				
+				<el-tree
+					:data="treeData"
+					:show-checkbox="true"
+					v-model="formData.treeData"
+					ref="tree"
+					node-key="id"
+				>
+				</el-tree>
+			<template #footer>
+				<el-button @click="roomDialogVisible = false" size="large"
+					>取 消</el-button
+				>
+				<el-button
+					type="primary"
+					@click="submitTree('byform')"
+					size="large"
+					:loading="submitLoading">
+					确 定
+				</el-button>
+			</template>
+		</el-dialog>
+	</div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from 'element-plus'
+import byTable from '@/components/byTable/index'
+import byForm from '@/components/byForm/index'
+import treeList from '@/components/treeList/index'
+import { computed, defineComponent, ref } from 'vue'
+const loading = ref(false)
+const submitLoading = ref(false)
+const sourceList = ref({
+	data: [],
+	pagination: {
+		total: 3,
+		pageNum: 1,
+		pageSize: 10,
+
+	},
+})
+let dialogVisible = ref(false)
+let roomDialogVisible = ref(false)
+let modalType = ref('add')
+let rules = ref({
+	roleKey: [{ required: true, message: '请输入角色编码', trigger: 'blur' }],
+	roleName: [{ required: true, message: '请输入角色名称', trigger: 'blur' }],
+})
+const { proxy } = getCurrentInstance()
+const selectConfig = computed(() => {
+	return [
+	]
+})
+const config = computed(() => {
+	return [
+        {
+			type: 'selection',
+			attrs: {
+				label: '多选',
+				prop: 'remark',
+			},
+		},
+		{
+			attrs: {
+				label: '角色编码',
+				prop: 'roleKey',
+			},
+		},
+		{
+			attrs: {
+				label: '角色名称',
+				prop: 'roleName',
+				align: 'left',
+			},
+		},
+		{
+			attrs: {
+				label: '创建时间',
+				prop: 'createTime',
+			},
+		},
+		{
+			attrs: {
+				label: '操作',
+				width: '200',
+				align: 'right',
+			},
+			// 渲染 el-button,一般用在最后一列。
+			renderHTML(row) {
+				return [
+					{
+						attrs: {
+							label: '修改',
+							type: 'primary',
+							text: true,
+						},
+						el: 'button',
+						click() {
+							getDtl(row)
+						},
+					},
+					{
+						attrs: {
+							label: '删除',
+							type: 'danger',
+							text: true,
+						},
+						el: 'button',
+						click() {
+							// 弹窗提示是否删除
+							ElMessageBox.confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+								confirmButtonText: '确定',
+								cancelButtonText: '取消',
+								type: 'warning',
+							})
+								.then(() => {
+									// 删除
+									proxy.post('/tenantRole/' + row.roleId, {
+										id: row.roleId,
+									},'delete').then((res) => {
+										ElMessage({
+											message: '删除成功',
+											type: 'success',
+										})
+										getList()
+									})
+								})
+						},
+					},
+				]
+			},
+		},
+	]
+})
+
+let formData = reactive({
+	data:{},
+	treeData:[],
+})
+const formOption = reactive({
+	inline: true,
+	labelWidth: 100,
+	itemWidth: 100,
+	rules: [],
+})
+const byform = ref(null)
+const treeData = ref([])
+const treeListData = ref([])
+const formConfig = computed(() => {
+	return [
+        
+		{
+			type: 'input',
+			prop: 'roleKey',
+			label: '角色编码',
+			required: true,
+			itemWidth: 100,
+			//disabled:true,
+			itemType: 'text',
+		},
+		{
+			type: 'input',
+			prop: 'roleName',
+			label: '角色名称',
+			required: true,
+			itemWidth: 100,
+			//disabled:true,
+			itemType: 'text',
+		},
+	]
+})
+const getTreeList = () => {
+    proxy.post('/tenantInfo/list').then((message) => {
+        message.map((item) => {
+            item.label = item.enterpriseName
+            item.id = item.tenantId
+            item.children = []
+        })
+        treeListData.value = message
+        console.log(treeListData.value)
+    })
+}
+const getList = async (req) => {
+	sourceList.value.pagination = { ...sourceList.value.pagination, ...req }
+	loading.value = true
+	proxy.get('/tenantRole/list',sourceList.value.pagination).then((message) => {
+		console.log(message)
+		sourceList.value.data = message.rows
+		sourceList.value.pagination.total = message.total
+		setTimeout(() => {
+			loading.value = false
+		}, 200)
+	})
+}
+
+const treeChange = ((e) => {
+	console.log(e)
+    sourceList.value.pagination.tenantId = e.id
+    getList({tenantId:e.id})
+})
+
+const openModal = () => {
+	dialogVisible.value = true
+	modalType.value = 'add'
+	formData.data = {
+		tableData:[{num:111,age:222,renyuan:2},{num:111,age:222,renyuan:1}]
+	}
+}
+const TreetenantId = ref('')
+const selection = ref({
+	data:[],
+})
+const select = (_selection, row) => {
+	selection.value.data = _selection
+	console.log(_selection.length)
+}
+const openRoomModal = () => {
+	roomDialogVisible.value = true
+	
+	proxy.get('/tenantRole/roleMenuTreeSelect/' + selection.value.data[0].roleId).then((res) => {
+		if(res.code == 200){
+			treeData.value = res.menus
+			formData.treeData = res.checkedKeys
+			tree.value.setCheckedKeys(res.checkedKeys)
+		}
+	})
+}
+const tree = ref(null)
+const submitTree = () => {
+	proxy.post('/tenantRole', {
+		... selection.value.data[0],
+		menuIds:tree.value.getCheckedKeys(),
+	},'PUT').then((res) => {
+		ElMessage({
+			message: '保存成功',
+			type: 'success',
+		})
+		roomDialogVisible.value = false
+	})
+}
+
+
+
+const submitForm = () => {
+	byform.value.handleSubmit((valid) => {
+		const method = modalType.value == 'add' ? 'POST' : 'PUT'
+		console.log(method)
+		proxy.post(
+				'/tenantRole',
+				{...formData.data,
+					tenantId:sourceList.value.pagination.tenantId,
+					roleSort:1,
+					status:"0"},
+					method
+				).then((res) => {
+			ElMessage({
+				message: modalType.value == 'add' ? '添加成功' : '编辑成功',
+				type: 'success',  
+			})
+			dialogVisible.value = false
+			getList()
+		})
+	})
+}
+
+const getDtl = (row) => {
+	formData.data = {...row}
+	delete formData.data.menuIds
+	console.log(formData.data)
+	modalType.value = 'edit'
+	console.log(modalType.value)
+	dialogVisible.value = true
+}
+getTreeList()
+getList()
+</script>
+  
+<style lang="scss" scoped>
+.role {
+	padding: 20px;
+    display: flex;
+    justify-content: space-between;
+    .tree{
+        width: 300px;
+    }
+    .content{
+        width:calc(100% - 320px);
+    }
+}
+</style>

+ 4 - 4
src/views/systemTenant/tenant/deptTenant/index.vue

@@ -96,19 +96,19 @@ const userList = ref([]);
 const typeList = ref([
   {
     label: "公司",
-    value: "0",
+    value: 0,
   },
   {
     label: "业务中心",
-    value: "1",
+    value: 1,
   },
   {
     label: "部门",
-    value: "2",
+    value: 2,
   },
   {
     label: "组",
-    value: "3",
+    value: 3,
   },
 ]);
 const sourceList = ref({

+ 12 - 4
src/views/systemTenant/tenant/dictTenant/index.vue

@@ -209,7 +209,7 @@ const config = computed(() => {
     },
   ];
 });
-let formData = reactive({
+const formData = reactive({
   data: {},
 });
 const formOption = reactive({
@@ -226,11 +226,14 @@ const formConfig = computed(() => {
       prop: "code",
       label: "字典编码",
       required: true,
+      disabled: formData.data.id,
+      maxlength:"50"
     },
     {
       type: "input",
       prop: "name",
       label: "字典名称",
+      maxlength:"50"
     },
     {
       label: "启用状态",
@@ -239,11 +242,11 @@ const formConfig = computed(() => {
       data: [
         {
           label: "禁用",
-          value: "0",
+          value: 0,
         },
         {
           label: "启用",
-          value: "1",
+          value: 1,
         },
       ],
     },
@@ -300,9 +303,14 @@ const getDept = () => {
   });
 };
 const getDtl = (row) => {
-  formData.data = { ...row };
   modalType.value = "edit";
   dialogVisible.value = true;
+  setTimeout(() => {
+    formData.data = row;
+    if (!formData.data.status) {
+      formData.data.status = 0;
+    }
+  }, 200);
 };
 getDept();
 getList();

+ 15 - 2
src/views/systemTenant/tenant/userTenant/index.vue

@@ -134,6 +134,7 @@ const config = computed(() => {
             el: "button",
             click() {
               userId.value = row.userId;
+              password.value = ''
               roomDialogVisible.value = true;
             },
           },
@@ -316,7 +317,10 @@ const openModal = () => {
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     const method = modalType.value == "add" ? "POST" : "PUT";
-    proxy.post("/tenantUser", formData.data, method).then((res) => {
+    proxy.post("/tenantUser", formData.data, method).then(() => {
+      if (formData.data.password && formData.data.userId) {
+        proxy.post("/tenantUser/resetPwd", { password: formData.data.password, userId: formData.data.userId }, "PUT").then();
+      }
       ElMessage({
         message: modalType.value == "add" ? "添加成功" : "编辑成功",
         type: "success",
@@ -334,7 +338,16 @@ const getDtl = (row) => {
 const newPassword = () => {
   formData.data.password = generatePassword();
 };
-const userId = ref('')
+const generatePassword = () => {
+  var length = 12,
+    charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
+    password = "";
+  for (var i = 0, n = charset.length; i < length; ++i) {
+    password += charset.charAt(Math.floor(Math.random() * n));
+  }
+  return password;
+};
+const userId = ref("");
 const password = ref("");
 const roomDialogVisible = ref(false);
 const submitPassword = (password1) => {