|
@@ -123,6 +123,10 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-radio>
|
|
|
+ <div>
|
|
|
+ <el-link :underline="false" type="primary" @click="setupRest">设置休息时间段</el-link>
|
|
|
+
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
|
|
@@ -290,6 +294,47 @@
|
|
|
<el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 设置休息时间段 -->
|
|
|
+ <el-dialog title="设置休息时间段" v-if="setupRestDialog" :visible.sync="setupRestDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
+ <el-table :data="restList" highlight-current-row height="400" style="width: 100%;">
|
|
|
+ <el-table-column prop="id" width="60" label="序号">
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ {{scope.$index + 1}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="时间段">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.startTime + '-' + scope.row.endTime}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ <el-button size="small" type="primary" @click="setupRestEdit(scope.row)">编辑</el-button>
|
|
|
+ <el-button size="small" type="danger" @click="setupRestDelete(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click.native="setupRestDialog = false">关闭</el-button>
|
|
|
+ <el-button type="primary" @click="setupRestNew">新增时间段</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog :title="setupItemId == null ? '新增' : '修改'" v-if="setupRestAppendDialog" :visible.sync="setupRestAppendDialog" :close-on-click-modal="false" customClass="customWidth" width="400px" append-to-body>
|
|
|
+ <el-form label-width="100px">
|
|
|
+ <el-form-item label="开始时间">
|
|
|
+ <el-time-picker v-model="restTime.startTime" placeholder="请选择时间" format="HH:mm" value-format="HH:mm" style="cursor: pointer;"></el-time-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="结束时间">
|
|
|
+ <el-time-picker v-model="restTime.endTime" placeholder="请选择时间" format="HH:mm" value-format="HH:mm" style="cursor: pointer;"></el-time-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click.native="setupRestAppendDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="setupRestSure">确认</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -331,10 +376,102 @@
|
|
|
addfm: {
|
|
|
name: '',
|
|
|
},
|
|
|
- iptss: ''
|
|
|
+ iptss: '',
|
|
|
+ setupRestDialog: false,
|
|
|
+ setupRestAppendDialog: false,
|
|
|
+ restTime: {
|
|
|
+ startTime: null,
|
|
|
+ endTime: null
|
|
|
+ },
|
|
|
+ restList: [],
|
|
|
+ setupItemId: null
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ setupRest(){
|
|
|
+ // this.getRestList()
|
|
|
+ this.setupRestDialog = true
|
|
|
+ },
|
|
|
+ getRestList(){
|
|
|
+ this.http.post('/time-auto-exclude/list',{
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ console.log('getRestList',res);
|
|
|
+ this.restList = res.data
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },err => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setupRestNew(){
|
|
|
+ this.setupItemId = null
|
|
|
+ this.setupRestAppendDialog = true
|
|
|
+ this.restTime = {startTime: null, endTime: null}
|
|
|
+ },
|
|
|
+ setupRestEdit(item){
|
|
|
+ this.setupItemId = item.id
|
|
|
+ this.setupRestAppendDialog = true
|
|
|
+ let Jitem = JSON.parse(JSON.stringify(item))
|
|
|
+ this.restTime = {
|
|
|
+ startTime: Jitem.startTime,
|
|
|
+ endTime: Jitem.endTime
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setupRestDelete(item){
|
|
|
+ this.http.post('/time-auto-exclude/delete',{
|
|
|
+ id: item.id
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.$message({
|
|
|
+ message: '删除成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getRestList()
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },err => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setupRestSure(){
|
|
|
+ if(this.setupItemId != null){
|
|
|
+ this.restTime.id = this.setupItemId
|
|
|
+ }
|
|
|
+ this.http.post('/time-auto-exclude/addOrMod',this.restTime,
|
|
|
+ res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.getRestList()
|
|
|
+ this.setupRestAppendDialog = false
|
|
|
+ }else {
|
|
|
+ this.setupRestAppendDialog = false
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },err => {
|
|
|
+ this.setupRestAppendDialog = false
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
bianji() {
|
|
|
this.subProjectVisible = true
|
|
|
this.listLoading = true;
|
|
@@ -648,6 +785,7 @@
|
|
|
mounted() {
|
|
|
this.initTime();
|
|
|
this.getCompanyTimeSetting();
|
|
|
+ this.getRestList()
|
|
|
}
|
|
|
};
|
|
|
</script>
|