index.vue 4.79 KB
Newer Older
潘际乾 committed
1 2
<template>
  <div class="eContainer">
3
    <!-- <el-button size="small"
吴佳 committed
4
         type="primary"
5
         @click="handleSave">save</el-button> -->
吴佳 committed
6
    <!-- <el-button size="small" @click="handletak">tak</el-button> -->
7 8 9 10 11 12 13
    <div class="m-Btn-eContainer">
        <div class="m-funcBtn-eContainer">
 
        <el-button size="small" type="primary" @click="handleSave">{{ $t('buttons.submit') }}</el-button>
        <el-button size="small" @click="handleCancel">{{ $t('buttons.quit') }}</el-button>
        </div>
    </div>
潘际乾 committed
14 15 16 17
    <el-form :model="model" :rules="rules" ref="modelForm" label-width="200px" size="small" :validate-on-rule-change="false">
       <c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="tabClick">
        
            <!--PD000052 -->
吴佳 committed
18
           <el-tab-pane label="Items Overview" name="sptroup" v-if="false">
潘际乾 committed
19 20 21 22
                <m-sptroup :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--PD000035 -->
潘际乾 committed
23
           <el-tab-pane label="Pending Item" name="sptnegp">
24
                <m-sptnegp ref="sptnegp" :model="model" :codes="codes"/>
潘际乾 committed
25 26 27
           </el-tab-pane>
 
            <!--PD000090 -->
潘际乾 committed
28
           <el-tab-pane label="Configure Print Reroute" name="prtcfg">
潘际乾 committed
29 30 31
                <m-prtcfg :model="model" :codes="codes"/>
           </el-tab-pane>
       </c-tabs>
吴佳 committed
32 33 34 35 36 37 38 39

       <c-grid-ety-prompt-dialog
        ref="etyDialog"
        :isPty="false"
        :promptData="promptData"
        @select-ety="selectMsg"
      >
      </c-grid-ety-prompt-dialog>
潘际乾 committed
40 41 42 43 44 45 46
    </el-form>
  </div>
</template>
<script>
import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable"
import Sptrou from "~/model/Sptrou"
wangren committed
47
import commonProcess from "~/mixin/commonProcess"
潘际乾 committed
48 49 50
import Check from "~/model/Sptrou/Check"
import Default from "~/model/Sptrou/Default"
import Pattern from "~/model/Sptrou/Pattern"
吴佳 committed
51
// import Sptroup from "./Sptroup"
潘际乾 committed
52 53 54 55 56
import Sptnegp from "./Sptnegp"
import Prtcfg from "./Prtcfg"


export default {
潘际乾 committed
57
    name: 'Sptrou',
潘际乾 committed
58
    components:{
吴佳 committed
59
        // "m-sptroup" : Sptroup,
潘际乾 committed
60 61 62 63 64 65 66 67
        "m-sptnegp" : Sptnegp,
        "m-prtcfg" : Prtcfg,
    },
    provide() {
        return {
            root: this
        }
    },
wangren committed
68
    mixins: [commonProcess],    // 里面包含了Default、Check等的公共处理
潘际乾 committed
69 70
    data(){
        return {
吴佳 committed
71
            tabVal: "sptnegp",
潘际乾 committed
72 73 74 75 76 77
            trnName: "sptrou",
            model: new Sptrou().data,
            checkRules: Check,
            defaultRules: Default,
            pattern: Pattern,
            rules: null,
吴佳 committed
78 79
            codes: { ...CodeTable },
            
潘际乾 committed
80 81 82 83
        }
    },
    methods:{
        tabClick(){
吴佳 committed
84 85 86 87 88 89 90 91 92 93 94 95 96

        },
        async handleSave(){
            let rtnmsg = await this.executeRule("sav")
            if(rtnmsg.respCode == SUCCESS)
            {
                this.$notify({
                title: "成功",
                message: "保存成功",
                type: "success",
                });
                this.$store.dispatch("TagsView/delView", this.$route)
                this.$router.history.push("/taskList", () => {
97
                this.$store.commit("setTaskListTabVal", 'sptsel')
吴佳 committed
98
                //修改待复核界面刷新状态为需要刷新
99
                this.$store.commit("setLoadingFreshSptsel", true)
吴佳 committed
100 101 102 103 104 105 106 107 108 109 110 111
                });

            }
            else
            {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
            }

        },
        handletak(){

        },
潘际乾 committed
112 113 114 115 116 117
    },
    created:async function(){
        console.log("进入sptrou交易");
        let rtnmsg = await this.init({})
        if(rtnmsg.respCode == SUCCESS)
        {
118 119 120 121 122 123 124 125 126 127 128 129 130
            //TODO 处理数据逻辑
            this.updateModel(rtnmsg.data)
            const wrkgrp = this.codes.codeSet['spt.wrkgrp']
            const wrkgrpArr = [];
            for (let i = 0; i < wrkgrp.length; i++) {
                const wrk = wrkgrp[i];
                const ss = wrk.split('\t')
                wrkgrpArr.push({
                    label: ss[1],
                    value: ss[0]
                })
            }
            this.$refs.sptnegp.sptWrkgrp = wrkgrpArr;
潘际乾 committed
131 132 133 134 135
        }
        else
        {
            this.$notify.error({title: '错误',message: '服务请求失败!'});
        }
136 137
    },
    
潘际乾 committed
138 139 140
}
</script>
<style>
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
    .m-Btn-eContainer {
        display: flex; /*flex布局*/
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: flex-start;
        height: 24px;
        margin-bottom: 5px;
        }
        .m-funcBtn-eContainer {
  order: 1;
}
        .m-funcBtn-eContainer button,
.m-funcBtn-eContainer .el-button + .el-button {
  margin: 0px 0px 0px 0px;
}
.m-funcBtn-eContainer .el-button--default {
  background-image: linear-gradient(#fff,#dedede);
  border: 1px solid #ccc;
}
.m-funcBtn-eContainer .el-button--primary {
  border: 1px solid #0D4FBD;
}
潘际乾 committed
164
</style>