ymy %!s(int64=2) %!d(string=hai) anos
pai
achega
c9c2a3fbfc
Modificáronse 4 ficheiros con 179 adicións e 11 borrados
  1. 11 7
      src/benyun/components/byBill/byBill.vue
  2. 149 2
      src/components/byLog/byLog.vue
  3. 3 0
      src/main.ts
  4. 16 2
      src/views/demo/bill.vue

+ 11 - 7
src/benyun/components/byBill/byBill.vue

@@ -49,8 +49,8 @@
         </div>
         <div class="bill-log">
           <div class="log-icon" @click="showLog">
-            <i v-if="!drawer" class="el-icon-s-fold"></i>
-            <i v-else class="el-icon-s-unfold"></i>
+            <i v-if="!drawer" class="el-icon-back"></i>
+            <i v-else class="el-icon-right"></i>
           </div>
         </div>
         <el-drawer
@@ -60,7 +60,7 @@
           title="操作日志"
           :visible.sync="drawer"
           direction="rtl">
-          <byLog :config="billConfig && billConfig.log" :parentValue="billValue" ref="log" />
+          <byLog :propConfig="billConfig && billConfig.log" :parentValue="billValue" ref="log" />
         </el-drawer>
       </div>
       <!-- 已提交 -->
@@ -181,6 +181,7 @@ export default class ByBill extends VueViews {
       this.drawer = true;
     }
     if(this.$refs.log){
+      (this.$refs.log as any).resertPage();
       (this.$refs.log as any).request();
     }
   }
@@ -262,6 +263,7 @@ export default class ByBill extends VueViews {
     if(this.$refs[code]){
       d = (this.$refs[code] as any)[0]?.getTableValue()
     }
+    return d;
   }
 
   //获取引单表格选中数据
@@ -393,7 +395,7 @@ export default class ByBill extends VueViews {
   }
 
   /**
-   * 获取表格分页
+   * 获取tab表格分页
    * @param n 
    */
   getTablePage(n:string){
@@ -514,17 +516,19 @@ export default class ByBill extends VueViews {
         justify-content: center;
         align-items: center;
         flex-shrink: 0;
-        margin-left: 8px;
+        margin-left: 16px;
         border-left: solid 1px #EEE;
         .log-icon{
-          // background-color: #EEE;
           width: 30px;
           height: 40px;
           display: flex;
           justify-content: center;
           align-items: center;
           cursor: pointer;
-          .el-icon-notebook{
+          border-top-right-radius: 5px;
+          border-bottom-right-radius: 5px;
+          background-color: #EEE;
+          >i{
             font-size: 20px;
           }
         }

+ 149 - 2
src/components/byLog/byLog.vue

@@ -1,7 +1,154 @@
 <template>
-  <div></div>
+  <div class="log">
+    <div class="log-main">
+      <div class="log-row" v-for="(item,index) of data" :key="index">
+        <div class="log-time">{{item.createTime}}</div>
+        <div class="log-user">{{item.optUser}}</div>
+        <div class="log-act">{{item.optName}}</div>
+        <div class="log-desc" v-html="item.optDesc"></div>
+      </div>
+    </div>
+    <div class="log-page">
+      <el-pagination
+        background
+        layout="prev, pager, next"
+        @current-change="handleCurrentChange"
+        :current-page="page.pageNo"
+        :page-size="page.pageSize"
+        :total="page.total">
+      </el-pagination>
+    </div>
+  </div>
 </template>
 
 <script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import VueViews from '@/benyun/compVue/VueViews'
+@Component
+export default class ByLog extends VueViews {
+  config:any={}
+  data:Array<any>=[];
+  load=false;
+  page = {
+    pageNo: 1, //当前页
+    pageSize: 20, //每页条数
+    total: 0 //总条数
+  }
+  created(){
+    if(this.propConfig){
+      this.setConfig(this.propConfig)
+    }
+  }
 
-</script>
+  mounted(){
+    this.request();
+  }
+  resertPage(){
+    this.page={
+      pageNo: 1, //当前页
+      pageSize: 20, //每页条数
+      total: 0 //总条数
+    }
+  }
+  handleCurrentChange(v:number){
+    this.page.pageNo = v;
+    this.request();
+  }
+  request(){
+    if(!this.requestConfig || !this.requestConfig.url){
+      return
+    }
+    if(!this.parentValue || !this.parentValue.id){
+      return
+    }
+    let parame = (this as any).$lodash.cloneDeep(this.requestConfig);
+    parame.params={
+      docId:this.parentValue.id,
+      pageNo:this.page.pageNo,
+      pageSize:this.page.pageSize
+    }
+    parame.success = (res:any) => {
+      this.load = false;
+      if(res.data && res.data.records){
+        this.data = res.data.records;
+      }
+      this.page.pageNo = res.data.current;
+      this.page.total = res.data.total;
+    }
+    parame.fail = () => {
+      this.load = false;
+    }
+    this.load = true;
+    this.requestHandle(parame);
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.log{
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+  padding: 0 16px;
+  .log-row{
+    width: 100%;
+    display: flex;
+    flex-flow: wrap;
+    font-size: 14px;
+    padding: 16px 0;
+    border-bottom: dotted 1px #CCC;
+    .log-time{
+      width: 150px;
+    }
+    .log-user{
+      width: 120px;
+      padding-right: 8px;
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+    .log-act{
+      width: 130px;
+      padding-right: 8px;
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+    .log-desc{
+      // min-width: 150px;
+      width: 100%;
+      font-size: 12px;
+      padding-top: 8px;
+      display: flex;
+      flex-wrap: wrap;
+      .mData{
+        font-style: italic;
+      }
+      .mCode{
+        font-size: 14px;
+        font-weight: 700;
+      }
+      .mNum,.mPrice{
+        font-size: 14px;
+        font-weight: 700;
+        color: #F00;
+      }
+      .mCont{
+        font-size: 14px;
+        font-weight: 700;
+      }
+    }
+  }
+  .log-main{
+    height: calc(100% - 50px);
+    overflow-y: auto;
+  }
+  .log-page{
+    height:50px;
+    display: flex;
+    align-items: flex-end;
+    flex-direction: column;
+    justify-content: center;
+  }
+}
+</style>

+ 3 - 0
src/main.ts

@@ -46,6 +46,9 @@ import warehouse from './components/warehouse/warehouse.vue';
 Vue.component('warehouse', warehouse);
 import warehousePosition from './components/warehousePosition/warehousePosition.vue';
 Vue.component('warehousePosition', warehousePosition);
+import byLog from './components/byLog/byLog.vue';
+Vue.component('byLog', byLog);
+
 
 Vue.use(Element, {
   size: Cookies.get('size') || 'medium' // set element-ui default size

+ 16 - 2
src/views/demo/bill.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <by-bill :propConfig="config" @search="search" @onSmt="onSmt" ref="bill" @onAdd="onAdd" @onUpdate="onUpdate" @resert="resert" @pagination="pagination" @detail="detail">
+    <by-bill :propConfig="config" @search="search" @onSmt="onSmt" ref="bill" @showLogBefore="showLogBefore" @onAdd="onAdd" @onUpdate="onUpdate" @resert="resert" @pagination="pagination" @detail="detail">
       <template v-slot:cus>我是插槽</template>
     </by-bill>
     <div style="clear: both;"></div>
@@ -148,6 +148,12 @@ export default class BillDemo extends Vue {
           }]
         ]
       },
+      log:{
+        request:{
+          url:'/supply/supplyPurchaseOrderOperateLog/page',
+          method:'GET'
+        }
+      },
       tableConfig:[{
         title:'单据表格1数据',
         tool:{
@@ -338,7 +344,15 @@ export default class BillDemo extends Vue {
   }
 
   mounted(){
-
+    setTimeout(()=>{
+      (this.$refs.bill as any).setBillFormValue({
+        id:'1000022023052000002'
+      })
+    },500)
+    
+  }
+  showLogBefore(){
+    
   }
   setReadonly(){
     let c = (this as any).$lodash.cloneDeep(this.config.bill);