Browse Source

add setItem username and docdt

thomas 3 years ago
parent
commit
05efd5bb6d
1 changed files with 27 additions and 3 deletions
  1. 27 3
      src/components/UIClient.vue

+ 27 - 3
src/components/UIClient.vue

@@ -59,13 +59,19 @@
       <div v-if="form.type=='productrequisition'">
         <h3>Product Requisition</h3>
         <div>
-          <label >Doc Date<input v-model="form.docDt"></label>
+          <label >Doc Date<input
+            v-model="form.docDt"
+            @change="setItemDocDt()"
+          ></label>
         </div>
       </div>
       <div v-if="form.type=='userprofile'">
         <h3>User Profile</h3>
         <div>
-          <label >User Name<input v-model="form.userName"></label>
+          <label >User Name<input
+            v-model="form.userName"
+            @change="setItemUserName()"
+          ></label>
         </div>
       </div>
       <div class="buttons">
@@ -119,9 +125,10 @@ import {
   getNewUserProfile,
   getLogoutMessage,
   getNewPurchaseRequisition,
-  // getSetPurchaseRequisitionDocDt,
   getCancelPurchaseRequisition,
   getCancelUserProfile,
+  getSetPurchaseRequisitionDocDt,
+  getSetUserProfileUserName,
 } from '../assets/js/__message-util';
 import { TestSocketIoClient } from "../assets/js/__transport.socketio"
 import { Component, Prop, Vue } from 'vue-property-decorator'
@@ -307,6 +314,7 @@ export default class UiClient extends Vue {
   
             // when listening display all results 
             if( listening ) {
+              console.log({ sub: data })
               let text = data?.header?.messageName
               this.subscription.messages.push({
                 id: Symbol(),
@@ -359,6 +367,22 @@ export default class UiClient extends Vue {
     this.loading = false
   }, 1000 , { trailing: false })
 
+  async setItemDocDt() {
+    await this.getResponse(
+      getSetPurchaseRequisitionDocDt(this.session.ucpId, this.form.docDt),
+      'setItem docDt',
+      _ => null,
+    )
+  }
+
+  async setItemUserName() {
+    await this.getResponse(
+      getSetUserProfileUserName(this.session.ucpId, this.form.userName),
+      'setItem userName',
+      _ => null,
+    )
+  }
+
   /*
   async newRequisition(ucpId: string) {
     this.purchaseRequisition = {