给文本框增加回车跳转下一个的事件
This commit is contained in:
@@ -685,3 +685,28 @@ export function handleIntroJs(module, cur_version) {
|
||||
Vue.ls.set('intro_cache_' + module, cur_version, 100 * 24 * 60 * 60 * 1000);
|
||||
}).start()
|
||||
}
|
||||
|
||||
/**
|
||||
* 回车后自动跳到下一个input
|
||||
*/
|
||||
export function autoJumpNextInput(domInfo) {
|
||||
let domIndex = 0
|
||||
let inputs = document.getElementById(domInfo).getElementsByTagName('input')
|
||||
inputs[domIndex].focus()
|
||||
document.getElementById(domInfo).addEventListener('keydown',function(e){
|
||||
if(e.keyCode === 13){
|
||||
domIndex++
|
||||
if(domIndex === inputs.length) {
|
||||
domIndex = 0
|
||||
}
|
||||
inputs[domIndex].focus()
|
||||
}
|
||||
})
|
||||
for(let i=0; i<inputs.length; i++){
|
||||
//这个index就是做个介质,来获取当前的i是第几个
|
||||
inputs[i].index = i;
|
||||
inputs[i].onclick = function () {
|
||||
domIndex = this.index
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
<j-editable-table id="purchaseInModal"
|
||||
:ref="refKeys[0]"
|
||||
:loading="materialTable.loading"
|
||||
:columns="materialTable.columns"
|
||||
@@ -178,7 +178,7 @@
|
||||
import { FormTypes } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
import { BillModalMixin } from '../mixins/BillModalMixin'
|
||||
import { getMpListShort, changeListFmtMinus,handleIntroJs } from "@/utils/util"
|
||||
import { getMpListShort, changeListFmtMinus,handleIntroJs,autoJumpNextInput } from "@/utils/util"
|
||||
import { getAction } from '@/api/manage'
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
@@ -324,6 +324,9 @@
|
||||
let url = this.readOnly ? this.url.detailList : this.url.detailList;
|
||||
this.requestSubTableData(url, params, this.materialTable);
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
autoJumpNextInput('purchaseInModal')
|
||||
})
|
||||
//复制新增单据-初始化单号和日期
|
||||
if(this.action === 'copyAdd') {
|
||||
this.model.id = ''
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<a-form :form="form">
|
||||
<a-tabs default-active-key="1">
|
||||
<a-tab-pane key="1" tab="基本信息" forceRender>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-row class="form-row" :gutter="24" id="materialHeadModal">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称" data-step="1" data-title="名称" data-intro="名称必填,可以重复">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'name', validatorRules.name]"/>
|
||||
@@ -167,7 +167,7 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
<div style="margin-top:8px;">
|
||||
<div style="margin-top:8px;" id="materialDetailModal">
|
||||
<j-editable-table
|
||||
ref="editableMeTable"
|
||||
:loading="meTable.loading"
|
||||
@@ -262,7 +262,7 @@
|
||||
import JEditableTable from '@/components/jeecg/JEditableTable'
|
||||
import { FormTypes, VALIDATE_NO_PASSED, getRefPromise, validateFormAndTables } from '@/utils/JEditableTableUtil'
|
||||
import {queryMaterialCategoryTreeList,checkMaterial,checkMaterialBarCode,getAllMaterialAttribute,getMaxBarCode} from '@/api/api'
|
||||
import { handleIntroJs } from "@/utils/util"
|
||||
import { handleIntroJs,autoJumpNextInput } from "@/utils/util"
|
||||
import { httpAction, getAction } from '@/api/manage'
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
@@ -433,6 +433,8 @@
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'name', 'standard', 'unit', 'unitId', 'model', 'color',
|
||||
'categoryId','enableSerialNumber','enableBatchNumber','expiryNum','safetyStock','remark','mfrs','otherField1','otherField2','otherField3'))
|
||||
autoJumpNextInput('materialHeadModal')
|
||||
autoJumpNextInput('materialDetailModal')
|
||||
});
|
||||
this.initMaterialAttribute()
|
||||
// 加载子表数据
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="accountModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
@@ -38,6 +38,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addAccount,editAccount,checkAccount } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "AccountModal",
|
||||
data () {
|
||||
@@ -84,6 +85,7 @@
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'serialNo', 'initialAmount', 'currentAmount', 'remark'))
|
||||
autoJumpNextInput('accountModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="customerModal">
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'supplier', validatorRules.supplier]" />
|
||||
@@ -93,6 +93,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addSupplier,editSupplier,checkSupplier } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "CustomerModal",
|
||||
data () {
|
||||
@@ -136,6 +137,7 @@
|
||||
this.form.setFieldsValue(pick(this.model,'supplier', 'contacts', 'telephone', 'email', 'telephone',
|
||||
'phoneNum', 'fax', 'beginNeedGet', 'beginNeedPay', 'allNeedGet', 'allNeedPay', 'taxNum', 'taxRate',
|
||||
'bankName', 'accountNumber', 'address', 'description'))
|
||||
autoJumpNextInput('customerModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="depotModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库名称">
|
||||
<a-input placeholder="请输入仓库名称" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
@@ -48,6 +48,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addDepot,editDepot,checkDepot,getUserList } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "DepotModal",
|
||||
data () {
|
||||
@@ -91,6 +92,7 @@
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,
|
||||
'name', 'address', 'warehousing', 'truckage', 'principal', 'sort', 'remark'))
|
||||
autoJumpNextInput('depotModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="functionModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
|
||||
<a-input placeholder="请输入编号" v-decorator.trim="[ 'number', validatorRules.number]" />
|
||||
</a-form-item>
|
||||
@@ -50,6 +50,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addFunction,editFunction,checkFunction } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
export default {
|
||||
name: "FunctionModal",
|
||||
@@ -123,6 +124,7 @@
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'number', 'name', 'parentNumber', 'url', 'component', 'sort', 'pushBtn', 'icon', 'enabled'))
|
||||
autoJumpNextInput('functionModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="inOutItemModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
@@ -35,6 +35,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addInOutItem,editInOutItem,checkInOutItem } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "InOutItemModal",
|
||||
data () {
|
||||
@@ -80,6 +81,7 @@
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'type', 'remark'))
|
||||
autoJumpNextInput('inOutItemModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="memberModal">
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'supplier', validatorRules.supplier]" />
|
||||
@@ -53,6 +53,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addSupplier,editSupplier,checkSupplier } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "MemberModal",
|
||||
data () {
|
||||
@@ -95,6 +96,7 @@
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'supplier', 'contacts', 'telephone', 'email', 'telephone',
|
||||
'phoneNum', 'description'))
|
||||
autoJumpNextInput('memberModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
cancelText="关闭">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="organizationModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator="['orgAbr', validatorRules.orgAbr ]"/>
|
||||
</a-form-item>
|
||||
@@ -38,6 +38,7 @@
|
||||
<script>
|
||||
import { httpAction } from '@/api/manage'
|
||||
import { queryOrganizationTreeList, checkOrganization } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
import pick from 'lodash.pick'
|
||||
import ATextarea from 'ant-design-vue/es/input/TextArea'
|
||||
export default {
|
||||
@@ -107,6 +108,7 @@
|
||||
this.loadTreeData();
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(record, 'orgAbr', 'orgNo', 'parentId', 'sort', 'remark'))
|
||||
autoJumpNextInput('organizationModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
style="top:20px;"
|
||||
>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="passwordModal">
|
||||
|
||||
<a-form-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入用户账号" v-decorator="[ 'username', {}]" :readOnly="true"/>
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
<script>
|
||||
import {changePassword} from '@/api/api'
|
||||
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "PasswordModal",
|
||||
data () {
|
||||
@@ -82,6 +82,7 @@
|
||||
this.model.username = username;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({username:username});
|
||||
autoJumpNextInput('passwordModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="personModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="姓名">
|
||||
<a-input placeholder="请输入姓名" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
@@ -33,6 +33,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addPerson,editPerson,checkPerson } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "PersonModal",
|
||||
data () {
|
||||
@@ -78,6 +79,7 @@
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'type', 'description'))
|
||||
autoJumpNextInput('personModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="roleModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="角色名称">
|
||||
<a-input placeholder="请输入角色名称" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
@@ -36,6 +36,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addRole,editRole,checkRole } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "RoleModal",
|
||||
data () {
|
||||
@@ -87,6 +88,7 @@
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'type', 'description'))
|
||||
autoJumpNextInput('roleModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="systemConfigModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司名称">
|
||||
<a-input placeholder="请输入公司名称" v-decorator.trim="[ 'companyName', validatorRules.companyName]" />
|
||||
</a-form-item>
|
||||
@@ -53,6 +53,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addSystemConfig,editSystemConfig,checkSystemConfig } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "SystemConfigModal",
|
||||
data () {
|
||||
@@ -110,6 +111,7 @@
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'companyName', 'companyContacts', 'companyAddress',
|
||||
'companyTel', 'companyFax', 'companyPostCode', 'depotFlag', 'customerFlag', 'minusStockFlag'))
|
||||
autoJumpNextInput('systemConfigModal')
|
||||
});
|
||||
if(record.id) {
|
||||
if (record.depotFlag != null) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="unitModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="基本单位">
|
||||
<a-input placeholder="请输入基本单位(小单位)" v-decorator.trim="[ 'basicUnit', validatorRules.basicUnit]" />
|
||||
</a-form-item>
|
||||
@@ -36,6 +36,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addUnit,editUnit,checkUnit } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "UnitModal",
|
||||
data () {
|
||||
@@ -85,6 +86,7 @@
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'basicUnit','otherUnit','ratio'))
|
||||
autoJumpNextInput('unitModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="userModal">
|
||||
<a-form-item label="登录名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入登录名称" v-decorator.trim="[ 'loginName', validatorRules.loginName]" :readOnly="!!model.id"
|
||||
suffix="初始密码:123456" />
|
||||
@@ -64,6 +64,7 @@
|
||||
import {addUser,editUser,queryOrganizationTreeList,roleAllList} from '@/api/api'
|
||||
import { disabledAuthFilter } from "@/utils/authFilter"
|
||||
import {duplicateCheck } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
import JImageUpload from '../../../components/jeecg/JImageUpload'
|
||||
export default {
|
||||
name: "UserModal",
|
||||
@@ -133,6 +134,7 @@
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'loginName','username','roleId','orgaId','position',
|
||||
'phonenum','email','userBlngOrgaDsplSeq','description'))
|
||||
autoJumpNextInput('userModal')
|
||||
});
|
||||
},
|
||||
close() {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form :form="form" id="vendorModal">
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'supplier', validatorRules.supplier]" />
|
||||
@@ -93,6 +93,7 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addSupplier,editSupplier,checkSupplier } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "VendorModal",
|
||||
data () {
|
||||
@@ -136,6 +137,7 @@
|
||||
this.form.setFieldsValue(pick(this.model,'supplier', 'contacts', 'telephone', 'email', 'telephone',
|
||||
'phoneNum', 'fax', 'beginNeedGet', 'beginNeedPay', 'allNeedGet', 'allNeedPay', 'taxNum', 'taxRate',
|
||||
'bankName', 'accountNumber', 'address', 'description'))
|
||||
autoJumpNextInput('vendorModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
|
||||
Reference in New Issue
Block a user