From a4e5f22b95b4f4e65cea7e4917f8fe9150430041 Mon Sep 17 00:00:00 2001
From: Vergil <974548713@qq.com>
Date: Mon, 24 Feb 2020 15:20:42 +0800
Subject: [PATCH 1/8] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=95=B0=E5=AD=97?=
=?UTF-8?q?=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../AmountInputBox/AmountInputBox.js | 81 +++++
src/components/AmountInputBox/index.js | 11 +
src/main.js | 4 +
.../GroupMatching/index.vue | 8 +-
.../machiningHoursStatistics/index.vue | 325 ++++++++----------
.../OutFactoryMaintenance/index.vue | 22 +-
.../TechnologyCenter/QueryParts/index.vue | 16 +-
7 files changed, 256 insertions(+), 211 deletions(-)
create mode 100644 src/components/AmountInputBox/AmountInputBox.js
create mode 100644 src/components/AmountInputBox/index.js
diff --git a/src/components/AmountInputBox/AmountInputBox.js b/src/components/AmountInputBox/AmountInputBox.js
new file mode 100644
index 00000000..2514ead5
--- /dev/null
+++ b/src/components/AmountInputBox/AmountInputBox.js
@@ -0,0 +1,81 @@
+/**
+ * @desc 验证整数类型数字方法
+ * @param {Object} e
+ * @param {regular} reg 正则
+ * @param {Number} charcode 键盘code
+ * */
+const checkNumber = (e, reg, charcode) => {
+ if (!reg.test(String.fromCharCode(charcode)) && charcode > 9 && !e.ctrlKey) {
+ if (e.preventDefault) {
+ e.preventDefault()
+ } else {
+ e.returnValue = false
+ }
+ }
+}
+
+/**
+ * @desc 验证浮点类型小数方法(建议用text类型的表单)
+ * @param {Object} e
+ * @param {regular} reg 正则
+ * @param {Number} charcode 键盘code
+ * @param {Object} el dom对象
+ * */
+const checkFloat = (e, reg, charcode, el) => {
+ if (charcode === 46) {
+ if (el.children[0].value.includes('.')) {
+ e.preventDefault()
+ }
+ return
+ } else if (
+ !reg.test(String.fromCharCode(charcode)) &&
+ charcode > 9 &&
+ !e.ctrlKey
+ ) {
+ if (e.preventDefault) {
+ e.preventDefault()
+ } else {
+ e.returnValue = false
+ }
+ }
+}
+
+/**
+ * @author LeeYunxiang
+ * @description 限制数字输入格式 int => 正整数 , num => 自然数(正整数包括0) , float => 正数包括小数(建议用text类型的input表单)
+ * */
+export default {
+ key: 'positive',
+ func: {
+ inserted(el, bind) {
+ el.addEventListener('keypress', e => {
+ e = e || window.event
+ const charcode = typeof e.charCode === 'number' ? e.charCode : e.keyCode
+ let reg = null
+ switch (bind.value) {
+ case 'num':
+ reg = /\d/
+ checkNumber(e, reg, charcode)
+ break
+ case 'int':
+ if (el.children[0].value.length === 0) {
+ reg = /^[1-9]$/
+ } else {
+ reg = /\d/
+ }
+ checkNumber(e, reg, charcode)
+ break
+ case 'float':
+ reg = /\d/
+ checkFloat(e, reg, charcode, el)
+ break
+ case 'notZero':
+ // reg = (/^([1-9]\d*(\.\d*[1-9])?)|(0\.\d*[1-9])$/)
+ reg = (/^(?!(0[0-9]{0,}$))[0-9]{1,}[.]{0,}[0-9]{0,}$/)
+ checkFloat(e, reg, charcode, el)
+ break
+ }
+ })
+ }
+ }
+}
diff --git a/src/components/AmountInputBox/index.js b/src/components/AmountInputBox/index.js
new file mode 100644
index 00000000..75190d55
--- /dev/null
+++ b/src/components/AmountInputBox/index.js
@@ -0,0 +1,11 @@
+import AmountInputBox from './AmountInputBox.js'
+const directives = [AmountInputBox]
+export default {
+ install: Vue => {
+ if (directives.length && directives.length > 0) {
+ directives.map(item => {
+ Vue.directive(item.key, item.func)
+ })
+ }
+ }
+}
diff --git a/src/main.js b/src/main.js
index 729e3d4d..42e86a8b 100644
--- a/src/main.js
+++ b/src/main.js
@@ -22,6 +22,10 @@ import 'viewerjs/dist/viewer.css'
import VueBarcode from '@xkeshi/vue-barcode'
import Direction from 'vue-direction-key'
import elDragDialog from '@/directive/el-dragDialog'
+// 全局数字、金额输入框组件
+import directive from './components/AmountInputBox/index.js'
+Vue.use(directive)
+
Vue.use(elDragDialog)
Vue.component('barcode', VueBarcode)
Vue.use(Direction)
diff --git a/src/views/ManufacturingCenter/GroupMatching/index.vue b/src/views/ManufacturingCenter/GroupMatching/index.vue
index 28f36a16..d469982e 100644
--- a/src/views/ManufacturingCenter/GroupMatching/index.vue
+++ b/src/views/ManufacturingCenter/GroupMatching/index.vue
@@ -1,7 +1,7 @@
-
+
{{ item.value2 }}
-
+
{{ item.value2 }}
- 查询
+ 查询
车间生产
@@ -77,7 +77,7 @@
-
+
-
-
+
~
@@ -16,188 +15,159 @@
v-model="endTime"
value-format="yyyy-MM-dd"
size="small"
- style="width: 170px;margin:0px 10px"
+ style="width: 150px"
type="date"
placeholder="选择加工完成日期"/>
- 查询
+ 查询
导出
+
+
+
+
+
+ {{ scope.row.姓名 }}
+
+
+
+
+ {{ scope.row.理论加工时间段 }}
+
+
+
+
+ {{ scope.row.实际加工时间段 }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.零件图号 }}
+
+
+
+
+ {{ scope.row.零件名称 }}
+
+
+
+
+ {{ scope.row.工艺名称 }}
+
+
+
+
+ {{ scope.row.完成数量 }}
+
+
+
+
+ {{ scope.row.理论加工时间段 }}
+
+
+
+
+ {{ scope.row.实际加工时间段 }}
+
+
+
+
+ {{ scope.row.加工完成时间 }}
+
+
+
+
+
+
+
+
-
-
-
-
- {{ scope.row.姓名 }}
-
-
-
-
- {{ scope.row.理论加工时间段 }}
-
-
-
-
- {{ scope.row.实际加工时间段 }}
-
-
-
-
-
-
-
-
-
-
-
- {{ scope.row.零件图号 }}
-
-
-
-
- {{ scope.row.零件名称 }}
-
-
-
-
- {{ scope.row.工艺名称 }}
-
-
-
-
- {{ scope.row.完成数量 }}
-
-
-
-
- {{ scope.row.理论加工时间段 }}
-
-
-
-
- {{ scope.row.实际加工时间段 }}
-
-
-
-
- {{ scope.row.加工完成时间 }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.label }}
- {{ item.name }}
-
-
-
- 机床导出
-
-
- 组件导出
-
-
-
-
-
-
-
- {{ scope.row.机床图号 }}
-
-
-
-
- {{ scope.row.理论加工时间段 }}
-
-
-
-
- {{ scope.row.实际加工时间段 }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ scope.row.机床图号 }}
-
-
-
-
- {{ scope.row.组号 }}
-
-
-
-
- {{ scope.row.理论加工时间段 }}
-
-
-
-
- {{ scope.row.实际加工时间段 }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ item.label }}
+ {{ item.name }}
+
+
+
+ 机床导出
+
+
+ 组件导出
+
+
+
+
+
+
+
+ {{ scope.row.机床图号 }}
+
+
+
+
+ {{ scope.row.理论加工时间段 }}
+
+
+
+
+ {{ scope.row.实际加工时间段 }}
+
+
+
+
+
+
+
+
+ {{ scope.row.机床图号 }}
+
+
+
+
+ {{ scope.row.组号 }}
+
+
+
+
+ {{ scope.row.理论加工时间段 }}
+
+
+
+
+ {{ scope.row.实际加工时间段 }}
+
+
+
+
+
@@ -207,6 +177,7 @@ import { searchtable, searchtable2, searchtable4, searchtable5, initProject, sea
export default {
data() {
return {
+ AmountInputBox: 231,
workerName: '',
startTime: '',
endTime: '',
diff --git a/src/views/Outsourcing/OutFactoryMaintenance/index.vue b/src/views/Outsourcing/OutFactoryMaintenance/index.vue
index 5142aa31..9b2e1617 100644
--- a/src/views/Outsourcing/OutFactoryMaintenance/index.vue
+++ b/src/views/Outsourcing/OutFactoryMaintenance/index.vue
@@ -1,13 +1,11 @@
- 厂家名称:
-
+
+ 查询
- 新增
+ 新增
-
-
@@ -45,19 +43,9 @@
{{ scope.row.备注 }}
-
+
- 编辑
-
-
-
-
-
+
diff --git a/src/views/TechnologyCenter/QueryParts/index.vue b/src/views/TechnologyCenter/QueryParts/index.vue
index 0d6daf08..99153845 100644
--- a/src/views/TechnologyCenter/QueryParts/index.vue
+++ b/src/views/TechnologyCenter/QueryParts/index.vue
@@ -1,24 +1,14 @@
-
-
-
-
-
-
-
-
- 机床图号
-
+
- 组号
-
+
-
+
From da5a0afa330e15016d37af0b9b776590e8ae6aad Mon Sep 17 00:00:00 2001
From: Vergil <974548713@qq.com>
Date: Mon, 24 Feb 2020 16:07:48 +0800
Subject: [PATCH 2/8] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E5=AE=9A=E9=A2=9D?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../PartWorkCraftSelect_rdlc.js | 4 +-
.../AmountInputBox/AmountInputBox.js | 3 +-
.../PartWorkCraftSelect_rdlc/index.vue | 131 +++++-------------
3 files changed, 36 insertions(+), 102 deletions(-)
diff --git a/src/api/ManufacturingCenter/PartWorkCraftSelect_rdlc.js b/src/api/ManufacturingCenter/PartWorkCraftSelect_rdlc.js
index dc8b0c80..02349744 100644
--- a/src/api/ManufacturingCenter/PartWorkCraftSelect_rdlc.js
+++ b/src/api/ManufacturingCenter/PartWorkCraftSelect_rdlc.js
@@ -44,7 +44,7 @@ export function initPerson() {
})
}
// 查询
-export function search(pageCurrent, pageSize, check1, val1, check2, val2, check3, val3, check4, val4) {
+export function search(pageCurrent, pageSize, check1, val1, check2, val2, check3, val3, check4, val4, check5, val5, val6) {
return request({
url: '',
method: 'post',
@@ -53,7 +53,7 @@ export function search(pageCurrent, pageSize, check1, val1, check2, val2, check3
ModularID: router.currentRoute.path,
type: '1',
name: '车间生产管理工艺_零件工序_查询数据_已编制工序的全部零件及工序_按机床分组图号人员查',
- param: `机床流水号_check=${check1}&机床流水号=${val1}&组件流水号_check=${check2}&组件流水号=${val2}&零件图号_check=${check3}&零件图号=${val3}&人员编号_check=${check4}&人员编号=${val4}`,
+ param: `机床流水号_check=${check1}&机床流水号=${val1}&组件流水号_check=${check2}&组件流水号=${val2}&零件图号_check=${check3}&零件图号=${val3}&人员编号_check=${check4}&人员编号=${val4}&编制时间_check=${val5}&编制开始时间=${val5}&编制结束时间=${val6}`,
Pagination: pageCurrent + '&' + pageSize
}
})
diff --git a/src/components/AmountInputBox/AmountInputBox.js b/src/components/AmountInputBox/AmountInputBox.js
index 2514ead5..3332bd83 100644
--- a/src/components/AmountInputBox/AmountInputBox.js
+++ b/src/components/AmountInputBox/AmountInputBox.js
@@ -70,8 +70,7 @@ export default {
checkFloat(e, reg, charcode, el)
break
case 'notZero':
- // reg = (/^([1-9]\d*(\.\d*[1-9])?)|(0\.\d*[1-9])$/)
- reg = (/^(?!(0[0-9]{0,}$))[0-9]{1,}[.]{0,}[0-9]{0,}$/)
+ reg = (/^[1-9][0-9]*$/)
checkFloat(e, reg, charcode, el)
break
}
diff --git a/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue b/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue
index 1cb6a61a..ad51a8d0 100644
--- a/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue
+++ b/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue
@@ -28,63 +28,66 @@
:label="item.label"
:value="item.value"/>
+
查询
- 零件工艺调整
+ 打回重新编制
-
+
-
-
-
+
+
+
{{ scope.row.机床图号 }}
-
+
{{ scope.row.组号 }}
-
+
{{ scope.row.零件图号 }}
-
+
{{ scope.row.零件名称 }}
-
+
{{ scope.row.批次数量 }}
-
+
{{ scope.row.工艺员 }}
+
+
+ {{ scope.row.工艺完成 }}
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
From e284656a1ede9f21f0a119903b3f703ef46c1358 Mon Sep 17 00:00:00 2001
From: Vergil <974548713@qq.com>
Date: Tue, 25 Feb 2020 11:25:17 +0800
Subject: [PATCH 8/8] =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=AE=8C=E6=88=90?=
=?UTF-8?q?=E5=B7=A5=E6=97=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/ManufacturingCenter/Enter0therData/index.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/ManufacturingCenter/Enter0therData/index.vue b/src/views/ManufacturingCenter/Enter0therData/index.vue
index 3e5a55df..715b97c6 100644
--- a/src/views/ManufacturingCenter/Enter0therData/index.vue
+++ b/src/views/ManufacturingCenter/Enter0therData/index.vue
@@ -25,7 +25,7 @@
type="month"
size="small"
value-format="yyyy-MM"
- style="margin-left: 400px; width: 140px"
+ style="margin-left: 280px; width: 140px"
placeholder="选择月"/>
查询