陈龙 3 mesi fa
parent
commit
57d7a522b7

+ 6 - 3
src/Auman.PieceWage.UniApp/components/easy-combobox-option/easy-combobox-option.vue

@@ -14,17 +14,21 @@
             },
             text: {
                 type: String
+            },
+            checked: {
+                type: Boolean,
+                default: false
             }
         },
         data() {
             return {
-                selected: false
+                selected: true
             };
         },
         created() {
+            this.selected = this.checked;
             root = this.getParent();
             root.addOption(this);
-            console.log('document:', document);
         },
         methods: {
             select() {
@@ -36,7 +40,6 @@
             },
 
             clickOption() {
-                this.select();
                 root.select(this);
             },
 

+ 1038 - 0
src/Auman.PieceWage.UniApp/components/easy-combobox/base.extend.js

@@ -0,0 +1,1038 @@
+/**
+ * 扩展
+ */
+const extend = {
+    /**
+     * 添加存储
+     * @param {string} key 
+     * @param {object} value 
+     * @returns 
+     */
+    addStorage(key, value) {
+        let res = false;
+        if (this.isEmptyString(key) || this.isNull(value)) {
+            return res;
+        }
+        if (this.isObject(value)) {
+            value = JSON.stringify(value);
+        }
+        uni.setStorageSync(key, value);
+        res = true;
+        return res;
+    },
+
+    /**
+     * 创建 GUID
+     * @returns 
+     */
+    createGUID() {
+        let date = new Date().getTime();
+        let guid = 'xxxxxxxx-xxxx-zxxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+            let random = (date + Math.random() * 16) % 16 | 0;
+            date = Math.floor(date / 16);
+            return (c == 'x' ? random : (random & 0x3 | 0x8)).toString(16);
+        });
+        guid = guid.replace('z', (parseInt(Math.random() * 16)).toString(16));
+        return guid;
+    },
+
+    /**
+     * 日期格式化
+     * @param {Date} date 被格式化日期类,必选
+     * @param {string} key 格式字符串,可选,默认 yyyy-MM-dd HH:mm:ss.ms
+     */
+    dateFormatter(date, format) {
+        if (this.isDate(date)) {
+            var hours = date.getHours();
+            format = this.isNonEmptyString(format) ? format : 'yyyy-MM-dd HH:mm:ss.ms';
+            format = format.replace(/yyyy|YYYY/, date.getFullYear().toString());
+            format = format.replace(/yy|YY/, this.padLeft(date.getYear() % 100, 2, '0'));
+            format = format.replace(/MM/, this.padLeft(date.getMonth() + 1, 2, '0'));
+            format = format.replace(/M/g, (date.getMonth() + 1).toString());
+            format = format.replace(/dd|DD/, this.padLeft(date.getDate(), 2, '0'));
+            format = format.replace(/d|D/g, date.getDate().toString());
+            format = format.replace(/HH/g, this.padLeft(hours, 2, '0'));
+            format = format.replace(/hh/g, hours >= 12 ? '下午' + this.padLeft(hours - 12, 2, '0') : '上午' + this
+                .padLeft(
+                    hours,
+                    2, '0'));
+            format = format.replace(/H/g, hours);
+            format = format.replace(/h/g, hours >= 12 ? '下午' + (hours - 12).toString() : '上午' + hours.toString());
+            format = format.replace(/mm/g, this.padLeft(date.getMinutes(), 2, '0'));
+            format = format.replace(/m/g, date.getMinutes().toString());
+            format = format.replace(/ss/g, this.padLeft(date.getSeconds(), 2, '0'));
+            format = format.replace(/s/g, date.getSeconds().toString());
+            format = format.replace(/ms/g, date.getMilliseconds().toString());
+            return format;
+        } else if (this.isNonEmptyString(date)) {
+            return this.dateFormatter(this.dateParse(date), format);
+        } else {
+            return '';
+        }
+    },
+
+    /**
+     * 日期字符串转换成日期对象
+     * @param {string} date 被转换字符串,必选
+     */
+    dateParse(date) {
+        let newDate = null;
+        if (this.isNumber(date)) {
+            if (date.toString().length === 10) {
+                date *= 1000;
+            }
+            date = 'Date(' + date + ')';
+        }
+        if (this.isNonEmptyString(date)) {
+            if (date.indexOf('Date') > 0) {
+                date = "new " + date.replace(/\//g, '');
+            }
+            date = date.replace(/-/g, '/');
+            date = date.replace(/T/g, ' ');
+            if (date.indexOf('Date') >= 0) {
+                newDate = this.eval(date);
+            } else {
+                let ms = 0;
+                let msIndex = value.indexOf('.');
+                if (msIndex > -1) {
+                    ms = parseInt(value.substring(msIndex + 1));
+                    value = value.substring(0, msIndex);
+                }
+                newDate = new Date(value);
+                if (!isNaN(ms)) {
+                    newDate.setMilliseconds(ms);
+                }
+            }
+        }
+        return newDate;
+    },
+
+    /**
+     * 删除结尾换行符
+     * @param {string} str 要处理的字符串
+     */
+    deleteEndLineFeed(str) {
+        let res = '';
+        if (this.isNonEmptyString(str)) {
+            let crIndex = str.lastIndexOf('\r');
+            let lfIndex = str.lastIndexOf('\n');
+            let crlfIndex = str.lastIndexOf('\r\n');
+            let index = crlfIndex >= 0 ? crlfIndex : crIndex >= 0 ? crIndex : lfIndex > 0 ? lfIndex : -1;
+            if (index > 0) {
+                res = str.substring(0, index);
+            } else {
+                res = str;
+            }
+        }
+        return res;
+    },
+
+    /**
+     * 将对象编码成url字符串
+     * @param {object} param 被编码对象,必选
+     * @param {string} url 被编码url,可选
+     */
+    encodeUrl(param, url) {
+        let result = '';
+        if (this.isObject(param)) {
+            result = Parse(param);
+            if (!this.isNonEmptyString(result)) {
+                return url;
+            } else if (this.isNonEmptyString(url)) {
+                if (url.indexOf('?') >= 0) {
+                    result = url + '&' + result;
+                } else {
+                    result = url + '?' + result;
+                }
+            }
+        } else {
+            return this.isNonEmptyString(url) ? url : result;
+        }
+        return result;
+
+        /**
+         * 转换方法
+         * @param {object} value 
+         */
+        function Parse(value, perfix) {
+            let result = '';
+            perfix = extend.isNonEmptyString(perfix) ? perfix : '';
+            if (typeof value !== 'object') {
+                return result += perfix + '=' + value;
+            }
+            let data = extend.toFormObject(value);
+            let count = 0;
+            for (let n in data) {
+                if (count === 0) {
+                    result += n + '=' + data[n];
+                } else {
+                    result += '&' + n + '=' + data[n];
+                }
+                count++;
+            }
+            return result;
+        }
+    },
+
+    /**
+     * 返回格式化后的报错内容
+     * @param {any} ex 要格式化的对象
+     */
+    errorFormatter(ex) {
+        let result = {
+            status: null,
+            success: false,
+            message: ''
+        };
+        if (typeof ex === 'string') {
+            result.message = ex;
+        } else if (typeof ex === 'object') {
+            if (this.isNonEmptyString(ex.data) && ex.data.indexOf('{') === 0) {
+                ex.data = JSON.parse(ex.data);
+                if (this.isNonEmptyString(ex.data.ExceptionMessage)) {
+                    ex.message = ex.data.ExceptionMessage;
+                } else if (this.isNonEmptyString(ex.data.Message)) {
+                    ex.message = ex.data.Message;
+                } else if (this.isNonEmptyString(ex.data.error_description)) {
+                    ex.message = ex.data.error_description;
+                }
+            }
+            if (this.isNonEmptyString(ex.stack)) {
+                result.message = ex.stack;
+            } else if (this.isNonEmptyString(ex.responseText)) {
+                result.message = ex.responseText;
+            } else if (this.isNonEmptyString(ex.statusText)) {
+                result.message = ex.statusText;
+            } else if (this.isNonEmptyString(ex.errMsg)) {
+                result.message = ex.errMsg;
+            } else if (this.isNonEmptyString(ex.msg)) {
+                result.message = ex.msg;
+            } else if (this.isNonEmptyString(ex.message)) {
+                result.message = ex.message;
+            } else if (this.isNonEmptyString(ex.Message)) {
+                result.message = ex.Message;
+            } else if (this.isNonEmptyString(ex.title)) {
+                result.message = ex.title;
+            } else if (this.isNonEmptyString(ex.error_description)) {
+                result.message = ex.error_description;
+            } else if (this.isNonEmptyString(ex.data)) {
+                result.message = ex.data;
+            } else if (this.isObject(ex.data)) {
+                if (this.isNonEmptyString(ex.data.error)) {
+                    result.message = ex.data.error;
+                }
+            } else if (this.isNonEmptyString(ex.errMsg)) {
+                result.message = ex.errMsg;
+            }
+        }
+        var statusMessage = {
+            0: '网络连接失败,请检查本地网络设置。',
+            400: '请求无效。',
+            401: '未授权。',
+            403: '禁止访问。',
+            404: '访问地址不存在。',
+            405: '不允许此方法。',
+            406: '不可接受。',
+            407: '需要代理身份验证。',
+            412: '前提条件失败。',
+            414: 'Request-URI 太长',
+            415: '不支持的媒体类型。',
+            500: '内部服务器错误。',
+            502: '网关错误。',
+            600: '不可解析的响应标头。',
+        };
+        if (this.isNumber(ex.statusCode)) {
+            result.status = ex.statusCode;
+        } else if (this.isNumber(ex.status)) {
+            result.status = ex.status;
+        }
+
+        if (result.status !== null && result.status !== 200 && (!this.isNonEmptyString(result.message) || result
+                .message === 'error') ||
+            result.message === 'request:ok') {
+            result.message = result.status.toString() + ' ' + (statusMessage[result.status] || '');
+        }
+        if (result.message === 'invalid_username_or_password') {
+            result.message = this.lang.errorUsernameOrPassword;
+        }
+        return result;
+    },
+
+    /**
+     * eval
+     * @param {string} str 
+     * @returns 
+     */
+    eval(str) {
+        let res = null;
+        try {
+            if (this.isJsonString(str)) {
+                res = JSON.parse(str);
+            } else if (this.isNumberString(str)) {
+                res = parseFloat(str);
+            } else {
+                res = str;
+            }
+            if (this.isNonEmptyString(str) && this.isNull(res)) {
+                res = str;
+            }
+        } catch (ex) {
+            res = str;
+        }
+        return res;
+    },
+
+    /**
+     * 获取字符长度
+     * @param {string} value 
+     */
+    getUTF8Length(value) {
+        let length = 0;
+        let code = 0;
+        if (this.isNonEmptyString(value)) {
+            for (let i = 0; i < value.length; i++) {
+                code = value[i].charCodeAt();
+                if (code < 128) {
+                    length++;
+                } else if (code >= 128 && code <= 2047) {
+                    length += 2;
+                } else if (code >= 2047 && code <= 65535) {
+                    length += 3;
+                } else {
+                    length += 4;
+                }
+            }
+        }
+        return length;
+    },
+
+    /**
+     * 获取窗口高度
+     */
+    getWindowHeight() {
+        let height = uni.getWindowInfo().windowHeight;
+        return height;
+    },
+
+    /**
+     * 是否为空
+     * @param {any} value 
+     * @returns 
+     */
+    isNull(value) {
+        return value === null || value === undefined;
+    },
+
+    /**
+     * 是否是字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isString(str) {
+        return typeof str === 'string';
+    },
+
+    /**
+     * 是否是空字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isEmptyString(str) {
+        return !this.isNonEmptyString(str);
+    },
+
+    /**
+     * 是否是非空字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isNonEmptyString(str) {
+        return this.isString(str) && str.length > 0;
+    },
+
+    /**
+     * 是否是数字
+     * @param {number} num
+     * @returns
+     */
+    isNumber(num) {
+        return typeof num === 'number' && !isNaN(num);
+    },
+
+    /**
+     * 是否是数字字符串
+     * @param {string} str 
+     * @returns {Boolean}
+     */
+    isNumberString(str) {
+        let res = this.parseFloat(str);
+        return !isNaN(res);
+    },
+
+    /**
+     * 是否是布尔值
+     * @param {boolean} bool
+     * @returns
+     */
+    isBool(bool) {
+        return typeof bool === 'boolean';
+    },
+
+    /**
+     * 是否是对象
+     * @param {object} obj 
+     * @returns 
+     */
+    isObject(obj) {
+        return !this.isNull(obj) && typeof obj === 'object';
+    },
+
+    /**
+     * 是否是日期对象
+     * @param {Date} date 
+     * @returns 
+     */
+    isDate(date) {
+        return this.isObject(date) && date instanceof Date && !isNaN(date.getTime());
+    },
+
+    /**
+     * 是否是日期字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isDateString(str) {
+        return !/Invalid|NaN/.test(new Date(value).toString());
+    },
+
+    /**
+     * 是否是 ISO 日期字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isISODateString(str) {
+        return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])this/.test(value);
+    },
+
+    /**
+     * 是否是正则表达式
+     * @param {RegExp} reg 
+     * @returns 
+     */
+    isRegExp(reg) {
+        return this.isObject(reg) && reg instanceof RegExp;
+    },
+
+    /**
+     * 是否是数组
+     * @param {Array} arr 
+     * @returns 
+     */
+    isArray(arr) {
+        // #ifdef APP
+        return this.isLikeArray(arr);
+        // #endif
+
+        return this.isObject(arr) && arr instanceof Array;
+    },
+
+    /**
+     * 是否是类数组
+     * @param {object} arr 
+     * @returns 
+     */
+    isLikeArray(arr) {
+        return this.isObject(arr) && arr !== window && this.isNumber(arr.length) && (arr.length > 0 && !this.isNull(
+            arr[
+                arr.length - 1]) || arr.length === 0);
+    },
+
+    /**
+     * 是否是数组字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isArrayString(str) {
+        return this.isString(str) && str.length > 1 && str.substring(0, 1) === '[' && str.substring(str.length -
+                1) ===
+            ']';
+    },
+
+    /**
+     * 是否是方法
+     * @param {Function} value 
+     * @returns 
+     */
+    isFunction(value) {
+        return typeof value === 'function';
+    },
+
+    /**
+     * 是否是 HTML 字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isHTML(str) {
+        return this.isString(str) && str.length >= 3 && str.charAt(0) === '<' && str.charAt(str.length - 1) === '>';
+    },
+
+    /**
+     * 是否是 XML 字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isXML(str) {
+        return this.isHTML(str) && (str.indexOf('<?xml') === 0 || str.indexOf('<!DOCTYPE') === 0);
+    },
+
+    /**
+     * 是否是 Json 字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isJsonString(str) {
+        return this.isString(str) && str.length > 1 && str.substring(0, 1) === '{' && str.substring(str.length -
+                1) ===
+            '}';
+    },
+
+    /**
+     * 是否是邮箱
+     * @param {string} str 
+     * @returns 
+     */
+    isEmail(str) {
+        return /^[a-zA-Z0-9.!#this%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*this/
+            .test(value);
+    },
+
+    /**
+     * 是否是手机号
+     * @param {string} str 
+     * @returns 
+     */
+    isPhone(str) {
+        return /^1(3|4|5|7|8|9)\d{9}this/.test(value);
+    },
+
+    /**
+     * 是否是身份证
+     * @param {string} str 
+     * @returns 
+     */
+    isIDCard(str) {
+        return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{4}this/.test(value);
+    },
+
+    /**
+     * 是否是密码
+     * @param {string} value 
+     * @param {number} min 
+     * @param {number} max 
+     * @returns 
+     */
+    isPassword(value, min, max) {
+        value = value === undefined ? '' : value;
+        min = this.isNumber(min) ? min : 1;
+        max = this.isNumber(max) ? max : 256;
+        var regexp = '/^([a-z]|[A-Z]|[0-9]|[_-]){' + min + ',' + max + '}this/';
+        return regexp.test(value);
+    },
+
+    /**
+     * 是否是 URL
+     * @param {string} url 被验证的字符串
+     * @returns {boolean} 验证结果
+     */
+    isUrl(url) {
+        if (this.isNonEmptyString(url)) {
+            let key = '://';
+            if (url.indexOf(key) > 0 && url.indexOf(key) < 10) {
+                return true;
+            }
+        }
+        return false;
+    },
+
+    /**
+     * 验证特殊字符,或者验证指定的字符 key
+     * @param {string | number} value 被验证的字符串,必选
+     * @param {string} key 验证关键字,必选
+     */
+    isSpecialChars(value, key) {
+        var msg = '';
+        value = this.isNonEmptyString(value) ? value : '';
+        key = this.isNonEmptyString(key) ? key : '';
+        for (var i = 0; i < value.length; ++i) {
+            var code = value[i].charCodeAt();
+            if (code < 32 || (code > 8399 && code < 12288) || (code > 12350 && code < 19968) || (code > 40907 &&
+                    code <
+                    65280) || code > 65519) {
+                msg += msg.length > 0 ? ',' : '';
+                msg += value[i];
+            } else {
+                for (var j = 0; j < key.length; ++j) {
+                    if (value[i] === key[j]) {
+                        msg += msg.length > 0 ? ',' : '';
+                        msg += value[i];
+                    }
+                }
+            }
+        }
+        return msg.length === 0 ? false : msg;
+    },
+
+    /**
+     * 判断是否是Map对象
+     * @param {Map} map Map对象
+     */
+    isMap(map) {
+        return this.isObject(map) && map instanceof Map;
+    },
+
+    /**
+     * Map对象键转数组。
+     * @param {Map} map Map对象
+     * @returns 
+     */
+    mapKeysToArray(map) {
+        let arr = [];
+        if (this.isMap(map)) {
+            for (let [name, value] of map) {
+                arr.push(name);
+            }
+        }
+        return arr;
+    },
+
+    /**
+     * Map对象值转数组。
+     * @param {Map} map Map对象
+     * @returns 
+     */
+    mapValuesToArray(map) {
+        let arr = [];
+        if (this.isMap(map)) {
+            for (let [name, value] of map) {
+                console.log(name, value);
+                arr.push(value);
+            }
+        }
+        return arr;
+    },
+
+    /**
+     * 字符串前缀拼接
+     * @param {string | number} value 要拼接的值
+     * @param {number} length 补位字符
+     * @param {string} prefix 拼接长度, 默认值 0
+     * value 值的长度 length 不够时, 将以前缀 prefix 填充, 比如: 001
+     * @returns {string}
+     */
+    padLeft(value, length, prefix) {
+        if (this.isNumber(value)) {
+            value = value.toString();
+        }
+        if (!this.isNonEmptyString(value)) {
+            value = '';
+        }
+        if (!this.isNumber(length) || value.length > length) {
+            length = value.length;
+        }
+        if (!this.isNonEmptyString(prefix)) {
+            prefix = '0';
+        }
+        return (Array(length).join(prefix) + (value.length === 0 ? prefix : value)).slice(-length);
+    },
+
+    /**
+     * 字符串后缀拼接
+     * @param {string | number} value 要拼接的值
+     * @param {number} length 补位字符
+     * @param {string} prefix 拼接长度, 默认值 0
+     * value 值的长度 length 不够时, 将以前缀 prefix 填充, 比如: 001
+     * @returns {string}
+     */
+    padRight(value, length, prefix) {
+        if (this.isNumber(value)) {
+            value = value.toString();
+        }
+        if (!this.isNonEmptyString(value)) {
+            value = '';
+        }
+        if (!this.isNumber(length) || value.length > length) {
+            length = value.length;
+        }
+        if (!this.isNonEmptyString(prefix)) {
+            prefix = '0';
+        }
+        return ((value.length === 0 ? prefix : value) + Array(length).join(prefix)).slice(0, length);
+    },
+
+    /**
+     * 转换成金额字符串
+     * @param {number} amount 金额
+     * @param {number} pointlength 保留小数位数, 默认 14,最大 14
+     * @returns {string} 金额字符串
+     */
+    parseAmount(amount, pointlength) {
+        if (!this.isNumber(amount)) {
+            amount = 0;
+        }
+        if (!this.isNumber(pointlength) || pointlength > 14) {
+            pointlength = 14;
+        }
+        if (pointlength > 0) {
+            amount = this.floatRound(amount, pointlength);
+        } else {
+            amount = Math.round(amount);
+        }
+        let text = amount.toString();
+        let temp = '';
+        let end = '';
+        let sign = '';
+        if (text.substring(0, 1) === '-') {
+            sign = '-';
+            text = text.substring(1);
+        }
+        // 格式化整数部分
+        if (text.indexOf('.') > 0) {
+            text = text.substring(0, text.indexOf('.'));
+        }
+        for (var i = 0; i < text.length; ++i) {
+            temp = text.substring(text.length - 1);
+            text = text.substring(0, text.length - 1);
+            if (temp.length > 0) {
+                if ((i + 1) % 3 === 0 && text.length > 0) {
+                    end = ',' + temp + end;
+                } else end = temp + end;
+            } else {
+                break;
+            }
+        }
+
+        // 格式化小数部分
+        text = amount.toString();
+        if (text.indexOf('.') > 0) {
+            text = text.substring(text.indexOf('.') + 1);
+        } else {
+            text = '';
+        }
+        if (text.length < pointlength) {
+            text = this.padRight(text, pointlength, '0');
+        }
+        end += `.${text}`;
+        return sign + end;
+    },
+
+    /**
+     * 转换成中文大写金额字符串
+     * @param {number} amount 金额
+     * @param {number} pointlength 保留小数位数, 默认 13
+     * @returns {string} 中文大写金额字符串
+     */
+    parseCNAmount(amount, pointlength) {
+        if (!this.isNumber(amount)) {
+            amount = 0;
+        }
+        if (!this.isNumber(pointlength) || pointlength > 13) {
+            pointlength = 13;
+        }
+        if (pointlength > 0) {
+            amount = this.floatRound(amount, pointlength);
+        } else {
+            amount = Math.round(amount);
+        }
+
+        let amountString = amount.toString();
+
+        // 定义中文数字集合
+        let assemble1 = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
+
+        // 定义小数中文集合
+        let assemble2 = ["角", "分", "厘", "毫", "丝", "忽", "微", "纤", "沙", "尘", "埃", "渺", "漠"];
+
+        // 定义拾佰仟集合
+        let assemble3 = ["", "拾", "佰", "仟"];
+
+        // 定义万以后的中文集合
+        let assemble4 = ["圆", "万", "亿", "兆", "京", "垓", "秭", "穰", "沟", "涧", "正", "载", "极", "归", "僧", "那", "思", "猴",
+            "格"
+        ];
+
+        // 定义整数字符串
+        let integerString = amountString.indexOf('.') > 0 ? amountString.substring(0, amountString.indexOf('.')) :
+            amountString;
+
+        // 定义小数字符串
+        let decimalString = amountString.indexOf('.') > 0 ? amountString.substring(amountString.indexOf('.') + 1) :
+            '';
+
+        // 定义转换后的文本
+        let text = '';
+
+        // 定义当前位是否是零
+        let currentIsZore = true;
+
+        // 定义上一位是否是零
+        let beforeIsZore = false;
+
+        // 定义位数
+        let index = 0;
+
+        // 格式化整数
+        // 算法:‘个拾佰仟’+‘阶位’
+        for (let i = integerString.length - 1; i >= 0; i--) {
+            // 判断当前位是否是0
+            currentIsZore = integerString[i] === '0';
+
+            // 计算阶位
+            let bitLevel = Math.floor((integerString.length - 1 - i) / 4);
+
+            // 如果第一位是0,则设置上一位是0
+            if (index === 0 && currentIsZore) {
+                beforeIsZore = true;
+            }
+
+            // 如果当前是第0位,则加大阶位
+            if (index === 0) {
+                text = assemble4[bitLevel] + text;
+            }
+
+            // 位当前为0
+            if (currentIsZore) {
+                // 前一位不是0,则加零
+                if (!beforeIsZore) {
+                    text = assemble1[integerString[i]] + text;
+                }
+            }
+
+            // 当前位不为0
+            else {
+                text = assemble1[integerString[i]] + assemble3[index] + text;
+            }
+
+            // 位数加1
+            index++;
+            index = index > 3 ? 0 : index;
+
+            // 设置上一位是否是0
+            beforeIsZore = currentIsZore;
+        }
+
+        // 格式化小数
+        for (let j = 0; j < decimalString.length; ++j) {
+            text += assemble1[decimalString[j]] + assemble2[j];
+        }
+
+        return text;
+    },
+
+    /**
+     * 转换浮点数
+     * @param {string | number} value 值
+     * @returns {number}
+     */
+    parseFloat(value) {
+        let res = NaN;
+        let temp = '';
+        if (this.isNumber(value)) {
+            return value;
+        } else if (this.isString(value)) {
+            temp = value;
+            if (temp.indexOf(',') >= 0) {
+                temp = value.replaceAll(',', '');
+            }
+            res = parseFloat(temp);
+        }
+        return res;
+    },
+
+    /**
+     * 日期字符串转换成日期对象
+     * @param {string} date 被转换字符串,必选
+     * @returns {Date} 日期对象
+     */
+    parseDate(date) {
+        let newDate = null;
+        if (this.isNumber(date)) {
+            if (date.toString().length === 10) {
+                date *= 1000;
+            }
+            date = 'Date(' + date + ')';
+        }
+        if (this.isNonEmptyString(date)) {
+            if (date.indexOf('Date') > 0) {
+                date = "new " + date.replace(/\//g, '');
+            }
+            date = date.replace(/-/g, '/');
+            date = date.replace(/T/g, ' ');
+            if (date.indexOf('Date') >= 0) {
+                newDate = eval(date);
+            } else {
+                let ms = 0;
+                let msIndex = date.indexOf('.');
+                if (msIndex > -1) {
+                    ms = parseInt(date.substring(msIndex + 1));
+                    date = date.substring(0, msIndex);
+                }
+                newDate = new Date(date);
+                if (!isNaN(ms)) {
+                    newDate.setMilliseconds(ms);
+                }
+            }
+        }
+        return newDate;
+    },
+
+    /**
+     * 转换浮点数
+     * @param {string | number} value 值
+     * @returns {number}
+     */
+    parseInt(value) {
+        return this.parseFloat(value);
+    },
+
+    /**
+     * 读取存储
+     * @param {string} key 
+     * @returns 
+     */
+    readStorage(key) {
+        let res = null;
+        if (this.isNonEmptyString(key)) {
+            let data = uni.getStorageSync(key);
+            if (this.isJsonString(data)) {
+                res = JSON.parse(data);
+            } else if (this.isNumberString(data)) {
+                res = parseFloat(data) || '';
+            } else if (this.isNumber(data) || this.isBool(data) || this.isNonEmptyString(data)) {
+                res = data;
+            }
+        }
+        return res;
+    },
+
+    /**
+     * 删除存储
+     * @param {string} key 
+     * @returns 
+     */
+    removeStorage(key) {
+        let res = false;
+        if (this.isNonEmptyString(key)) {
+            uni.removeStorageSync(key);
+            res = true;
+        }
+        return res;
+    },
+
+    /**
+     * 截取末尾字符串
+     * @param {string} str 被截取字符串
+     * @param {number} length 截取长度
+     */
+    subEndString(str, length) {
+        let res = '';
+        if (this.isString(str)) {
+            if (!this.isNumber(length)) {
+                length = str.length;
+            }
+            res = str.substring(str.length - length, str.length);
+        }
+        return res;
+    },
+
+    /**
+     * 截取开头字符串
+     * @param {string} str 被截取字符串
+     * @param {number} length 截取长度
+     */
+    subStartString(str, length) {
+        let res = '';
+        if (this.isString(str)) {
+            if (!this.isNumber(length)) {
+                length = str.length;
+            }
+            res = str.substring(0, length);
+        }
+        return res;
+    },
+
+    /**
+     * 转换成 Form 键值对
+     * @param {object} value 
+     * @param {string} name 
+     * @returns 
+     */
+    toFormObject(value, name) {
+        let res = {};
+        let cres = null;
+        let isEmpty = true;
+        if (!this.isObject(value)) {
+            return value;
+        }
+        if (this.isNull(name)) {
+            name = '';
+        }
+
+        if (this.isLikeArray(value)) {
+            for (let i in value) {
+                isEmpty = false;
+                cres = this.toFormObject(value[i], name + '[' + i + ']');
+                if (this.isObject(cres)) {
+                    for (let m in cres) {
+                        res[m] = cres[m];
+                    }
+                } else if (!this.isNull(cres)) {
+                    res[name + '[' + i + ']'] = cres;
+                }
+            }
+            if (isEmpty && this.isNonEmptyString(name)) {
+                res[name] = [];
+            }
+        } else {
+            for (let n in value) {
+                isEmpty = false;
+                cres = this.toFormObject(value[n], this.isEmptyString(name) ? n : name + '.' + n);
+                if (this.isObject(cres)) {
+                    for (let o in cres) {
+                        res[o] = cres[o];
+                    }
+                } else if (!this.isNull(cres)) {
+                    res[this.isEmptyString(name) ? n : name + '.' + n] = cres;
+                }
+            }
+            if (isEmpty && this.isNonEmptyString(name)) {
+                res[name] = {};
+            }
+        }
+        return res;
+    },
+
+    /**
+     * 将url参数解码成对象
+     * @param {string} url 统一资源定位符
+     */
+    urlToObject(url) {
+        var result = null;
+        if (this.isNonEmptyString(url)) {
+            url = decodeURI(url);
+            var arr = null;
+            var temp = url.substring(url.indexOf('?'));
+            if (temp.indexOf('?') >= 0) {
+                temp = temp.substring(1);
+                arr = temp.split('&');
+                result = {};
+                for (var i = 0; i < arr.length; i++) {
+                    temp = arr[i].split('=');
+                    result[temp[0]] = temp[1];
+                }
+            }
+        }
+        return result;
+    }
+}
+
+export default extend;

+ 50 - 11
src/Auman.PieceWage.UniApp/components/easy-combobox/easy-combobox.vue

@@ -1,17 +1,17 @@
 <template>
     <view class="easy-combobox" :style="`width:${comboboxWidth}`">
-        <view class="easy-combobox-view">
+        <view class="easy-combobox-view" @tap="clickView">
             <view class="easy-combobox-view-text">{{text}}</view>
             <uni-icons type="down" size="12"></uni-icons>
         </view>
-        <view class="easy-combobox-panel">
+        <view :class="`easy-combobox-panel${isShowPanel?' easy-combobox-show':''}`">
             <slot></slot>
         </view>
     </view>
 </template>
 
 <script>
-    import extend from '../../utils/extend';
+    import base from './base.extend.js';
 
     let options = [];
     let current = -1;
@@ -24,34 +24,39 @@
                 default: 0
             },
             width: {
-                type: Number
+                type: Number || String,
+                default: '160'
             }
         },
         data() {
             return {
                 comboboxWidth: '120upx',
-                text: ''
+                text: '',
+                isShowPanel: false
             };
         },
         created() {
             options = [];
             current = this.selected;
-            if (extend.isNumber(this.width) || extend.isNumberString(this.width)) {
+            if (base.isNumber(this.width) || base.isNumberString(this.width)) {
                 this.comboboxWidth = `${this.width}upx`;
-            } else if (extend.isNonEmptyString(this.width) && extend.isNumber(parseFloat(this.width))) {
+            } else if (base.isNonEmptyString(this.width) && base.isNumber(parseFloat(this.width))) {
                 this.comboboxWidth = this.width;
             }
         },
         mounted() {
             if (current < options.length && current >= 0) {
                 options[current].select();
-                this.select(current);
+                this.change(current);
             }
         },
         methods: {
             addOption(option) {
-                if (extend.isObject(option)) {
+                if (base.isObject(option)) {
                     options.push(option);
+                    if (option.checked) {
+                        this.change(option);
+                    }
                 }
             },
 
@@ -60,6 +65,17 @@
              * @param {number|object} option 选项,option 数组下标或者 option 组件本身
              */
             select(option) {
+                this.change(option);
+                this.isShowPanel = false;
+                let opt = options[current].getOption();
+                this.$emit('change', opt);
+            },
+
+            /**
+             * 改变
+             * @param {number|object} option 选项,option 数组下标或者 option 组件本身
+             */
+            change(option) {
                 let i = 0;
 
                 if (typeof option === 'number') {
@@ -77,11 +93,26 @@
                         options[current].select();
                         let opt = options[current].getOption();
                         this.text = opt.text;
-                        this.$emit('change', opt);
                     } else {
                         options[i].unselect();
                     }
                 }
+            },
+
+            clickView() {
+                this.isShowPanel = !this.isShowPanel;
+            },
+
+            getOption() {
+                return options[current];
+            },
+
+            getValue() {
+                return options[current].value;
+            },
+
+            getText() {
+                return options[current].text;
             }
         }
     }
@@ -93,6 +124,7 @@
         box-sizing: border-box;
         display: inline-block;
         height: 70upx;
+        flex-shrink: 0;
 
         .easy-combobox-view {
             position: relative;
@@ -106,12 +138,15 @@
             border-radius: 10upx;
             padding: 10upx;
         }
-        
+
         .easy-combobox-view-text {
+            display: flex;
             font-size: 24upx;
+            flex-grow: 1;
         }
 
         .easy-combobox-panel {
+            display: none;
             position: absolute;
             box-sizing: border-box;
             left: 0;
@@ -122,5 +157,9 @@
             box-shadow: 0 0 20upx #999999;
             border-radius: 10upx;
         }
+
+        .easy-combobox-show {
+            display: block;
+        }
     }
 </style>

+ 23 - 7
src/Auman.PieceWage.UniApp/components/easy-tab-item/easy-tab-item.vue

@@ -1,5 +1,5 @@
 <template>
-    <view :class="`easy-tab-item${selected ? ' selected' : ''}`" @tap="select()">
+    <view :class="`easy-tab-item${selected ? ' selected' : ''}`" @tap="clickTab">
         <view class="easy-tab-item-content">
             <slot></slot>
         </view>
@@ -7,28 +7,38 @@
 </template>
 
 <script>
+    let root = null;
     export default {
         name: "easy-tab-item",
+        props: {
+            value: {
+                type: Number || String,
+                default: ''
+            }
+        },
         data() {
             return {
                 selected: false
             };
         },
         created() {
-            this.root = this.getTab();
-            this.root.items.push(this);
+            root = this.getParent();
+            root.addTab(this);
         },
         methods: {
             select() {
                 this.selected = true;
-                this.root.select(this);
             },
-
-            unSelect() {
+            
+            unselect() {
                 this.selected = false;
             },
+            
+            clickTab() {
+                root.select(this);
+            },
 
-            getTab(name = 'easy-tab') {
+            getParent(name = 'easy-tab') {
                 let parent = this.$parent;
                 let parentName = parent.$options.name;
                 while (parentName !== name) {
@@ -37,6 +47,12 @@
                     parentName = parent.$options.name;
                 }
                 return parent;
+            },
+            
+            getTab(){
+                return {
+                    value: this.value
+                };
             }
         }
     }

+ 1038 - 0
src/Auman.PieceWage.UniApp/components/easy-tab/base.extend.js

@@ -0,0 +1,1038 @@
+/**
+ * 扩展
+ */
+const extend = {
+    /**
+     * 添加存储
+     * @param {string} key 
+     * @param {object} value 
+     * @returns 
+     */
+    addStorage(key, value) {
+        let res = false;
+        if (this.isEmptyString(key) || this.isNull(value)) {
+            return res;
+        }
+        if (this.isObject(value)) {
+            value = JSON.stringify(value);
+        }
+        uni.setStorageSync(key, value);
+        res = true;
+        return res;
+    },
+
+    /**
+     * 创建 GUID
+     * @returns 
+     */
+    createGUID() {
+        let date = new Date().getTime();
+        let guid = 'xxxxxxxx-xxxx-zxxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+            let random = (date + Math.random() * 16) % 16 | 0;
+            date = Math.floor(date / 16);
+            return (c == 'x' ? random : (random & 0x3 | 0x8)).toString(16);
+        });
+        guid = guid.replace('z', (parseInt(Math.random() * 16)).toString(16));
+        return guid;
+    },
+
+    /**
+     * 日期格式化
+     * @param {Date} date 被格式化日期类,必选
+     * @param {string} key 格式字符串,可选,默认 yyyy-MM-dd HH:mm:ss.ms
+     */
+    dateFormatter(date, format) {
+        if (this.isDate(date)) {
+            var hours = date.getHours();
+            format = this.isNonEmptyString(format) ? format : 'yyyy-MM-dd HH:mm:ss.ms';
+            format = format.replace(/yyyy|YYYY/, date.getFullYear().toString());
+            format = format.replace(/yy|YY/, this.padLeft(date.getYear() % 100, 2, '0'));
+            format = format.replace(/MM/, this.padLeft(date.getMonth() + 1, 2, '0'));
+            format = format.replace(/M/g, (date.getMonth() + 1).toString());
+            format = format.replace(/dd|DD/, this.padLeft(date.getDate(), 2, '0'));
+            format = format.replace(/d|D/g, date.getDate().toString());
+            format = format.replace(/HH/g, this.padLeft(hours, 2, '0'));
+            format = format.replace(/hh/g, hours >= 12 ? '下午' + this.padLeft(hours - 12, 2, '0') : '上午' + this
+                .padLeft(
+                    hours,
+                    2, '0'));
+            format = format.replace(/H/g, hours);
+            format = format.replace(/h/g, hours >= 12 ? '下午' + (hours - 12).toString() : '上午' + hours.toString());
+            format = format.replace(/mm/g, this.padLeft(date.getMinutes(), 2, '0'));
+            format = format.replace(/m/g, date.getMinutes().toString());
+            format = format.replace(/ss/g, this.padLeft(date.getSeconds(), 2, '0'));
+            format = format.replace(/s/g, date.getSeconds().toString());
+            format = format.replace(/ms/g, date.getMilliseconds().toString());
+            return format;
+        } else if (this.isNonEmptyString(date)) {
+            return this.dateFormatter(this.dateParse(date), format);
+        } else {
+            return '';
+        }
+    },
+
+    /**
+     * 日期字符串转换成日期对象
+     * @param {string} date 被转换字符串,必选
+     */
+    dateParse(date) {
+        let newDate = null;
+        if (this.isNumber(date)) {
+            if (date.toString().length === 10) {
+                date *= 1000;
+            }
+            date = 'Date(' + date + ')';
+        }
+        if (this.isNonEmptyString(date)) {
+            if (date.indexOf('Date') > 0) {
+                date = "new " + date.replace(/\//g, '');
+            }
+            date = date.replace(/-/g, '/');
+            date = date.replace(/T/g, ' ');
+            if (date.indexOf('Date') >= 0) {
+                newDate = this.eval(date);
+            } else {
+                let ms = 0;
+                let msIndex = value.indexOf('.');
+                if (msIndex > -1) {
+                    ms = parseInt(value.substring(msIndex + 1));
+                    value = value.substring(0, msIndex);
+                }
+                newDate = new Date(value);
+                if (!isNaN(ms)) {
+                    newDate.setMilliseconds(ms);
+                }
+            }
+        }
+        return newDate;
+    },
+
+    /**
+     * 删除结尾换行符
+     * @param {string} str 要处理的字符串
+     */
+    deleteEndLineFeed(str) {
+        let res = '';
+        if (this.isNonEmptyString(str)) {
+            let crIndex = str.lastIndexOf('\r');
+            let lfIndex = str.lastIndexOf('\n');
+            let crlfIndex = str.lastIndexOf('\r\n');
+            let index = crlfIndex >= 0 ? crlfIndex : crIndex >= 0 ? crIndex : lfIndex > 0 ? lfIndex : -1;
+            if (index > 0) {
+                res = str.substring(0, index);
+            } else {
+                res = str;
+            }
+        }
+        return res;
+    },
+
+    /**
+     * 将对象编码成url字符串
+     * @param {object} param 被编码对象,必选
+     * @param {string} url 被编码url,可选
+     */
+    encodeUrl(param, url) {
+        let result = '';
+        if (this.isObject(param)) {
+            result = Parse(param);
+            if (!this.isNonEmptyString(result)) {
+                return url;
+            } else if (this.isNonEmptyString(url)) {
+                if (url.indexOf('?') >= 0) {
+                    result = url + '&' + result;
+                } else {
+                    result = url + '?' + result;
+                }
+            }
+        } else {
+            return this.isNonEmptyString(url) ? url : result;
+        }
+        return result;
+
+        /**
+         * 转换方法
+         * @param {object} value 
+         */
+        function Parse(value, perfix) {
+            let result = '';
+            perfix = extend.isNonEmptyString(perfix) ? perfix : '';
+            if (typeof value !== 'object') {
+                return result += perfix + '=' + value;
+            }
+            let data = extend.toFormObject(value);
+            let count = 0;
+            for (let n in data) {
+                if (count === 0) {
+                    result += n + '=' + data[n];
+                } else {
+                    result += '&' + n + '=' + data[n];
+                }
+                count++;
+            }
+            return result;
+        }
+    },
+
+    /**
+     * 返回格式化后的报错内容
+     * @param {any} ex 要格式化的对象
+     */
+    errorFormatter(ex) {
+        let result = {
+            status: null,
+            success: false,
+            message: ''
+        };
+        if (typeof ex === 'string') {
+            result.message = ex;
+        } else if (typeof ex === 'object') {
+            if (this.isNonEmptyString(ex.data) && ex.data.indexOf('{') === 0) {
+                ex.data = JSON.parse(ex.data);
+                if (this.isNonEmptyString(ex.data.ExceptionMessage)) {
+                    ex.message = ex.data.ExceptionMessage;
+                } else if (this.isNonEmptyString(ex.data.Message)) {
+                    ex.message = ex.data.Message;
+                } else if (this.isNonEmptyString(ex.data.error_description)) {
+                    ex.message = ex.data.error_description;
+                }
+            }
+            if (this.isNonEmptyString(ex.stack)) {
+                result.message = ex.stack;
+            } else if (this.isNonEmptyString(ex.responseText)) {
+                result.message = ex.responseText;
+            } else if (this.isNonEmptyString(ex.statusText)) {
+                result.message = ex.statusText;
+            } else if (this.isNonEmptyString(ex.errMsg)) {
+                result.message = ex.errMsg;
+            } else if (this.isNonEmptyString(ex.msg)) {
+                result.message = ex.msg;
+            } else if (this.isNonEmptyString(ex.message)) {
+                result.message = ex.message;
+            } else if (this.isNonEmptyString(ex.Message)) {
+                result.message = ex.Message;
+            } else if (this.isNonEmptyString(ex.title)) {
+                result.message = ex.title;
+            } else if (this.isNonEmptyString(ex.error_description)) {
+                result.message = ex.error_description;
+            } else if (this.isNonEmptyString(ex.data)) {
+                result.message = ex.data;
+            } else if (this.isObject(ex.data)) {
+                if (this.isNonEmptyString(ex.data.error)) {
+                    result.message = ex.data.error;
+                }
+            } else if (this.isNonEmptyString(ex.errMsg)) {
+                result.message = ex.errMsg;
+            }
+        }
+        var statusMessage = {
+            0: '网络连接失败,请检查本地网络设置。',
+            400: '请求无效。',
+            401: '未授权。',
+            403: '禁止访问。',
+            404: '访问地址不存在。',
+            405: '不允许此方法。',
+            406: '不可接受。',
+            407: '需要代理身份验证。',
+            412: '前提条件失败。',
+            414: 'Request-URI 太长',
+            415: '不支持的媒体类型。',
+            500: '内部服务器错误。',
+            502: '网关错误。',
+            600: '不可解析的响应标头。',
+        };
+        if (this.isNumber(ex.statusCode)) {
+            result.status = ex.statusCode;
+        } else if (this.isNumber(ex.status)) {
+            result.status = ex.status;
+        }
+
+        if (result.status !== null && result.status !== 200 && (!this.isNonEmptyString(result.message) || result
+                .message === 'error') ||
+            result.message === 'request:ok') {
+            result.message = result.status.toString() + ' ' + (statusMessage[result.status] || '');
+        }
+        if (result.message === 'invalid_username_or_password') {
+            result.message = this.lang.errorUsernameOrPassword;
+        }
+        return result;
+    },
+
+    /**
+     * eval
+     * @param {string} str 
+     * @returns 
+     */
+    eval(str) {
+        let res = null;
+        try {
+            if (this.isJsonString(str)) {
+                res = JSON.parse(str);
+            } else if (this.isNumberString(str)) {
+                res = parseFloat(str);
+            } else {
+                res = str;
+            }
+            if (this.isNonEmptyString(str) && this.isNull(res)) {
+                res = str;
+            }
+        } catch (ex) {
+            res = str;
+        }
+        return res;
+    },
+
+    /**
+     * 获取字符长度
+     * @param {string} value 
+     */
+    getUTF8Length(value) {
+        let length = 0;
+        let code = 0;
+        if (this.isNonEmptyString(value)) {
+            for (let i = 0; i < value.length; i++) {
+                code = value[i].charCodeAt();
+                if (code < 128) {
+                    length++;
+                } else if (code >= 128 && code <= 2047) {
+                    length += 2;
+                } else if (code >= 2047 && code <= 65535) {
+                    length += 3;
+                } else {
+                    length += 4;
+                }
+            }
+        }
+        return length;
+    },
+
+    /**
+     * 获取窗口高度
+     */
+    getWindowHeight() {
+        let height = uni.getWindowInfo().windowHeight;
+        return height;
+    },
+
+    /**
+     * 是否为空
+     * @param {any} value 
+     * @returns 
+     */
+    isNull(value) {
+        return value === null || value === undefined;
+    },
+
+    /**
+     * 是否是字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isString(str) {
+        return typeof str === 'string';
+    },
+
+    /**
+     * 是否是空字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isEmptyString(str) {
+        return !this.isNonEmptyString(str);
+    },
+
+    /**
+     * 是否是非空字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isNonEmptyString(str) {
+        return this.isString(str) && str.length > 0;
+    },
+
+    /**
+     * 是否是数字
+     * @param {number} num
+     * @returns
+     */
+    isNumber(num) {
+        return typeof num === 'number' && !isNaN(num);
+    },
+
+    /**
+     * 是否是数字字符串
+     * @param {string} str 
+     * @returns {Boolean}
+     */
+    isNumberString(str) {
+        let res = this.parseFloat(str);
+        return !isNaN(res);
+    },
+
+    /**
+     * 是否是布尔值
+     * @param {boolean} bool
+     * @returns
+     */
+    isBool(bool) {
+        return typeof bool === 'boolean';
+    },
+
+    /**
+     * 是否是对象
+     * @param {object} obj 
+     * @returns 
+     */
+    isObject(obj) {
+        return !this.isNull(obj) && typeof obj === 'object';
+    },
+
+    /**
+     * 是否是日期对象
+     * @param {Date} date 
+     * @returns 
+     */
+    isDate(date) {
+        return this.isObject(date) && date instanceof Date && !isNaN(date.getTime());
+    },
+
+    /**
+     * 是否是日期字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isDateString(str) {
+        return !/Invalid|NaN/.test(new Date(value).toString());
+    },
+
+    /**
+     * 是否是 ISO 日期字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isISODateString(str) {
+        return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])this/.test(value);
+    },
+
+    /**
+     * 是否是正则表达式
+     * @param {RegExp} reg 
+     * @returns 
+     */
+    isRegExp(reg) {
+        return this.isObject(reg) && reg instanceof RegExp;
+    },
+
+    /**
+     * 是否是数组
+     * @param {Array} arr 
+     * @returns 
+     */
+    isArray(arr) {
+        // #ifdef APP
+        return this.isLikeArray(arr);
+        // #endif
+
+        return this.isObject(arr) && arr instanceof Array;
+    },
+
+    /**
+     * 是否是类数组
+     * @param {object} arr 
+     * @returns 
+     */
+    isLikeArray(arr) {
+        return this.isObject(arr) && arr !== window && this.isNumber(arr.length) && (arr.length > 0 && !this.isNull(
+            arr[
+                arr.length - 1]) || arr.length === 0);
+    },
+
+    /**
+     * 是否是数组字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isArrayString(str) {
+        return this.isString(str) && str.length > 1 && str.substring(0, 1) === '[' && str.substring(str.length -
+                1) ===
+            ']';
+    },
+
+    /**
+     * 是否是方法
+     * @param {Function} value 
+     * @returns 
+     */
+    isFunction(value) {
+        return typeof value === 'function';
+    },
+
+    /**
+     * 是否是 HTML 字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isHTML(str) {
+        return this.isString(str) && str.length >= 3 && str.charAt(0) === '<' && str.charAt(str.length - 1) === '>';
+    },
+
+    /**
+     * 是否是 XML 字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isXML(str) {
+        return this.isHTML(str) && (str.indexOf('<?xml') === 0 || str.indexOf('<!DOCTYPE') === 0);
+    },
+
+    /**
+     * 是否是 Json 字符串
+     * @param {string} str 
+     * @returns 
+     */
+    isJsonString(str) {
+        return this.isString(str) && str.length > 1 && str.substring(0, 1) === '{' && str.substring(str.length -
+                1) ===
+            '}';
+    },
+
+    /**
+     * 是否是邮箱
+     * @param {string} str 
+     * @returns 
+     */
+    isEmail(str) {
+        return /^[a-zA-Z0-9.!#this%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*this/
+            .test(value);
+    },
+
+    /**
+     * 是否是手机号
+     * @param {string} str 
+     * @returns 
+     */
+    isPhone(str) {
+        return /^1(3|4|5|7|8|9)\d{9}this/.test(value);
+    },
+
+    /**
+     * 是否是身份证
+     * @param {string} str 
+     * @returns 
+     */
+    isIDCard(str) {
+        return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{4}this/.test(value);
+    },
+
+    /**
+     * 是否是密码
+     * @param {string} value 
+     * @param {number} min 
+     * @param {number} max 
+     * @returns 
+     */
+    isPassword(value, min, max) {
+        value = value === undefined ? '' : value;
+        min = this.isNumber(min) ? min : 1;
+        max = this.isNumber(max) ? max : 256;
+        var regexp = '/^([a-z]|[A-Z]|[0-9]|[_-]){' + min + ',' + max + '}this/';
+        return regexp.test(value);
+    },
+
+    /**
+     * 是否是 URL
+     * @param {string} url 被验证的字符串
+     * @returns {boolean} 验证结果
+     */
+    isUrl(url) {
+        if (this.isNonEmptyString(url)) {
+            let key = '://';
+            if (url.indexOf(key) > 0 && url.indexOf(key) < 10) {
+                return true;
+            }
+        }
+        return false;
+    },
+
+    /**
+     * 验证特殊字符,或者验证指定的字符 key
+     * @param {string | number} value 被验证的字符串,必选
+     * @param {string} key 验证关键字,必选
+     */
+    isSpecialChars(value, key) {
+        var msg = '';
+        value = this.isNonEmptyString(value) ? value : '';
+        key = this.isNonEmptyString(key) ? key : '';
+        for (var i = 0; i < value.length; ++i) {
+            var code = value[i].charCodeAt();
+            if (code < 32 || (code > 8399 && code < 12288) || (code > 12350 && code < 19968) || (code > 40907 &&
+                    code <
+                    65280) || code > 65519) {
+                msg += msg.length > 0 ? ',' : '';
+                msg += value[i];
+            } else {
+                for (var j = 0; j < key.length; ++j) {
+                    if (value[i] === key[j]) {
+                        msg += msg.length > 0 ? ',' : '';
+                        msg += value[i];
+                    }
+                }
+            }
+        }
+        return msg.length === 0 ? false : msg;
+    },
+
+    /**
+     * 判断是否是Map对象
+     * @param {Map} map Map对象
+     */
+    isMap(map) {
+        return this.isObject(map) && map instanceof Map;
+    },
+
+    /**
+     * Map对象键转数组。
+     * @param {Map} map Map对象
+     * @returns 
+     */
+    mapKeysToArray(map) {
+        let arr = [];
+        if (this.isMap(map)) {
+            for (let [name, value] of map) {
+                arr.push(name);
+            }
+        }
+        return arr;
+    },
+
+    /**
+     * Map对象值转数组。
+     * @param {Map} map Map对象
+     * @returns 
+     */
+    mapValuesToArray(map) {
+        let arr = [];
+        if (this.isMap(map)) {
+            for (let [name, value] of map) {
+                console.log(name, value);
+                arr.push(value);
+            }
+        }
+        return arr;
+    },
+
+    /**
+     * 字符串前缀拼接
+     * @param {string | number} value 要拼接的值
+     * @param {number} length 补位字符
+     * @param {string} prefix 拼接长度, 默认值 0
+     * value 值的长度 length 不够时, 将以前缀 prefix 填充, 比如: 001
+     * @returns {string}
+     */
+    padLeft(value, length, prefix) {
+        if (this.isNumber(value)) {
+            value = value.toString();
+        }
+        if (!this.isNonEmptyString(value)) {
+            value = '';
+        }
+        if (!this.isNumber(length) || value.length > length) {
+            length = value.length;
+        }
+        if (!this.isNonEmptyString(prefix)) {
+            prefix = '0';
+        }
+        return (Array(length).join(prefix) + (value.length === 0 ? prefix : value)).slice(-length);
+    },
+
+    /**
+     * 字符串后缀拼接
+     * @param {string | number} value 要拼接的值
+     * @param {number} length 补位字符
+     * @param {string} prefix 拼接长度, 默认值 0
+     * value 值的长度 length 不够时, 将以前缀 prefix 填充, 比如: 001
+     * @returns {string}
+     */
+    padRight(value, length, prefix) {
+        if (this.isNumber(value)) {
+            value = value.toString();
+        }
+        if (!this.isNonEmptyString(value)) {
+            value = '';
+        }
+        if (!this.isNumber(length) || value.length > length) {
+            length = value.length;
+        }
+        if (!this.isNonEmptyString(prefix)) {
+            prefix = '0';
+        }
+        return ((value.length === 0 ? prefix : value) + Array(length).join(prefix)).slice(0, length);
+    },
+
+    /**
+     * 转换成金额字符串
+     * @param {number} amount 金额
+     * @param {number} pointlength 保留小数位数, 默认 14,最大 14
+     * @returns {string} 金额字符串
+     */
+    parseAmount(amount, pointlength) {
+        if (!this.isNumber(amount)) {
+            amount = 0;
+        }
+        if (!this.isNumber(pointlength) || pointlength > 14) {
+            pointlength = 14;
+        }
+        if (pointlength > 0) {
+            amount = this.floatRound(amount, pointlength);
+        } else {
+            amount = Math.round(amount);
+        }
+        let text = amount.toString();
+        let temp = '';
+        let end = '';
+        let sign = '';
+        if (text.substring(0, 1) === '-') {
+            sign = '-';
+            text = text.substring(1);
+        }
+        // 格式化整数部分
+        if (text.indexOf('.') > 0) {
+            text = text.substring(0, text.indexOf('.'));
+        }
+        for (var i = 0; i < text.length; ++i) {
+            temp = text.substring(text.length - 1);
+            text = text.substring(0, text.length - 1);
+            if (temp.length > 0) {
+                if ((i + 1) % 3 === 0 && text.length > 0) {
+                    end = ',' + temp + end;
+                } else end = temp + end;
+            } else {
+                break;
+            }
+        }
+
+        // 格式化小数部分
+        text = amount.toString();
+        if (text.indexOf('.') > 0) {
+            text = text.substring(text.indexOf('.') + 1);
+        } else {
+            text = '';
+        }
+        if (text.length < pointlength) {
+            text = this.padRight(text, pointlength, '0');
+        }
+        end += `.${text}`;
+        return sign + end;
+    },
+
+    /**
+     * 转换成中文大写金额字符串
+     * @param {number} amount 金额
+     * @param {number} pointlength 保留小数位数, 默认 13
+     * @returns {string} 中文大写金额字符串
+     */
+    parseCNAmount(amount, pointlength) {
+        if (!this.isNumber(amount)) {
+            amount = 0;
+        }
+        if (!this.isNumber(pointlength) || pointlength > 13) {
+            pointlength = 13;
+        }
+        if (pointlength > 0) {
+            amount = this.floatRound(amount, pointlength);
+        } else {
+            amount = Math.round(amount);
+        }
+
+        let amountString = amount.toString();
+
+        // 定义中文数字集合
+        let assemble1 = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
+
+        // 定义小数中文集合
+        let assemble2 = ["角", "分", "厘", "毫", "丝", "忽", "微", "纤", "沙", "尘", "埃", "渺", "漠"];
+
+        // 定义拾佰仟集合
+        let assemble3 = ["", "拾", "佰", "仟"];
+
+        // 定义万以后的中文集合
+        let assemble4 = ["圆", "万", "亿", "兆", "京", "垓", "秭", "穰", "沟", "涧", "正", "载", "极", "归", "僧", "那", "思", "猴",
+            "格"
+        ];
+
+        // 定义整数字符串
+        let integerString = amountString.indexOf('.') > 0 ? amountString.substring(0, amountString.indexOf('.')) :
+            amountString;
+
+        // 定义小数字符串
+        let decimalString = amountString.indexOf('.') > 0 ? amountString.substring(amountString.indexOf('.') + 1) :
+            '';
+
+        // 定义转换后的文本
+        let text = '';
+
+        // 定义当前位是否是零
+        let currentIsZore = true;
+
+        // 定义上一位是否是零
+        let beforeIsZore = false;
+
+        // 定义位数
+        let index = 0;
+
+        // 格式化整数
+        // 算法:‘个拾佰仟’+‘阶位’
+        for (let i = integerString.length - 1; i >= 0; i--) {
+            // 判断当前位是否是0
+            currentIsZore = integerString[i] === '0';
+
+            // 计算阶位
+            let bitLevel = Math.floor((integerString.length - 1 - i) / 4);
+
+            // 如果第一位是0,则设置上一位是0
+            if (index === 0 && currentIsZore) {
+                beforeIsZore = true;
+            }
+
+            // 如果当前是第0位,则加大阶位
+            if (index === 0) {
+                text = assemble4[bitLevel] + text;
+            }
+
+            // 位当前为0
+            if (currentIsZore) {
+                // 前一位不是0,则加零
+                if (!beforeIsZore) {
+                    text = assemble1[integerString[i]] + text;
+                }
+            }
+
+            // 当前位不为0
+            else {
+                text = assemble1[integerString[i]] + assemble3[index] + text;
+            }
+
+            // 位数加1
+            index++;
+            index = index > 3 ? 0 : index;
+
+            // 设置上一位是否是0
+            beforeIsZore = currentIsZore;
+        }
+
+        // 格式化小数
+        for (let j = 0; j < decimalString.length; ++j) {
+            text += assemble1[decimalString[j]] + assemble2[j];
+        }
+
+        return text;
+    },
+
+    /**
+     * 转换浮点数
+     * @param {string | number} value 值
+     * @returns {number}
+     */
+    parseFloat(value) {
+        let res = NaN;
+        let temp = '';
+        if (this.isNumber(value)) {
+            return value;
+        } else if (this.isString(value)) {
+            temp = value;
+            if (temp.indexOf(',') >= 0) {
+                temp = value.replaceAll(',', '');
+            }
+            res = parseFloat(temp);
+        }
+        return res;
+    },
+
+    /**
+     * 日期字符串转换成日期对象
+     * @param {string} date 被转换字符串,必选
+     * @returns {Date} 日期对象
+     */
+    parseDate(date) {
+        let newDate = null;
+        if (this.isNumber(date)) {
+            if (date.toString().length === 10) {
+                date *= 1000;
+            }
+            date = 'Date(' + date + ')';
+        }
+        if (this.isNonEmptyString(date)) {
+            if (date.indexOf('Date') > 0) {
+                date = "new " + date.replace(/\//g, '');
+            }
+            date = date.replace(/-/g, '/');
+            date = date.replace(/T/g, ' ');
+            if (date.indexOf('Date') >= 0) {
+                newDate = eval(date);
+            } else {
+                let ms = 0;
+                let msIndex = date.indexOf('.');
+                if (msIndex > -1) {
+                    ms = parseInt(date.substring(msIndex + 1));
+                    date = date.substring(0, msIndex);
+                }
+                newDate = new Date(date);
+                if (!isNaN(ms)) {
+                    newDate.setMilliseconds(ms);
+                }
+            }
+        }
+        return newDate;
+    },
+
+    /**
+     * 转换浮点数
+     * @param {string | number} value 值
+     * @returns {number}
+     */
+    parseInt(value) {
+        return this.parseFloat(value);
+    },
+
+    /**
+     * 读取存储
+     * @param {string} key 
+     * @returns 
+     */
+    readStorage(key) {
+        let res = null;
+        if (this.isNonEmptyString(key)) {
+            let data = uni.getStorageSync(key);
+            if (this.isJsonString(data)) {
+                res = JSON.parse(data);
+            } else if (this.isNumberString(data)) {
+                res = parseFloat(data) || '';
+            } else if (this.isNumber(data) || this.isBool(data) || this.isNonEmptyString(data)) {
+                res = data;
+            }
+        }
+        return res;
+    },
+
+    /**
+     * 删除存储
+     * @param {string} key 
+     * @returns 
+     */
+    removeStorage(key) {
+        let res = false;
+        if (this.isNonEmptyString(key)) {
+            uni.removeStorageSync(key);
+            res = true;
+        }
+        return res;
+    },
+
+    /**
+     * 截取末尾字符串
+     * @param {string} str 被截取字符串
+     * @param {number} length 截取长度
+     */
+    subEndString(str, length) {
+        let res = '';
+        if (this.isString(str)) {
+            if (!this.isNumber(length)) {
+                length = str.length;
+            }
+            res = str.substring(str.length - length, str.length);
+        }
+        return res;
+    },
+
+    /**
+     * 截取开头字符串
+     * @param {string} str 被截取字符串
+     * @param {number} length 截取长度
+     */
+    subStartString(str, length) {
+        let res = '';
+        if (this.isString(str)) {
+            if (!this.isNumber(length)) {
+                length = str.length;
+            }
+            res = str.substring(0, length);
+        }
+        return res;
+    },
+
+    /**
+     * 转换成 Form 键值对
+     * @param {object} value 
+     * @param {string} name 
+     * @returns 
+     */
+    toFormObject(value, name) {
+        let res = {};
+        let cres = null;
+        let isEmpty = true;
+        if (!this.isObject(value)) {
+            return value;
+        }
+        if (this.isNull(name)) {
+            name = '';
+        }
+
+        if (this.isLikeArray(value)) {
+            for (let i in value) {
+                isEmpty = false;
+                cres = this.toFormObject(value[i], name + '[' + i + ']');
+                if (this.isObject(cres)) {
+                    for (let m in cres) {
+                        res[m] = cres[m];
+                    }
+                } else if (!this.isNull(cres)) {
+                    res[name + '[' + i + ']'] = cres;
+                }
+            }
+            if (isEmpty && this.isNonEmptyString(name)) {
+                res[name] = [];
+            }
+        } else {
+            for (let n in value) {
+                isEmpty = false;
+                cres = this.toFormObject(value[n], this.isEmptyString(name) ? n : name + '.' + n);
+                if (this.isObject(cres)) {
+                    for (let o in cres) {
+                        res[o] = cres[o];
+                    }
+                } else if (!this.isNull(cres)) {
+                    res[this.isEmptyString(name) ? n : name + '.' + n] = cres;
+                }
+            }
+            if (isEmpty && this.isNonEmptyString(name)) {
+                res[name] = {};
+            }
+        }
+        return res;
+    },
+
+    /**
+     * 将url参数解码成对象
+     * @param {string} url 统一资源定位符
+     */
+    urlToObject(url) {
+        var result = null;
+        if (this.isNonEmptyString(url)) {
+            url = decodeURI(url);
+            var arr = null;
+            var temp = url.substring(url.indexOf('?'));
+            if (temp.indexOf('?') >= 0) {
+                temp = temp.substring(1);
+                arr = temp.split('&');
+                result = {};
+                for (var i = 0; i < arr.length; i++) {
+                    temp = arr[i].split('=');
+                    result[temp[0]] = temp[1];
+                }
+            }
+        }
+        return result;
+    }
+}
+
+export default extend;

+ 49 - 22
src/Auman.PieceWage.UniApp/components/easy-tab/easy-tab.vue

@@ -5,6 +5,11 @@
 </template>
 
 <script>
+    import base from './base.extend.js';
+
+    let tabs = [];
+    let current = -1;
+
     export default {
         name: "easy-tab",
         props: {
@@ -23,40 +28,62 @@
             };
         },
         created() {
-            this.items = [];
-            this.current = this.selected;
+            tabs = [];
+            current = this.selected;
         },
         mounted() {
-            if (this.current < this.items.length && this.current >= 0) {
-                this.items[this.current].select();
+            if (current < tabs.length && current >= 0) {
+                tabs[current].select();
             }
         },
         methods: {
+            addTab(tab) {
+                if (base.isObject(tab)) {
+                    tabs.push(tab);
+                }
+            },
+
+            /**
+             * 选择
+             * @param {number|object} tab 选项,option 数组下标或者 option 组件本身
+             */
+            select(tab) {
+                let before = current;
+                this.change(tab);
+                let opt = tabs[current].getTab();
+                this.$emit('change', {
+                    current: current,
+                    before: before,
+                    value: opt.value
+                });
+            },
+
             /**
              * 选择
              * @param {number | object} item 
              */
-            select(item) {
-                if (typeof item === 'number') {
-                    if (item < this.item.length && item >= 0) {
-                        this.current = item;
-                        // this.items[item].select();
-                        this.$emit('change', item);
-                    }
-                } else if (typeof item === 'object') {
-                    for (let i = 0; i < this.items.length; i++) {
-                        if (this.items[i] === item) {
-                            // this.items[i].select();
-                            this.$emit('change', {
-                                before: this.current,
-                                current: i
-                            });
-                            this.current = i;
-                        } else {
-                            this.items[i].unSelect();
+            change(tab) {
+                let i = 0;
+                let before = current;
+
+                if (typeof tab === 'number') {
+                    current = tab;
+                } else if (typeof tab === 'object') {
+                    for (i = 0; i < tabs.length; i++) {
+                        if (tabs[i] === tab) {
+                            current = i;
+                            break;
                         }
                     }
                 }
+                for (i = 0; i < tabs.length; i++) {
+                    if (current === i) {
+                        tabs[current].select();
+                    } else {
+                        tabs[i].unselect();
+                    }
+                }
+                this.isShowPanel = false;
             }
         }
     }

+ 66 - 24
src/Auman.PieceWage.UniApp/components/page-dispatch/page-dispatch.vue

@@ -1,10 +1,13 @@
 <template>
     <view class="flex direction-column height-100pre width-100per">
+        <easy-tab ref="tabProcess" type="line" @change="onTabChange">
+            <easy-tab-item v-for="(item, index) in process" :value="item.processId">{{item.processName}}</easy-tab-item>
+        </easy-tab>
         <view class="flex items-center padding-lr">
-            <easy-combobox width="160">
-                <easy-combobox-option v-if="isDispatch" value="1" text="派工"></easy-combobox-option>
-                <easy-combobox-option v-if="isDispatch" value="2" text="派工确认"></easy-combobox-option>
-                <easy-combobox-option v-if="!isDispatch" value="3" text="报工"></easy-combobox-option>
+            <easy-combobox ref="comboboxStatus" width="160" @change="changeStatus">
+                <easy-combobox-option v-if="isDispatch" :value="1" text="派工"></easy-combobox-option>
+                <easy-combobox-option v-if="isDispatch" :value="2" text="派工确认"></easy-combobox-option>
+                <easy-combobox-option v-if="!isDispatch" :value="3" text="报工"></easy-combobox-option>
             </easy-combobox>
             <uni-search-bar placeholder="单号、型号" clearButton="none" class="grow-1" v-model="searchValue"
                 @confirm="load"></uni-search-bar>
@@ -32,7 +35,8 @@
                     <view class="dispatch-row-cells child-gap">状态:{{item.statusText}}</view>
                 </view>
                 <view class="shrink-0">
-                    <button size="mini" :type="item.buttonType" @tap="details(item.dispatchOrderId)">{{item.buttonText}}</button>
+                    <button size="mini" :type="item.buttonType"
+                        @tap="details(item.dispatchOrderId)">{{item.buttonText}}</button>
                 </view>
             </view>
         </view>
@@ -105,48 +109,59 @@
         data() {
             return {
                 searchValue: '',
+                process: [],
                 items: [],
                 currentItem: null,
                 currentDescription: '',
                 currentWorkingTeam: null,
-                currentStatus: 1
+                currentStatus: 1,
+                currentProcessId: 0
             };
         },
         async created() {
-            await this.load();
+            // await this.load();
+            await this.getProcess();
+            this.currentStatus = this.$refs.comboboxStatus.getValue();
+            this.$refs.tabProcess.select(0);
         },
         methods: {
+            async onTabChange(e) {
+                this.currentProcessId = e.value;
+                await this.load();
+            },
+            
             async load() {
+                let url = '';
                 let rows = [];
-                let res = [];
-                if (this.isDispatch) {
-                    rows = await this.loadOrders('dispatching-order/search');
-                    res = await this.loadOrders('dispatch-order/search');
-                    rows = rows.concat(res);
-                } else {
-                    rows = await this.loadOrders('report-order/search');
+                switch (this.currentStatus) {
+                    case 1:
+                        url = 'dispatching-order/search';
+                        break;
+                    case 2:
+                        url = 'dispatch-order/search';
+                        break;
+                    case 3:
+                        url = 'report-order/search';
+                        break;
                 }
-                rows = this.parseRows(rows);
-                this.items = rows;
-            },
-            async loadOrders(url) {
-                let rows = [];
-                if (extend.isEmptyString(this.url)) {
+                if (extend.isEmptyString(url)) {
                     return;
                 }
                 uni.showLoading();
                 let res = await request.sendToken({
-                    url: `${url}`,
+                    url: url,
                     method: this.method,
                     data: {
-                        userId: userinfo.systemUserId
+                        userId: userinfo.systemUserId,
+                        process: this.currentProcessId
                     }
                 });
                 uni.hideLoading();
                 if (res.success) {
                     if (extend.isObject(res.data) && extend.isArray(res.data.rows)) {
-                        rows = res.data.rows;
-                        console.log(res.data.rows);
+                        rows = this.parseRows(res.data.rows);
+                        this.items = rows;
+                        console.log('orders:', res.data.rows);
                     }
                 } else {
                     uni.showModal({
@@ -157,6 +172,33 @@
                 return rows;
             },
 
+            async getProcess() {
+                let res = await request.sendToken({
+                    url: `process/search`,
+                    data: {
+                        name: '',
+                        groupNumber: '',
+                        // workshopSectionId: 0,
+                        opened: true
+                    }
+                });
+                if (res.success) {
+                    this.process = res.data.rows;
+                    console.log('process:', res.data.rows);
+                } else {
+                    uni.showModal({
+                        title: '错误',
+                        content: res.message
+                    });
+                }
+            },
+
+            changeStatus(option) {
+                this.currentStatus = option.value;
+                console.log('changeStatus', option);
+                this.load();
+            },
+
             getRowById(id) {
                 let res = null;
                 for (let i = 0; i < this.items.length; i++) {

+ 2 - 2
src/Auman.PieceWage.UniApp/manifest.json

@@ -2,8 +2,8 @@
     "name" : "生产流程管理",
     "appid" : "__UNI__0D07441",
     "description" : "生产流程管理",
-    "versionName" : "0.0.8",
-    "versionCode" : 8,
+    "versionName" : "0.0.9",
+    "versionCode" : 9,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 2 - 2
src/Auman.PieceWage.UniApp/pages.json

@@ -36,7 +36,7 @@
             "style" : 
             {
                 "navigationBarTitleText" : "派工",
-                "enablePullDownRefresh": true
+                "enablePullDownRefresh": false
             }
         },
         {
@@ -44,7 +44,7 @@
             "style" : 
             {
                 "navigationBarTitleText" : "报工",
-                "enablePullDownRefresh": true
+                "enablePullDownRefresh": false
             }
         },
         {

+ 14 - 39
src/Auman.PieceWage.UniApp/pages/dispatch/dispatch.vue

@@ -1,10 +1,7 @@
 <template>
     <view class="flex direction-column height-100pre">
-        <!-- <easy-tab type="line" @change="onTabChange">
-            <easy-tab-item v-for="(item, index) in process">{{item.processName}}</easy-tab-item>
-        </easy-tab> -->
         <view class="flex grow-1 height-0 width-100per">
-            <page-dispatch ref="child" :url="url" method="get" :isDispatch="true"></page-dispatch>
+            <page-dispatch ref="child" :isDispatch="true"></page-dispatch>
         </view>
     </view>
 </template>
@@ -19,57 +16,35 @@
 
     let isLoading = false;
 
+    let isPullDownRefresh = false;
+
     export default {
         data() {
             return {
-                // url: 'dispatching-order/search',
-                url: 'production-order/search',
-                process: []
             };
         },
         async onLoad() {
-            // await this.getProcess();
         },
         async onShow() {
             console.log('userinfo:', userinfo);
             this.getSelectWorkingTeam();
         },
-        methods: {
-            onTabChange(e) {
-                console.log(e);
-            },
-
-            onPullDownRefresh() {
-                if (!isLoading) {
-                    this.getOrders();
-                }
-            },
-
-            async getProcess() {
-                let res = await request.sendToken({
-                    url: `${url.apiUrl}process/search`,
-                    data: {
-                        name: '',
-                        groupNumber: '',
-                        // workshopSectionId: 0,
-                        opened: true
-                    }
-                });
-                if (res.success) {
-                    this.process = res.data.rows;
-                    console.log('process:', res.data.rows);
-                } else {
-                    uni.showModal({
-                        title: '错误',
-                        content: res.message
-                    });
-                }
-            },
 
+        onPullDownRefresh() {
+            if (!isLoading) {
+                isPullDownRefresh = true;
+                this.getOrders();
+            }
+        },
+        methods: {
             async getOrders() {
                 isLoading = true;
                 await this.$refs.child.load();
                 isLoading = false;
+                if (isPullDownRefresh) {
+                    uni.stopPullDownRefresh();
+                    isPullDownRefresh = false;
+                }
             },
 
             getSelectWorkingTeam() {

+ 14 - 38
src/Auman.PieceWage.UniApp/pages/work-order/work-order.vue

@@ -1,10 +1,7 @@
 <template>
     <view class="flex direction-column height-100pre">
-        <!-- <easy-tab type="line" @change="onTabChange">
-            <easy-tab-item v-for="(item, index) in process">{{item.processName}}</easy-tab-item>
-        </easy-tab> -->
         <view class="flex grow-1 height-0 width-100per">
-            <page-dispatch ref="child" :url="url" method="get" :isDispatch="false"></page-dispatch>
+            <page-dispatch ref="child" :isDispatch="false"></page-dispatch>
         </view>
     </view>
 </template>
@@ -19,56 +16,35 @@
 
     let isLoading = false;
 
+    let isPullDownRefresh = false;
+
     export default {
         data() {
             return {
-                url: 'dispatching-order/search',
-                process: []
             };
         },
         async onLoad() {
-            // await this.getProcess();
         },
         async onShow() {
             console.log('userinfo:', userinfo);
             this.getSelectWorkingTeam();
         },
-        methods: {
-            onTabChange(e) {
-                console.log(e);
-            },
-
-            onPullDownRefresh() {
-                if (!isLoading) {
-                    this.getOrders();
-                }
-            },
-
-            async getProcess() {
-                let res = await request.sendToken({
-                    url: `${url.apiUrl}process/search`,
-                    data: {
-                        name: '',
-                        groupNumber: '',
-                        // workshopSectionId: 0,
-                        opened: true
-                    }
-                });
-                if (res.success) {
-                    this.process = res.data.rows;
-                    console.log('process:', res.data.rows);
-                } else {
-                    uni.showModal({
-                        title: '错误',
-                        content: res.message
-                    });
-                }
-            },
 
+        onPullDownRefresh() {
+            if (!isLoading) {
+                isPullDownRefresh = true;
+                this.getOrders();
+            }
+        },
+        methods: {
             async getOrders() {
                 isLoading = true;
                 await this.$refs.child.load();
                 isLoading = false;
+                if (isPullDownRefresh) {
+                    uni.stopPullDownRefresh();
+                    isPullDownRefresh = false;
+                }
             },
 
             getSelectWorkingTeam() {

+ 1 - 1
src/Auman.PieceWage.UniApp/script/status.js

@@ -10,7 +10,7 @@ export default {
         /**
          * 未知
          */
-        unknown: 1,
+        unknown: 0,
         
         /**
          * 待派工

+ 3 - 1
src/Auman.PieceWage.UniApp/styles/reset-uni.css

@@ -8,6 +8,7 @@ uni-button,
 .uni-input-input,
 .uni-input-placeholder{
     font-size: 32upx !important;
+    flex-shrink: 0;
 }
 
 .uni-table-th,
@@ -33,12 +34,13 @@ uni-button[size='default'] {
 
 uni-button[size='mini'] {
     line-height: 2 !important;
+    font-size: 24upx !important;
     padding: 8upx 24upx !important;
 }
 
 uni-button[size='micro'] {
     display: inline-flex;
-    font-size: 26upx !important;
+    font-size: 20upx !important;
     padding: 12upx 18upx !important;
     width: fit-content !important;
     line-height: normal !important;

+ 1 - 1
src/Auman.PieceWage.UniApp/unpackage/dist/build/app-plus/app-config-service.js

@@ -2,7 +2,7 @@
   ;(function(){
   let u=void 0,isReady=false,onReadyCallbacks=[],isServiceReady=false,onServiceReadyCallbacks=[];
   const __uniConfig = {"pages":[],"globalStyle":{"backgroundColor":"#F8F8F8","navigationBar":{"backgroundColor":"#F8F8F8","titleText":"uni-app","type":"default","titleColor":"#000000"},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"生产流程管理","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":true},"compilerVersion":"4.45","entryPagePath":"pages/home/index","entryPageQuery":"","realEntryPagePath":"","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"tabBar":{"position":"bottom","color":"#666666","selectedColor":"#2185d0","borderStyle":"black","blurEffect":"none","fontSize":"10px","iconWidth":"24px","spacing":"3px","height":"50px","list":[{"pagePath":"pages/home/index","text":"首页","iconPath":"/static/tabbar/house.png","selectedIconPath":"/static/tabbar/house_active.png"},{"pagePath":"pages/dispatch/dispatch","text":"派工","iconPath":"/static/tabbar/chart-bar.png","selectedIconPath":"/static/tabbar/chart-bar_active.png"},{"pagePath":"pages/work-order/work-order","text":"报工","iconPath":"/static/tabbar/calendar-check.png","selectedIconPath":"/static/tabbar/calendar-check_active.png"},{"pagePath":"pages/my/index","text":"我","iconPath":"/static/tabbar/user.png","selectedIconPath":"/static/tabbar/user_active.png"}],"selectedIndex":0,"shown":true},"locales":{},"darkmode":false,"themeConfig":{}};
-  const __uniRoutes = [{"path":"pages/home/index","meta":{"isQuit":true,"isEntry":true,"isTabBar":true,"tabBarIndex":0,"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/my/index","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":3,"navigationBar":{"titleText":"我的","type":"default"},"isNVue":false}},{"path":"pages/login/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/login/serverSetting","meta":{"navigationBar":{"titleText":"服务器设置","type":"default"},"isNVue":false}},{"path":"pages/my/protocol","meta":{"navigationBar":{"titleText":"服务协议和隐私政策","type":"default"},"isNVue":false}},{"path":"pages/dispatch/dispatch","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":1,"enablePullDownRefresh":true,"navigationBar":{"titleText":"派工","type":"default"},"isNVue":false}},{"path":"pages/work-order/work-order","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":2,"enablePullDownRefresh":true,"navigationBar":{"titleText":"报工","type":"default"},"isNVue":false}},{"path":"pages/workingTeam/select","meta":{"navigationBar":{"titleText":"选择工作组","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
+  const __uniRoutes = [{"path":"pages/home/index","meta":{"isQuit":true,"isEntry":true,"isTabBar":true,"tabBarIndex":0,"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/my/index","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":3,"navigationBar":{"titleText":"我的","type":"default"},"isNVue":false}},{"path":"pages/login/index","meta":{"navigationBar":{"style":"custom","type":"default"},"isNVue":false}},{"path":"pages/login/serverSetting","meta":{"navigationBar":{"titleText":"服务器设置","type":"default"},"isNVue":false}},{"path":"pages/my/protocol","meta":{"navigationBar":{"titleText":"服务协议和隐私政策","type":"default"},"isNVue":false}},{"path":"pages/dispatch/dispatch","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":1,"enablePullDownRefresh":false,"navigationBar":{"titleText":"派工","type":"default"},"isNVue":false}},{"path":"pages/work-order/work-order","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":2,"enablePullDownRefresh":false,"navigationBar":{"titleText":"报工","type":"default"},"isNVue":false}},{"path":"pages/workingTeam/select","meta":{"navigationBar":{"titleText":"选择工作组","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
   __uniConfig.styles=[];//styles
   __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
   __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});

File diff suppressed because it is too large
+ 0 - 0
src/Auman.PieceWage.UniApp/unpackage/dist/build/app-plus/app-service.js


File diff suppressed because it is too large
+ 0 - 0
src/Auman.PieceWage.UniApp/unpackage/dist/build/app-plus/app.css


+ 2 - 2
src/Auman.PieceWage.UniApp/unpackage/dist/build/app-plus/manifest.json

@@ -7,8 +7,8 @@
   "id": "__UNI__0D07441",
   "name": "生产流程管理",
   "version": {
-    "name": "0.0.7",
-    "code": 7
+    "name": "0.0.9",
+    "code": 9
   },
   "description": "生产流程管理",
   "developer": {

File diff suppressed because it is too large
+ 0 - 0
src/Auman.PieceWage.UniApp/unpackage/dist/build/app-plus/pages/dispatch/dispatch.css


File diff suppressed because it is too large
+ 0 - 0
src/Auman.PieceWage.UniApp/unpackage/dist/build/app-plus/pages/work-order/work-order.css


Some files were not shown because too many files changed in this diff