|
@@ -1,1140 +1,1165 @@
|
|
|
<template>
|
|
|
+ <!-- 1022 -->
|
|
|
+ <div>
|
|
|
|
|
|
- <div>
|
|
|
-
|
|
|
-
|
|
|
- <el-card class="box-card">
|
|
|
- <!-- 搜索区域 -->
|
|
|
- <div class="search-bx1">
|
|
|
- <el-input v-model="searchData.number" placeholder="工单编号" style="width: 180px;" class="g-mr20 g-mb20" clearable />
|
|
|
- <el-input v-model="searchData.user_name" placeholder="负责人" style="width: 180px;" class="g-mr20" clearable />
|
|
|
- <el-input v-model="searchData.user_phone" placeholder="负责人手机号" style="width: 180px;" class="g-mr20" clearable />
|
|
|
- <el-input v-model="searchData.operation_user" placeholder="派单人" style="width: 180px;" class="g-mr20" clearable />
|
|
|
- <el-select v-model="searchData.status" filterable placeholder="工单分类" class="g-mr20" style="width: 180px;" clearable>
|
|
|
- <el-option v-for="item in orderTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
- <el-select v-model="searchData.work_order_category_id" filterable placeholder="类型" class="g-mr20" style="width: 180px;" clearable>
|
|
|
- <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
-
|
|
|
- <el-select v-model="searchData.status" filterable placeholder="状态" class="g-mr20" style="width: 180px;" clearable>
|
|
|
- <el-option v-for="item in statusList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
-
|
|
|
- <el-date-picker v-model="searchData.inputDatetime1" class="g-mr20" type="daterange" range-separator="至" start-placeholder="完成时间" end-placeholder="完成时间" style="width: 250px;" />
|
|
|
-
|
|
|
- <el-date-picker v-model="searchData.inputDatetime2" class="g-mr20" type="daterange" range-separator="至" start-placeholder="派单时间" end-placeholder="派单时间" style="width: 250px;" />
|
|
|
-
|
|
|
-
|
|
|
- <el-button type="primary" @click="form_search">搜索</el-button>
|
|
|
- <el-button type="primary" @click="form_clear">重置</el-button>
|
|
|
- <el-button type="primary" v-if="isButtonEdit" @click="form_add1">添加一次性工单</el-button>
|
|
|
- <!-- <el-button type="primary" v-if="isButtonEdit" @click="form_add2">添加周期工单</el-button> -->
|
|
|
- <!-- <el-button type="primary" @click="form_export">导出</el-button> -->
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <!-- 表格 -->
|
|
|
- <el-table key="0" :data="tableList" v-loading="tableLoading" element-loading-text="给我一点时间" border fit>
|
|
|
- <el-table-column label="序号" width="50px" align="center" fixed="left">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.id }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="工单编号" min-width="200px" align="center" fixed="left">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- <span>{{ scope.row.number }}</span> -->
|
|
|
- <el-button type="primary" size="mini" @click="form_see1(scope.row)">{{ scope.row.number }}</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="类型" min-width="150px" align="center" fixed="left">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.work_order_category_name }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="状态" min-width="150px" align="center" fixed="left">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- <span v-if = "scope.row.status == 0">未知</span> -->
|
|
|
- <span v-if = "scope.row.status == 1">已创建未执行</span>
|
|
|
- <span v-if = "scope.row.status == 2">执行中</span>
|
|
|
- <span v-if = "scope.row.status == 3">已完成</span>
|
|
|
- <span v-if = "scope.row.status == 4">已关闭</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="工单分类" min-width="150px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- <span v-if = "scope.row.status == 0">未知</span> -->
|
|
|
- <span v-if = "scope.row.status == 1">周期性工单</span>
|
|
|
- <span v-if = "scope.row.status == 2">一次性工单</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="对象" min-width="150px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- <el-button type="primary" size="mini" @click="form_see(scope.row)">查看</el-button> -->
|
|
|
- <span>{{ scope.row.barn_names }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="任务" min-width="150px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.remark }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="派单人" min-width="150px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.operation_name }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="派单人手机号" min-width="150px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.operation_phone }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="派单时间" min-width="150px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.created_at_format }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="负责人" min-width="150px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.user_name }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="负责人手机号" min-width="150px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.user_phone }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="完成时间" min-width="150px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.finished_at_format }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ <el-card class="box-card">
|
|
|
+ <!-- 搜索区域 -->
|
|
|
+ <div class="search-bx1">
|
|
|
+ <el-input v-model="searchData.number" placeholder="工单编号" style="width: 180px;" class="g-mr20 g-mb20" clearable />
|
|
|
+ <el-input v-model="searchData.user_name" placeholder="负责人" style="width: 180px;" class="g-mr20" clearable />
|
|
|
+ <el-input v-model="searchData.user_phone" placeholder="负责人手机号" style="width: 180px;" class="g-mr20" clearable />
|
|
|
+ <el-input v-model="searchData.operation_user" placeholder="派单人" style="width: 180px;" class="g-mr20" clearable />
|
|
|
+ <el-select v-model="searchData.status" filterable placeholder="工单分类" class="g-mr20" style="width: 180px;" clearable>
|
|
|
+ <el-option v-for="item in orderTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="searchData.work_order_category_id" filterable placeholder="类型" class="g-mr20" style="width: 180px;" clearable>
|
|
|
+ <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <el-select v-model="searchData.status" filterable placeholder="状态" class="g-mr20" style="width: 180px;" clearable>
|
|
|
+ <el-option v-for="item in statusList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <el-date-picker v-model="searchData.inputDatetime1" class="g-mr20" type="daterange" range-separator="至" start-placeholder="完成时间" end-placeholder="完成时间" style="width: 250px;" />
|
|
|
+
|
|
|
+ <el-date-picker v-model="searchData.inputDatetime2" class="g-mr20" type="daterange" range-separator="至" start-placeholder="派单时间" end-placeholder="派单时间" style="width: 250px;" />
|
|
|
|
|
|
+
|
|
|
+ <el-button type="primary" @click="form_search">搜索</el-button>
|
|
|
+ <el-button type="primary" @click="form_clear">重置</el-button>
|
|
|
+ <el-button type="primary" v-if="isButtonEdit" @click="form_add1">添加一次性工单</el-button>
|
|
|
+ <!-- <el-button type="primary" v-if="isButtonEdit" @click="form_add2">添加周期工单</el-button> -->
|
|
|
+ <!-- <el-button type="primary" @click="form_export">导出</el-button> -->
|
|
|
+ </div>
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button> -->
|
|
|
- <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_edit1(scope.row)">修改</el-button>
|
|
|
- <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_see1(scope.row)">详情</el-button>
|
|
|
- <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_result1(scope.row)">执行结果</el-button>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <el-button type="danger" v-if="isButtonEdit &&(scope.row.status == 1 || scope.row.status == 2)" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">关闭工单</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
-
|
|
|
- <!-- <span v-if = "scope.row.status == 1">已创建未执行</span>
|
|
|
- <span v-if = "scope.row.status == 2">执行中</span>
|
|
|
- <span v-if = "scope.row.status == 3">已完成</span>
|
|
|
- <span v-if = "scope.row.status == 4">已关闭</span> -->
|
|
|
-
|
|
|
- <!-- 分页区域 -->
|
|
|
- <el-pagination @size-change="change_size_page" @current-change="change_current_page" :current-page="searchData.page" :page-sizes="[1,5,10,20,30,50]" :page-size="searchData.page_size" layout="total, prev, pager, next" :total="searchData.total"/>
|
|
|
- </el-card>
|
|
|
-
|
|
|
-
|
|
|
- <!-- 弹窗 新增or修改一次性工单 -->
|
|
|
- <el-dialog :title="addFormTxt1[addFormStatus1]" :visible.sync="addFormShow1" @close="add_dialog_close1" width="50%">
|
|
|
- <div class="">
|
|
|
- <el-form ref="addFormRef1" :rules="addFormRules1" :model="addForm1" label-position="right" label-width="140px" style="width:90%;margin:0 auto 50px">
|
|
|
-
|
|
|
-
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="工单类型:" prop="work_order_category_id">
|
|
|
- <el-select v-model="addForm1.work_order_category_id" placeholder="请选择" class="filter-item" style="width: 100%;" :disabled=" addFormStatus1=='see'">
|
|
|
- <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="工单任务:" prop="remark">
|
|
|
- <el-input v-model="addForm1.remark" type="textarea" maxlength="200" :rows="3" :disabled=" addFormStatus1=='see'" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="20">
|
|
|
+ <!-- 表格 -->
|
|
|
+ <el-table key="0" :data="tableList" v-loading="tableLoading" element-loading-text="给我一点时间" border fit>
|
|
|
+ <el-table-column label="序号" width="50px" align="center" fixed="left">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.id }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="工单编号" min-width="200px" align="center" fixed="left">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- <span>{{ scope.row.number }}</span> -->
|
|
|
+ <el-button type="primary" size="mini" @click="form_see1(scope.row)">{{ scope.row.number }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="类型" min-width="150px" align="center" fixed="left">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.work_order_category_name }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" min-width="150px" align="center" fixed="left">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- <span v-if = "scope.row.status == 0">未知</span> -->
|
|
|
+ <span v-if = "scope.row.status == 1">已创建未执行</span>
|
|
|
+ <span v-if = "scope.row.status == 2">执行中</span>
|
|
|
+ <span v-if = "scope.row.status == 3">已完成</span>
|
|
|
+ <span v-if = "scope.row.status == 4">已关闭</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="工单分类" min-width="150px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- <span v-if = "scope.row.status == 0">未知</span> -->
|
|
|
+ <span v-if = "scope.row.status == 1">周期性工单</span>
|
|
|
+ <span v-if = "scope.row.status == 2">一次性工单</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="对象" min-width="150px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- <el-button type="primary" size="mini" @click="form_see(scope.row)">查看</el-button> -->
|
|
|
+ <span>{{ scope.row.barn_names }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="任务" min-width="150px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.remark }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
- <el-col :span="12" style="text-align:left">
|
|
|
- <h4>工单对象</h4>
|
|
|
-
|
|
|
- <el-input
|
|
|
- placeholder="输入关键字进行过滤"
|
|
|
- v-model="filterText">
|
|
|
- </el-input>
|
|
|
- <!-- 树形控件 -->
|
|
|
- <el-tree ref="tree" :data="rightlist" :props="{ label:'name',children:'barn_list' }" show-checkbox node-key="idTxt" default-expand-all :default-checked-keys="checkedIdTxtArr" @check-change="change_check" :filter-node-method="filterNode"> </el-tree>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12" style="text-align:left">
|
|
|
-
|
|
|
- <h4>已选栏舍</h4>
|
|
|
- <el-tag v-for="item in leftlist" style="margin-right:20px;margin-bottom:20px">{{item}}</el-tag>
|
|
|
-
|
|
|
- </el-col>
|
|
|
-
|
|
|
+ <el-table-column label="派单人" min-width="150px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.operation_name }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="派单人手机号" min-width="150px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.operation_phone }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="派单时间" min-width="150px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.created_at_format }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="负责人" min-width="150px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.user_name }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="负责人手机号" min-width="150px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.user_phone }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="完成时间" min-width="150px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.finished_at_format }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
-
|
|
|
- </el-row>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <!-- <el-row :gutter="20">
|
|
|
- <el-transfer :titles="['栏舍名称', '栏舍名称']" v-model="transDataChooseRight2" :data="transDataList2" :props="{ key: 'id', label: 'name' }" @change="change_transData2"></el-transfer>
|
|
|
- </el-row>
|
|
|
- -->
|
|
|
-
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" v-if="addFormStatus1==='create' || addFormStatus1==='edit'" @click="addFormStatus1==='create'?add_dialog_save1():edit_dialog_save1()">确认</el-button>
|
|
|
- <el-button @click="addFormShow = false">关闭</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
-
|
|
|
- <!-- 弹窗 详情 一次性工单 -->
|
|
|
- <el-dialog title="工单信息" :visible.sync="seeFormShow1" @close="see_dialog_close1" width="50%">
|
|
|
- <div class="">
|
|
|
- <el-form ref="seeFormRef1" :model="seeForm1" label-position="right" label-width="140px" style="width:90%;margin:0 auto 50px">
|
|
|
-
|
|
|
-
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="工单类型:" prop="work_order_category_id">
|
|
|
- <el-select v-model="seeForm1.work_order_category_id" placeholder="请选择" class="filter-item" style="width: 100%;" :disabled=" addFormStatus1=='see'">
|
|
|
- <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="工单任务:" prop="remark">
|
|
|
- <el-input v-model="seeForm1.remark" type="textarea" maxlength="200" :rows="3" disabled />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button> -->
|
|
|
+ <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_edit1(scope.row)">修改</el-button>
|
|
|
+ <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_see1(scope.row)">详情</el-button>
|
|
|
+ <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_result1(scope.row)">执行结果</el-button>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-button type="danger" v-if="isButtonEdit &&(scope.row.status == 1 || scope.row.status == 2)" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">关闭工单</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- <span v-if = "scope.row.status == 1">已创建未执行</span>
|
|
|
+ <span v-if = "scope.row.status == 2">执行中</span>
|
|
|
+ <span v-if = "scope.row.status == 3">已完成</span>
|
|
|
+ <span v-if = "scope.row.status == 4">已关闭</span> -->
|
|
|
+
|
|
|
+ <!-- 分页区域 -->
|
|
|
+ <el-pagination @size-change="change_size_page" @current-change="change_current_page" :current-page="searchData.page" :page-sizes="[1,5,10,20,30,50]" :page-size="searchData.page_size" layout="total, prev, pager, next" :total="searchData.total"/>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 弹窗 新增or修改一次性工单 -->
|
|
|
+ <el-dialog :title="addFormTxt1[addFormStatus1]" :visible.sync="addFormShow1" @close="add_dialog_close1" width="50%">
|
|
|
+ <div class="">
|
|
|
+ <el-form ref="addFormRef1" :rules="addFormRules1" :model="addForm1" label-position="right" label-width="140px" style="width:90%;margin:0 auto 50px">
|
|
|
+
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工单类型:" prop="work_order_category_id">
|
|
|
+ <el-select v-model="addForm1.work_order_category_id" placeholder="请选择" class="filter-item" style="width: 100%;" :disabled=" addFormStatus1=='see'">
|
|
|
+ <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工单任务:" prop="remark">
|
|
|
+ <el-input v-model="addForm1.remark" type="textarea" maxlength="200" :rows="3" :disabled=" addFormStatus1=='see'" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+
|
|
|
+ <el-col :span="12" style="text-align:left">
|
|
|
+ <h4>工单对象</h4>
|
|
|
+
|
|
|
+ <el-input
|
|
|
+ placeholder="输入关键字进行过滤"
|
|
|
+ v-model="filterText">
|
|
|
+ </el-input>
|
|
|
+ <!-- 树形控件 -->
|
|
|
+ <el-tree ref="tree" :data="rightlist" :props="{ label:'name',children:'barn_list' }" show-checkbox node-key="idTxt" default-expand-all :default-checked-keys="checkedIdTxtArr" @check-change="change_check" :filter-node-method="filterNode"> </el-tree>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" style="text-align:left">
|
|
|
+
|
|
|
+ <h4>已选栏舍</h4>
|
|
|
+ <el-tag v-for="item in leftlist" style="margin-right:20px;margin-bottom:20px">{{item}}</el-tag>
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="20">
|
|
|
-
|
|
|
- <!-- <div v-for="item in tableArrList">
|
|
|
- <h3>{{item.date}}</h3>
|
|
|
- <el-table :data="item.tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" border :span-method="ObjectSpanMethod" >
|
|
|
- <el-table-column prop="date" label="栏舍组" sortable min-width="180"> </el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="address" label="栏舍" min-width="180"> </el-table-column>
|
|
|
- <el-table-column prop="name" label="数量" sortable min-width="180"> </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div> -->
|
|
|
-
|
|
|
- <el-table :data="tableSeeList" style="width: 100%;margin-bottom: 20px;" row-key="id" border :span-method="ObjectSpanMethod" >
|
|
|
- <el-table-column prop="cowshedGroup" label="栏舍组" sortable width="180"> </el-table-column>
|
|
|
-
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" v-if="addFormStatus1==='create' || addFormStatus1==='edit'" @click="addFormStatus1==='create'?add_dialog_save1():edit_dialog_save1()">确认</el-button>
|
|
|
+ <el-button @click="addFormShow1 = false">关闭</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 弹窗 详情 一次性工单 -->
|
|
|
+ <el-dialog title="工单信息" :visible.sync="seeFormShow1" @close="see_dialog_close1" width="50%">
|
|
|
+ <div class="">
|
|
|
+ <el-form ref="seeFormRef1" :model="seeForm1" label-position="right" label-width="140px" style="width:90%;margin:0 auto 50px">
|
|
|
+
|
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工单类型:" prop="work_order_category_id">
|
|
|
+ <el-select v-model="seeForm1.work_order_category_id" placeholder="请选择" class="filter-item" style="width: 100%;" :disabled=" addFormStatus1=='see'">
|
|
|
+ <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工单任务:" prop="remark">
|
|
|
+ <el-input v-model="seeForm1.remark" type="textarea" maxlength="200" :rows="3" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+
|
|
|
+ <!-- <div v-for="item in tableArrList">
|
|
|
+ <h3>{{item.date}}</h3>
|
|
|
+ <el-table :data="item.tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" border :span-method="ObjectSpanMethod" >
|
|
|
+ <el-table-column prop="date" label="栏舍组" sortable min-width="180"> </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column prop="address" label="栏舍" min-width="180"> </el-table-column>
|
|
|
+ <el-table-column prop="name" label="数量" sortable min-width="180"> </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ <el-table :data="tableSeeList1" style="width: 100%;margin-bottom: 20px;" row-key="id" border :span-method="ObjectSpanMethod" >
|
|
|
+ <el-table-column prop="cowshedGroup" label="栏舍组" min-width="200px" > </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column prop="cowshed" label="栏舍" min-width="200px" > </el-table-column>
|
|
|
+ <el-table-column prop="num" label="数量" min-width="200px" > </el-table-column>
|
|
|
|
|
|
- <el-table-column prop="cowshed" label="栏舍"> </el-table-column>
|
|
|
- <el-table-column prop="num" label="数量" sortable width="180"> </el-table-column>
|
|
|
-
|
|
|
- </el-table>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ </el-table>
|
|
|
|
|
|
- </el-row>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click=" see_dialog_save1() ">确认</el-button>
|
|
|
- <el-button @click="seeFormShow1 = false">关闭</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="see_dialog_close1()">确认</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 弹窗 执行结果 一次性工单 -->
|
|
|
+ <el-dialog title="工单信息" :visible.sync="resultFormShow1" @close="result_dialog_close1" width="80%">
|
|
|
+ <div class="">
|
|
|
+ <el-form ref="resultFormRef1" :model="resultForm1" label-position="right" label-width="140px" style="width:90%;margin:0 auto 50px">
|
|
|
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
|
|
|
-import { parseTime, json2excel } from '@/utils/index.js'
|
|
|
-export default {
|
|
|
- data() {
|
|
|
-
|
|
|
- return {
|
|
|
-
|
|
|
-
|
|
|
- tableArrList:[
|
|
|
- {date:"123123", tableData: [
|
|
|
-
|
|
|
- { id: 1, cowshedGroup: 'A组', num: '33', cowshed: '001舍' },
|
|
|
- { id: 31, cowshedGroup: 'A组', num: '33', cowshed: '002舍' },
|
|
|
- { id: 32, cowshedGroup: 'A组', num: '33', cowshed: '001舍' },
|
|
|
-
|
|
|
- { id: 1, cowshedGroup: 'B组', num: '33', cowshed: '003舍' },
|
|
|
- { id: 31, cowshedGroup: 'B组', num: '33', cowshed: '002舍' },
|
|
|
- { id: 32, cowshedGroup: 'B组', num: '33', cowshed: '002舍' },
|
|
|
-
|
|
|
-
|
|
|
- ]
|
|
|
- } ,
|
|
|
- {date:"2222", tableData: [
|
|
|
-
|
|
|
- { id: 1, cowshedGroup: 'A组', num: '33', cowshed: '001舍' },
|
|
|
- { id: 31, cowshedGroup: 'A组', num: '33', cowshed: '002舍' },
|
|
|
- { id: 32, cowshedGroup: 'A组', num: '33', cowshed: '001舍' },
|
|
|
-
|
|
|
- { id: 1, cowshedGroup: 'B组', num: '33', cowshed: '003舍' },
|
|
|
- { id: 31, cowshedGroup: 'B组', num: '33', cowshed: '002舍' },
|
|
|
- { id: 32, cowshedGroup: 'B组', num: '33', cowshed: '002舍' },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- ] }
|
|
|
-
|
|
|
-
|
|
|
- ],
|
|
|
- tableSeeList:[
|
|
|
-
|
|
|
- { id: 1, cowshedGroup: 'A组(总数:100)', groupnum: '100', num: '33', cowshed: '001舍' },
|
|
|
- { id: 31, cowshedGroup: 'A组(总数:100)', groupnum: '100', num: '33', cowshed: '002舍' },
|
|
|
- { id: 32, cowshedGroup: 'A组(总数:100)', groupnum: '100',num: '33', cowshed: '003舍' },
|
|
|
-
|
|
|
- { id: 1, cowshedGroup: 'B组(总数:100)', groupnum: '200',num: '33', cowshed: '003舍' },
|
|
|
- { id: 31, cowshedGroup: 'B组(总数:100)', groupnum: '200', num: '33', cowshed: '003舍' },
|
|
|
- { id: 32, cowshedGroup: 'B组(总数:100)', groupnum: '200', num: '33', cowshed: '006舍' },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- ],
|
|
|
-
|
|
|
- //接口 - 获取 - 表格
|
|
|
- url_get_table:'/api/v1/ops/work_order/list',
|
|
|
- //接口 - 新增 - 表格
|
|
|
- url_add_table:'/api/v1/ops/work_order/add',
|
|
|
- //接口 - 修改 - 表格
|
|
|
- url_edit_table:'/api/v1/ops/work_order/update',
|
|
|
- //接口 - 删除 - 表格
|
|
|
- url_delete_table:'/api/v1/ops/work_order/close',
|
|
|
-
|
|
|
- //接口 - 下拉框 列表
|
|
|
- url_get_select1:'/role/getAll',
|
|
|
-
|
|
|
- //按钮权限
|
|
|
- isButtonEdit:false,
|
|
|
-
|
|
|
- //获取 - 表格数据 - 参数
|
|
|
- searchData:{
|
|
|
- number: "",
|
|
|
- user_name: "",
|
|
|
- user_phone: "",
|
|
|
- operation_user: "",
|
|
|
- work_order_category_id: undefined,
|
|
|
- status: undefined,
|
|
|
- start_finished_time: "",
|
|
|
- end_finished_time: "",
|
|
|
- start_created_time: "",
|
|
|
- end_created_time: "",
|
|
|
- inputDatetime1:"",
|
|
|
- inputDatetime2:"",
|
|
|
- page: 1, //页码
|
|
|
- page_size: 10, //每页数量
|
|
|
- total:0, //总页数
|
|
|
- pastureId: ""
|
|
|
- },
|
|
|
- tableLoading: false,
|
|
|
- //表格内容
|
|
|
- tableList:[
|
|
|
- { number:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
|
|
|
- // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
|
|
|
- // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
|
|
|
- ],
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- typeList:[
|
|
|
-
|
|
|
- ],
|
|
|
-
|
|
|
- personList:[
|
|
|
-
|
|
|
- ],
|
|
|
-
|
|
|
- statusList:[
|
|
|
- // {id: 0, name: '未知'},
|
|
|
- {id: 1, name: '已创建未执行'},
|
|
|
- {id: 2, name: '执行中'},
|
|
|
- {id: 3, name: '已完成'},
|
|
|
- {id: 4, name: '已关闭'},
|
|
|
- ],
|
|
|
-
|
|
|
- orderTypeList:[
|
|
|
- // {id: 0, name: '未知'},
|
|
|
- {id: 1, name: '周期工单'},
|
|
|
- {id: 2, name: '一次性工单'},
|
|
|
|
|
|
- ],
|
|
|
-
|
|
|
-
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- addFormShow1:false,
|
|
|
- addFormStatus1: '',
|
|
|
- addFormTxt1: { edit: '修改', create: '新增' },
|
|
|
- addForm1:{
|
|
|
- remark:'',user_phone:'', work_order_category_id:undefined,user_id:undefined,id:undefined,
|
|
|
- },
|
|
|
-
|
|
|
- addFormRules1:{
|
|
|
- name: [ { required: true, message: '类型名称必填', trigger: 'blur' }, ],
|
|
|
+
|
|
|
+
|
|
|
+ <el-table :data="tableResultList1" style="width: 100%;margin-bottom: 20px;" row-key="id" border >
|
|
|
+ <el-table-column prop="cowshedGroup" label="序号" min-width="100px" > </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column prop="cowshed" label="派单时间" min-width="200px" > </el-table-column>
|
|
|
+ <el-table-column prop="num" label="状态" min-width="200px" > </el-table-column>
|
|
|
+ <el-table-column prop="num" label="执行人" min-width="200px" > </el-table-column>
|
|
|
+ <el-table-column prop="num" label="执行时间" min-width="200px" > </el-table-column>
|
|
|
+ <el-table-column prop="num" label="用时" min-width="200px" > </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="result_dialog_close1()">确认</el-button>
|
|
|
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- seeFormShow1:false,
|
|
|
- seeFormStatus1: '',
|
|
|
- seeFormTxt1: { edit: '修改', create: '新增' },
|
|
|
- seeForm1:{
|
|
|
- remark:'',user_phone:'', work_order_category_id:undefined,user_id:undefined,id:undefined,
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //穿梭框右边的值
|
|
|
- transDataChooseRight1:[],
|
|
|
- //穿梭框所有列表
|
|
|
- transDataList1:[
|
|
|
- // {key:1,label:'组1',disabled:false},
|
|
|
- // {key:2,label:'组2',disabled:false},
|
|
|
- // {key:3,label:'组3',disabled:false},
|
|
|
- // {key:4,label:'组4',disabled:false},
|
|
|
- // {key:5,label:'组5',disabled:false},
|
|
|
- // {key:6,label:'组6',disabled:false},
|
|
|
- // {key:7,label:'组7',disabled:false},
|
|
|
- ],
|
|
|
-
|
|
|
- //穿梭框右边的值
|
|
|
- transDataChooseRight2:[],
|
|
|
- //穿梭框所有列表
|
|
|
- transDataList2:[
|
|
|
- // {key:1,label:'组1',disabled:false},
|
|
|
- // {key:2,label:'组2',disabled:false},
|
|
|
- // {key:3,label:'组3',disabled:false},
|
|
|
- // {key:4,label:'组4',disabled:false},
|
|
|
- // {key:5,label:'组5',disabled:false},
|
|
|
- // {key:6,label:'组6',disabled:false},
|
|
|
- // {key:7,label:'组7',disabled:false},
|
|
|
- ],
|
|
|
-
|
|
|
-
|
|
|
- rightlistAll:[],
|
|
|
-
|
|
|
- //权限数据
|
|
|
- rightlist: [
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ import { ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
|
|
|
+ import { parseTime, json2excel } from '@/utils/index.js'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+
|
|
|
+ return {
|
|
|
+
|
|
|
+
|
|
|
+ tableArrList:[
|
|
|
+ {date:"123123", tableData: [
|
|
|
|
|
|
+ { id: 1, cowshedGroup: 'A组', num: '33', cowshed: '001舍' },
|
|
|
+ { id: 31, cowshedGroup: 'A组', num: '33', cowshed: '002舍' },
|
|
|
+ { id: 32, cowshedGroup: 'A组', num: '33', cowshed: '001舍' },
|
|
|
+
|
|
|
+ { id: 1, cowshedGroup: 'B组', num: '33', cowshed: '003舍' },
|
|
|
+ { id: 31, cowshedGroup: 'B组', num: '33', cowshed: '002舍' },
|
|
|
+ { id: 32, cowshedGroup: 'B组', num: '33', cowshed: '002舍' },
|
|
|
+
|
|
|
+
|
|
|
+ ]
|
|
|
+ } ,
|
|
|
+ {date:"2222", tableData: [
|
|
|
+
|
|
|
+ { id: 1, cowshedGroup: 'A组', num: '33', cowshed: '001舍' },
|
|
|
+ { id: 31, cowshedGroup: 'A组', num: '33', cowshed: '002舍' },
|
|
|
+ { id: 32, cowshedGroup: 'A组', num: '33', cowshed: '001舍' },
|
|
|
+
|
|
|
+ { id: 1, cowshedGroup: 'B组', num: '33', cowshed: '003舍' },
|
|
|
+ { id: 31, cowshedGroup: 'B组', num: '33', cowshed: '002舍' },
|
|
|
+ { id: 32, cowshedGroup: 'B组', num: '33', cowshed: '002舍' },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ] }
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- ],
|
|
|
-
|
|
|
- //栏舍名字数据
|
|
|
- cowShedlist: [
|
|
|
-
|
|
|
-
|
|
|
],
|
|
|
-
|
|
|
- //名字数据
|
|
|
- leftlist: [
|
|
|
|
|
|
+
|
|
|
+ //接口 - 获取 - 表格
|
|
|
+ url_get_table:'/api/v1/ops/work_order/list',
|
|
|
+ //接口 - 新增 - 表格
|
|
|
+ url_add_table:'/api/v1/ops/work_order/add',
|
|
|
+ //接口 - 修改 - 表格
|
|
|
+ url_edit_table:'/api/v1/ops/work_order/update',
|
|
|
+ //接口 - 删除 - 表格
|
|
|
+ url_delete_table:'/api/v1/ops/work_order/close',
|
|
|
|
|
|
- ],
|
|
|
+ //接口 - 下拉框 列表
|
|
|
+ url_get_select1:'/role/getAll',
|
|
|
+
|
|
|
+ //按钮权限
|
|
|
+ isButtonEdit:false,
|
|
|
+
|
|
|
+ //获取 - 表格数据 - 参数
|
|
|
+ searchData:{
|
|
|
+ number: "",
|
|
|
+ user_name: "",
|
|
|
+ user_phone: "",
|
|
|
+ operation_user: "",
|
|
|
+ work_order_category_id: undefined,
|
|
|
+ status: undefined,
|
|
|
+ start_finished_time: "",
|
|
|
+ end_finished_time: "",
|
|
|
+ start_created_time: "",
|
|
|
+ end_created_time: "",
|
|
|
+ inputDatetime1:"",
|
|
|
+ inputDatetime2:"",
|
|
|
+ page: 1, //页码
|
|
|
+ page_size: 10, //每页数量
|
|
|
+ total:0, //总页数
|
|
|
+ pastureId: ""
|
|
|
+ },
|
|
|
+ tableLoading: false,
|
|
|
+ //表格内容
|
|
|
+ tableList:[
|
|
|
+ { number:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
|
|
|
+ // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
|
|
|
+ // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
|
|
|
+ ],
|
|
|
|
|
|
- //树形控件的属性绑定对象
|
|
|
- // treeProps:{
|
|
|
- // label:'name',children:'barn_list'
|
|
|
- // },
|
|
|
|
|
|
|
|
|
- //树形默认选中的值
|
|
|
- checkedIdTxtArr:[],
|
|
|
-
|
|
|
- filterText:""
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
+ typeList:[
|
|
|
+
|
|
|
+ ],
|
|
|
+
|
|
|
+ personList:[
|
|
|
+
|
|
|
+ ],
|
|
|
+
|
|
|
+ statusList:[
|
|
|
+ // {id: 0, name: '未知'},
|
|
|
+ {id: 1, name: '已创建未执行'},
|
|
|
+ {id: 2, name: '执行中'},
|
|
|
+ {id: 3, name: '已完成'},
|
|
|
+ {id: 4, name: '已关闭'},
|
|
|
+ ],
|
|
|
+
|
|
|
+ orderTypeList:[
|
|
|
+ // {id: 0, name: '未知'},
|
|
|
+ {id: 1, name: '周期工单'},
|
|
|
+ {id: 2, name: '一次性工单'},
|
|
|
|
|
|
- created(){
|
|
|
- //获取按钮权限
|
|
|
- const isButtonEdit = checkButtons(this.$store.state.buttonsList, "犊牛类型编辑")
|
|
|
- this.isButtonEdit = isButtonEdit
|
|
|
- console.log('this.isButtonEdit==========',this.isButtonEdit)
|
|
|
-
|
|
|
- var me = this
|
|
|
- //获取下拉框
|
|
|
- this.get_select_list1()
|
|
|
-
|
|
|
- //表格 - 初始化
|
|
|
- this.get_table_data()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //合并单元格
|
|
|
- this.getSpanArr(me.tableSeeList)
|
|
|
-
|
|
|
+ ],
|
|
|
|
|
|
- //不定项的合并单元格
|
|
|
- // me.tableArrList.forEach(function(item,index){
|
|
|
- // me.getSpanArr1(item.tableData, index)
|
|
|
- // })
|
|
|
-
|
|
|
|
|
|
- },
|
|
|
- watch: {
|
|
|
- filterText(val) {
|
|
|
- this.$refs.tree.filter(val);
|
|
|
- }
|
|
|
- },
|
|
|
- methods:{
|
|
|
-
|
|
|
-
|
|
|
- getSpanArr1(list,index) {
|
|
|
- var me = this
|
|
|
- // 先给所有的数据都加一个v.rowspan = 1
|
|
|
- list.forEach(item => {
|
|
|
- item.rowspan = 1;
|
|
|
- item.rowspan1 = 1;
|
|
|
-
|
|
|
- });
|
|
|
- // 双层循环
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- for (let j = i + 1; j < list.length; j++) {
|
|
|
- //此处可根据相同字段进行合并
|
|
|
- if (list[i].date== list[j].date) {
|
|
|
- list[i].rowspan++;
|
|
|
- list[j].rowspan--;
|
|
|
- }
|
|
|
- }
|
|
|
- // 这里跳过已经重复的数据
|
|
|
- i = i + list[i].rowspan - 1;
|
|
|
- i = i + list[i].rowspan1 - 1;
|
|
|
- }
|
|
|
- me.tableArrList[index].tableData = list;
|
|
|
- },
|
|
|
-
|
|
|
- //设置单元格
|
|
|
- getSpanArr(list) {
|
|
|
- // 先给所有的数据都加一个v.rowspan = 1
|
|
|
- list.forEach(item => {
|
|
|
- item.rowspan = 1;
|
|
|
- item.rowspan1 = 1;
|
|
|
-
|
|
|
- });
|
|
|
- // 双层循环
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- for (let j = i + 1; j < list.length; j++) {
|
|
|
- //此处可根据相同字段进行合并 - 第一列
|
|
|
- if (list[i].cowshedGroup== list[j].cowshedGroup) {
|
|
|
- list[i].rowspan++;
|
|
|
- list[j].rowspan--;
|
|
|
- }
|
|
|
- //此处可根据相同字段进行合并 - 第二列
|
|
|
- // if (list[i].cowshed== list[j].cowshed) {
|
|
|
- // list[i].rowspan1++;
|
|
|
- // list[j].rowspan1--;
|
|
|
- // }
|
|
|
- }
|
|
|
- // 这里跳过已经重复的数据
|
|
|
- i = i + list[i].rowspan - 1;
|
|
|
- i = i + list[i].rowspan1 - 1;
|
|
|
- }
|
|
|
- this.tableData = list;
|
|
|
- },
|
|
|
-
|
|
|
- // 合并单元格相同内容
|
|
|
- ObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
- // 第一列
|
|
|
- if (columnIndex === 0) {
|
|
|
- return {
|
|
|
- rowspan: row.rowspan,
|
|
|
- colspan: 1,
|
|
|
- };
|
|
|
- }
|
|
|
- // 第二列
|
|
|
- // if (columnIndex === 1) {
|
|
|
- // return {
|
|
|
- // rowspan: row.rowspan1,
|
|
|
- // colspan: 1,
|
|
|
- // };
|
|
|
- // }
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
- filterNode(value, data) {
|
|
|
- if (!value) return true;
|
|
|
- return data.name.indexOf(value) !== -1;
|
|
|
- },
|
|
|
-
|
|
|
- get_auto_buttons() {
|
|
|
- // 编辑
|
|
|
- const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
|
|
|
- this.isButtonEdit = isButtonEdit
|
|
|
- console.log('this.isButtonEdit==========',this.isButtonEdit)
|
|
|
- },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ addFormShow1:false,
|
|
|
+ addFormStatus1: '',
|
|
|
+ addFormTxt1: { edit: '修改', create: '新增' },
|
|
|
+ addForm1:{
|
|
|
+ remark:'',user_phone:'', work_order_category_id:undefined,user_id:undefined,id:undefined,
|
|
|
+ },
|
|
|
+
|
|
|
+ addFormRules1:{
|
|
|
+ name: [ { required: true, message: '类型名称必填', trigger: 'blur' }, ],
|
|
|
|
|
|
- //获取 下拉框
|
|
|
- get_select_list1(){
|
|
|
- var me = this
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ seeFormShow1:false,
|
|
|
+ seeFormStatus1: '',
|
|
|
+ seeFormTxt1: { edit: '修改', create: '新增' },
|
|
|
+ seeForm1:{
|
|
|
+ remark:'',user_phone:'', work_order_category_id:undefined,user_id:undefined,id:undefined,
|
|
|
+ },
|
|
|
+
|
|
|
+ tableSeeList1:[
|
|
|
+ { id: 1, cowshedGroup: 'A组(总数:100)', groupnum: '100', num: '33', cowshed: '001舍' },
|
|
|
+ { id: 31, cowshedGroup: 'A组(总数:100)', groupnum: '100', num: '33', cowshed: '002舍' },
|
|
|
+ { id: 32, cowshedGroup: 'A组(总数:100)', groupnum: '100',num: '33', cowshed: '003舍' },
|
|
|
+ { id: 1, cowshedGroup: 'B组(总数:100)', groupnum: '200',num: '33', cowshed: '003舍' },
|
|
|
+ { id: 31, cowshedGroup: 'B组(总数:100)', groupnum: '200', num: '33', cowshed: '003舍' },
|
|
|
+ { id: 32, cowshedGroup: 'B组(总数:100)', groupnum: '200', num: '33', cowshed: '006舍' },
|
|
|
+ ],
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ resultFormShow1:false,
|
|
|
+ resultFormStatus1: '',
|
|
|
+ resultFormTxt1: { edit: '修改', create: '新增' },
|
|
|
+ resultForm1:{
|
|
|
+ remark:'',user_phone:'', work_order_category_id:undefined,user_id:undefined,id:undefined,
|
|
|
+ },
|
|
|
+ tableResultList1:[
|
|
|
+ { id: 1, cowshedGroup: 'A组(总数:100)', groupnum: '100', num: '33', cowshed: '001舍' },
|
|
|
+ { id: 31, cowshedGroup: 'A组(总数:100)', groupnum: '100', num: '33', cowshed: '002舍' },
|
|
|
+ { id: 32, cowshedGroup: 'A组(总数:100)', groupnum: '100',num: '33', cowshed: '003舍' },
|
|
|
+ { id: 1, cowshedGroup: 'B组(总数:100)', groupnum: '200',num: '33', cowshed: '003舍' },
|
|
|
+ { id: 31, cowshedGroup: 'B组(总数:100)', groupnum: '200', num: '33', cowshed: '003舍' },
|
|
|
+ { id: 32, cowshedGroup: 'B组(总数:100)', groupnum: '200', num: '33', cowshed: '006舍' },
|
|
|
+ ],
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ rightlistAll:[],
|
|
|
+
|
|
|
+ //权限数据
|
|
|
+ rightlist: [
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ],
|
|
|
+
|
|
|
+ //栏舍名字数据
|
|
|
+ cowShedlist: [
|
|
|
|
|
|
- ajaxDataPost('/api/v1/ops/base_setting/category_table/list?page=1&page_size=1000', {category_type:1}).then(e => {
|
|
|
- console.log("工单下拉框1:",e)
|
|
|
- if(e.code == 200 ){
|
|
|
- me.typeList = e.data.list
|
|
|
- } else {
|
|
|
- me.typeList = []
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
|
|
|
+ ],
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- ajaxDataPost('/api/v1/system/user/list?page=1&page_size=1000', {name:""}).then(e => {
|
|
|
- console.log("人员下拉:",e)
|
|
|
- if(e.code == 200 ){
|
|
|
- me.personList = e.data.list
|
|
|
- } else {
|
|
|
- me.personList = []
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// rightlist
|
|
|
-
|
|
|
- ajaxDataPost('/api/v1/ops/barn_group/list?page=1&page_size=1000', {name:""}).then(e => {
|
|
|
- console.log("多选框1:",e)
|
|
|
-
|
|
|
- //打印请求成功结果
|
|
|
- if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0 ){
|
|
|
- me.rightlist = []
|
|
|
- } else {
|
|
|
- var rightlist = e.data.list
|
|
|
- //由于后端数据ID重复,这里需要ID前增加虚拟数据。一级组,二级舍
|
|
|
- rightlist.forEach(function(item){
|
|
|
- item.idTxt = "组"+item.id
|
|
|
- console.log(item)
|
|
|
- if(item.barn_list.length !== 0){
|
|
|
- item.barn_list.forEach(function(items){
|
|
|
- items.idTxt = ""+ items.id
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- me.rightlist = rightlist
|
|
|
- }
|
|
|
-
|
|
|
- console.log("多选框 me.rightlist :", me.rightlist )
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- ajaxDataPost('/api/v1/ops/barn/list?page=1&page_size=1000', {name:"",barn_group_name:"",status:undefined}).then(e => {
|
|
|
- console.log("所有栏舍:",e)
|
|
|
-
|
|
|
- //打印请求成功结果
|
|
|
- if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0 ){
|
|
|
- me.cowShedlist = []
|
|
|
- } else {
|
|
|
+ //名字数据
|
|
|
+ leftlist: [
|
|
|
|
|
|
- me.cowShedlist = e.data.list
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // ajaxDataPost('/api/v1/ops/barn_group/list?page=1&page_size=1000', {name:""}).then(e => {
|
|
|
- // console.log("穿梭框1:",e)
|
|
|
-
|
|
|
- // //打印请求成功结果
|
|
|
- // if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0 ){
|
|
|
- // me.transDataList1 = []
|
|
|
- // } else {
|
|
|
- // var transDataList1 = e.data.list
|
|
|
- // transDataList1.forEach(function(item){
|
|
|
- // item.name = item.name + "(犊牛数量:"+ item.calf_number + ")"
|
|
|
- // })
|
|
|
- // me.transDataList1 = transDataList1
|
|
|
- // }
|
|
|
-
|
|
|
- // })
|
|
|
-
|
|
|
-
|
|
|
- // ajaxDataPost('/api/v1/ops/barn/list?page=1&page_size=1000', {name:"",barn_group_name:"",status:undefined}).then(e => {
|
|
|
- // console.log("穿梭框2:",e)
|
|
|
-
|
|
|
- // //打印请求成功结果
|
|
|
- // if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0 ){
|
|
|
- // me.transDataList2 = []
|
|
|
- // } else {
|
|
|
|
|
|
- // var transDataList2 = e.data.list
|
|
|
- // transDataList2.forEach(function(item){
|
|
|
- // if(item.stauts == 4){
|
|
|
- // item.name = item.name + "(犊牛数量:0)"
|
|
|
- // } else {
|
|
|
- // item.name = item.name + "(犊牛数量:1)"
|
|
|
- // }
|
|
|
-
|
|
|
- // })
|
|
|
- // me.transDataList2 = transDataList2
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // })
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- //获取 表格
|
|
|
- get_table_data() {
|
|
|
-
|
|
|
- var me = this
|
|
|
-
|
|
|
- me.tableLoading = true
|
|
|
- console.log("searchData======>", me.searchData)
|
|
|
-
|
|
|
- var send_url = me.url_get_table + '?page=' + me.searchData.page + '&page_size=' + me.searchData.page_size
|
|
|
-
|
|
|
- ajaxDataPost(send_url, me.searchData).then(e => {
|
|
|
- console.log("表格请求结果:",e)
|
|
|
- //打印请求成功结果
|
|
|
- if(e.code == 200 ){
|
|
|
- me.tableList = e.data.list
|
|
|
- me.searchData.total = e.data.total; // 总数
|
|
|
- me.searchData.page = e.data.page; //页码
|
|
|
- me.searchData.page_size = e.data.page_size; //每页数量
|
|
|
-
|
|
|
- } else {
|
|
|
- me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
|
|
|
- }
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- me.tableLoading = false
|
|
|
- }, 100)
|
|
|
+ ],
|
|
|
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
- //搜索 查询表格
|
|
|
- form_search(){
|
|
|
- var me = this
|
|
|
- console.log('请求表格列表searchData',me.searchData)
|
|
|
- if (me.searchData.inputDatetime1 !== '' && me.searchData.inputDatetime1 !== null) {
|
|
|
- me.searchData.min_operation_time = parseTime(me.searchData.inputDatetime1[0], '{y}-{m}-{d}')
|
|
|
- me.searchData.max_operation_time = parseTime(me.searchData.inputDatetime1[1], '{y}-{m}-{d}')
|
|
|
- } else {
|
|
|
- me.searchData.inputDatetime1 = ''
|
|
|
- me.searchData.min_operation_time = ''
|
|
|
- me.searchData.max_operation_time = ''
|
|
|
- }
|
|
|
-
|
|
|
- if (me.searchData.inputDatetime2 !== '' && me.searchData.inputDatetime2 !== null) {
|
|
|
- me.searchData.start_created_time = parseTime(me.searchData.inputDatetime2[0], '{y}-{m}-{d}')
|
|
|
- me.searchData.end_created_time = parseTime(me.searchData.inputDatetime2[1], '{y}-{m}-{d}')
|
|
|
- } else {
|
|
|
- me.searchData.inputDatetime2 = ''
|
|
|
- me.searchData.start_created_time = ''
|
|
|
- me.searchData.end_created_time = ''
|
|
|
- }
|
|
|
- me.get_table_data()
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- //重置 表格
|
|
|
- form_clear(){
|
|
|
+ //树形控件的属性绑定对象
|
|
|
+ // treeProps:{
|
|
|
+ // label:'name',children:'barn_list'
|
|
|
+ // },
|
|
|
+
|
|
|
+
|
|
|
+ //树形默认选中的值
|
|
|
+ checkedIdTxtArr:[],
|
|
|
+
|
|
|
+ filterText:""
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ created(){
|
|
|
+ //获取按钮权限
|
|
|
+ const isButtonEdit = checkButtons(this.$store.state.buttonsList, "犊牛类型编辑")
|
|
|
+ this.isButtonEdit = isButtonEdit
|
|
|
+ console.log('this.isButtonEdit==========',this.isButtonEdit)
|
|
|
+
|
|
|
var me = this
|
|
|
- me.searchData.number = ""
|
|
|
- me.searchData.user_name = ""
|
|
|
- me.searchData.user_phone = ""
|
|
|
- me.searchData.operation_user = ""
|
|
|
- me.searchData.operation_phone = ""
|
|
|
- me.searchData.work_order_category_id = undefined
|
|
|
- me.searchData.status = undefined
|
|
|
- me.searchData.start_finished_time = ""
|
|
|
- me.searchData.end_finished_time = ""
|
|
|
- me.searchData.start_created_time = ""
|
|
|
- me.searchData.end_created_time = ""
|
|
|
- me.searchData.inputDatetime1 = ""
|
|
|
- me.searchData.inputDatetime2 = ""
|
|
|
-
|
|
|
- me.searchData.page = 1
|
|
|
- me.searchData.page_size = 10
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- me.get_table_data()
|
|
|
- },
|
|
|
-
|
|
|
- //监听 page_size 改变的事件
|
|
|
- change_size_page(item){
|
|
|
- console.log(item)
|
|
|
- // this.searchData.page_size = item
|
|
|
- // this.getUserList()
|
|
|
- },
|
|
|
-
|
|
|
- //监听 page 改变的事件
|
|
|
- change_current_page(item){
|
|
|
- console.log(item)
|
|
|
- this.searchData.page = item
|
|
|
+ //获取下拉框
|
|
|
+ this.get_select_list1()
|
|
|
+
|
|
|
+ //表格 - 初始化
|
|
|
this.get_table_data()
|
|
|
- },
|
|
|
-
|
|
|
- //清空弹窗表单信息
|
|
|
- reset_form1(){
|
|
|
- this.addForm1.remark = ''
|
|
|
- this.addForm1.user_phone = ''
|
|
|
- this.addForm1.work_order_category_id = undefined
|
|
|
- this.addForm1.user_id = undefined
|
|
|
- this.addForm1.id = undefined
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- //新增
|
|
|
- form_add1() {
|
|
|
- this.reset_form1()
|
|
|
- this.addFormStatus1 = 'create'
|
|
|
- this.addFormShow1 = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['addFormRef1'].clearValidate()
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- form_see1(row) {
|
|
|
-
|
|
|
- // router.push('/login')
|
|
|
-
|
|
|
-
|
|
|
- console.log('行内容row=========', row)
|
|
|
- //编辑行内容赋值
|
|
|
- this.seeForm1 = Object.assign({}, row)
|
|
|
-
|
|
|
- this.seeFormShow1 = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['seeFormRef1'].clearValidate()
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- see_dialog_close1(){
|
|
|
- //内容重置
|
|
|
- this.$refs['seeFormRef1'].resetFields()
|
|
|
- this.seeFormShow1 = false
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- //编辑
|
|
|
- form_edit1(row) {
|
|
|
- var me = this
|
|
|
- console.log('行内容row=========', row)
|
|
|
- //编辑行内容赋值
|
|
|
- this.addForm1 = Object.assign({}, row)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //这里获取一下实际存的栏舍ID
|
|
|
- var checklist = [27,28,30]
|
|
|
- if(checklist.length !== 0){
|
|
|
-
|
|
|
- var newChecklist = checklist.map((item)=>{
|
|
|
- return ""+item
|
|
|
- })
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //合并单元格
|
|
|
+ this.getSpanArr(me.tableSeeList1)
|
|
|
+
|
|
|
+
|
|
|
+ //不定项的合并单元格
|
|
|
+ // me.tableArrList.forEach(function(item,index){
|
|
|
+ // me.getSpanArr1(item.tableData, index)
|
|
|
+ // })
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- console.log("newChecklist===========",newChecklist)
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ filterText(val) {
|
|
|
+ this.$refs.tree.filter(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+
|
|
|
+
|
|
|
+ getSpanArr1(list,index) {
|
|
|
+ var me = this
|
|
|
+ // 先给所有的数据都加一个v.rowspan = 1
|
|
|
+ list.forEach(item => {
|
|
|
+ item.rowspan = 1;
|
|
|
+ item.rowspan1 = 1;
|
|
|
+
|
|
|
+ });
|
|
|
+ // 双层循环
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ for (let j = i + 1; j < list.length; j++) {
|
|
|
+ //此处可根据相同字段进行合并
|
|
|
+ if (list[i].date== list[j].date) {
|
|
|
+ list[i].rowspan++;
|
|
|
+ list[j].rowspan--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 这里跳过已经重复的数据
|
|
|
+ i = i + list[i].rowspan - 1;
|
|
|
+ i = i + list[i].rowspan1 - 1;
|
|
|
+ }
|
|
|
+ me.tableArrList[index].tableData = list;
|
|
|
+ },
|
|
|
+
|
|
|
+ //设置单元格
|
|
|
+ getSpanArr(list) {
|
|
|
+ // 先给所有的数据都加一个v.rowspan = 1
|
|
|
+ list.forEach(item => {
|
|
|
+ item.rowspan = 1;
|
|
|
+ item.rowspan1 = 1;
|
|
|
+
|
|
|
+ });
|
|
|
+ // 双层循环
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ for (let j = i + 1; j < list.length; j++) {
|
|
|
+ //此处可根据相同字段进行合并 - 第一列
|
|
|
+ if (list[i].cowshedGroup== list[j].cowshedGroup) {
|
|
|
+ list[i].rowspan++;
|
|
|
+ list[j].rowspan--;
|
|
|
+ }
|
|
|
+ //此处可根据相同字段进行合并 - 第二列
|
|
|
+ // if (list[i].cowshed== list[j].cowshed) {
|
|
|
+ // list[i].rowspan1++;
|
|
|
+ // list[j].rowspan1--;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ // 这里跳过已经重复的数据
|
|
|
+ i = i + list[i].rowspan - 1;
|
|
|
+ i = i + list[i].rowspan1 - 1;
|
|
|
+ }
|
|
|
+ this.tableData = list;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 合并单元格相同内容
|
|
|
+ ObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
+ // 第一列
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ return {
|
|
|
+ rowspan: row.rowspan,
|
|
|
+ colspan: 1,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ // 第二列
|
|
|
+ // if (columnIndex === 1) {
|
|
|
+ // return {
|
|
|
+ // rowspan: row.rowspan1,
|
|
|
+ // colspan: 1,
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ filterNode(value, data) {
|
|
|
+ if (!value) return true;
|
|
|
+ return data.name.indexOf(value) !== -1;
|
|
|
+ },
|
|
|
+
|
|
|
+ get_auto_buttons() {
|
|
|
+ // 编辑
|
|
|
+ const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
|
|
|
+ this.isButtonEdit = isButtonEdit
|
|
|
+ console.log('this.isButtonEdit==========',this.isButtonEdit)
|
|
|
+ },
|
|
|
|
|
|
- me.checkedIdTxtArr = newChecklist
|
|
|
-
|
|
|
- var leftlist = []
|
|
|
- me.cowShedlist.forEach(function(item){
|
|
|
-
|
|
|
- newChecklist.forEach(function(items){
|
|
|
- if(parseFloat(items) == item.id ){
|
|
|
- console.log(items)
|
|
|
- if(items.indexOf("组") == -1 ){
|
|
|
- leftlist.push(item.name)
|
|
|
- }
|
|
|
+ //获取 下拉框
|
|
|
+ get_select_list1(){
|
|
|
+ var me = this
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- me.leftlist = leftlist
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- this.addFormStatus1 = 'edit'
|
|
|
- this.addFormShow1 = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['addFormRef1'].clearValidate()
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- //新增关闭
|
|
|
- add_dialog_close1(){
|
|
|
- //内容重置
|
|
|
- this.$refs['addFormRef1'].resetFields()
|
|
|
- this.addFormShow1 = false
|
|
|
- },
|
|
|
-
|
|
|
- //新增 保存
|
|
|
- add_dialog_save1() {
|
|
|
- var me = this
|
|
|
- this.$refs['addFormRef1'].validate(valid => {
|
|
|
- //验证成功
|
|
|
- if (valid) {
|
|
|
- //发起请求
|
|
|
- var send_data = {
|
|
|
- "work_order_category_id": me.addForm.work_order_category_id,
|
|
|
- "user_id": me.addForm.user_id,
|
|
|
- "user_phone": me.addForm.user_phone,
|
|
|
- "remark": me.addForm.remark,
|
|
|
- "barns": me.transDataChooseRight2,
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- console.log("弹窗参数:", send_data)
|
|
|
-
|
|
|
- //关闭弹窗
|
|
|
- // me.addFormShow = false
|
|
|
- //加载 - 发送新增保存
|
|
|
- ajaxDataPost(me.url_add_table, send_data).then(e => {
|
|
|
- console.log("新增结果:",e)
|
|
|
- //打印请求成功结果
|
|
|
- if(e.code == 200 ){
|
|
|
- me.$message({ type: 'success', message: '新增成功!' , duration: 2000 })
|
|
|
- //关闭弹窗
|
|
|
- me.addFormShow = false
|
|
|
- me.get_table_data()
|
|
|
- } else {
|
|
|
- me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
|
|
|
- }
|
|
|
- })
|
|
|
+ ajaxDataPost('/api/v1/ops/base_setting/category_table/list?page=1&page_size=1000', {category_type:1}).then(e => {
|
|
|
+ console.log("工单下拉框1:",e)
|
|
|
+ if(e.code == 200 ){
|
|
|
+ me.typeList = e.data.list
|
|
|
+ } else {
|
|
|
+ me.typeList = []
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- //编辑 保存
|
|
|
- edit_dialog_save(){
|
|
|
- var me = this
|
|
|
- this.$refs['addFormRef'].validate(valid => {
|
|
|
- //验证成功
|
|
|
- if (valid) {
|
|
|
- //发起请求
|
|
|
- var send_data = {
|
|
|
-
|
|
|
- "id": me.addForm.id,
|
|
|
- "work_order_category_id": me.addForm.work_order_category_id,
|
|
|
- "user_id": me.addForm.user_id,
|
|
|
- "user_phone": me.addForm.user_phone,
|
|
|
- "remark": me.addForm.remark,
|
|
|
- "barns": me.transDataChooseRight2,
|
|
|
- }
|
|
|
- console.log("弹窗参数:", send_data)
|
|
|
-
|
|
|
- //关闭弹窗
|
|
|
- // me.addFormShow = false
|
|
|
- //加载 - 发送新增保存
|
|
|
- ajaxDataPut(me.url_edit_table, send_data).then(e => {
|
|
|
- console.log("编辑结果:",e)
|
|
|
- //打印请求成功结果
|
|
|
- if(e.code == 200 ){
|
|
|
- me.$message({ type: 'success', message: '编辑成功!' , duration: 2000 })
|
|
|
- //关闭弹窗
|
|
|
- me.addFormShow = false
|
|
|
- me.get_table_data()
|
|
|
- } else {
|
|
|
- me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ajaxDataPost('/api/v1/system/user/list?page=1&page_size=1000', {name:""}).then(e => {
|
|
|
+ console.log("人员下拉:",e)
|
|
|
+ if(e.code == 200 ){
|
|
|
+ me.personList = e.data.list
|
|
|
+ } else {
|
|
|
+ me.personList = []
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // rightlist
|
|
|
+
|
|
|
+ ajaxDataPost('/api/v1/ops/barn_group/list?page=1&page_size=1000', {name:""}).then(e => {
|
|
|
+ console.log("多选框1:",e)
|
|
|
+
|
|
|
+ //打印请求成功结果
|
|
|
+ if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0 ){
|
|
|
+ me.rightlist = []
|
|
|
+ } else {
|
|
|
+ var rightlist = e.data.list
|
|
|
+ //由于后端数据ID重复,这里需要ID前增加虚拟数据。一级组,二级舍
|
|
|
+ rightlist.forEach(function(item){
|
|
|
+ item.idTxt = "组"+item.id
|
|
|
+ console.log(item)
|
|
|
+ if(item.barn_list.length !== 0){
|
|
|
+ item.barn_list.forEach(function(items){
|
|
|
+ items.idTxt = ""+ items.id
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ me.rightlist = rightlist
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("多选框 me.rightlist :", me.rightlist )
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ ajaxDataPost('/api/v1/ops/barn/list?page=1&page_size=1000', {name:"",barn_group_name:"",status:undefined}).then(e => {
|
|
|
+ console.log("所有栏舍:",e)
|
|
|
+
|
|
|
+ //打印请求成功结果
|
|
|
+ if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0 ){
|
|
|
+ me.cowShedlist = []
|
|
|
+ } else {
|
|
|
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- form_delete(row) {
|
|
|
+ me.cowShedlist = e.data.list
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // ajaxDataPost('/api/v1/ops/barn_group/list?page=1&page_size=1000', {name:""}).then(e => {
|
|
|
+ // console.log("穿梭框1:",e)
|
|
|
+
|
|
|
+ // //打印请求成功结果
|
|
|
+ // if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0 ){
|
|
|
+ // me.transDataList1 = []
|
|
|
+ // } else {
|
|
|
+ // var transDataList1 = e.data.list
|
|
|
+ // transDataList1.forEach(function(item){
|
|
|
+ // item.name = item.name + "(犊牛数量:"+ item.calf_number + ")"
|
|
|
+ // })
|
|
|
+ // me.transDataList1 = transDataList1
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+
|
|
|
+
|
|
|
+ // ajaxDataPost('/api/v1/ops/barn/list?page=1&page_size=1000', {name:"",barn_group_name:"",status:undefined}).then(e => {
|
|
|
+ // console.log("穿梭框2:",e)
|
|
|
+
|
|
|
+ // //打印请求成功结果
|
|
|
+ // if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0 ){
|
|
|
+ // me.transDataList2 = []
|
|
|
+ // } else {
|
|
|
+
|
|
|
+ // var transDataList2 = e.data.list
|
|
|
+ // transDataList2.forEach(function(item){
|
|
|
+ // if(item.stauts == 4){
|
|
|
+ // item.name = item.name + "(犊牛数量:0)"
|
|
|
+ // } else {
|
|
|
+ // item.name = item.name + "(犊牛数量:1)"
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+ // me.transDataList2 = transDataList2
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //获取 表格
|
|
|
+ get_table_data() {
|
|
|
+
|
|
|
var me = this
|
|
|
-
|
|
|
- me.$confirm('是否关闭此条内容?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- console.log("删除的ID参数:", row.id)
|
|
|
- //加载 - 发送新增保存
|
|
|
- ajaxDataDelete(me.url_delete_table + '/' +row.id, {}).then(e => {
|
|
|
- console.log("编辑结果:",e)
|
|
|
- //打印请求成功结果
|
|
|
- if(e.code == 200 ){
|
|
|
- me.$message({ type: 'success', message: '关闭成功!' });
|
|
|
- me.get_table_data()
|
|
|
- } else {
|
|
|
- me.$message({ type: 'error', message: '关闭失败!' + e.msg, duration: 2000 })
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
+
|
|
|
+ me.tableLoading = true
|
|
|
+ console.log("searchData======>", me.searchData)
|
|
|
+
|
|
|
+ var send_url = me.url_get_table + '?page=' + me.searchData.page + '&page_size=' + me.searchData.page_size
|
|
|
+
|
|
|
+ ajaxDataPost(send_url, me.searchData).then(e => {
|
|
|
+ console.log("表格请求结果:",e)
|
|
|
+ //打印请求成功结果
|
|
|
+ if(e.code == 200 ){
|
|
|
+ me.tableList = e.data.list
|
|
|
+ me.searchData.total = e.data.total; // 总数
|
|
|
+ me.searchData.page = e.data.page; //页码
|
|
|
+ me.searchData.page_size = e.data.page_size; //每页数量
|
|
|
+
|
|
|
+ } else {
|
|
|
+ me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
|
|
|
+ }
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ me.tableLoading = false
|
|
|
+ }, 100)
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
+ },
|
|
|
+ //搜索 查询表格
|
|
|
+ form_search(){
|
|
|
+ var me = this
|
|
|
+ console.log('请求表格列表searchData',me.searchData)
|
|
|
+ if (me.searchData.inputDatetime1 !== '' && me.searchData.inputDatetime1 !== null) {
|
|
|
+ me.searchData.min_operation_time = parseTime(me.searchData.inputDatetime1[0], '{y}-{m}-{d}')
|
|
|
+ me.searchData.max_operation_time = parseTime(me.searchData.inputDatetime1[1], '{y}-{m}-{d}')
|
|
|
+ } else {
|
|
|
+ me.searchData.inputDatetime1 = ''
|
|
|
+ me.searchData.min_operation_time = ''
|
|
|
+ me.searchData.max_operation_time = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ if (me.searchData.inputDatetime2 !== '' && me.searchData.inputDatetime2 !== null) {
|
|
|
+ me.searchData.start_created_time = parseTime(me.searchData.inputDatetime2[0], '{y}-{m}-{d}')
|
|
|
+ me.searchData.end_created_time = parseTime(me.searchData.inputDatetime2[1], '{y}-{m}-{d}')
|
|
|
+ } else {
|
|
|
+ me.searchData.inputDatetime2 = ''
|
|
|
+ me.searchData.start_created_time = ''
|
|
|
+ me.searchData.end_created_time = ''
|
|
|
+ }
|
|
|
+ me.get_table_data()
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ //重置 表格
|
|
|
+ form_clear(){
|
|
|
+ var me = this
|
|
|
+ me.searchData.number = ""
|
|
|
+ me.searchData.user_name = ""
|
|
|
+ me.searchData.user_phone = ""
|
|
|
+ me.searchData.operation_user = ""
|
|
|
+ me.searchData.operation_phone = ""
|
|
|
+ me.searchData.work_order_category_id = undefined
|
|
|
+ me.searchData.status = undefined
|
|
|
+ me.searchData.start_finished_time = ""
|
|
|
+ me.searchData.end_finished_time = ""
|
|
|
+ me.searchData.start_created_time = ""
|
|
|
+ me.searchData.end_created_time = ""
|
|
|
+ me.searchData.inputDatetime1 = ""
|
|
|
+ me.searchData.inputDatetime2 = ""
|
|
|
+
|
|
|
+ me.searchData.page = 1
|
|
|
+ me.searchData.page_size = 10
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- }).catch(() => {
|
|
|
- me.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
- //监听勾选
|
|
|
- change_check(data, checked, indeterminate) {
|
|
|
- console.log(data, checked, indeterminate)
|
|
|
- var me = this
|
|
|
|
|
|
- var checkedKeys = this.$refs.tree.getCheckedKeys() // 所有被选中的节点的 key 所组成的数组数据
|
|
|
- console.log(checkedKeys)
|
|
|
- this.checkedIdTxtArr = checkedKeys
|
|
|
|
|
|
- console.log("选中的IDTXT checkedIdTxtArr",me.checkedIdTxtArr)
|
|
|
+ me.get_table_data()
|
|
|
+ },
|
|
|
|
|
|
- console.log(" me.cowShedlist", me.cowShedlist)
|
|
|
-
|
|
|
- var leftlist = []
|
|
|
-
|
|
|
- me.cowShedlist.forEach(function(item){
|
|
|
-
|
|
|
- me.checkedIdTxtArr.forEach(function(items){
|
|
|
- if(parseFloat(items) == item.id ){
|
|
|
- //不包含 组这个字段
|
|
|
+ //监听 page_size 改变的事件
|
|
|
+ change_size_page(item){
|
|
|
+ console.log(item)
|
|
|
+ // this.searchData.page_size = item
|
|
|
+ // this.getUserList()
|
|
|
+ },
|
|
|
+
|
|
|
+ //监听 page 改变的事件
|
|
|
+ change_current_page(item){
|
|
|
+ console.log(item)
|
|
|
+ this.searchData.page = item
|
|
|
+ this.get_table_data()
|
|
|
+ },
|
|
|
+
|
|
|
+ //清空弹窗表单信息
|
|
|
+ reset_form1(){
|
|
|
+ this.addForm1.remark = ''
|
|
|
+ this.addForm1.user_phone = ''
|
|
|
+ this.addForm1.work_order_category_id = undefined
|
|
|
+ this.addForm1.user_id = undefined
|
|
|
+ this.addForm1.id = undefined
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ //新增
|
|
|
+ form_add1() {
|
|
|
+ this.reset_form1()
|
|
|
+ this.addFormStatus1 = 'create'
|
|
|
+ this.addFormShow1 = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['addFormRef1'].clearValidate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ form_see1(row) {
|
|
|
+ console.log('行内容row=========', row)
|
|
|
+ //编辑行内容赋值
|
|
|
+ this.seeForm1 = Object.assign({}, row)
|
|
|
+ this.seeFormShow1 = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['seeFormRef1'].clearValidate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ see_dialog_close1(){
|
|
|
+ //内容重置
|
|
|
+ this.$refs['seeFormRef1'].resetFields()
|
|
|
+ this.seeFormShow1 = false
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ form_result1(row) {
|
|
|
+ console.log('行内容row=========', row)
|
|
|
+ //编辑行内容赋值
|
|
|
+ this.resultForm1 = Object.assign({}, row)
|
|
|
+ this.resultFormShow1 = true
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ result_dialog_close1(){
|
|
|
+ //内容重置
|
|
|
+
|
|
|
+ this.resultFormShow1 = false
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //编辑
|
|
|
+ form_edit1(row) {
|
|
|
+ var me = this
|
|
|
+ console.log('行内容row=========', row)
|
|
|
+ //编辑行内容赋值
|
|
|
+ this.addForm1 = Object.assign({}, row)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //这里获取一下实际存的栏舍ID
|
|
|
+ var checklist = [27,28,30]
|
|
|
+ if(checklist.length !== 0){
|
|
|
+
|
|
|
+ var newChecklist = checklist.map((item)=>{
|
|
|
+ return ""+item
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ console.log("newChecklist===========",newChecklist)
|
|
|
+
|
|
|
+ me.checkedIdTxtArr = newChecklist
|
|
|
+
|
|
|
+ var leftlist = []
|
|
|
+ me.cowShedlist.forEach(function(item){
|
|
|
+
|
|
|
+ newChecklist.forEach(function(items){
|
|
|
+ if(parseFloat(items) == item.id ){
|
|
|
+ console.log(items)
|
|
|
if(items.indexOf("组") == -1 ){
|
|
|
- console.log(items)
|
|
|
leftlist.push(item.name)
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
-
|
|
|
- })
|
|
|
- me.leftlist = leftlist
|
|
|
-
|
|
|
- console.log(" me.leftlist", me.leftlist)
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- change_person(value){
|
|
|
- var me = this
|
|
|
- console.log("更改人员Id",value)
|
|
|
- var item = me.personList.find(obj => obj.id == value)
|
|
|
- console.log("更改人员当前的内容",item)
|
|
|
- me.addForm.user_phone = item.phone
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ me.leftlist = leftlist
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.addFormStatus1 = 'edit'
|
|
|
+ this.addFormShow1 = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['addFormRef1'].clearValidate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //新增关闭
|
|
|
+ add_dialog_close1(){
|
|
|
+ //内容重置
|
|
|
+ this.$refs['addFormRef1'].resetFields()
|
|
|
+ this.addFormShow1 = false
|
|
|
+ },
|
|
|
+
|
|
|
+ //新增 保存
|
|
|
+ add_dialog_save1() {
|
|
|
+ var me = this
|
|
|
+ this.$refs['addFormRef1'].validate(valid => {
|
|
|
+ //验证成功
|
|
|
+ if (valid) {
|
|
|
+ //发起请求
|
|
|
+ var send_data = {
|
|
|
+ "work_order_category_id": me.addForm.work_order_category_id,
|
|
|
+ "user_id": me.addForm.user_id,
|
|
|
+ "user_phone": me.addForm.user_phone,
|
|
|
+ "remark": me.addForm.remark,
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ console.log("弹窗参数:", send_data)
|
|
|
+
|
|
|
+ //关闭弹窗
|
|
|
+ // me.addFormShow = false
|
|
|
+ //加载 - 发送新增保存
|
|
|
+ ajaxDataPost(me.url_add_table, send_data).then(e => {
|
|
|
+ console.log("新增结果:",e)
|
|
|
+ //打印请求成功结果
|
|
|
+ if(e.code == 200 ){
|
|
|
+ me.$message({ type: 'success', message: '新增成功!' , duration: 2000 })
|
|
|
+ //关闭弹窗
|
|
|
+ me.addFormShow = false
|
|
|
+ me.get_table_data()
|
|
|
+ } else {
|
|
|
+ me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- },
|
|
|
-
|
|
|
- //监听 - 穿梭框选到右边的值
|
|
|
- change_transData1(value){
|
|
|
- console.log("穿梭框选到右边的值",value)
|
|
|
- },
|
|
|
-
|
|
|
- //监听 - 穿梭框选到右边的值
|
|
|
- change_transData2(value){
|
|
|
- console.log("穿梭框选到右边的值",value)
|
|
|
- },
|
|
|
-
|
|
|
- form_export() {
|
|
|
- //获取请求表格数据的参数
|
|
|
- //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
|
|
|
- //请求表格
|
|
|
- // GetDataByName(this.download.getdataListParm).then(response => {
|
|
|
- // if (response.data.list !== null) {
|
|
|
- // this.download.list = response.data.list
|
|
|
- // } else {
|
|
|
- // this.download.list = []
|
|
|
- // }
|
|
|
- // var excelDatas = [
|
|
|
- // {
|
|
|
- // tHeader: ['表头1', '表头2', '表头3', '表头4',],
|
|
|
- // filterVal: ['title1', 'title2', 'title3', 'title4'],
|
|
|
- // tableDatas: this.download.list,
|
|
|
- // sheetName: 'Sheet1'
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // json2excel(excelDatas, '表格大标题', true, 'xlsx')
|
|
|
- // })
|
|
|
-
|
|
|
- var excelDatas = [
|
|
|
- {
|
|
|
- tHeader: ['表头1', '表头2', '表头3', '表头4',],
|
|
|
- filterVal: ['title1', 'title2', 'title3', 'title4'],
|
|
|
- tableDatas: [
|
|
|
- {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
|
|
|
- {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
|
|
|
- {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
|
|
|
- ],
|
|
|
- sheetName: 'Sheet1'
|
|
|
- }
|
|
|
- ]
|
|
|
- json2excel(excelDatas, '表格大标题', true, 'xlsx')
|
|
|
-}
|
|
|
-
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //编辑 保存
|
|
|
+ edit_dialog_save1(){
|
|
|
+ var me = this
|
|
|
+ this.$refs['addFormRef1'].validate(valid => {
|
|
|
+ //验证成功
|
|
|
+ if (valid) {
|
|
|
+ //发起请求
|
|
|
+ var send_data = {
|
|
|
+
|
|
|
+ "id": me.addForm1.id,
|
|
|
+ "work_order_category_id": me.addForm.work_order_category_id,
|
|
|
+ "user_id": me.addForm.user_id,
|
|
|
+ "user_phone": me.addForm.user_phone,
|
|
|
+ }
|
|
|
+ console.log("弹窗参数:", send_data)
|
|
|
+
|
|
|
+ //关闭弹窗
|
|
|
+ // me.addFormShow = false
|
|
|
+ //加载 - 发送新增保存
|
|
|
+ ajaxDataPut(me.url_edit_table, send_data).then(e => {
|
|
|
+ console.log("编辑结果:",e)
|
|
|
+ //打印请求成功结果
|
|
|
+ if(e.code == 200 ){
|
|
|
+ me.$message({ type: 'success', message: '编辑成功!' , duration: 2000 })
|
|
|
+ //关闭弹窗
|
|
|
+ me.addFormShow = false
|
|
|
+ me.get_table_data()
|
|
|
+ } else {
|
|
|
+ me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ form_delete(row) {
|
|
|
+ var me = this
|
|
|
+
|
|
|
+ me.$confirm('是否关闭此条内容?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ console.log("删除的ID参数:", row.id)
|
|
|
+ //加载 - 发送新增保存
|
|
|
+ ajaxDataDelete(me.url_delete_table + '/' +row.id, {}).then(e => {
|
|
|
+ console.log("编辑结果:",e)
|
|
|
+ //打印请求成功结果
|
|
|
+ if(e.code == 200 ){
|
|
|
+ me.$message({ type: 'success', message: '关闭成功!' });
|
|
|
+ me.get_table_data()
|
|
|
+ } else {
|
|
|
+ me.$message({ type: 'error', message: '关闭失败!' + e.msg, duration: 2000 })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }).catch(() => {
|
|
|
+ me.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ //监听勾选
|
|
|
+ change_check(data, checked, indeterminate) {
|
|
|
+ console.log(data, checked, indeterminate)
|
|
|
+ var me = this
|
|
|
+
|
|
|
+ var checkedKeys = this.$refs.tree.getCheckedKeys() // 所有被选中的节点的 key 所组成的数组数据
|
|
|
+ console.log(checkedKeys)
|
|
|
+ this.checkedIdTxtArr = checkedKeys
|
|
|
+
|
|
|
+ console.log("选中的IDTXT checkedIdTxtArr",me.checkedIdTxtArr)
|
|
|
+
|
|
|
+ console.log(" me.cowShedlist", me.cowShedlist)
|
|
|
+
|
|
|
+ var leftlist = []
|
|
|
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-<!-- 加了scoped,则是仅在此组件里生效 -->
|
|
|
-<style scoped>
|
|
|
-.el-transfer /deep/.el-transfer-panel { width:300px; text-align: left;}
|
|
|
-</style>
|
|
|
-
|
|
|
+ me.cowShedlist.forEach(function(item){
|
|
|
+
|
|
|
+ me.checkedIdTxtArr.forEach(function(items){
|
|
|
+ if(parseFloat(items) == item.id ){
|
|
|
+ //不包含 组这个字段
|
|
|
+ if(items.indexOf("组") == -1 ){
|
|
|
+ console.log(items)
|
|
|
+ leftlist.push(item.name)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ })
|
|
|
+ me.leftlist = leftlist
|
|
|
+
|
|
|
+ console.log(" me.leftlist", me.leftlist)
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ change_person(value){
|
|
|
+ var me = this
|
|
|
+ console.log("更改人员Id",value)
|
|
|
+ var item = me.personList.find(obj => obj.id == value)
|
|
|
+ console.log("更改人员当前的内容",item)
|
|
|
+ me.addForm.user_phone = item.phone
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ form_export() {
|
|
|
+ //获取请求表格数据的参数
|
|
|
+ //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
|
|
|
+ //请求表格
|
|
|
+ // GetDataByName(this.download.getdataListParm).then(response => {
|
|
|
+ // if (response.data.list !== null) {
|
|
|
+ // this.download.list = response.data.list
|
|
|
+ // } else {
|
|
|
+ // this.download.list = []
|
|
|
+ // }
|
|
|
+ // var excelDatas = [
|
|
|
+ // {
|
|
|
+ // tHeader: ['表头1', '表头2', '表头3', '表头4',],
|
|
|
+ // filterVal: ['title1', 'title2', 'title3', 'title4'],
|
|
|
+ // tableDatas: this.download.list,
|
|
|
+ // sheetName: 'Sheet1'
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ // json2excel(excelDatas, '表格大标题', true, 'xlsx')
|
|
|
+ // })
|
|
|
+
|
|
|
+ var excelDatas = [
|
|
|
+ {
|
|
|
+ tHeader: ['表头1', '表头2', '表头3', '表头4',],
|
|
|
+ filterVal: ['title1', 'title2', 'title3', 'title4'],
|
|
|
+ tableDatas: [
|
|
|
+ {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
|
|
|
+ {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
|
|
|
+ {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
|
|
|
+ ],
|
|
|
+ sheetName: 'Sheet1'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ json2excel(excelDatas, '表格大标题', true, 'xlsx')
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ <!-- 加了scoped,则是仅在此组件里生效 -->
|
|
|
+ <style scoped>
|
|
|
+ .el-transfer /deep/.el-transfer-panel { width:300px; text-align: left;}
|
|
|
+ </style>
|
|
|
+
|
|
|
+
|