Browse Source

Merge branch 'dev_web' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_web

dev_web_online
陈薪名 2 years ago
parent
commit
8e64864eeb
  1. 15
      fe/PC/README.md
  2. 14
      fe/PC/src/components/currenForm/index.vue
  3. 12
      fe/PC/src/components/currenTable/index.vue
  4. 12
      fe/PC/src/components/umyTable/index.vue
  5. 44
      fe/PC/src/utils/index.js
  6. 23
      fe/PC/src/utils/tableColumns/index.js
  7. 20
      fe/PC/src/utils/tabsDesTions/index.js
  8. 4
      fe/PC/src/views/basicData/CustomerManage/Customer.vue

15
fe/PC/README.md

@ -107,8 +107,19 @@ active 步骤控制
pageStatus 结合active控制返回结果
[字段设置:rowDrop]
@radio="rowDrop" 数据更新方法
:tableColumns="tableColumns" 表头数据
:visible="visible" 是否显示
@closeRowDrop="closeRowDrop" 关闭方法
@closeRowDrop="closeRowDrop" 关闭方法
[表单组件补充:currenForm]
validType type仅等于input时:实时keyUp校验,类型如下:
1、number:正整数,
2、pointNumber:数字+带小数点(只能输入一个小数点, 小数点后方保留位数见<pointNumberFixed>),
3、numberLetter: 数字+字母,
4、letter:纯字母,
5、letterCn:字母+中文
pointNumberFixed 组合上方validType值仅等于pointNumber时:
小数点后方保留位数,如不填写默认为100位
<validType>+<pointNumberFixed>示例:
{ type:"input", label:"金额", prop:"money", validType:'pointNumber',pointNumberFixed:2},

14
fe/PC/src/components/currenForm/index.vue

@ -23,11 +23,12 @@
v-if="!hide ? true : false"
>
<!-- 输入框 onkeyup: 正则表达式用于前端输入校验工作-->
<!-- :onkeyup="item.onkeyup" -->
<el-input
v-if="item.type === 'input'"
v-model="searchData[item.prop]"
:maxlength="item.maxlength"
:onkeyup="item.onkeyup"
:onkeyup="itemOnKeyUp(item,searchData[item.prop])"
clearable
:disabled="Boolean(item.disabled)"
:placeholder="item.placeholder || '请输入' + item.label"
@ -422,6 +423,7 @@ import currenUpload from "@/components/currenUpload";
import currenUploadList from "@/components/currenUploadList";
import currenUploadPictureCard from "@/components/currenUploadPictureCard";
import filterSelect from "@/components/filterSelect"
import { getMatchRegConformValue } from "@/utils/index"
export default {
name: "currenForm",
components: {
@ -574,6 +576,16 @@ export default {
})
},
methods: {
// type=input
itemOnKeyUp(item,value){
if(item.onkeyup){
return item.onkeyup()
}else{
if(value && item.validType){
this.searchData[item.prop]=getMatchRegConformValue(item.validType,value,item.pointNumberFixed)
}
}
},
// inputonkeyup
typeNumberOnkeyup(item,value){
if(value){

12
fe/PC/src/components/currenTable/index.vue

@ -36,6 +36,7 @@
<el-form>
<el-form-item
v-if="item.type == 'input'"
:onkeyup="itemOnKeyUp(item,searchData[item.prop])"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
@ -307,6 +308,7 @@
<script>
import Sortable from "sortablejs";
import { parseTime, debounce } from "@/utils/index";
import { getMatchRegConformValue } from "@/utils/index"
import _ from "lodash";
export default {
name: "currenTable",
@ -434,6 +436,16 @@ export default {
// })
},
methods: {
// type=input
itemOnKeyUp(item,value){
if(item.onkeyup){
return item.onkeyup()
}else{
if(value && item.validType){
this.searchData[item.prop]=getMatchRegConformValue(item.validType,value,item.pointNumberFixed)
}
}
},
// inputonkeyup
typeNumberOnkeyup(item,value){
if(value){

12
fe/PC/src/components/umyTable/index.vue

@ -41,6 +41,7 @@
<el-form>
<el-form-item
v-if="item.type == 'input'"
:onkeyup="itemOnKeyUp(item,searchData[item.prop])"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
@ -321,6 +322,7 @@
<script>
import { parseTime } from "@/utils/index";
import _ from "lodash";
import { getMatchRegConformValue } from "@/utils/index"
export default {
name: "currenTable",
filters: {
@ -493,6 +495,16 @@ export default {
}
return _re
},
// type=input
itemOnKeyUp(item,value){
if(item.onkeyup){
return item.onkeyup()
}else{
if(value && item.validType){
this.searchData[item.prop]=getMatchRegConformValue(item.validType,value,item.pointNumberFixed)
}
}
},
// inputonkeyup
typeNumberOnkeyup(item,value){
if(value){

44
fe/PC/src/utils/index.js

@ -447,6 +447,48 @@ export function getImgsDetailPopData(row,sucess,faild) {
return imgsrcList
}
// 匹配正则返回值
/** README.md[:currenForm]
* @param {*} type 需要匹配的正则类型
* @param {*} value 当前传入值即需要校验值
* @param {*} fixedNum 如果type为pointNumber需要保留小数点后的位数
* @returns
*/
export function getMatchRegConformValue(type,value,fixedNum){
let _conformValue = ""
switch(type){
// 正整数
case "number":
_conformValue=value.replace(/[^\d]/g,'');
break;
// 数字+带小数点,只能输入一个小数点
case "pointNumber":
//小数点后保留位数
let _fixed = fixedNum ? Number(fixedNum) : 100
let reg = new RegExp(`\\d+\\.?\\d{0,${_fixed}}`);
let _match = String(value).match(reg)
_conformValue = _match ? _match[0] : _match
break;
// 数字+字母
case "numberLetter":
_conformValue=value.replace(/[\W]/g,'');
break;
// 字母
case "letter":
_conformValue=value.replace(/[^a-zA-Z]/g,'');
break;
// 字母+中文
case "letterCn":
_conformValue=value.replace(/[\d]/g,'');
break;
}
return _conformValue
}
// 字典格式化数据结构
export function dictFormatData() {
return new Promise(resolve => {
@ -496,3 +538,5 @@ export function dictFormatData() {
// })
// })
// }

23
fe/PC/src/utils/tableColumns/index.js

@ -96,7 +96,7 @@ export const ItemCategory = [
// fixed: "right"
// },
]
// 物品包装信息
// 物品包装信息 20230328
export const ItemPack = [
{
label: "包装代码",
@ -107,11 +107,17 @@ export const ItemPack = [
{ label: "包装名称", prop: "packName" },
{ label: '包装类型', prop: "packType" },
{ label: '物料代码', prop: "itemCode" },
{ label: "是否标准包装", prop: 'isStdPack', type: "filter", filters: "whetherOrNot" },
{ label: '标包编号', prop: "stdPackCode" },
{ label: "包装数量", prop: "packQty", showProp: true },
{ label: "物料单位", prop: "packUom", showProp: true },
{ label: "转换率", prop: "conversionRate" },
// { label: "是否标准包装", prop: 'isStdPack', type: "filter", filters: "whetherOrNot" },
// { label: '标包编号', prop: "stdPackCode" },
// { label: "包装数量", prop: "packQty" },
// { label: "物料单位", prop: "packUom" },
// { label: "转换率", prop: "conversionRate" },
// -----------------------------------------------------------------------
{ label: '包装计量单位', prop: "basicUom" },
{ label: '包装数量', prop: "qty" },
{ label: "备注", prop: "remark" },
{ label: "创建时间", prop: "creationTime", type:'dateTime' },
{ label: "上次修改时间", prop: "lastModificationTime", type:'dateTime' },
// {
// label: "操作",
// type:"buttonOperation",
@ -120,7 +126,7 @@ export const ItemPack = [
// fixed: "right"
// },
]
// 物料质检标准信息
// 物料质检标准信息 20230328
export const AQL = [
{
//label: "物料代码",
@ -137,6 +143,9 @@ export const AQL = [
{ label: "抽检百分比", prop: 'samplePercent' },
{ label: "抽检数量", prop: 'sampleQty' },
{ label: "备注", prop: "remark" },
// -----------------------------------------------------------------------
{ label: "创建时间", prop: "creationTime", type:'dateTime' },
{ label: "上次修改时间", prop: "lastModificationTime", type:'dateTime' },
// {
// label: "操作",
// type:"buttonOperation",

20
fe/PC/src/utils/tabsDesTions/index.js

@ -74,16 +74,18 @@ export const ItemCategory = [
// { label: "公司", prop: 'company' },
// -----------------------------------------------------------------------
]
// 物品包装信息 20221212
// 物品包装信息 20230328
export const ItemPack = [
{ label: "包装代码", prop: 'packCode' },
{ label: "包装名称", prop: "packName" },
{ label: '物料代码', prop: "itemCode" },
{ label: "是否标准包装", prop: 'isStdPack', type: "filter", filters: "whetherOrNot" },
{ label: '标包编号', prop: "stdPackCode" },
{ label: "包装数量", prop: "packQty" },
{ label: "物料单位", prop: "packUom" },
{ label: "转换率", prop: "conversionRate" },
{ label: '包装计量单位', prop: "basicUom" },
{ label: '包装数量', prop: "qty" },
// { label: "是否标准包装", prop: 'isStdPack', type: "filter", filters: "whetherOrNot" },
// { label: '标包编号', prop: "stdPackCode" },
// { label: "包装数量", prop: "packQty" },
// { label: "物料单位", prop: "packUom" },
// { label: "转换率", prop: "conversionRate" },
{ label: "备注", prop: 'remark', colSpan: 12 },
// -----------------------------------------------------------------------
{ label: "事务代码", prop: "tenantId" },
@ -93,10 +95,10 @@ export const ItemPack = [
{ label: "上次修改时间", prop: "lastModificationTime", type:'dateTime' },
{ label: "上次修改者Id", prop: "lastModifierId" },
{ label: "id", prop: 'id' },
{ label: "公司", prop: 'company' },
// { label: "公司", prop: 'company' },
// -----------------------------------------------------------------------
]
// 物料质检标准信息 20221212
// 物料质检标准信息 20230328
export const AQL = [
{ label: "物料代码", prop: "itemCode" },
{ label: "供应商代码", prop: "supplierCode" },
@ -114,7 +116,7 @@ export const AQL = [
{ label: "上次修改时间", prop: "lastModificationTime", type:'dateTime' },
{ label: "上次修改者Id", prop: "lastModifierId" },
{ label: "id", prop: 'id' },
{ label: "公司", prop: 'company' },
// { label: "公司", prop: 'company' },
// -----------------------------------------------------------------------
]
// 物料清单信息 20230328

4
fe/PC/src/views/basicData/CustomerManage/Customer.vue

@ -150,7 +150,7 @@ export default {
{ type: "input", label: "城市", prop: "city", colSpan: 12 },
{ type: "input", label: "地址", prop: "address", colSpan: 12 },
{ type: "input", label: "联系人", prop: "contacts", colSpan: 12 },
{ type: "input", label: "电话", prop: "phone", colSpan: 12 },
{ type: "input", label: "电话", prop: "phone", colSpan: 12, validType:'number', maxlength:11},
{ type: "input", label: "传真", prop: "fax", colSpan: 12 },
{ type: "input", label: "邮编", prop: "postID", colSpan: 12 },
{ type: "input", label: "货币", prop: "currency", colSpan: 12 },
@ -165,7 +165,7 @@ export default {
{ type: "input", label: "城市", prop: "city", colSpan: 12 },
{ type: "input", label: "地址", prop: "address", colSpan: 12 },
{ type: "input", label: "联系人", prop: "contacts", colSpan: 12 },
{ type: "input", label: "电话", prop: "phone", colSpan: 12 },
{ type: "input", label: "电话", prop: "phone", colSpan: 12, validType:'number', maxlength:11 },
{ type: "input", label: "传真", prop: "fax", colSpan: 12 },
{ type: "input", label: "邮编", prop: "postID", colSpan: 12 },
{ type: "input", label: "货币", prop: "currency", colSpan: 12 },

Loading…
Cancel
Save