123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437 |
- <template>
- <div>
- <div class="container structure-r" style="margin: 0;width: calc(50% - 10px);">
- <fullscreen :fullscreen.sync="fullscreen" class="container-box" style="padding: 0 20px 0 0;">
- <div class="titbox">
- <h2 class="font-ui">测试终端申请</h2>
- </div>
- <div class="search">
- <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
- </div>
- <div class="tabbox">
- <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" size="small"
- border style="width: 100%">
- <el-table-column prop="terminalTypeName" label="类型">
- </el-table-column>
- <el-table-column prop="brandName" label="品牌">
- </el-table-column>
- <el-table-column prop="modelType" label="型号">
- </el-table-column>
- <el-table-column prop="terminalNo" label="终端编码">
- </el-table-column>
- <el-table-column label="操作" width="80px" align="center">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" @click="dialogCheck(scope.row)">申请</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
- :total="total">
- </el-pagination>
- </div>
- </fullscreen>
- </div>
- <div class="container structure-r" style="margin: 0;width: calc(50% - 10px);margin-left: 20px;">
- <div class="onetab">
- <el-table height="calc(100% - 10px)" class="com-table" ref="multipleTable" :data="infoApply" tooltip-effect="dark" size="small"
- border style="width: 100%">
- <el-table-column prop="terminalTypeName" label="类型">
- </el-table-column>
- <el-table-column prop="brandName" label="品牌">
- </el-table-column>
- <el-table-column prop="modelType" label="型号">
- </el-table-column>
- <el-table-column prop="terminalNo" label="终端编码">
- </el-table-column>
- <el-table-column label="操作" width="80px" align="center">
- <template slot-scope="scope">
- <el-button size="mini" type="danger" @click="delone(scope.row)">x</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-form :model="infolist" ref="infolist" :rules="rules">
- <div class="info-line">
- <el-form-item prop="terminalTypeName">
- <span>申请标题</span>
- <el-input v-model="infolist.tit" placeholder="申请标题" :disabled="disableStatus"></el-input>
- </el-form-item>
- <el-form-item prop="modelType">
- <span>归还时间</span>
- <el-date-picker v-model="infolist.time" type="date" placeholder="归还时间">
- </el-date-picker>
- </el-form-item>
- </div>
- <div class="info-line">
- <el-form-item>
- <span>申请流程</span>
- <el-select clearable v-model="terminal" placeholder="申请流程" disabled>
- <el-option v-for="items in options" :key="items.procId" :label="items.procName"
- :value="items.procId">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <span>操作姓名</span>
- <el-input v-model="infolist.opName" placeholder="操作姓名" disabled></el-input>
- </el-form-item>
- </div>
- </el-form>
- <div class="t-footer">
- <el-button type="primary" @click="dialogCli(2)">确 定</el-button>
- <el-button @click="dialogCli(1)">取 消</el-button>
- </div>
- </div>
- </div>
- </template>
- <script>
- import mySearch from "../../../components/search.vue";
- export default {
- components: {
- mySearch
- },
- data() {
- const terminalTypeName = (rule, value, callback) => {
- if (!this.infolist.tit) {
- callback(new Error('不能为空'))
- } else {
- callback()
- }
- }
- const modelType = (rule, value, callback) => {
- if (!this.infolist.time) {
- callback(new Error('不能为空'))
- } else {
- callback()
- }
- }
- return {
- rules: {
- terminalTypeName: [{
- required: true,
- trigger: 'blur',
- validator: terminalTypeName
- }],
- modelType: [{
- required: true,
- trigger: 'blur',
- validator: modelType
- }],
- },
- searchList: [{
- type: 'input',
- tit: '类别',
- value: '',
- width: '48%',
- },
- {
- type: 'input',
- tit: '品牌',
- value: '',
- width: '48%',
- },
- // {
- // type: 'input',
- // tit: '型号',
- // value: '',
- // width: '32%',
- // },
- ],
- fullscreen: false,
- total: 0,
- pageSize: 1,
- tableData: [{}],
- disableStatus: false,
- titname: '终端',
- infolist: {},
- typeOptions: [{
- dataCode: 1,
- dataName: 111,
- }],
- userInfo: {},
- params: {},
- infoApply: [],
- options: [],
- terminal:'686495855492730880',
- }
- },
- methods: {
- //搜索数据
- searchInfo(v) {
- this.params = {};
- v[0] ? this.params.terminalTypeName = v[0] : '';
- v[1] ? this.params.brandName = v[1] : '';
- v[2] ? this.params.modelType = v[2] : '';
- this.getList(this.params, this.pageSize);
- },
- //获取列表
- getList(v, n) {
- v.sts = '0';
- this.pageSize = n;
- let _this = this;
- this.$http({
- url: "/market/terminal/terminalrepo/queryPage",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- "page": '{"pageNo":"' + n + '","pageSize":"10"}'
- },
- data: v,
- }).then((res) => {
- this.tableData = res.data.data;
- this.total = res.data.totalRecord;
- for (let i = 0; i < this.tableData.length; i++) {
- _this.tableData[i].opTime = _this.$formatDate(_this.tableData[i].opTime, "YYYY-MM-DD")
- }
- });
- },
- currchange(v) {
- this.pageSize = v;
- this.getList(this.params, this.pageSize);
- },
- //申请
- dialogCheck(n) {
- let _this = this;
- let sts = true;
- this.infolist.opNo = this.userInfo.loginNo;
- this.infolist.opName = this.userInfo.loginName;
- for(let i=0;i<this.infoApply.length;i++){
- if(n.id === this.infoApply[i].id){
- sts = false;
- }
- }
- sts ? this.infoApply.push(Object.assign({}, n)) : '';
- },
- delone(n){
- for(let i=0;i<this.infoApply.length;i++){
- if(n.id === this.infoApply[i].id){
- this.infoApply.splice(i,1)
- }
- }
- },
- //添加
- dialogCli(v) {
- if (v === 1) {
- this.infolist = {};
- this.infoApply = [];
- this.getUser();
- return
- }
- let _this = this;
- let info = {};
- info.opTime = _this.$formatDate(new Date(), "YYYY-MM-DD");
- info.opNo = this.userInfo.loginNo;
- info.opName = this.userInfo.loginName;
- info.params = {};
- info.params.reqBackTime = _this.infolist.time?_this.$formatDate(_this.infolist.time, "YYYY-MM-DD"):'';
- info.params.terminalRes = [];
- for (let i = 0; i < this.infoApply.length; i++) {
- let terminal = {
- terminalNo: this.infoApply[i].terminalNo,
- terminalTypeName: this.infoApply[i].terminalTypeName,
- brandName: this.infoApply[i].brandName,
- modelType: this.infoApply[i].modelType,
- id: this.infoApply[i].id,
- }
- info.params.terminalRes.push(terminal)
- }
- info.woTitle = this.infolist.tit;
- info.params.woTitle = this.infolist.tit;
- info.procId = this.terminal;
- for (let i = 0; i < this.options.length; i++) {
- if(this.infolist.terminal === this.options[i].procId){
- info.procName = this.options[i].procName;
- info.procVersion = this.options[i].procVersion;
- }
- }
- info.params.terminalRes = JSON.stringify(info.params.terminalRes)
- this.submitInfo("/bpm/api/startProc",info);
- },
- submitInfo(u,v) {
- let _this = this;
- this.$refs.infolist.validate(valid => {
- if (valid) {
- this.$http({
- url: u,
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: v,
- }).then((res) => {
- if (res.data.result === 1) {
- _this.$message({
- message: res.data.desc,
- type: 'error'
- });
- } else {
- _this.$message({
- message: '成功',
- type: 'success'
- });
- _this.infolist = {};
- _this.infoApply = [];
- _this.getUser();
- }
- });
- }
- })
- },
- //删除
- delLine(v) {
- let _this = this;
- this.$confirm('即将删除此条数据, 是否删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.$http({
- url: "/market/terminal/terminaltype/del",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- id: v.id
- },
- }).then((res) => {
- if (res.data.result === 1) {
- _this.$message({
- message: res.data.desc,
- type: 'error'
- });
- } else {
- _this.$message({
- message: '删除成功',
- type: 'success'
- });
- _this.getList(this.params, this.pageSize);
- }
- });
- })
- },
- //流程
- getTermianl() {
- this.$http({
- url: "/bpm/api/queryBpmProcList",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- "page": '{"pageNo":"' + 1 + '","pageSize":"100"}'
- },
- data: {},
- }).then((res) => {
- this.options = res.data.data;
- });
- },
- //功能栏
- iconCli(v) {
- if (v === 1) {
- this.getList(this.params, this.pageSize);
- }
- if (v === 2) {
- this.fullscreen = !this.fullscreen
- }
- },
- getUser() {
- this.userInfo = JSON.parse(window.sessionStorage.userInfo);
- this.infolist = {
- opNo: '',
- opName: '',
- };
- this.infolist.opNo = this.userInfo.loginNo;
- this.infolist.opName = this.userInfo.loginName;
- }
- },
- mounted() {
- this.getList({}, 1);
- this.getTermianl();
- this.getUser();
- },
- created() {
- }
- }
- </script>
- <style scoped lang="scss">
- .t-footer {
- text-align: right;
- padding-right: 20px;
- }
- .onetab {
- padding: 20px;
- height: calc(100% - 180px);
- }
- .titbox {
- div {
- float: right;
- i {
- font-size: 22px;
- margin-left: 20px;
- cursor: pointer;
- }
- }
- }
- .tabbox {
- margin-top: 15px;
- }
- .pageBox {
- text-align: right;
- margin-top: 10px;
- }
- .info-line {
- width: 100%;
- display: block;
- padding-left: 20px;
- div {
- width: 50%;
- display: inline-block;
- }
- span {
- width: 80px;
- display: inline-block;
- text-align: left;
- i {
- color: red;
- display: inline-block;
- padding-right: 5px;
- }
- }
- .el-select,
- .el-input {
- width: calc(100% - 100px);
- }
- }
- .online {
- width: 100%;
- .el-select {
- width: calc(100% - 100px);
- }
- span {
- vertical-align: top;
- }
- .el-textarea {
- width: calc(100% - 100px);
- }
- }
- </style>
|