diff --git a/src/api/system/user.js b/src/api/system/user.js
index 4ac28c3..2ea737e 100644
--- a/src/api/system/user.js
+++ b/src/api/system/user.js
@@ -9,6 +9,14 @@ export function listUser(query) {
params: query
})
}
+// 查询包含调班的用户列表
+export function listUserWithShift(query) {
+ return request({
+ url: '/system/user/shiftList',
+ method: 'get',
+ params: query
+ })
+}
// 查询用户列表ByIds
export function listUserByIds(userIds) {
diff --git a/src/api/yh/shift.js b/src/api/yh/shift.js
new file mode 100644
index 0000000..b3f6dd0
--- /dev/null
+++ b/src/api/yh/shift.js
@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询调班列表
+export function listShift(query) {
+ return request({
+ url: '/yh/shift/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询调到本部门的列表
+export function listTargetShift(query) {
+ return request({
+ url: '/yh/shift/targetList',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询调班详细
+export function getShift(shiftId) {
+ return request({
+ url: '/yh/shift/' + shiftId,
+ method: 'get'
+ })
+}
+
+// 新增调班
+export function addShift(data) {
+ return request({
+ url: '/yh/shift',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改调班
+export function updateShift(data) {
+ return request({
+ url: '/yh/shift',
+ method: 'put',
+ data: data
+ })
+}
+
+// 删除调班
+export function delShift(shiftId) {
+ return request({
+ url: '/yh/shift/' + shiftId,
+ method: 'delete'
+ })
+}
diff --git a/src/components/Business/User/UserDialog.vue b/src/components/Business/User/UserDialog.vue
index f35c10f..9836150 100644
--- a/src/components/Business/User/UserDialog.vue
+++ b/src/components/Business/User/UserDialog.vue
@@ -8,7 +8,9 @@
ref="check"
:multiple="multiple"
:init-select="initSelect"
+ :list-api="listApi"
v-on="$listeners"
+ :query="query"
/>
diff --git a/src/components/Business/User/UserDrawer.vue b/src/components/Business/User/UserDrawer.vue
index 68a3329..39dcc1b 100644
--- a/src/components/Business/User/UserDrawer.vue
+++ b/src/components/Business/User/UserDrawer.vue
@@ -13,7 +13,9 @@
ref="check"
:multiple="multiple"
:init-select="initSelect"
+ :list-api="listApi"
v-on="$listeners"
+ :query="query"
/>
@@ -26,6 +28,7 @@ import Price from "@/views/yh/price/index.vue";
import BooleanTag from "@/components/BooleanTag/index.vue";
import {$showColumns} from "@/utils/mixins";
import UserCheck from "@/components/Business/User/UserCheck.vue";
+import {listUser} from "@/api/system/user";
export default {
@@ -55,6 +58,10 @@ export default {
type: Array,
default: null,
},
+ listApi: {
+ type: Function,
+ default: listUser
+ }
},
computed: {
visible: {
diff --git a/src/components/Business/User/UserInput.vue b/src/components/Business/User/UserInput.vue
index eb86562..3fcb3b0 100644
--- a/src/components/Business/User/UserInput.vue
+++ b/src/components/Business/User/UserInput.vue
@@ -12,7 +12,7 @@
disable-transitions
:closable="!disabled"
@close="onCloseSelected(index)"
- >{{item.name}}
+ >{{item[showProp]}}
+
+
diff --git a/src/components/StartEndDatePicker/index.vue b/src/components/StartEndDatePicker/index.vue
new file mode 100644
index 0000000..e89fef7
--- /dev/null
+++ b/src/components/StartEndDatePicker/index.vue
@@ -0,0 +1,58 @@
+
+
+
+
diff --git a/src/utils/constants.js b/src/utils/constants.js
index 0141709..7041af0 100644
--- a/src/utils/constants.js
+++ b/src/utils/constants.js
@@ -1,4 +1,6 @@
// 视图
+import {getLastDate, getLastDateTimeEnd, getLastDateTimeStart, getLastMonth, getLastMonthTimeEnd} from "@/utils/index";
+
export const views = {
}
@@ -110,3 +112,64 @@ export const OperLogBizType = {
MATERIAL: "4", // 物料
UNIT: "5", // 单位
}
+
+// 日期选择器快捷选项
+export const DatePickerOptions = {
+ // 默认
+ DEFAULT: {
+ shortcuts: [{
+ text: '最近一周',
+ onClick(picker) {
+ const end = getLastDate(0);
+ const start = getLastDate(6);
+ picker.$emit('pick', [start, end]);
+ }
+ }, {
+ text: '最近一个月',
+ onClick(picker) {
+ const end = getLastDate(0);
+ const start = getLastMonth(1);
+ picker.$emit('pick', [start, end]);
+ }
+ }, {
+ text: '最近三个月',
+ onClick(picker) {
+ const end = getLastDate(0);
+ const start = getLastMonth(3);
+ picker.$emit('pick', [start, end]);
+ }
+ }]
+ },
+ // 未来
+ FUTURE: {
+ shortcuts: [{
+ text: '明天',
+ onClick(picker) {
+ const end = getLastDateTimeEnd(-1);
+ const start = getLastDateTimeStart(-1);
+ picker.$emit('pick', [start, end]);
+ }
+ },{
+ text: '未来一周',
+ onClick(picker) {
+ const end = getLastDateTimeEnd(-6);
+ const start = getLastDateTimeStart(0);
+ picker.$emit('pick', [start, end]);
+ }
+ }, {
+ text: '未来一个月',
+ onClick(picker) {
+ const end = getLastMonthTimeEnd(-1);
+ const start = getLastDateTimeStart(0);
+ picker.$emit('pick', [start, end]);
+ }
+ }, {
+ text: '未来三个月',
+ onClick(picker) {
+ const end = getLastMonthTimeEnd(-3);
+ const start = getLastDateTimeStart(0);
+ picker.$emit('pick', [start, end]);
+ }
+ }]
+ }
+}
diff --git a/src/utils/index.js b/src/utils/index.js
index d4dff41..e4b4a9b 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -466,6 +466,22 @@ export function getLastMonth(n) {
return date;
}
+export function getLastMonthTimeEndStr(n) {
+ let date = getLastMonth(n)
+ return parseTime(date, "{y}-{m}-{d} 23:59:59");
+}
+export function getLastMonthTimeEnd(n) {
+ return new Date(getLastMonthTimeEndStr(n));
+}
+
+export function getLastMonthTimeStartStr(n) {
+ let date = getLastMonth(n)
+ return parseTime(date, "{y}-{m}-{d} 00:00:00");
+}
+export function getLastMonthTimeStart(n) {
+ return new Date(getLastMonthTimeStartStr(n))
+}
+
// 获取前n月的日期字符串
export function getLastMonthDateStr(n) {
let date = getLastMonth(n);
diff --git a/src/views/yh/report/edit/components/ReportProductEdit.vue b/src/views/yh/report/edit/components/ReportProductEdit.vue
index 25a56b8..222d587 100644
--- a/src/views/yh/report/edit/components/ReportProductEdit.vue
+++ b/src/views/yh/report/edit/components/ReportProductEdit.vue
@@ -128,7 +128,13 @@
-
+
@@ -208,6 +215,13 @@ export default {
}
},
computed: {
+ // 用户查询条件
+ userQuery() {
+ return {
+ shiftDate: this.form.reportDate,
+ targetDeptId: this.form.deptId
+ }
+ },
// 获取属性名
getProp() {
return (index, prop) => {
diff --git a/src/views/yh/report/edit/components/ReportProductRowEdit.vue b/src/views/yh/report/edit/components/ReportProductRowEdit.vue
index 932271f..a67ae15 100644
--- a/src/views/yh/report/edit/components/ReportProductRowEdit.vue
+++ b/src/views/yh/report/edit/components/ReportProductRowEdit.vue
@@ -44,6 +44,7 @@
:price="form.pricePrice"
:price-unit="form.priceUnit"
:rules="rules.userProdList"
+ :user-query="userQuery"
/>
关联订单
@@ -94,6 +95,11 @@ export default {
visible: {
type: Boolean,
default: false,
+ },
+ // 用户查询条件
+ userQuery: {
+ type: Object,
+ default: () => ({})
}
},
data() {
diff --git a/src/views/yh/report/edit/components/ReportProductUserListEdit.vue b/src/views/yh/report/edit/components/ReportProductUserListEdit.vue
index 2c57842..8361684 100644
--- a/src/views/yh/report/edit/components/ReportProductUserListEdit.vue
+++ b/src/views/yh/report/edit/components/ReportProductUserListEdit.vue
@@ -4,7 +4,7 @@
-
+
@@ -49,7 +49,9 @@
@@ -62,6 +64,7 @@ import UserDialog from "@/components/Business/User/UserDialog.vue";
import UserInput from "@/components/Business/User/UserInput.vue";
import {calcMulDecimal} from "@/utils/money";
import UserDrawer from "@/components/Business/User/UserDrawer.vue";
+import {listUserWithShift} from "@/api/system/user";
export default {
name: "ReportProductUserListEdit",
@@ -86,6 +89,10 @@ export default {
rules: {
type: Object,
default: () => ({})
+ },
+ userQuery: {
+ type: Object,
+ default: () => ({})
}
},
data() {
@@ -101,6 +108,7 @@ export default {
}
},
methods: {
+ listUserWithShift,
// 添加用户产量
handleAddUserProduct() {
this.showUserDialog = true;
diff --git a/src/views/yh/report/edit/components/UserProductBatchDialog.vue b/src/views/yh/report/edit/components/UserProductBatchDialog.vue
index c74232e..b44c055 100644
--- a/src/views/yh/report/edit/components/UserProductBatchDialog.vue
+++ b/src/views/yh/report/edit/components/UserProductBatchDialog.vue
@@ -25,7 +25,7 @@
-
+
@@ -58,6 +58,8 @@
@@ -74,15 +76,22 @@ import UserInput from "@/components/Business/User/UserInput.vue";
import UserDialog from "@/components/Business/User/UserDialog.vue";
import {isEmpty} from "@/utils";
import {IncomeMode} from "@/utils/constants";
+import UserDrawer from "@/components/Business/User/UserDrawer.vue";
+import {listUserWithShift} from "@/api/system/user";
export default {
name: "UserProductBatchDialog",
- components: {UserDialog, UserInput, FormCol},
+ components: {UserDrawer, UserDialog, UserInput, FormCol},
props: {
show: {
type: Boolean,
default: false
},
+ // 用户查询条件
+ userQuery: {
+ type: Object,
+ default: () => ({})
+ }
},
computed: {
IncomeMode() {
@@ -106,6 +115,7 @@ export default {
}
},
methods: {
+ listUserWithShift,
onSubmit() {
this.$emit('submit', this.form);
},
diff --git a/src/views/yh/shift/index.vue b/src/views/yh/shift/index.vue
new file mode 100644
index 0000000..eef43d8
--- /dev/null
+++ b/src/views/yh/shift/index.vue
@@ -0,0 +1,389 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+ {{d.row[column.key]}}
+
+
+
+ {{item.nickName | dv}}
+
+
+
+ 起始:{{d.row.shiftTimeStart | dv}}
+ 结束:{{d.row.shiftTimeEnd | dv}}
+
+
+ {{d.row.createBy | dv}}
+ {{d.row.createTime | dv}}
+
+
+ {{d.row.updateBy | dv}}
+ {{d.row.updateTime | dv}}
+
+
+ {{d.row[column.key] | dv}}
+
+
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+