“linengliang”
2023-11-22 c2ba0d418a2d33043e396d385dc73664737686e0
src/views/eam/ABC/StreamList.vue
@@ -4,6 +4,20 @@
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col
          :span="6"
          >
            <a-form-item
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="单据号"
            >
              <a-input
                placeholder="请输入单据号查询"
                v-model="queryParam.num"
              ></a-input>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </div>
@@ -11,7 +25,16 @@
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button
        type="primary"
        @click="searchQuery"
        icon="search"
      >查询</a-button>
      <a-button
        @click="searchReset"
        icon="reload"
      >重置</a-button>
      <a-button @click="handleAdd" type="primary" icon="plus" v-if="nodeSort===1">新增</a-button>
      <!-- <a-button type="primary" icon="download" @click="handleExportXls('设备ABC评价')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
@@ -61,10 +84,13 @@
            下载
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <div v-if="nodeValue===record.status">
            <a @click="handleStreamNext(record)" :disabled="nodeSort===1&&nodeValue!==record.status" >{{button1.name}}</a>
          <a-divider type="vertical" />
            <a @click="handleStreamLast(record)" :disabled="nodeSort===1" >{{button2.name}}</a>
         </div>
         <div v-if="nodeSort===1&&nodeValue===record.status">
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
@@ -74,8 +100,12 @@
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
              <a-menu-item>
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
         </div>
        </span>
      </a-table>
@@ -91,6 +121,7 @@
    </a-tabs>
    <stream-modal ref="modalForm" @ok="modalFormOk"></stream-modal>
    <node-model ref="nodeModel" @ok="modalFormOk"></node-model>
  </a-card>
</template>
@@ -102,6 +133,8 @@
  import StreamOperationList from './StreamOperationList'
  import ABCAssessmentList from './ABCAssessmentList'
  import '@/assets/less/TableExpand.less'
  import NodeModel from './modules/NodeModel.vue'
  export default {
    name: "StreamList",
@@ -109,7 +142,8 @@
    components: {
      StreamOperationList,
      ABCAssessmentList,
      StreamModal
      StreamModal,
        NodeModel
    },
    data () {
      return {
@@ -135,13 +169,13 @@
          {
            title:'当前节点',
            align:"center",
            dataIndex: 'status',
            dataIndex: 'status_dictText',
            width:300
          },
          {
            title:'单据类型',
            align:"center",
            dataIndex: 'type',
            dataIndex: 'type_dictText',
            width:300
          },
          {
@@ -170,6 +204,7 @@
          deleteBatch: "/eam/stream/deleteBatch",
          exportXlsUrl: "/eam/stream/exportXls",
          importExcelUrl: "eam/stream/importExcel",
          getPreInfo:"eam/stream/getPreInfo"
        },
        dictOptions:{
        },
@@ -189,10 +224,17 @@
        superFieldList:[],
        streamOperationMainId: '',
        aBCAssessmentMainId: '',
        button1:{},
        button2:{},
        nodeSort:0,
        nodeValue:''
      }
    },
    created() {
      this.getSuperFieldList();
    },
    mounted(){
      this.getPreInfo();
    },
    computed: {
      importExcelUrl: function(){
@@ -210,6 +252,30 @@
            }
          }
        }
      },
      handleStreamNext(record){
        var step = {
          name:this.button1.name,
          value:this.button1.value,
          opType:'next',
          nodeSort:this.nodeSort,
          node:this.nodeValue,
          streamId:record.id
        }
        this.$refs.nodeModel.title = this.button1.name+"操作";
        this.$refs.nodeModel.edit(step);
      },
      handleStreamLast(record){
        var step = {
          name:this.button2.name,
          value:this.button2.value,
          opType:'last',
          nodeSort:this.nodeSort,
          node:this.nodeValue,
          streamId:record.id
        }
        this.$refs.nodeModel.title = this.button2.name+"操作";
        this.$refs.nodeModel.edit(step);
      },
      onClearSelected() {
        this.selectedRowKeys = [];
@@ -260,6 +326,16 @@
        fieldList.push({type:'string',value:'status',text:'status',dictCode:''})
        fieldList.push({type:'string',value:'type',text:'单据类型',dictCode:''})
        this.superFieldList = fieldList
      },
      getPreInfo(){
        getAction(this.url.getPreInfo).then(res=>{
            if(res.result.msg==='ok'){
              this.button1 = res.result.buttons[0];
              this.button2 = res.result.buttons[1];
              this.nodeSort = res.result.nodeSort;
              this.nodeValue = res.result.nodeValue;
            }
        })
      }
    }
  }