瀏覽代碼

Merge branch '长阳分支中职' of http://8.141.155.183:3000/bjquanjiang/DigitalScholl into 长阳分支中职

长阳分支中职
ndbs 1 周之前
父節點
當前提交
9f5bf127c2
共有 4 個文件被更改,包括 66 次插入44 次删除
  1. +2
    -2
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js
  2. +1
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/organize-picker.vue
  3. +7
    -7
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/list.vue
  4. +56
    -35
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/single.vue

+ 2
- 2
Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js 查看文件

@@ -390,8 +390,8 @@ export default {
verify() { verify() {
return { return {
NotNull: t => t.length > 0 || '不能为空', NotNull: t => t.length > 0 || '不能为空',
Num: t => !isNaN(t) || '须输入数值',
NumOrNull: t => t.length <= 0 || !isNaN(t) || '须留空或输入数值',
Num: t => (t||t===0)&&!isNaN(t) || '须输入数值',
NumOrNull: t => !t || !isNaN(t) || '须留空或输入数值',
Email: t => /^[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_]+.[a-zA-Z0-9]+$/.test(t) || '须符合Email格式', Email: t => /^[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_]+.[a-zA-Z0-9]+$/.test(t) || '须符合Email格式',
EmailOrNull: t => t.length <= 0 || /^[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_]+.[a-zA-Z0-9]+$/.test(t) || EmailOrNull: t => t.length <= 0 || /^[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_]+.[a-zA-Z0-9]+$/.test(t) ||
'须留空或符合Email格式', '须留空或符合Email格式',


+ 1
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/organize-picker.vue 查看文件

@@ -42,6 +42,7 @@ export default {
this.ONCE('select-organize', data => { this.ONCE('select-organize', data => {
this.$emit('input', data.id||data.map(t=>t.id).toString()) this.$emit('input', data.id||data.map(t=>t.id).toString())
this.$emit('change', data.id||data.map(t=>t.id).toString()) this.$emit('change', data.id||data.map(t=>t.id).toString())
this.$emit('dataChange', data)
}) })


const rootType = this.rootType || { user: 'department', department: 'company', company: 'company' }[this.type] const rootType = this.rootType || { user: 'department', department: 'company', company: 'company' }[this.type]


+ 7
- 7
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/list.vue 查看文件

@@ -13,7 +13,7 @@


<view class="customlist-item-field"> <view class="customlist-item-field">
<text class="customlist-item-field-title">使用管理人:</text> <text class="customlist-item-field-title">使用管理人:</text>
{{ displayListItem(item, 'JZGNo') }}
{{ displayListItem(item, 'UserId') }}
</view> </view>


<view class="customlist-item-field"> <view class="customlist-item-field">
@@ -157,7 +157,7 @@
return { return {
// 数据项的数据类型、结构 // 数据项的数据类型、结构
scheme: { scheme: {
JZGNo: {
UserId: {
type: 'select' type: 'select'
}, },
Department: { Department: {
@@ -204,7 +204,7 @@


// 数据源 // 数据源
dataSource: { dataSource: {
JZGNo: [],
UserId: [],
Department: [], Department: [],
Types: Object.values(this.GET_GLOBAL('dataDictionary').AssType).map(t => ({ Types: Object.values(this.GET_GLOBAL('dataDictionary').AssType).map(t => ({
value: t.value, value: t.value,
@@ -247,9 +247,9 @@
// 拉取加载列表和数据源 // 拉取加载列表和数据源
await Promise.all([ await Promise.all([
this.FETCH_DATASOURCE('teacheruserdata').then(result => { this.FETCH_DATASOURCE('teacheruserdata').then(result => {
this.dataSource.JZGNo = result.data.map(t => ({
this.dataSource.UserId = result.data.map(t => ({
text: t.f_realname, text: t.f_realname,
value: t.f_encode,
value: t.f_userid,
f_encode: t.f_encode, f_encode: t.f_encode,
f_userid: t.f_userid, f_userid: t.f_userid,
})); }));
@@ -333,9 +333,9 @@


// 姓名格式化 // 姓名格式化
if (this.searchData.Name_) { if (this.searchData.Name_) {
let arr = this.dataSource.JZGNo
let arr = this.dataSource.UserId
let obj = arr.find(e => e.f_userid == this.queryData.Name_) let obj = arr.find(e => e.f_userid == this.queryData.Name_)
this.searchData.JZGNo = obj ? obj.text : ''
this.searchData.UserId = obj ? obj.text : ''
} }


await this.refreshList(false) await this.refreshList(false)


+ 56
- 35
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/single.vue 查看文件

@@ -1,37 +1,36 @@
<template> <template>
<view class="page"> <view class="page">
<view v-if="ready"> <view v-if="ready">
<!-- <l-select @input="setValue('OfficeEquipment.Name', $event)" :value="getValue('OfficeEquipment.Name')"
:range="dataSource.OfficeEquipment.Name" title="姓名" required /> -->
<l-organize-picker @input="setValue('OfficeEquipment.Name', $event)"
:value="getValue('OfficeEquipment.Name')" type="user" title="使用管理人" required :readonly="!edit" />
<!-- <l-select @input="setValue('OfficeEquipment.UserId', $event)" :value="getValue('OfficeEquipment.UserId')"
:range="dataSource.OfficeEquipment.UserId" title="姓名" required /> -->
<l-organize-picker @input="setValue('OfficeEquipment.UserId', $event)" @dataChange="dataChange"
:value="getValue('OfficeEquipment.UserId')" type="user" title="使用管理人" required :readonly="!edit" />
<l-organize-picker @input="setValue('OfficeEquipment.Department', $event)" <l-organize-picker @input="setValue('OfficeEquipment.Department', $event)"
:value="getValue('OfficeEquipment.Department')" type="department" title="部门" required :value="getValue('OfficeEquipment.Department')" type="department" title="部门" required
:readonly="!edit" />
readonly />
<!-- <l-select @input="setValue('OfficeEquipment.Department', $event)" <!-- <l-select @input="setValue('OfficeEquipment.Department', $event)"
:value="getValue('OfficeEquipment.Department')" :range="dataSource.OfficeEquipment.Department" :value="getValue('OfficeEquipment.Department')" :range="dataSource.OfficeEquipment.Department"
title="部门" required /> --> title="部门" required /> -->
<l-input @input="setValue('OfficeEquipment.DeviceName', $event)"
:value="getValue('OfficeEquipment.DeviceName')" :disabled="!edit" title="资产名称" required />
<l-input @input="setValue('OfficeEquipment.Code', $event)" :value="getValue('OfficeEquipment.Code')" <l-input @input="setValue('OfficeEquipment.Code', $event)" :value="getValue('OfficeEquipment.Code')"
:disabled="!edit" title="资产编号" required /> :disabled="!edit" title="资产编号" required />
<l-organize-picker @input="setValue('OfficeEquipment.Types', $event)"
:value="getValue('OfficeEquipment.Types')" type="Types" title="资产类别" required
:readonly="!edit" />
<l-input @input="setValue('OfficeEquipment.Brand', $event)"
:value="getValue('OfficeEquipment.Brand')" title="品牌" required />
<l-input @input="setValue('OfficeEquipment.Model', $event)"
:value="getValue('OfficeEquipment.Model')" title="型号" required />
<l-input @input="setValue('OfficeEquipment.Argument', $event)"
:value="getValue('OfficeEquipment.Argument')" title="参数" required />
<l-input @input="setValue('OfficeEquipment.Unit', $event)"
:value="getValue('OfficeEquipment.Unit')" title="单位" required />
<l-input @input="setValue('OfficeEquipment.DeviceName', $event)"
:value="getValue('OfficeEquipment.DeviceName')" :disabled="!edit" title="资产名称" required />
<l-select @input="setValue('OfficeEquipment.Types', $event)" :disabled="!edit"
required :value="getValue('OfficeEquipment.Types')" :range="dataSource.OfficeEquipment.Types" title="资产类别" />
<l-input @input="setValue('OfficeEquipment.Brand', $event)" :disabled="!edit"
:value="getValue('OfficeEquipment.Brand')" title="品牌" />
<l-input @input="setValue('OfficeEquipment.Model', $event)" :disabled="!edit"
:value="getValue('OfficeEquipment.Model')" title="型号" />
<l-input @input="setValue('OfficeEquipment.Argument', $event)" :disabled="!edit"
:value="getValue('OfficeEquipment.Argument')" title="参数" />
<l-select @input="setValue('OfficeEquipment.Unit', $event)" :disabled="!edit"
:value="getValue('OfficeEquipment.Unit')" title="单位" required :range="dataSource.OfficeEquipment.Unit" />
<l-input @input="setValue('OfficeEquipment.Nuantity', $event)" <l-input @input="setValue('OfficeEquipment.Nuantity', $event)"
:value="getValue('OfficeEquipment.Nuantity')" title="数量" required />
<l-select @input="setValue('OfficeEquipment.Status', $event)"
:value="getValue('OfficeEquipment.Status')" title="使用状态" />
:value="getValue('OfficeEquipment.Nuantity')" title="数量" required :disabled="!edit" />
<l-select @input="setValue('OfficeEquipment.Status', $event)" :disabled="!edit"
:value="getValue('OfficeEquipment.Status')" title="使用状态" :range="dataSource.OfficeEquipment.Status" />
<l-textarea @input="setValue('OfficeEquipment.Remark', $event)" :value="getValue('OfficeEquipment.Remark')" <l-textarea @input="setValue('OfficeEquipment.Remark', $event)" :value="getValue('OfficeEquipment.Remark')"
:readonly="!edit" title="备注" />
:readonly="!edit" title="备注" :disabled="!edit"/>
</view> </view>
<view v-if="ready && current.OfficeEquipment && mode!='view'" class="bg-white margin-tb padding" <view v-if="ready && current.OfficeEquipment && mode!='view'" class="bg-white margin-tb padding"
style="padding-top: 0; overflow: hidden;"> style="padding-top: 0; overflow: hidden;">
@@ -84,11 +83,15 @@
// 表单项数据结构 // 表单项数据结构
scheme: { scheme: {
OfficeEquipment: { OfficeEquipment: {
Name: {
type: 'select',
UserId: {
type: 'text',
title: '使用管理人', title: '使用管理人',
verify: "NotNull" verify: "NotNull"
}, },
Name: {
type: 'text',
title: '使用管理人',
},
Department: { Department: {
type: 'select', type: 'select',
title: '部门', title: '部门',
@@ -129,7 +132,7 @@
Nuantity: { Nuantity: {
type: 'text', type: 'text',
title: '数量', title: '数量',
verify: "NotNull"
verify: "Num"
}, },
Remark: { Remark: {
type: 'text', type: 'text',
@@ -144,8 +147,20 @@
// 数据源 // 数据源
dataSource: { dataSource: {
OfficeEquipment: { OfficeEquipment: {
Name: [],
JZGNo: [],
Department: [], Department: [],
Types: Object.values(this.GET_GLOBAL('dataDictionary').AssType).map(t => ({
value: t.value,
text: t.text
})),
Status: Object.values(this.GET_GLOBAL('dataDictionary').AssState).map(t => ({
value: t.value,
text: t.text
})),
Unit: Object.values(this.GET_GLOBAL('dataDictionary').sldw).map(t => ({
value: t.value,
text: t.text
})),
}, },


} }
@@ -170,7 +185,7 @@
// 拉取表单数据,同时拉取所有来自数据源的选单数据 // 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([ await Promise.all([
this.FETCH_DATASOURCE('teacheruserdata').then(result => { this.FETCH_DATASOURCE('teacheruserdata').then(result => {
this.dataSource.OfficeEquipment.Name = result.data.map(t => ({
this.dataSource.OfficeEquipment.UserId = result.data.map(t => ({
text: t.f_realname, text: t.f_realname,
value: t.f_encode, value: t.f_encode,
f_encode: t.f_encode, f_encode: t.f_encode,
@@ -196,16 +211,16 @@
if (this.mode === 'create') { if (this.mode === 'create') {
this.origin = await this.getDefaultForm() this.origin = await this.getDefaultForm()
// let userInfo = this.GET_GLOBAL('loginUser'); // let userInfo = this.GET_GLOBAL('loginUser');
// this.origin.OfficeEquipment.Name = userInfo.enCode
// this.origin.OfficeEquipment.UserId = userInfo.enCode
// this.origin.OfficeEquipment.Department = userInfo.departmentId // this.origin.OfficeEquipment.Department = userInfo.departmentId
} else { } else {
const result = await this.HTTP_GET('/Learun/adms/EducationalAdministration/officeEquipment/form', const result = await this.HTTP_GET('/Learun/adms/EducationalAdministration/officeEquipment/form',
this.id) this.id)
this.origin = await this.formatFormData(result) this.origin = await this.formatFormData(result)


let arr = this.dataSource.OfficeEquipment.Name
let obj = arr.find(e => e.f_encode == this.origin.OfficeEquipment.Name)
this.origin.OfficeEquipment.Name = obj ? obj.f_userid : this.origin.OfficeEquipment.Name
// let arr = this.dataSource.OfficeEquipment.UserId
// let obj = arr.find(e => e.f_encode == this.origin.OfficeEquipment.UserId)
// this.origin.OfficeEquipment.UserId = obj ? obj.f_userid : this.origin.OfficeEquipment.UserId


} }
this.current = this.COPY(this.origin) this.current = this.COPY(this.origin)
@@ -238,11 +253,12 @@
const postData = await this.getPostData(this.id) const postData = await this.getPostData(this.id)
let strEntity = JSON.parse(postData.strEntity) let strEntity = JSON.parse(postData.strEntity)


let arr = this.dataSource.OfficeEquipment.Name
let obj = arr.find(e => e.f_userid == strEntity.Name)
strEntity.Name = obj ? obj.f_encode : strEntity.Name
// let arr = this.dataSource.OfficeEquipment.UserId
// let obj = arr.find(e => e.f_userid == strEntity.UserId)
// strEntity.UserId = obj ? obj.f_encode : strEntity.UserId


postData.strEntity = JSON.stringify(strEntity)
// postData.strEntity = JSON.stringify(strEntity)
// return
this.HTTP_POST('/Learun/adms/EducationalAdministration/OfficeEquipment/save', postData, '提交失败') this.HTTP_POST('/Learun/adms/EducationalAdministration/OfficeEquipment/save', postData, '提交失败')
.then(success => { .then(success => {
this.HIDE_LOADING() this.HIDE_LOADING()
@@ -280,6 +296,11 @@
break break
} }
}, },
dataChange(data){
this.setValue('OfficeEquipment.Department', data.departmentId)
this.setValue('OfficeEquipment.Name', data.name)
},


// 获取表单值 // 获取表单值
getValue(path) { getValue(path) {


Loading…
取消
儲存