buli
2023-06-09 f94d7f9cd1d2d467e7242245719192d7157e3ede
issfix
8个文件已修改
1223 ■■■■■ 已修改文件
.sf/config.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html 146 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js 207 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html 146 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js 221 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.css 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html 252 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.sf/config.json
@@ -1,3 +1,3 @@
{
  "target-org": "DaikinDev"
  "target-org": "OlympusDev"
}
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
@@ -3,9 +3,14 @@
        <lightning-spinner size="medium" variant="brand"></lightning-spinner>
    </template>
    <c-common-toast></c-common-toast>
    <div style="border: 1px solid #D4D4D4;border-radius:5px;">
        <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
  <div style="border: 1px solid #d4d4d4; border-radius: 5px">
    <div
      style="
        border-top: 3px solid #51606e;
        border-bottom: 1px solid #d4d4d4;
        padding: 3px;
      "
    >
            <div>
                <!-- <p style="font-size: 18px;"><strong>取消拆盒</strong></p> -->
                <lightning-layout>
@@ -17,15 +22,47 @@
                </lightning-layout>
            </div>
        </div>
        <div style="padding:10px;">
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
            <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
    <div style="padding: 10px">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
          "
        >
                <!-- <lightning-button variant="brand" class='lexstyle' style="margin-left:10px;" label="取消拆盒确认" title="取消拆盒确认" onclick={saveConfirm}></lightning-button></td> -->
                <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-left:10px;margin-top:12px;margin-bottom:12px;" label="取消拆盒确认" onclick={saveConfirm}>取消拆盒确认</button>
          <button
            class="slds-button slds-button_neutral slds-button_stretch lexBorder"
            style="margin-left: 10px; margin-top: 12px; margin-bottom: 12px"
            label="取消拆盒确认"
            onclick={saveConfirm}
          >
            取消拆盒确认
          </button>
            </div>
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:5px;">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
          margin-top: 5px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
          "
        >
                    <lightning-layout>
                        <lightning-layout-item padding="around-small">
                            <p style="font-size: 16px">
@@ -57,12 +94,25 @@
                            <tr>
                                <td></td>
                                <td align="right" class="searchName">BarCode</td>
                                <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
                                        onchange={handleChange}></lightning-textarea></td>
              <td style="width: 600px">
                <lightning-textarea
                  class="inputFont"
                  name="BarCode"
                  label=""
                  onchange={handleChange}
                ></lightning-textarea>
              </td>
                                <td align="right"></td>
                                <td></td>
                                <td  style="width: 200px;">
                                    <button style="margin-top:14px;"  class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="获取明细" onclick={getDetails}>获取明细</button>
              <td style="width: 200px">
                <button
                  style="margin-top: 14px"
                  class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                  label="获取明细"
                  onclick={getDetails}
                >
                  获取明细
                </button>
                                    <!-- <lightning-button variant="brand" class='lexstyle' label="获取明细" title="获取明细" onclick={getDetails}
                                       ></lightning-button> -->
                                </td>
@@ -72,8 +122,20 @@
                <!-- </div> -->
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
          "
        >
                    <lightning-layout>
                        <lightning-layout-item padding="around-small">
                            <p style="font-size: 18px">
@@ -82,21 +144,39 @@
                        </lightning-layout-item>
                    </lightning-layout>
                </div>
                <div style="padding:10px;">
        <div style="padding: 10px">
                    <!-- <div style="height: 300px;"> -->
                        <!-- <template if:true={showTable}> -->
                            <c-lex-custom-lightning-datatable key-field="prodid" data={data} columns={columns}
                            onrowselection={getSelectedRows} hide-checkbox-column="true"
                            selected-rows={selectedRows} class="wrapped-header-datatable">
          <c-lex-custom-lightning-datatable
            key-field="prodid"
            data={data}
            columns={columns}
            onrowselection={getSelectedRows}
            hide-checkbox-column="true"
            selected-rows={selectedRows}
            class="wrapped-header-datatable"
            style="word-wrap: break-word; word-break: break-all"
          >
                                </c-lex-custom-lightning-datatable>
                        <!-- </template> -->
                    <!-- </div> -->
                </div>
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:10px">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
          margin-top: 10px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
          "
        >
                    <table>
                        <tr>
                            <td>
@@ -112,20 +192,20 @@
                    </table>
                </div>
 
            <div style="padding:10px;">
        <div style="padding: 10px">
                <lightning-datatable
                key-field="id" data={errorDetail} columns={column}
                onrowselection={getSelectedRows}   hide-checkbox-column="true"
               selected-rows={selectedRows}  class="wrapped-header-datatable">
            key-field="id"
            data={errorDetail}
            columns={column}
            onrowselection={getSelectedRows}
            hide-checkbox-column="true"
            selected-rows={selectedRows}
            class="wrapped-header-datatable"
            style="word-wrap: break-word; word-break: break-all"
          >
        </lightning-datatable>
            </div>
        </div>
        </div>
    </div>
</template>
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
@@ -1,77 +1,76 @@
import { LightningElement, wire, api, track } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { LightningElement, wire, api, track } from "lwc";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import oninit from "@salesforce/apex/LexCancelRemoveBoxController.init";
import searchDeatail from "@salesforce/apex/LexCancelRemoveBoxController.searchConsumableorderdetails"
import saveConfirm from '@salesforce/apex/LexCancelRemoveBoxController.cancelRemoveBoxConfirm';
import searchDeatail from "@salesforce/apex/LexCancelRemoveBoxController.searchConsumableorderdetails";
import saveConfirm from "@salesforce/apex/LexCancelRemoveBoxController.cancelRemoveBoxConfirm";
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
const columns = [
    {
      label: '消耗品名称',
      fieldName: 'Name__c',
    label: "消耗品名称",
    fieldName: "Name__c",
      hideDefaultActions: true,
      wrapText:true
      // initialWidth: 350,
    },
    {
      label: '规格',
      fieldName: 'ProductPacking_list_manual__c',
    label: "规格",
    fieldName: "ProductPacking_list_manual__c",
      hideDefaultActions: true,
      cellAttributes: { alignment: "right" },
      initialWidth: 50,
    initialWidth: 50
    },
    {
      label: 'CFDA状态',
      fieldName: 'CFDA_Status__c',
    label: "CFDA状态",
    fieldName: "CFDA_Status__c",
    hideDefaultActions: true,
    initialWidth: 100,
    wrapText: true
  },
  {
    label: "注册证编码号",
    fieldName: "Report_Product_Approbation__c",
      hideDefaultActions: true,
      initialWidth: 200,
    wrapText: true
    },
    {
      label: '注册证编码号',
      fieldName: 'Report_Product_Approbation__c',
    label: "注册证效期",
    fieldName: "Report_Product_Expiration__c",
      hideDefaultActions: true,
      initialWidth: 200,
    initialWidth: 110,
    wrapText: true
    },
    {
      label: '注册证效期',
      fieldName: 'Report_Product_Expiration__c',
    label: "BarCode",
    fieldName: "Bar_Code__c",
      hideDefaultActions: true,
      // initialWidth: 250,
    },
    {
      label: 'BarCode',
      fieldName: 'Bar_Code__c',
      hideDefaultActions: true,
      initialWidth: 400,
    wrapText: true
    }
  ];
  
  const column = [
    {
      label: '消耗品名称',
      fieldName: 'Name__c',
    label: "消耗品名称",
    fieldName: "Name__c",
      hideDefaultActions: true,
    wrapText: true
    },
    {
      label: 'BarCode',
      fieldName: 'Bar_Code__c',
      hideDefaultActions: true,
    }
    ,
    label: "BarCode",
    fieldName: "Bar_Code__c",
    wrapText: true,
    hideDefaultActions: true
    // initialWidth:600
  },
    {
      label: '错误原因',
      fieldName: 'ErrorReason',
      hideDefaultActions: true,
    label: "错误原因",
    fieldName: "ErrorReason",
    hideDefaultActions: true
    }
  ];
export default class LexCancelRemoveBox extends LightningElement {
    columns = columns;
@@ -81,15 +80,15 @@
    @track errorDetail = [];
  
    // 显示
    @track showTable = false
  @track showTable = false;
    @track showSpinner = false;
    //数据构成
    @track accountName
    @track userWorkLocation
    @track agencyProType
    @track barcode = ''
    @track saveFLGbln = false
  @track accountName;
  @track userWorkLocation;
  @track agencyProType;
  @track barcode = "";
  @track saveFLGbln = false;
    @track dataSize = 0;
    renderedCallback() {
@@ -105,27 +104,26 @@
      }
  }
  
    connectedCallback() {
      console.log('初始化');
    console.log("初始化");
      // this.showTable = false;
      oninit().then((result) => {
    oninit()
      .then((result) => {
        result = JSON.parse(JSON.stringify(result));
        console.log('result =' + JSON.stringify(result));
        if (result.status = 'Success') {
          console.log('result');
        console.log("result =" + JSON.stringify(result));
        if ((result.status = "Success")) {
          console.log("result");
          this.agencyProType = result.entity.agencyProType;
          this.userWorkLocation = result.entity.userWorkLocation;
          this.accountName = result.entity.accountName;
          // this.data = JSON.parse(result.entity.codPageRecords);
          // this.showTable = true;
        } else {
          this.showMyToast('初始化失败',result.msg,'error');
          this.showMyToast("初始化失败", result.msg, "error");
        }
      }).catch((error) => {
        console.log('error = ' + JSON.stringify(error));
      })
      .catch((error) => {
        console.log("error = " + JSON.stringify(error));
      });
    }
@@ -137,47 +135,56 @@
      userWorkLocation: this.userWorkLocation,
      agencyProType: this.agencyProType,
      barcode: this.barcode
    }).then((result) => {
    })
      .then((result) => {
      result = JSON.parse(JSON.stringify(result));
      console.log('result =' + JSON.stringify(result));
      if (result.status == 'Success') {
        console.log('成功');
        this.data = JSON.parse(result.entity.ConsumableorderdetailsRecordsdummy);
        this.errorDetail = JSON.parse(result.entity.ConsumableorderdetailsRecordserror);
        console.log("result =" + JSON.stringify(result));
        if (result.status == "Success") {
          console.log("成功");
          this.data = JSON.parse(
            result.entity.ConsumableorderdetailsRecordsdummy
          );
          this.errorDetail = JSON.parse(
            result.entity.ConsumableorderdetailsRecordserror
          );
        this.dataSize = result.entity.dataSize;
        for (let i in this.data) {
          this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
          this.data[i]['ProductPacking_list_manual__c'] = this.data[i].esd.ProductPacking_list_manual__c;
          this.data[i]['CFDA_Status__c'] = this.data[i].esd.CFDA_Status__c;
          this.data[i]['Report_Product_Approbation__c'] = this.data[i].esd.Report_Product_Approbation__c;
          this.data[i]['Report_Product_Expiration__c'] = this.data[i].esd.Report_Product_Expiration__c;
          this.data[i]['Bar_Code__c'] = this.data[i].esd.Bar_Code__c;
            this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
            this.data[i]["ProductPacking_list_manual__c"] =
              this.data[i].esd.ProductPacking_list_manual__c;
            this.data[i]["CFDA_Status__c"] = this.data[i].esd.CFDA_Status__c;
            this.data[i]["Report_Product_Approbation__c"] =
              this.data[i].esd.Report_Product_Approbation__c;
            this.data[i]["Report_Product_Expiration__c"] =
              this.data[i].esd.Report_Product_Expiration__c;
            this.data[i]["Bar_Code__c"] = this.data[i].esd.Bar_Code__c;
        }
        // this.showTable = true;
        for (let i in this.errorDetail) {
          this.errorDetail[i]['Name__c'] = this.errorDetail[i].Prod.Name__c;
          this.errorDetail[i]['Bar_Code__c'] = this.errorDetail[i].esd.Bar_Code__c;
          this.errorDetail[i]['ErrorReason'] = this.errorDetail[i].ErrorReason;
            this.errorDetail[i]["Name__c"] = this.errorDetail[i].Prod.Name__c;
            this.errorDetail[i]["Bar_Code__c"] =
              this.errorDetail[i].esd.Bar_Code__c;
            this.errorDetail[i]["ErrorReason"] =
              this.errorDetail[i].ErrorReason;
        }
        // this.showTables = true;
        this.showSpinner = false;
      } else{
        this.showMyToast('获取失败',result.msg,'error');
          this.showMyToast("获取失败", result.msg, "error");
        this.showSpinner = false;
      }
    }).catch((error) => {
      console.log('error = ' + JSON.stringify(error));
      })
      .catch((error) => {
        console.log("error = " + JSON.stringify(error));
    });
  }
   //获取当前输入值
   handleChange(event) {
    let value = event.detail.value;
    console.log('value' + value);
    console.log("value" + value);
    this.barcode = value;
    console.log('this.barcode' + this.barcode);
    console.log("this.barcode" + this.barcode);
  }
  saveConfirm() {
    let msg = "确认取消拆盒吗";
@@ -196,47 +203,43 @@
      accountName: this.accountName,
      userWorkLocation: this.userWorkLocation,
      agencyProType: this.agencyProType
    }).then((result) => {
    })
      .then((result) => {
      result = JSON.parse(JSON.stringify(result));
      console.log('result保存 = ' + JSON.stringify(result));
      if (result.status == 'Success') {
        console.log("result保存 = " + JSON.stringify(result));
        if (result.status == "Success") {
         this.saveFLGbln = result.entity.saveFLGbln;
        //  this.showSpinner = false;
         if(this.saveFLGbln){
          this.showMyToast(result.msg,'','success');
            this.showMyToast(result.msg, "", "success");
          this.showSpinner = false;
         }
      } else {
        this.showMyToast('取消拆盒失败',result.msg,'error');
          this.showMyToast("取消拆盒失败", result.msg, "error");
        this.showSpinner = false;
      }
    })
      .catch((error) => {
        console.log('error = ' + JSON.stringify(error));
        console.log("error = " + JSON.stringify(error));
      });
  }
  showMyToast(title, message, variant) {
    console.log('show custom message');
    var iconName = '';
    var content = '';
    if(variant == 'success'){
       iconName = 'utility:check';
    console.log("show custom message");
    var iconName = "";
    var content = "";
    if (variant == "success") {
      iconName = "utility:check";
    }else{
       iconName = 'utility:error';
      iconName = "utility:error";
    }
    if(message != ''){
       content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
    if (message != "") {
      content =
        "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>";
    }else{
       content = '<h2><strong>'+title+'<strong/></h2>';
      content = "<h2><strong>" + title + "<strong/></h2>";
    }
    this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
    this.template
      .querySelector("c-common-toast")
      .showToast(variant, content, iconName, 10000);
    }
}
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
@@ -3,9 +3,14 @@
        <lightning-spinner size="medium" variant="brand"></lightning-spinner>
    </template>
    <c-common-toast></c-common-toast>
    <div style="border: 1px solid #D4D4D4;border-radius:5px;">
        <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
  <div style="border: 1px solid #d4d4d4; border-radius: 5px">
    <div
      style="
        border-top: 3px solid #51606e;
        border-bottom: 1px solid #d4d4d4;
        padding: 3px;
      "
    >
            <div>
                <!-- <p style="font-size: 18px;"><strong>拆盒</strong></p> -->
                <lightning-layout>
@@ -17,15 +22,47 @@
                </lightning-layout>
            </div>
        </div>
        <div style="padding:10px;">
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
            <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
    <div style="padding: 10px">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
          "
        >
                <!-- <lightning-button variant="brand" class='lexstyle' style="margin-left:10px;" label="拆盒确认" title="拆盒确认" onclick={saveConfirm}></lightning-button>-->
                <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-left:10px;margin-top:12px;margin-bottom:12px;"  label="拆盒确认" onclick={saveConfirm}>拆盒确认</button>
          <button
            class="slds-button slds-button_neutral slds-button_stretch lexBorder"
            style="margin-left: 10px; margin-top: 12px; margin-bottom: 12px"
            label="拆盒确认"
            onclick={saveConfirm}
          >
            拆盒确认
          </button>
            </div>
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:5px;">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
          margin-top: 5px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
          "
        >
                    <lightning-layout>
                        <lightning-layout-item padding="around-small">
                            <p style="font-size: 16px">
@@ -57,12 +94,25 @@
                            <tr>
                                <td></td>
                                <td align="right" class="searchName">BarCode</td>
                                <td style="width:600px"><lightning-textarea class="inputFont"  name="BarCode" label=""
                                        onchange={handleChange}></lightning-textarea></td>
              <td style="width: 600px">
                <lightning-textarea
                  class="inputFont"
                  name="BarCode"
                  label=""
                  onchange={handleChange}
                ></lightning-textarea>
              </td>
                                <td align="right"></td>
                                <td></td>
                                <td  style="width: 200px;">
                                    <button style="margin-top:14px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="获取明细" onclick={getDetails}>获取明细</button>
              <td style="width: 200px">
                <button
                  style="margin-top: 14px"
                  class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                  label="获取明细"
                  onclick={getDetails}
                >
                  获取明细
                </button>
                                    <!-- <lightning-button variant="brand" class='lexstyle' label="获取明细" title="获取明细" onclick={getDetails}
                                       ></lightning-button> -->
                                </td>
@@ -72,8 +122,21 @@
                <!-- </div> -->
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:10px">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
          margin-top: 10px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
          "
        >
                    <lightning-layout>
                        <lightning-layout-item padding="around-small">
                            <p style="font-size: 18px">
@@ -82,8 +145,7 @@
                        </lightning-layout-item>
                    </lightning-layout>
                </div>
                <div style="padding:10px;">
        <div style="padding: 10px">
                    <!-- <div style="height: 300px;"> -->
                        <!-- <template if:true={showTable}> -->
                            <!-- <c-lex-custom-lightning-datatable key-field="prodid" data={data} columns={columns}
@@ -91,17 +153,35 @@
                            selected-rows={selectedRows}>
                                </c-lex-custom-lightning-datatable> -->
                                <lightning-datatable
                                key-field="prodid" data={data} columns={columns}
                                onrowselection={getSelectedRows} hide-checkbox-column="true"
                                selected-rows={selectedRows} class="wrapped-header-datatable">
            key-field="prodid"
            data={data}
            columns={columns}
            onrowselection={getSelectedRows}
            hide-checkbox-column="true"
            selected-rows={selectedRows}
            class="wrapped-header-datatable"
            style="word-wrap: break-word; word-break: break-all"
          >
                        </lightning-datatable>
                        <!-- </template> -->
                    <!-- </div> -->
                </div>
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:10px">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
          margin-top: 10px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
          "
        >
                    <table>
                        <tr>
                            <td>
@@ -117,7 +197,7 @@
                    </table>
                </div>
 
            <div style="padding:10px;">
        <div style="padding: 10px">
                <!-- <template if:true={showTables}> -->
                 
                    <!-- <c-lex-custom-lightning-datatable key-field="id" data={errorDetail} columns={column}
@@ -125,19 +205,19 @@
                   selected-rows={selectedRows}>
               </c-lex-custom-lightning-datatable> -->
               <lightning-datatable
               key-field="id" data={errorDetail} columns={column}
               onrowselection={getSelectedRows}   hide-checkbox-column="true"
              selected-rows={selectedRows} class="wrapped-header-datatable">
            key-field="id"
            data={errorDetail}
            columns={column}
            onrowselection={getSelectedRows}
            hide-checkbox-column="true"
            selected-rows={selectedRows}
            class="wrapped-header-datatable"
            style="word-wrap: break-word; word-break: break-all"
          >
       </lightning-datatable>
                <!-- </template> -->
            </div>
        </div>
        </div>
    </div>
</template>
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
@@ -1,8 +1,8 @@
import { LightningElement, wire, api, track } from 'lwc';
import init from '@salesforce/apex/LexRemoveBoxController.init';
import searchDeatail from '@salesforce/apex/LexRemoveBoxController.searchConsumableorderdetails';
import saveconfirm from '@salesforce/apex/LexRemoveBoxController.removeBoxConfirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { LightningElement, wire, api, track } from "lwc";
import init from "@salesforce/apex/LexRemoveBoxController.init";
import searchDeatail from "@salesforce/apex/LexRemoveBoxController.searchConsumableorderdetails";
import saveconfirm from "@salesforce/apex/LexRemoveBoxController.removeBoxConfirm";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
// import { NavigationMixin } from 'lightning/navigation';
//table css 
import { loadStyle } from "lightning/platformResourceLoader";
@@ -10,74 +10,70 @@
const columns = [
  {
    label: '消耗品名称',
    fieldName: 'Name__c',
    label: "消耗品名称",
    fieldName: "Name__c",
    wrapText:true,
    hideDefaultActions: true,
    initialWidth: 400,
    hideDefaultActions: true
    // initialWidth: 400,
  },
  {
    label: '规格',
    fieldName: 'ProductPacking_list_manual__c',
    label: "规格",
    fieldName: "ProductPacking_list_manual__c",
    hideDefaultActions: true,
    initialWidth: 50,
    cellAttributes: { alignment: "right" },
    cellAttributes: { alignment: "right" }
  },
  {
    label: 'CFDA状态',
    fieldName: 'CFDA_Status__c',
    label: "CFDA状态",
    fieldName: "CFDA_Status__c",
    hideDefaultActions: true,
    initialWidth: 100,
    wrapText: true
  },
  {
    label: "注册证编码号",
    fieldName: "Report_Product_Approbation__c",
    hideDefaultActions: true,
    initialWidth: 200,
    wrapText: true
  },
  {
    label: '注册证编码号',
    fieldName: 'Report_Product_Approbation__c',
    label: "注册证效期",
    fieldName: "Report_Product_Expiration__c",
    hideDefaultActions: true,
    initialWidth: 200,
    initialWidth: 110,
    wrapText: true
  },
  {
    label: '注册证效期',
    fieldName: 'Report_Product_Expiration__c',
    label: "BarCode",
    fieldName: "Bar_Code__c",
    hideDefaultActions: true,
    // initialWidth: 250,
  },
  {
    label: 'BarCode',
    fieldName: 'Bar_Code__c',
    hideDefaultActions: true,
    wrapText:true,
    initialWidth:400,
    wrapText: true
    // initialWidth:600,
  }
];
const column = [
  {
    label: '消耗品名称',
    fieldName: 'Name__c',
    label: "消耗品名称",
    fieldName: "Name__c",
    hideDefaultActions: true,
    wrapText: true
  },
  {
    label: 'BarCode',
    fieldName: 'Bar_Code__c',
    label: "BarCode",
    fieldName: "Bar_Code__c",
    hideDefaultActions: true,
  }
  ,
    wrapText: true
    // initialWidth:600,
  },
  {
    label: '错误原因',
    fieldName: 'ErrorReason',
    label: "错误原因",
    fieldName: "ErrorReason",
    hideDefaultActions: true,
    wrapText: true
  }
];
export default class LexRemoveBox extends LightningElement {
  columns = columns;
@@ -87,16 +83,16 @@
  @track errorDetail = [];
  // 显示
  @track showTable = false
  @track accountName
  @track userWorkLocation
  @track agencyProType
  @track barcode = ''
  @track saveFLGbln = false
  @track showTable = false;
  @track accountName;
  @track userWorkLocation;
  @track agencyProType;
  @track barcode = "";
  @track saveFLGbln = false;
  @track dataSize = 0;
  //加载框
  @track showSpinner = false
  @track showSpinner = false;
  renderedCallback() {
    if (!this.stylesLoaded) {
@@ -113,24 +109,26 @@
  //初始化
  connectedCallback() {
    console.log('初始化');
    console.log("初始化");
    this.showTable = false;
    init().then((result) => {
    init()
      .then((result) => {
      result = JSON.parse(JSON.stringify(result));
      console.log('result =' + JSON.stringify(result));
      if (result.status = 'Success') {
        console.log('result');
        console.log("result =" + JSON.stringify(result));
        if ((result.status = "Success")) {
          console.log("result");
        this.agencyProType = result.entity.agencyProType;
        this.userWorkLocation = result.entity.userWorkLocation;
        this.accountName = result.entity.accountName;
        // this.data = JSON.parse(result.entity.codPageRecords);
        // this.showTable = true;
      } else {
        this.showMyToast('初始化失败',result.msg,'error');
          this.showMyToast("初始化失败", result.msg, "error");
      }
    }).catch((error) => {
      console.log('error = ' + JSON.stringify(error));
      })
      .catch((error) => {
        console.log("error = " + JSON.stringify(error));
    });
  }
  //录入
@@ -140,48 +138,58 @@
      userWorkLocation: this.userWorkLocation,
      agencyProType: this.agencyProType,
      barcode: this.barcode
    }).then((result) => {
    })
      .then((result) => {
      result = JSON.parse(JSON.stringify(result));
      console.log('result =' + JSON.stringify(result));
      if (result.status == 'Success') {
        console.log('成功');
        this.data = JSON.parse(result.entity.ConsumableorderdetailsRecordsdummy);
        this.errorDetail = JSON.parse(result.entity.ConsumableorderdetailsRecordserror);
        console.log("result =" + JSON.stringify(result));
        if (result.status == "Success") {
          console.log("成功");
          this.data = JSON.parse(
            result.entity.ConsumableorderdetailsRecordsdummy
          );
          this.errorDetail = JSON.parse(
            result.entity.ConsumableorderdetailsRecordserror
          );
        this.dataSize = result.entity.dataSize;
        console.log('this.dataSize'+this.dataSize);
          console.log("this.dataSize" + this.dataSize);
        for (let i in this.data) {
          this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
          this.data[i]['ProductPacking_list_manual__c'] = this.data[i].esd.ProductPacking_list_manual__c;
          this.data[i]['CFDA_Status__c'] = this.data[i].esd.CFDA_Status__c;
          this.data[i]['Report_Product_Approbation__c'] = this.data[i].esd.Report_Product_Approbation__c;
          this.data[i]['Report_Product_Expiration__c'] = this.data[i].esd.Report_Product_Expiration__c;
          this.data[i]['Bar_Code__c'] = this.data[i].esd.Bar_Code__c;
            this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
            this.data[i]["ProductPacking_list_manual__c"] =
              this.data[i].esd.ProductPacking_list_manual__c;
            this.data[i]["CFDA_Status__c"] = this.data[i].esd.CFDA_Status__c;
            this.data[i]["Report_Product_Approbation__c"] =
              this.data[i].esd.Report_Product_Approbation__c;
            this.data[i]["Report_Product_Expiration__c"] =
              this.data[i].esd.Report_Product_Expiration__c;
            this.data[i]["Bar_Code__c"] = this.data[i].esd.Bar_Code__c;
        }
        for (let i in this.errorDetail) {
          this.errorDetail[i]['Name__c'] = this.errorDetail[i].Prod.Name__c;
          this.errorDetail[i]['Bar_Code__c'] = this.errorDetail[i].esd.Bar_Code__c;
          this.errorDetail[i]['ErrorReason'] = this.errorDetail[i].ErrorReason;
            this.errorDetail[i]["Name__c"] = this.errorDetail[i].Prod.Name__c;
            this.errorDetail[i]["Bar_Code__c"] =
              this.errorDetail[i].esd.Bar_Code__c;
            this.errorDetail[i]["ErrorReason"] =
              this.errorDetail[i].ErrorReason;
        }
        this.showTables = true;
        this.showTable = true;
      } else{
        console.log('result.msg = ' + result.msg);
        this.showMyToast('获取失败',result.msg,'error');
          console.log("result.msg = " + result.msg);
          this.showMyToast("获取失败", result.msg, "error");
      }
    }).catch((error) => {
      console.log('error = ' + JSON.stringify(error));
      })
      .catch((error) => {
        console.log("error = " + JSON.stringify(error));
    });
  }
  //获取当前输入值
  handleChange(event) {
    let value = event.detail.value;
    console.log('value' + value);
    console.log("value" + value);
    this.barcode = value;
    console.log('this.barcode' + this.barcode);
    console.log("this.barcode" + this.barcode);
  }
  saveConfirm() {
    console.log('进入确认');
    console.log("进入确认");
    let msg = "确认拆盒吗";
    if (this.dataSize>0) {
        if (confirm(msg) == true) {
@@ -190,7 +198,6 @@
    } else {
        this.removeBox();
    }
  }
  removeBox(){
    this.showSpinner = true;
@@ -199,46 +206,44 @@
      accountName: this.accountName,
      userWorkLocation: this.userWorkLocation,
      agencyProType: this.agencyProType
    }).then((result) => {
    })
      .then((result) => {
      result = JSON.parse(JSON.stringify(result));
      console.log('result保存 = ' + JSON.stringify(result));
      if (result.status == 'Success') {
        console.log("result保存 = " + JSON.stringify(result));
        if (result.status == "Success") {
         this.saveFLGbln = result.entity.saveFLGbln;
        //  this.showSpinner = false;
         if(this.saveFLGbln){
          this.showMyToast(result.msg,'','success');
            this.showMyToast(result.msg, "", "success");
          this.showSpinner = false;
         }
      } else {
        console.log('result.msg = ' + result.msg);
        this.showMyToast('拆盒失败',result.msg,'error');
          console.log("result.msg = " + result.msg);
          this.showMyToast("拆盒失败", result.msg, "error");
        this.showSpinner = false;
      }
    })
      .catch((error) => {
        console.log('error = ' + JSON.stringify(error));
        console.log("error = " + JSON.stringify(error));
      });
  }
  showMyToast(title, message, variant) {
    console.log('show custom message');
    var iconName = '';
    var content = '';
    if(variant == 'success'){
       iconName = 'utility:check';
    console.log("show custom message");
    var iconName = "";
    var content = "";
    if (variant == "success") {
      iconName = "utility:check";
    }else{
       iconName = 'utility:error';
      iconName = "utility:error";
    }
    if(message != ''){
       content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
    if (message != "") {
      content =
        "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>";
    }else{
       content = '<h2><strong>'+title+'<strong/></h2>';
      content = "<h2><strong>" + title + "<strong/></h2>";
    }
    this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
    this.template
      .querySelector("c-common-toast")
      .showToast(variant, content, iconName, 10000);
    }
}
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.css
@@ -1 +1,16 @@
@import 'c/lexCssUtility';
@import "c/lexCssUtility";
.lexButtoun {
  font-size: 18px;
  font-family: "sans-serif";
  font-weight: 500;
  color: #0a81df;
  /* border:2px solid rgb(8,16,132); */
  /* border-color:rgb(8,16,132); */
  width: 160px;
  height: 36px;
  border-radius: 4px;
  opacity: 1;
  background: #ffffff;
  box-sizing: border-box;
  border: 1px solid #0a81df;
}
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
@@ -3,8 +3,14 @@
        <lightning-spinner size="medium" variant="brand"></lightning-spinner>
    </template>
    <c-common-toast></c-common-toast>
    <div style="border: 1px solid #D4D4D4;border-radius:5px;">
        <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
  <div style="border: 1px solid #d4d4d4; border-radius: 5px">
    <div
      style="
        border-top: 3px solid #51606e;
        border-bottom: 1px solid #d4d4d4;
        padding: 3px;
      "
    >
            <!-- <p style="font-size: 18px;"><strong>库存管理</strong></p> -->
            <lightning-layout>
                <lightning-layout-item padding="around-small">
@@ -14,9 +20,21 @@
                </lightning-layout-item>
            </lightning-layout>
        </div>
        <div style="padding:10px;">
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:10px;">
    <div style="padding: 10px">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 10px;
          "
        >
                    <!-- <lightning-button variant="brand" class = 'lexstyle' style="margin:12px;" label="库存盘点" title="库存盘点"
                        onclick={inventoryCount}></lightning-button>
                    <lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="过期库存销存" title="过期库存销存"
@@ -24,16 +42,58 @@
                    <lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="拆盒" title="拆盒" onclick={removeBox}></lightning-button>
                    <lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="取消拆盒" title="取消拆盒"
                        onclick={cancelremoveBox}></lightning-button> -->
                        <button style ="margin-left:5px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="库存盘点" onclick={inventoryCount}>库存盘点</button>
                        <button  class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="过期库存销存" style = "margin-left:150px;" onclick={handleExpired}>过期库存销存</button>
                        <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="拆盒" style = "margin-left:150px;" onclick={removeBox}>拆盒</button>
                    <button  class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="取消拆盒" style = "margin-left:150px;" onclick={cancelremoveBox}>取消拆盒</button>
          <button
            style="margin-left: 5px"
            class="slds-button slds-button_neutral slds-button_stretch lexBorder"
            label="库存盘点"
            onclick={inventoryCount}
          >
            库存盘点
          </button>
          <button
            class="slds-button slds-button_neutral slds-button_stretch lexButtoun"
            label="过期库存销存"
            style="margin-left: 60px"
            onclick={handleExpired}
          >
            过期库存销存
          </button>
          <button
            class="slds-button slds-button_neutral slds-button_stretch lexButtoun"
            label="拆盒"
            style="margin-left: 60px"
            onclick={removeBox}
          >
            拆盒
          </button>
          <button
            class="slds-button slds-button_neutral slds-button_stretch lexButtoun"
            label="取消拆盒"
            style="margin-left: 60px"
            onclick={cancelremoveBox}
          >
            取消拆盒
          </button>
                </div>
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:30px;">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;height:115px">
                    <table style="margin-top:10px;">
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
          margin-top: 30px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
            height: 115px;
          "
        >
          <table style="margin-top: 10px">
                        <colgroup>
                            <col width="160px" />
                            <col width="100px" />
@@ -54,51 +114,129 @@
                        </colgroup>
                        <tbody>
                            <tr> 
                                <td style="width:10px;"></td>
                <td style="width: 10px"></td>
                                <td style="width:250px">
                                    <div style="width:90px;margin-left:12px;" class="searchName">消耗品名称</div>
                  <div
                    style="width: 90px; margin-left: 12px"
                    class="searchName"
                  >
                    消耗品名称
                  </div>
                                </td>
                                <td style="width: 21%;">
                                    <lightning-input class="searchName" type="text" name="Name" label="消耗品名称" value={Name}
                                    variant="label-hidden" onchange={dataChange}
                                        data-field="Name"></lightning-input>
                <td style="width: 21%">
                  <lightning-input
                    class="searchName"
                    type="text"
                    name="Name"
                    label="消耗品名称"
                    value={Name}
                    variant="label-hidden"
                    onchange={dataChange}
                    data-field="Name"
                  ></lightning-input>
                                </td>
                                <td style="width:150px">
                                    <div style="width:90px;text-align:center;" class="searchName">第3分类</div>
                  <div
                    style="width: 90px; text-align: center"
                    class="searchName"
                  >
                    第3分类
                  </div>
                                </td>
                                <td style="width: 21%;">
                                    <lightning-combobox class="inputFont" style="margin-left:5px;" name="CategoryThree" label="第3分类" value={value}
                                        placeholder="请选择..." options={category3Options}   variant="label-hidden"
                                        data-field="CategoryThree" onchange={dataChange}></lightning-combobox>
                <td style="width: 21%">
                  <lightning-combobox
                    class="inputFont"
                    style="margin-left: 5px"
                    name="CategoryThree"
                    label="第3分类"
                    value={value}
                    placeholder="请选择..."
                    options={category3Options}
                    variant="label-hidden"
                    data-field="CategoryThree"
                    onchange={dataChange}
                  ></lightning-combobox>
                                </td>
                                <td style="width:150px">
                                    <div style="width:90px;text-align:center;" class="searchName">第4分类</div>
                  <div
                    style="width: 90px; text-align: center"
                    class="searchName"
                  >
                    第4分类
                  </div>
                                </td>
                                <td style="width: 21%;">
                                    <lightning-combobox class="inputFont"  name="CategoryFour" label="第4分类" value={value}
                                        placeholder="请选择..." options={category4Options}  variant="label-hidden"
                                        data-field="CategoryFour" onchange={dataChange}></lightning-combobox>
                <td style="width: 21%">
                  <lightning-combobox
                    class="inputFont"
                    name="CategoryFour"
                    label="第4分类"
                    value={value}
                    placeholder="请选择..."
                    options={category4Options}
                    variant="label-hidden"
                    data-field="CategoryFour"
                    onchange={dataChange}
                  ></lightning-combobox>
                                </td>
                                <td style="width:150px">
                                    <div style="width:90px;text-align:center;" class="searchName">第5分类</div>
                  <div
                    style="width: 90px; text-align: center"
                    class="searchName"
                  >
                    第5分类
                  </div>
                                </td>
                                <td style="width: 21%;">
                                    <lightning-combobox class="inputFont" name="CategoryFive" label="第5分类" value={value}
                                        placeholder="请选择..." options={category5Options}  variant="label-hidden"
                                        data-field="CategoryFive" onchange={dataChange}></lightning-combobox>
                <td style="width: 21%">
                  <lightning-combobox
                    class="inputFont"
                    name="CategoryFive"
                    label="第5分类"
                    value={value}
                    placeholder="请选择..."
                    options={category5Options}
                    variant="label-hidden"
                    data-field="CategoryFive"
                    onchange={dataChange}
                  ></lightning-combobox>
                                </td>
                                <td style="width: 1%;"></td>
                <td style="width: 1%"></td>
                            </tr>
                        </tbody>
                    </table>
                    <br/>
                    <div style="float:right;margin-right:10px;">   <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" label="消耗品搜索" onclick={searchOrderDetail}>消耗品搜索</button>
                        <button style="margin-left:10px;" class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="清空" onclick={clearAll}>清空</button></div>
          <div style="float: right; margin-right: 10px">
            <button
              class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
              label="消耗品搜索"
              onclick={searchOrderDetail}
            >
              消耗品搜索
            </button>
            <button
              style="margin-left: 10px"
              class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
              label="清空"
              onclick={clearAll}
            >
              清空
            </button>
                </div>
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
      </div>
      <div
        style="
          border: 1px solid #d4d4d4;
          border-radius: 5px;
          margin-bottom: 7px;
        "
      >
        <div
          style="
            border-top: 3px solid #51606e;
            border-bottom: 1px solid #d4d4d4;
            padding: 3px;
          "
        >
                    <!-- <p style="font-size: 16px;"><strong>库存详情</strong></p> -->
                    <lightning-layout>
                        <lightning-layout-item padding="around-small">
@@ -108,22 +246,36 @@
                        </lightning-layout-item>
                    </lightning-layout>
                </div>
                <div style="padding:10px;">
        <div style="padding: 10px">
                    <template if:true={showTable}>
                        <c-lex-custom-lightning-datatable key-field="id" data={data} columns={columns}
                            default-sort-direction={defaultSortDirection} sorted-direction={sortDirection}
                            sorted-by={sortedBy} onsort={onHandleSort} hide-checkbox-column={hidecheckboxcolumn}
                            class="wrapped-header-datatable">
            <c-lex-custom-lightning-datatable
              key-field="id"
              data={data}
              columns={columns}
              default-sort-direction={defaultSortDirection}
              sorted-direction={sortDirection}
              sorted-by={sortedBy}
              onsort={onHandleSort}
              hide-checkbox-column={hidecheckboxcolumn}
              class="wrapped-header-datatable"
            >
                        </c-lex-custom-lightning-datatable>
                    </template>
                    <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange}
                        onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions}
                        previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled}
                        record-start={recordStart} record-end={recordEnd} total-records={totalRecords}></c-paginator>
          <c-paginator
            onprevious={handlePrevious}
            onnext={handleNext}
            onpageschange={handlePageschange}
            onfirst={handleFirst}
            onlast={handleLast}
            page-size-options={pageSizeOptions}
            previous-button-disabled={previousButtonDisabled}
            next-button-disabled={nextButtonDisabled}
            record-start={recordStart}
            record-end={recordEnd}
            total-records={totalRecords}
          ></c-paginator>
                </div>
            </div>
        </div>
    </div>
</template>
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
@@ -1,4 +1,4 @@
import { LightningElement, wire, api, track } from 'lwc';
import { LightningElement, wire, api, track } from "lwc";
import oninit from "@salesforce/apex/LexInventoryViewController.init";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import searchOrder from "@salesforce/apex/LexInventoryViewController.searchConsumableorderdetails";
@@ -9,8 +9,9 @@
import { loadStyle } from "lightning/platformResourceLoader";
import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
export default class LexinventoryViewLWC extends NavigationMixin(LightningElement) {
export default class LexinventoryViewLWC extends NavigationMixin(
  LightningElement
) {
    //分页start
    @track sortBy = "";
    //@track sortDirection = "asc";
@@ -55,7 +56,6 @@
    //表头样式
    stylesLoaded = false;
    @track columns = [
        {
            label: "消耗品名称",
@@ -63,7 +63,7 @@
            type: "Name",
            sortable: true,
            hideDefaultActions: true,
            // initialWidth: 300,
      initialWidth: 300,
            wrapText: true,
            cellAttributes: { alignment: "left" }
        },
@@ -74,7 +74,7 @@
            cellAttributes: { alignment: "left" },
            hideDefaultActions: true,
            sortable: true,
            wrapText: true,
      wrapText: true
        },
        {
            label: "第四分类",
@@ -83,8 +83,7 @@
            initialWidth: 90,
            hideDefaultActions: true,
            wrapText: true,
            sortable: true,
      sortable: true
        },
        {
            label: "第五分类",
@@ -93,8 +92,7 @@
            initialWidth: 90,
            hideDefaultActions: true,
            wrapText: true,
            sortable: true,
      sortable: true
        },
    
        {
@@ -103,7 +101,7 @@
            cellAttributes: { alignment: "right" },
            initialWidth: 55,
            wrapText: true,
            hideDefaultActions: true,
      hideDefaultActions: true
        },
        {
            label: "单位",
@@ -111,7 +109,7 @@
            cellAttributes: { alignment: "left" },
            initialWidth: 55,
            wrapText: true,
            hideDefaultActions: true,
      hideDefaultActions: true
        },
        {
            label: "注册证编码号",
@@ -119,7 +117,7 @@
            cellAttributes: { alignment: "left" },
            wrapText: true,
            initialWidth: 155,
            hideDefaultActions: true,
      hideDefaultActions: true
        },
        {
            label: "注册有效期",
@@ -135,7 +133,7 @@
            cellAttributes: { alignment: "left" },
            initialWidth: 95,
            wrapText: true,
            hideDefaultActions: true,
      hideDefaultActions: true
        },
        {
            label: "使用期限",
@@ -145,7 +143,7 @@
            initialWidth: 105
        },
        {
            label:'有效期内库存',
      label: "有效期内库存",
            type: "customInventoryColor",
            // sortable: true,
            cellAttributes: {alignment: "right" },
@@ -153,7 +151,7 @@
            value: { fieldName:"limitCount"},
            upperlimit: { fieldName: "upperlimit" },
            lowerlimit: { fieldName: "lowerlimit" },
            boxPrice:{ fieldName: "BoxPiece" },
        boxPrice: { fieldName: "BoxPiece" }
            },
            hideDefaultActions: true,
            initialWidth:150
@@ -171,8 +169,6 @@
    sortDirection = "asc";
    sortedBy;
    renderedCallback() {
        if (!this.stylesLoaded) {
            Promise.all([loadStyle(this, WrappedHeaderTable)])
@@ -186,7 +182,6 @@
        }
    }
    connectedCallback() {
        this.loader = true;
        this.init();
@@ -199,25 +194,45 @@
            pageTokenLWC: this.currentPageToken,
            sortFieldLWC: this.sortBy,
            sortOrderLWC: this.sortDirection
        }).then((result) => {
    })
      .then((result) => {
            result = JSON.parse(JSON.stringify(result));
            console.log("result.pageRecords = " + JSON.stringify(result.entity.pageRecords));
            console.log("result.consumableorderdetailsRecords = " + JSON.stringify(result.entity.consumableorderdetailsRecords));
        console.log(
          "result.pageRecords = " + JSON.stringify(result.entity.pageRecords)
        );
        console.log(
          "result.consumableorderdetailsRecords = " +
            JSON.stringify(result.entity.consumableorderdetailsRecords)
        );
            console.log("result.status = " + result.status);
            console.log("result = " + JSON.stringify(result));
            console.log("result 1= " + JSON.stringify(result.entity));
            console.log("result 2= " + JSON.stringify(result.entity.pageRecords));
            console.log("result.entity.categoryOptionMap 2= " + JSON.stringify(result.entity.categoryOptionMap));
            console.log("result.entity.categoryOptionMap 2= " + JSON.stringify(result.entity.category4OptionMap));
            console.log("result.entity.categoryOptionMap 2= " + JSON.stringify(result.entity.category5OptionMap));
        console.log(
          "result.entity.categoryOptionMap 2= " +
            JSON.stringify(result.entity.categoryOptionMap)
        );
        console.log(
          "result.entity.categoryOptionMap 2= " +
            JSON.stringify(result.entity.category4OptionMap)
        );
        console.log(
          "result.entity.categoryOptionMap 2= " +
            JSON.stringify(result.entity.category5OptionMap)
        );
            if (result.status == "Success") {
                console.log('result.entity.paginatedAccounts = ' + JSON.stringify(result.entity.paginatedAccounts));
          console.log(
            "result.entity.paginatedAccounts = " +
              JSON.stringify(result.entity.paginatedAccounts)
          );
                this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
                this.totalRecords = result.entity.paginatedAccounts.totalRecords;
                this.recordStart = result.entity.paginatedAccounts.recordStart;
                this.recordEnd = result.entity.paginatedAccounts.recordEnd;
                this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
                console.log('this.totalPages = ' + this.totalPages);
          this.totalPages = Math.ceil(
            result.entity.paginatedAccounts.totalRecords / this.pageSize
          );
          console.log("this.totalPages = " + this.totalPages);
                this.paginationVisibility = this.totalPages > 1 ? true : false;
                this.loader = false;
@@ -238,12 +253,14 @@
                let option1ValueTemp = [];
                for (var key in result.entity.categoryOptionMap) {
                    let object = {};
                    object['label'] = result.entity.categoryOptionMap[key];
                    object['value'] = key;
            object["label"] = result.entity.categoryOptionMap[key];
            object["value"] = key;
                    option1ValueTemp.push(object);
                }
                this.category3Options = option1ValueTemp;
                console.log(' this.optionscatone===>' + JSON.stringify(this.optionscatone));
          console.log(
            " this.optionscatone===>" + JSON.stringify(this.optionscatone)
          );
                let option2ValueTemp = [];
                for (var key in result.entity.category4OptionMap) {
                    let object = {};
@@ -261,7 +278,7 @@
                }
                this.category5Options = option3ValueTemp;
                this.hasHos = result.entity.hasHos;
                console.log('this.hasHos'+this.hasHos);
          console.log("this.hasHos" + this.hasHos);
                //颜色标记
                
                  //hasHos = true 医院特价
@@ -270,29 +287,33 @@
                        label: "医院特价",
                        fieldName: "hospitalSpecialOffer__c",
                        hideDefaultActions: true,
                        type:'boolean',
              type: "boolean",
                        cellAttributes: { alignment: "left" },
                        initialWidth:80
                    };
                    this.columns.push(object1);
                    console.log(' this.columns'+  this.columns);
            console.log(" this.columns" + this.columns);
                    for (var j in this.data) {
                        this.data[j]["Name__c"] = this.data[j].Prod.Name__c;
                        this.data[j]["Category3__c"] = this.data[j].Prod.Category3__c;
                        this.data[j]["Category4__c"] = this.data[j].Prod.Category3__c;
                        this.data[j]["Category5__c"] = this.data[j].Prod.Category3__c;
                        this.data[j]["SFDA_Status__c"] = this.data[j].Prod.SFDA_Status__c;
                        this.data[j]["hospitalSpecialOffer__c"] = this.data[j].hospitalSpecialOffer;
                        console.log('this.data[j].hospitalSpecialOffer__c'+this.data[j].hospitalSpecialOffer);
              this.data[j]["hospitalSpecialOffer__c"] =
                this.data[j].hospitalSpecialOffer;
              console.log(
                "this.data[j].hospitalSpecialOffer__c" +
                  this.data[j].hospitalSpecialOffer
              );
                    }
                }
                this.showSpinner = false;
            } else {
                // this.showToast("Error",'Error', result.msg);
                this.showMyToast('初始化失败',result.msg,'error');
          this.showMyToast("初始化失败", result.msg, "error");
            }
        }).catch((error) => {
      })
      .catch((error) => {
            this.loader = false;
            this.showSpinner = false;
            console.log("error = " + JSON.stringify(error));
@@ -333,17 +354,17 @@
                this.CategoryThree = value;
                //调用后台显示第四五分类
                this.showAllCate();
                if (this.CategoryThree == '') {
                    this.CategoryFour = '';
                    this.CategoryFive = '';
        if (this.CategoryThree == "") {
          this.CategoryFour = "";
          this.CategoryFive = "";
                }
                break;
            case "CategoryFour":
                this.Category4 = value;
                //调用后台显示第五分类
                this.showCate();
                if (this.CategoryFour == '') {
                    this.CategoryFive = '';
        if (this.CategoryFour == "") {
          this.CategoryFive = "";
                }
                break;
            case "CategoryFive":
@@ -352,12 +373,12 @@
        }
    }
    showAllCate() {
        categoryAllload({
            category3LWC: this.CategoryThree,
            agencyProTypeLWC:this.agencyProType
        }).then((result) => {
    })
      .then((result) => {
            result = JSON.parse(JSON.stringify(result));
            console.log("result = " + JSON.stringify(result));
            if (result.status == "Success") {
@@ -370,7 +391,9 @@
                    object["value"] = key;
                    this.category4Options.push(object);
                }
                console.log("this.category4Options = " + JSON.stringify(this.category4Options));
          console.log(
            "this.category4Options = " + JSON.stringify(this.category4Options)
          );
                //第5分类
                for (var key in result.entity.category5OptionMap) {
                    let object = {};
@@ -380,9 +403,10 @@
                }
            } else {
                console.log("result = " + JSON.stringify(result));
                this.showMyToast(result.msg,'','error');
          this.showMyToast(result.msg, "", "error");
            }
        }).catch((error) => {
      })
      .catch((error) => {
            console.log("error" + JSON.stringify(error));
        });
    }
@@ -399,7 +423,7 @@
            agencyProType: this.agencyProType,
            userWorkLocation: this.userWorkLocation,
            pageSizeLWC: this.pageSize,
            pageTokenLWC: this.currentPageToken,
      pageTokenLWC: this.currentPageToken
            // sortFieldLWC: this.sortBy,
            // sortOrderLWC: this.sortDirection
        })
@@ -410,28 +434,31 @@
                    this.totalRecords = result.entity.paginatedAccounts.totalRecords;
                    this.recordStart = result.entity.paginatedAccounts.recordStart;
                    this.recordEnd = result.entity.paginatedAccounts.recordEnd;
                    this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
                    console.log('this.totalPages = ' + this.totalPages);
          this.totalPages = Math.ceil(
            result.entity.paginatedAccounts.totalRecords / this.pageSize
          );
          console.log("this.totalPages = " + this.totalPages);
                    this.paginationVisibility = this.totalPages > 1 ? true : false;
                    console.log('this.sortDirection = ' + this.sortDirection);
          console.log("this.sortDirection = " + this.sortDirection);
                    // this.showToast("Success",'搜索成功', result.msg);
                    this.showMyToast('搜索成功',result.msg,'success');
          this.showMyToast("搜索成功", result.msg, "success");
                    this.data = result.entity.pageRecords;
                    console.log('搜索Data==>'+JSON.stringify(this.data));
          console.log("搜索Data==>" + JSON.stringify(this.data));
                    for (var i in this.data) {
                        this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
                        this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
                        this.data[i]["Category4__c"] = this.data[i].Prod.Category3__c;
                        this.data[i]["Category5__c"] = this.data[i].Prod.Category3__c;
                        this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
                        this.data[i]["hospitalSpecialOffer__c"] = this.data[i].hospitalSpecialOffer;
            this.data[i]["hospitalSpecialOffer__c"] =
              this.data[i].hospitalSpecialOffer;
                    }
                    this.data = [...this.data];
                    console.log('this.data = ' + JSON.stringify(this.data));
          console.log("this.data = " + JSON.stringify(this.data));
                    this.showTable = true;
                } else {
                    // this.showToast("Error",'Error', result.msg);
                    this.showMyToast('搜索失败',result.msg,'error');
          this.showMyToast("搜索失败", result.msg, "error");
                }
            })
            .catch((error) => {
@@ -440,54 +467,51 @@
    }
    inventoryCount() {
        this[NavigationMixin.Navigate]({
            type: 'standard__webPage',
      type: "standard__webPage",
            attributes: {
                url: '/lexinventory'
        url: "/lexinventory"
            }
        });
    }
    handleExpired() {
        console.log('过期库存呢销存');
    console.log("过期库存呢销存");
        this[NavigationMixin.Navigate]({
            type: 'standard__webPage',
      type: "standard__webPage",
            attributes: {
                url: '/lexoverduestock'
        url: "/lexoverduestock"
            }
        });
    }
    removeBox() {
        this[NavigationMixin.Navigate]({
            type: 'standard__webPage',
      type: "standard__webPage",
            attributes: {
                url: '/lexremovebox'
        url: "/lexremovebox"
            }
        });
    }
    cancelremoveBox() {
        this[NavigationMixin.Navigate]({
            type: 'standard__webPage',
      type: "standard__webPage",
            attributes: {
                url: '/lexcancelremovebox'
        url: "/lexcancelremovebox"
            }
        });
    }
    clearAll() {
        this.showSpinner = true;
        this.showTable = false;
        this.Name = '';
        this.CategoryThree = '';
        this.CategoryFour = '';
        this.CategoryFive = '';
    this.Name = "";
    this.CategoryThree = "";
    this.CategoryFour = "";
    this.CategoryFive = "";
        this.template.querySelectorAll("lightning-combobox").forEach((each) => {
            each.value = null;
        });
        console.log(' this.CategoryThree' + this.CategoryThree);
        console.log('数据列表' + this.data);
    console.log(" this.CategoryThree" + this.CategoryThree);
    console.log("数据列表" + this.data);
        searchOrder({
            category1: this.Name,
            Category3: this.CategoryThree,
@@ -498,21 +522,22 @@
            agencyProType: this.agencyProType,
            userWorkLocation: this.userWorkLocation,
            pageSizeLWC: this.pageSize,
            pageTokenLWC: this.currentPageToken,
      pageTokenLWC: this.currentPageToken
        })
            .then((result) => {
                console.log("result搜索 = " + JSON.stringify(result));
                result = JSON.parse(JSON.stringify(result));
                if (result.status == "Success") {
                    this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
                    this.totalRecords = result.entity.paginatedAccounts.totalRecords;
                    this.recordStart = result.entity.paginatedAccounts.recordStart;
                    this.recordEnd = result.entity.paginatedAccounts.recordEnd;
                    this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
                    console.log('this.totalPages = ' + this.totalPages);
          this.totalPages = Math.ceil(
            result.entity.paginatedAccounts.totalRecords / this.pageSize
          );
          console.log("this.totalPages = " + this.totalPages);
                    this.paginationVisibility = this.totalPages > 1 ? true : false;
                    console.log('this.sortDirection = ' + this.sortDirection);
          console.log("this.sortDirection = " + this.sortDirection);
                    this.data = result.entity.pageRecords;
                    for (var i in this.data) {
@@ -524,12 +549,12 @@
                    }
                    this.showSpinner = false;
                    this.showTable = true;
                    this.showMyToast('搜索成功',result.msg,'success');
          this.showMyToast("搜索成功", result.msg, "success");
                    // this.showToast("Success",'搜索成功', result.msg);
                    this.showSpinner = false;
                } else {
                    // this.showToast("Error", 'Error',result.msg);
                    this.showMyToast('搜索失败',result.msg,'error');
          this.showMyToast("搜索失败", result.msg, "error");
                }
            })
            .catch((error) => {
@@ -558,8 +583,8 @@
        this.sortBy = event.detail.fieldName;
        this.sortDirection = event.detail.sortDirection;
        this.currentPageToken = 0;
        console.log('this.sortBy = ' + this.sortBy)
        console.log('this.sortDirection = ' + this.sortDirection)
    console.log("this.sortBy = " + this.sortBy);
    console.log("this.sortDirection = " + this.sortDirection);
        // if('limitCount' != this.sortBy)
        //     this.searchOrderDetail();
        // else{
@@ -572,7 +597,9 @@
        // }
        const { fieldName: sortedBy, sortDirection } = event.detail;
        const cloneData = [...this.data];
        cloneData.sort(this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1));
    cloneData.sort(
      this.sortByMethod(sortedBy, sortDirection === "asc" ? 1 : -1)
    );
        this.data = cloneData;
        this.sortDirection = sortDirection;
        this.sortedBy = sortedBy;
@@ -588,12 +615,14 @@
    }
    handlePrevious() {
        this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
    this.currentPageToken =
      Number(this.currentPageToken) - Number(this.pageSize);
        this.searchOrderDetail();
    }
    handleNext() {
        this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
    this.currentPageToken =
      Number(this.currentPageToken) + Number(this.pageSize);
        this.searchOrderDetail();
    }
    handleFirst() {
@@ -602,7 +631,8 @@
    }
    handleLast() {
        this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
    this.currentPageToken =
      this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
        this.searchOrderDetail();
    }
@@ -620,21 +650,23 @@
        return this.nextPageToken === undefined;
    }
    showMyToast(title, message, variant) {
        console.log('show custom message');
        var iconName = '';
        var content = '';
        if(variant == 'success'){
           iconName = 'utility:check';
    console.log("show custom message");
    var iconName = "";
    var content = "";
    if (variant == "success") {
      iconName = "utility:check";
        }else{
           iconName = 'utility:error';
      iconName = "utility:error";
        }
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
    if (message != "") {
      content =
        "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>";
        }else{
           content = '<h2><strong>'+title+'<strong/></h2>';
      content = "<h2><strong>" + title + "<strong/></h2>";
        }
        this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
    this.template
      .querySelector("c-common-toast")
      .showToast(variant, content, iconName, 10000);
    // showToast(type,title,msg) {
    //     this.showSpinner = false;