| .sf/config.json | 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexConsumable/lexConsumable.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexConsumable/lexConsumable.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
.sf/config.json
force-app/main/default/lwc/lexConsumable/lexConsumable.html
@@ -128,7 +128,12 @@ margin-bottom: 7px; " > <div style="border-bottom: 1px solid #d4d4d4; padding: 3px"> <div style=" border-bottom: 1px solid #d4d4d4; padding: 3px; " > <lightning-layout> <lightning-layout-item padding="around-small"> <p style="font-size: 18px"> @@ -194,7 +199,9 @@ </template> </td> --> <td> <template if:true={showAttUploadDate}> <template if:true={showAttUploadDate} > <lightning-output-field field-name="Consumable_pdf_insert_day__c" ></lightning-output-field> @@ -215,7 +222,9 @@ <tr> <td></td> <td> <template if:true={showOrderDate}> <template if:true={showOrderDate} > <lightning-output-field field-name="Order_date__c" ></lightning-output-field> @@ -233,7 +242,10 @@ title="附件列表" icon-name="utility:attach" > <lightning-layout slot="footer" multiple-rows="true"> <lightning-layout slot="footer" multiple-rows="true" > <template for:each={attachmentRecoeds} for:item="item" @@ -243,11 +255,16 @@ padding="around-none" size="2" key={item.recordId} style="text-align: left; padding: 5px" style=" text-align: left; padding: 5px; " > <lightning-icon title={item.fileFullName} style="margin-left: 20px" style=" margin-left: 20px; " icon-name="doctype:gform" alternative-text={item.fileFullName} size="large" @@ -269,10 +286,16 @@ </div> <p> <!-- <a data-fileid ={item.documentId} onclick={previweAtt}> --> <a href={item.attUrl} target="_blank"> <a href={item.attUrl} target="_blank" > 预览 </a > · <a href={item.downloadUrl}> 下载 </a <a href={item.downloadUrl} > 下载 </a > · <a data-fileid={item.recordId} @@ -341,7 +364,12 @@ <!-- <tr style="height: 10px;"></tr> --> <tr> <td> <div style="color: #696969; font-size: 16px"> <div style=" color: #696969; font-size: 16px; " > 消耗品名称 </div> </td> @@ -356,7 +384,14 @@ </td> <td></td> <td> <div style="color: #696969; font-size: 16px">第3分类</div> <div style=" color: #696969; font-size: 16px; " > 第3分类 </div> </td> <td> <lightning-combobox @@ -370,7 +405,14 @@ </td> <td style="width: 30px"></td> <td style="width: 66px"> <div style="color: #696969; font-size: 16px">第4分类</div> <div style=" color: #696969; font-size: 16px; " > 第4分类 </div> </td> <td> <lightning-combobox @@ -384,7 +426,14 @@ </td> <td></td> <td style="width: 66px"> <div style="color: #696969; font-size: 16px">第5分类</div> <div style=" color: #696969; font-size: 16px; " > 第5分类 </div> </td> <td style="width: 160px"> <lightning-combobox @@ -400,8 +449,15 @@ <tr style="height: 10px"></tr> <tr> <td style="width: 100px"> <div style="color: #696969; font-size: 16px"> <span style="color: red">* </span>合同 <div style=" color: #696969; font-size: 16px; " > <span style="color: red" >* </span >合同 </div> </td> <td style="width: 320px"> @@ -427,14 +483,24 @@ <td style="width: 30px"></td> <td style="width: 66px"> <template if:true={showHospital}> <div style="color: #696969; font-size: 16px"> <span style="color: red">* </span>医院 <div style=" color: #696969; font-size: 16px; " > <span style="color: red" >* </span >医院 </div> </template> </td> <td colspan="4" style="padding-bottom: 5px; padding-top: 5px" style=" padding-bottom: 5px; padding-top: 5px; " > <template if:true={showHospital}> <div @@ -461,7 +527,11 @@ <td colspan="2"> <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="width: 130px; height: 32px; margin-right: 10px" style=" width: 130px; height: 32px; margin-right: 10px; " label="消耗品搜索" onclick={searchProduct} > @@ -469,7 +539,10 @@ </button> <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="width: 80px; height: 32px" style=" width: 80px; height: 32px; " label="清空" onclick={clear} > @@ -585,7 +658,10 @@ <template if:true={editAble}> <c-lex-custom-lightning-datatable class="wrapped-header-datatable" style="word-wrap: break-word; word-break: break-all" style=" word-wrap: break-word; word-break: break-all; " key-field="recordId" data={currentRecord} columns={cols} @@ -615,7 +691,10 @@ <template if:false={editAble}> <c-lex-custom-lightning-datatable class="wrapped-header-datatable" style="word-wrap: break-word; word-break: break-all" style=" word-wrap: break-word; word-break: break-all; " hide-checkbox-column key-field="recordId" data={consumableorderdetailsRecordsview} @@ -668,10 +747,16 @@ style="border: 1px solid #d4d4d4" > <template if:true={showPopSpinner}> <lightning-spinner size="medium" variant="brand"></lightning-spinner> <lightning-spinner size="medium" variant="brand" ></lightning-spinner> </template> <div class="slds-modal__container"> <header class="slds-modal__header" style="background-color: #f3f3f3"> <header class="slds-modal__header" style="background-color: #f3f3f3" > <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" @@ -755,7 +840,10 @@ style="border: 1px solid #d4d4d4" > <div class="slds-modal__container"> <header class="slds-modal__header" style="background-color: #f3f3f3"> <header class="slds-modal__header" style="background-color: #f3f3f3" > <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" @@ -787,7 +875,11 @@ <tr> <td style="width: 74px"> <div style="color: #696969; font-size: 16px; text-align: left" style=" color: #696969; font-size: 16px; text-align: left; " > 医院名称 </div> @@ -826,9 +918,16 @@ margin-bottom: 7px; " > <div style="border-bottom: 1px solid #d4d4d4; padding: 3px"> <div style=" border-bottom: 1px solid #d4d4d4; padding: 3px; " > <lightning-layout> <lightning-layout-item padding="around-small"> <lightning-layout-item padding="around-small" > <p style="font-size: 18px"> <strong>搜索结果</strong> </p> @@ -875,7 +974,10 @@ style="border: 1px solid #d4d4d4" > <div class="slds-modal__container"> <header class="slds-modal__header" style="background-color: #f3f3f3"> <header class="slds-modal__header" style="background-color: #f3f3f3" > <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" @@ -907,7 +1009,11 @@ <tr> <td style="width: 74px"> <div style="color: #696969; font-size: 16px; text-align: left" style=" color: #696969; font-size: 16px; text-align: left; " > 合同名称 </div> @@ -947,9 +1053,16 @@ margin-bottom: 7px; " > <div style="border-bottom: 1px solid #d4d4d4; padding: 3px"> <div style=" border-bottom: 1px solid #d4d4d4; padding: 3px; " > <lightning-layout> <lightning-layout-item padding="around-small"> <lightning-layout-item padding="around-small" > <p style="font-size: 18px"> <strong>搜索结果</strong> </p> force-app/main/default/lwc/lexConsumable/lexConsumable.js
@@ -1,27 +1,27 @@ import { LightningElement, wire, api, track } from "lwc"; import { CurrentPageReference } from "lightning/navigation"; import { ShowToastEvent } from "lightning/platformShowToastEvent"; import { NavigationMixin } from "lightning/navigation"; import initPage from "@salesforce/apex/LexConsumableController.init"; import categoryAllload from "@salesforce/apex/LexConsumableController.categoryAllload"; import categoryload from "@salesforce/apex/LexConsumableController.categoryload"; import searchConsumableorderdetails from "@salesforce/apex/LexConsumableController.searchConsumableorderdetails"; import searchorderdetails from "@salesforce/apex/LexConsumableController.searchorderdetails"; import save from "@salesforce/apex/LexConsumableController.save"; import ordrCopy from "@salesforce/apex/LexConsumableController.ordrCopy"; import setEditAble from "@salesforce/apex/LexConsumableController.setEditAble"; import backOrder from "@salesforce/apex/LexConsumableController.backOrder"; import delConsumable from "@salesforce/apex/LexConsumableController.delConsumable"; import sorder from "@salesforce/apex/LexConsumableController.sorder"; import filesUpload from "@salesforce/apex/LexConsumableController.filesUpload"; import initHospital from "@salesforce/apex/LexSearchHospitalController.init"; import searchHospital from "@salesforce/apex/LexSearchHospitalController.searchHospital"; import initContract from "@salesforce/apex/LexSearchContractController.init"; import searchContract from "@salesforce/apex/LexSearchContractController.searchContract"; import deleteAtt from "@salesforce/apex/LexConsumableController.deleteAtt"; import { LightningElement, wire, api, track } from 'lwc'; import { CurrentPageReference } from 'lightning/navigation'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import { NavigationMixin } from 'lightning/navigation'; import initPage from '@salesforce/apex/LexConsumableController.init'; import categoryAllload from '@salesforce/apex/LexConsumableController.categoryAllload'; import categoryload from '@salesforce/apex/LexConsumableController.categoryload'; import searchConsumableorderdetails from '@salesforce/apex/LexConsumableController.searchConsumableorderdetails'; import searchorderdetails from '@salesforce/apex/LexConsumableController.searchorderdetails'; import save from '@salesforce/apex/LexConsumableController.save'; import ordrCopy from '@salesforce/apex/LexConsumableController.ordrCopy'; import setEditAble from '@salesforce/apex/LexConsumableController.setEditAble'; import backOrder from '@salesforce/apex/LexConsumableController.backOrder'; import delConsumable from '@salesforce/apex/LexConsumableController.delConsumable'; import sorder from '@salesforce/apex/LexConsumableController.sorder'; import filesUpload from '@salesforce/apex/LexConsumableController.filesUpload'; import initHospital from '@salesforce/apex/LexSearchHospitalController.init'; import searchHospital from '@salesforce/apex/LexSearchHospitalController.searchHospital'; import initContract from '@salesforce/apex/LexSearchContractController.init'; import searchContract from '@salesforce/apex/LexSearchContractController.searchContract'; import deleteAtt from '@salesforce/apex/LexConsumableController.deleteAtt'; //table css import { loadStyle } from "lightning/platformResourceLoader"; import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable"; import { loadStyle } from 'lightning/platformResourceLoader'; import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable'; export default class LexConsumable extends NavigationMixin(LightningElement) { //页面基础数据 @@ -37,9 +37,9 @@ @track specialCampaign = false; @track dealerProductId = []; @track category1; @track category3 = ""; @track category4 = ""; @track category5 = ""; @track category3 = ''; @track category4 = ''; @track category5 = ''; @track category_Goods; @track category3Option = []; @track category4Option = []; @@ -81,7 +81,7 @@ //是否一直显示提示 @track isNoteStay = true; //排序相关 @track sortDirection = "asc"; @track sortDirection = 'asc'; @track sortedBy; //分页 @track currentPage = 1; @@ -115,30 +115,30 @@ @track hosCols = [ // {label:'医院名称',fieldName:'Name',type:'button',typeAttributes:{label:{fieldName:'Name'},variant:'base'}}, { label: "", type: "button", typeAttributes: { label: "选择" }, label: '', type: 'button', typeAttributes: { label: '选择' }, initialWidth: 90, hideDefaultActions: true, wrapText: true }, { label: "医院名称", fieldName: "Name", label: '医院名称', fieldName: 'Name', initialWidth: 380, wrapText: true, hideDefaultActions: true }, { label: "省份", fieldName: "StateMaster", label: '省份', fieldName: 'StateMaster', initialWidth: 80, hideDefaultActions: true, wrapText: true }, { label: "地址", fieldName: "Address__c", label: '地址', fieldName: 'Address__c', hideDefaultActions: true, wrapText: true } @@ -155,43 +155,43 @@ @track tempidPp; @track conCols = [ { label: "", type: "button", typeAttributes: { label: "选择" }, label: '', type: 'button', typeAttributes: { label: '选择' }, initialWidth: 90, hideDefaultActions: true, wrapText: true }, { label: "合同名称", fieldName: "Name", label: '合同名称', fieldName: 'Name', wrapText: true, hideDefaultActions: true }, { label: "省份", fieldName: "StateMaster", label: '省份', fieldName: 'StateMaster', initialWidth: 80, hideDefaultActions: true, wrapText: true }, { label: "申请销售课", fieldName: "Sales_Section__c", label: '申请销售课', fieldName: 'Sales_Section__c', initialWidth: 160, hideDefaultActions: true, wrapText: true }, { label: "允许报价期间(开始日)", fieldName: "Contract_Decide_Start_Date__c", label: '允许报价期间(开始日)', fieldName: 'Contract_Decide_Start_Date__c', initialWidth: 175, hideDefaultActions: true, wrapText: true }, { label: "允许报价期间(结束日)", fieldName: "Contract_Decide_End_Date__c", label: '允许报价期间(结束日)', fieldName: 'Contract_Decide_End_Date__c', initialWidth: 175, hideDefaultActions: true, wrapText: true @@ -202,61 +202,61 @@ get cols() { var cols = []; cols.push({ label: "消耗品名称", fieldName: "prodName", label: '消耗品名称', fieldName: 'prodName', wrapText: true, hideDefaultActions: true, sortable: true // initialWidth: 136 }); cols.push({ label: "规格", fieldName: "packing_list", label: '规格', fieldName: 'packing_list', wrapText: true, hideDefaultActions: true, initialWidth: 50, cellAttributes: { alignment: "right" } cellAttributes: { alignment: 'right' } }); cols.push({ label: "CFDA状态", fieldName: "prodSFDAStatus", label: 'CFDA状态', fieldName: 'prodSFDAStatus', wrapText: true, hideDefaultActions: true, initialWidth: 84 }); cols.push({ label: "注册证编码号", fieldName: "approbation_No", label: '注册证编码号', fieldName: 'approbation_No', wrapText: true, hideDefaultActions: true, initialWidth: 104 }); cols.push({ label: "注册证效期", fieldName: "expiration_Date", label: '注册证效期', fieldName: 'expiration_Date', wrapText: true, hideDefaultActions: true, initialWidth: 95 }); cols.push({ label: "第3分类", fieldName: "prodCategory3", label: '第3分类', fieldName: 'prodCategory3', wrapText: true, hideDefaultActions: true, initialWidth: 84, sortable: true }); cols.push({ label: "第4分类", fieldName: "prodCategory4", label: '第4分类', fieldName: 'prodCategory4', wrapText: true, hideDefaultActions: true, initialWidth: 84, sortable: true }); cols.push({ label: "第5分类", fieldName: "prodCategory5", label: '第5分类', fieldName: 'prodCategory5', wrapText: true, hideDefaultActions: true, initialWidth: 84, @@ -264,73 +264,73 @@ }); if (this.cansee) { cols.push({ label: "标准单价", type: "number", label: '标准单价', type: 'number', typeAttributes: { minimumFractionDigits: 2 }, fieldName: "prodIntraTradeList", fieldName: 'prodIntraTradeList', hideDefaultActions: true, initialWidth: 78 }); } if (this.editAble) { cols.push({ label: "采购数量", type: "customTableInput", label: '采购数量', type: 'customTableInput', typeAttributes: { recordId: { fieldName: "recordId" }, inputValue: { fieldName: "consumableCount" }, upperLimit: { fieldName: "upperlimit" }, lowerLimit: { fieldName: "lowerlimit" }, allnumber: { fieldName: "allnumber" }, valueType: "Number" recordId: { fieldName: 'recordId' }, inputValue: { fieldName: 'consumableCount' }, upperLimit: { fieldName: 'upperlimit' }, lowerLimit: { fieldName: 'lowerlimit' }, allnumber: { fieldName: 'allnumber' }, valueType: 'Number' }, hideDefaultActions: true, initialWidth: 78 }); } else { cols.push({ label: "采购数量", fieldName: "consumableCount", label: '采购数量', fieldName: 'consumableCount', hideDefaultActions: true, initialWidth: 78, cellAttributes: { alignment: "right" } cellAttributes: { alignment: 'right' } }); } cols.push({ label: "在库数下限", fieldName: "lowerlimit", label: '在库数下限', fieldName: 'lowerlimit', hideDefaultActions: true, initialWidth: 86, cellAttributes: { alignment: "right" } cellAttributes: { alignment: 'right' } }); cols.push({ label: "在库数上限", fieldName: "upperlimit", label: '在库数上限', fieldName: 'upperlimit', hideDefaultActions: true, initialWidth: 86, cellAttributes: { alignment: "right" } cellAttributes: { alignment: 'right' } }); // cols.push({label:'有效期库存(盒)',fieldName:'allnumber',hideDefaultActions: true,initialWidth:105,sortable: true}); cols.push({ label: "有效期库存(盒)", type: "customInventoryColor", fieldName: "allnumber", label: '有效期库存(盒)', type: 'customInventoryColor', fieldName: 'allnumber', typeAttributes: { value: { fieldName: "allnumber" }, upperlimit: { fieldName: "upperlimit" }, lowerlimit: { fieldName: "lowerlimit" }, boxPrice: "盒" value: { fieldName: 'allnumber' }, upperlimit: { fieldName: 'upperlimit' }, lowerlimit: { fieldName: 'lowerlimit' }, boxPrice: '盒' }, hideDefaultActions: true, initialWidth: 122, sortable: true }); cols.push({ label: "有效期库存(个)", fieldName: "allnumber_piece", label: '有效期库存(个)', fieldName: 'allnumber_piece', hideDefaultActions: true, initialWidth: 112, cellAttributes: { alignment: "right" } cellAttributes: { alignment: 'right' } }); return cols; } @@ -338,36 +338,36 @@ //附件cols @track attCols = [ { label: "标题", fieldName: "attUrl", type: "url", label: '标题', fieldName: 'attUrl', type: 'url', typeAttributes: { label: { fieldName: "fileName" }, target: "_blank" label: { fieldName: 'fileName' }, target: '_blank' }, hideDefaultActions: true }, { label: "创建人", fieldName: "ownerUrl", type: "url", label: '创建人', fieldName: 'ownerUrl', type: 'url', typeAttributes: { label: { fieldName: "ownerName" }, target: "_blank" label: { fieldName: 'ownerName' }, target: '_blank' }, hideDefaultActions: true }, { label: "上传日期", fieldName: "updateDate", label: '上传日期', fieldName: 'updateDate', hideDefaultActions: true }, { label: "", type: "tableCellIcon", label: '', type: 'tableCellIcon', typeAttributes: { iconName: "utility:delete", recordId: { fieldName: "recordId" } iconName: 'utility:delete', recordId: { fieldName: 'recordId' } }, initialWidth: 50, hideDefaultActions: true @@ -397,9 +397,9 @@ ) { count++; console.log( "checkId:" + 'checkId:' + selectedRows[j].recordId + "---" + '---' + this.consumableorderdetailsRecordsview[i].prodName ); } @@ -414,10 +414,10 @@ } } for (var i in this.selectRows) { console.log("checkId1:" + this.selectRows[i]); console.log('checkId1:' + this.selectRows[i]); for (var i in this.currentRecord) { if (this.currentRecord[i].recordId == this.selectRows[i]) { console.log("currentRecord:" + this.selectRows[i]); console.log('currentRecord:' + this.selectRows[i]); } } } @@ -427,19 +427,25 @@ conCountChange(event) { var recordId = event.detail.data.recordId; var conCount = event.detail.data.value; console.log("countChange:" + recordId + "---" + conCount); console.log('countChange:' + recordId + '---' + conCount); for (var i in this.consumableorderdetailsRecordsview) { if (this.consumableorderdetailsRecordsview[i].recordId == recordId) { this.consumableorderdetailsRecordsview[i].esd.Consumable_count__c = if ( this.consumableorderdetailsRecordsview[i].recordId == recordId ) { this.consumableorderdetailsRecordsview[ i ].esd.Consumable_count__c = conCount; this.consumableorderdetailsRecordsview[i].consumableCount = conCount; this.consumableorderdetailsRecordsview[i].consumableCount = conCount; if (conCount != null && conCount != 0 && conCount != "") { if (conCount != null && conCount != 0 && conCount != '') { this.consumableorderdetailsRecordsview[i].check = true; } else { this.consumableorderdetailsRecordsview[i].check = false; this.consumableorderdetailsRecordsview[i].esd.Consumable_count__c = this.consumableorderdetailsRecordsview[ i ].esd.Consumable_count__c = null; this.consumableorderdetailsRecordsview[i].consumableCount = null; this.consumableorderdetailsRecordsview[i].consumableCount = null; } } } @@ -447,7 +453,8 @@ for (var i in this.currentRecord) { if (this.currentRecord[i].recordId == recordId) { console.log( "currentRecord1:" + this.currentRecord[i].esd.Consumable_count__c 'currentRecord1:' + this.currentRecord[i].esd.Consumable_count__c ); } } @@ -460,13 +467,13 @@ var upperLimit = event.detail.data.upperLimit; var lowerLimit = event.detail.data.lowerLimit; console.log( "limit:" + 'limit:' + conCount + "---" + '---' + allnumber + "---" + '---' + lowerLimit + "---" + '---' + allnumber ); if ( @@ -477,25 +484,25 @@ ) { if (parseInt(allnumber) + parseInt(conCount) > upperLimit) { // window.alert("该产品订购数量超出库存上限!"); this.showMyToast("该产品订购数量超出库存上限!", "", "error"); this.showMyToast('该产品订购数量超出库存上限!', '', 'error'); } if (parseInt(allnumber) + parseInt(conCount) < lowerLimit) { // window.alert("该产品订购数量低于库存下限!"); this.showMyToast("该产品订购数量低于库存下限!", "", "error"); this.showMyToast('该产品订购数量低于库存下限!', '', 'error'); } } } @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log("CurrentPageReference"); console.log('CurrentPageReference'); if (currentPageReference) { this.pageType = currentPageReference.state?.type; this.esetId = currentPageReference.state?.ESetid; this.keyWords = currentPageReference.state?.KeyWords; console.log("type:" + this.pageType); console.log("esetId:" + this.esetId); console.log("keyWords:" + this.keyWords); console.log('type:' + this.pageType); console.log('esetId:' + this.esetId); console.log('keyWords:' + this.keyWords); } } @@ -503,11 +510,11 @@ if (!this.stylesLoaded) { Promise.all([loadStyle(this, WrappedHeaderTable)]) .then(() => { console.log("Custom styles loaded"); console.log('Custom styles loaded'); this.stylesLoaded = true; }) .catch((error) => { console.error("Error loading custom styles"); console.error('Error loading custom styles'); }); } } @@ -522,11 +529,12 @@ }) .then((result) => { this.isNoteStay = result.isNoteStay; if (result.result == "Success") { if (result.result == 'Success') { this.editAble = result.editAble; this.edoffersPrice = result.edoffersPrice; this.cansee = result.cansee; this.editDelCommitBtnDisabled = result.editDelCommitBtnDisabled; this.editDelCommitBtnDisabled = result.editDelCommitBtnDisabled; this.category3Option = result.category3Option; this.category4Option = result.category4Option; this.category5Option = result.category5Option; @@ -535,45 +543,49 @@ this.OSHFLG = result.OSHFLG; this.hospitalName = result.hospitalName; this.contractName = result.contractName; this.contractLabel = "经销商有效合同"; this.contractLabel = '经销商有效合同'; this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; this.currentPage = 1; this.showCurrentReocrd(); this.getAllChecked(); this.attachmentRecoeds = result.attachmentRecoeds; console.log("attSize:" + this.attachmentRecoeds.length); console.log('attSize:' + this.attachmentRecoeds.length); for (var i in this.attachmentRecoeds) { this.attachmentRecoeds[i]["recordId"] = this.attachmentRecoeds[i]['recordId'] = this.attachmentRecoeds[i].Concc.Id; this.attachmentRecoeds[i]["documentId"] = this.attachmentRecoeds[i]['documentId'] = this.attachmentRecoeds[i].Concc.ContentDocumentId; this.attachmentRecoeds[i]["fileFullName"] = this.attachmentRecoeds[i]['fileFullName'] = this.attachmentRecoeds[i].Concc.Title; var contractionName = this.attachmentRecoeds[i].Concc.Title; var contractionName = this.attachmentRecoeds[i].Concc.Title; // var contractionName = '长文件长文件长文件长文件'; if (contractionName.length > 25) { contractionName = contractionName.substr(0, 21) + "..."; contractionName = contractionName.substr(0, 21) + '...'; } this.attachmentRecoeds[i]["fileName"] = contractionName; this.attachmentRecoeds[i]["ownerName"] = this.attachmentRecoeds[i]['fileName'] = contractionName; this.attachmentRecoeds[i]['ownerName'] = this.attachmentRecoeds[i].Concc.Owner.Name; this.attachmentRecoeds[i]["downloadUrl"] = "/sfc/servlet.shepherd/document/download/" + this.attachmentRecoeds[i]['downloadUrl'] = '/sfc/servlet.shepherd/document/download/' + this.attachmentRecoeds[i].Concc.ContentDocumentId + "?operationContext=S1"; '?operationContext=S1'; // var date = this.attachmentRecoeds[i].Concc.CreatedDate; // var year = date.getFullYear(); // var month = date.getMonth(); // var day = date.getDay(); // console.log(year+'-'+month+'-'+day); this.attachmentRecoeds[i]["updateDate"] = new Date( Date.parse(this.attachmentRecoeds[i].Concc.CreatedDate) this.attachmentRecoeds[i]['updateDate'] = new Date( Date.parse( this.attachmentRecoeds[i].Concc.CreatedDate ) ).toLocaleString(); this.attachmentRecoeds[i]["attUrl"] = "/" + this.attachmentRecoeds[i].Concc.Id; this.attachmentRecoeds[i]["ownerUrl"] = "/" + this.attachmentRecoeds[i].Concc.OwnerId; this.attachmentRecoeds[i]['attUrl'] = '/' + this.attachmentRecoeds[i].Concc.Id; this.attachmentRecoeds[i]['ownerUrl'] = '/' + this.attachmentRecoeds[i].Concc.OwnerId; } this.errorMsgs = result.errorMsgList; this.warningMsgs = result.warningMsgList; @@ -589,16 +601,20 @@ this.pageType = result.methodType; this.proLimitAndDate = result.proLimitAndDate; console.log( "proLimitAndDate:" + JSON.stringify(this.proLimitAndDate) 'proLimitAndDate:' + JSON.stringify(this.proLimitAndDate) ); this.coc = result.coc; this.cocId = this.coc.Id; if (this.pageType == "hospitalorder" && this.agencyProType != "ET") { if ( this.pageType == 'hospitalorder' && this.agencyProType != 'ET' ) { this.showHospital = true; } if ( this.coc.Order_status__c == "已提交" || this.coc.Order_status__c == "批准" this.coc.Order_status__c == '已提交' || this.coc.Order_status__c == '批准' ) { this.showOrderDate = true; } @@ -610,9 +626,9 @@ this.showOfferPriceInputBtn = true; } if ( this.coc.Order_status__c == "已提交" || this.coc.Order_status__c == "批准" || this.coc.Order_status__c == "驳回" this.coc.Order_status__c == '已提交' || this.coc.Order_status__c == '批准' || this.coc.Order_status__c == '驳回' ) { this.disabledEditBtn = true; this.disabledUploadSheetBtn = true; @@ -636,48 +652,54 @@ (this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice) && this.coc.Order_status__c != "驳回" this.coc.Order_status__c != '驳回' ) { this.showSaveOrderbtn1 = true; } if (this.coc.Order_status__c == "驳回" && this.editAble) { if (this.coc.Order_status__c == '驳回' && this.editAble) { this.showSaveOrderbtn2 = true; } if (this.coc.Order_status__c == "驳回" && !this.editAble) { if (this.coc.Order_status__c == '驳回' && !this.editAble) { this.showReapplyBtn = true; } this.showSpinner = false; this.showPage = true; } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); this.showMyToast("初始化页面失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast( '初始化页面失败', result.errorMsg, 'error' ); } }) .catch((error) => { this.showSpinner = false; console.log("error:" + error); this.showMyToast("初始化页面失败", error, "error"); console.log('error:' + error); this.showMyToast('初始化页面失败', error, 'error'); }); } //排序 onHandleSort(event) { //将已经选好了的放到前面,不进行排序 console.log("sort"); console.log('sort'); if (this.editAble) { const { fieldName: sortedBy, sortDirection } = event.detail; const cloneData = [...this.currentRecord]; cloneData.sort(this.sortBy(sortedBy, sortDirection === "asc" ? 1 : -1)); cloneData.sort( this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1) ); let index = 0; let selectedRows = this.template .querySelector("c-lex-custom-lightning-datatable") .querySelector('c-lex-custom-lightning-datatable') .getSelectedRows(); let selectedRowsIds = []; for (var i in selectedRows) { selectedRowsIds.push(selectedRows[i].recordId); } console.log("selectedRowsIds = " + JSON.stringify(selectedRowsIds)); console.log('selectedRowsIds = ' + JSON.stringify(selectedRowsIds)); for (var i = 0; i < cloneData.length; i++) { if (selectedRowsIds.indexOf(cloneData[i].recordId) != -1) { if (i != 0) { @@ -694,7 +716,9 @@ } else { const { fieldName: sortedBy, sortDirection } = event.detail; const cloneData = [...this.currentRecord]; cloneData.sort(this.sortBy(sortedBy, sortDirection === "asc" ? 1 : -1)); cloneData.sort( this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1) ); this.currentRecord = cloneData; this.sortDirection = sortDirection; this.sortedBy = sortedBy; @@ -751,20 +775,20 @@ category3Change(event) { this.showSpinner = true; this.category3 = event.detail.value; this.category4 = ""; this.category5 = ""; this.category4 = ''; this.category5 = ''; categoryAllload({ agencyProTypeStr: this.agencyProType, category3Str: this.category3 }).then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.category4Option = result.category4Option; this.category5Option = result.category5Option; this.showSpinner = false; } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); this.showMyToast("加载分类失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('加载分类失败', result.errorMsg, 'error'); } }); } @@ -773,20 +797,20 @@ category4Change(event) { this.showSpinner = true; this.category4 = event.detail.value; this.category5 = ""; this.category5 = ''; categoryload({ agencyProTypeStr: this.agencyProType, category3Str: this.category3, category4Str: this.category4 }).then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.category4Option = result.category4Option; this.category5Option = result.category5Option; this.showSpinner = false; } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); this.showMyToast("加载分类失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('加载分类失败', result.errorMsg, 'error'); } }); } @@ -821,7 +845,7 @@ proLimitAndDateList: this.proLimitAndDate }) .then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; this.currentPage = 1; @@ -833,28 +857,28 @@ this.warningMsgs = result.warningMsgList; // this.hasError = result.hasError; // this.hasWarning = result.hasWarning; this.showMyToast("搜索成功", result.errorMsg, "success"); this.showMyToast('搜索成功', result.errorMsg, 'success'); } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); if (result.errorMsg == "没有搜索到相关数据") { this.showMyToast(result.errorMsg, "", "error"); console.log('Error:' + result.errorMsg); if (result.errorMsg == '没有搜索到相关数据') { this.showMyToast(result.errorMsg, '', 'error'); } else { this.showMyToast("搜索失败", result.errorMsg, "error"); this.showMyToast('搜索失败', result.errorMsg, 'error'); } } }) .catch((error) => { console.log("Error:" + error); console.log('Error:' + error); }); } //清除搜索栏 clear(event) { this.category1 = ""; this.category3 = ""; this.category4 = ""; this.category5 = ""; this.category1 = ''; this.category3 = ''; this.category4 = ''; this.category5 = ''; this.showSpinner = true; searchConsumableorderdetails({ userWorkLocationStr: this.userWorkLocation, @@ -877,7 +901,7 @@ ), proLimitAndDateList: this.proLimitAndDate }).then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; this.currentPage = 1; @@ -885,14 +909,14 @@ this.showCurrentReocrd(); this.getAllChecked(); this.showSpinner = false; this.showMyToast("搜索成功", result.errorMsg, "success"); this.showMyToast('搜索成功', result.errorMsg, 'success'); } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); if (result.errorMsg == "没有搜索到相关数据") { this.showMyToast(result.errorMsg, "", "error"); console.log('Error:' + result.errorMsg); if (result.errorMsg == '没有搜索到相关数据') { this.showMyToast(result.errorMsg, '', 'error'); } else { this.showMyToast("搜索失败", result.errorMsg, "error"); this.showMyToast('搜索失败', result.errorMsg, 'error'); } } }); @@ -905,14 +929,16 @@ i < len; i++ ) { this.consumableorderdetailsRecordsview[i].check = event.target.checked; this.consumableorderdetailsRecordsview[i].check = event.target.checked; } } //选择 check(event) { let index = event.target.getAttribute("data-index"); this.consumableorderdetailsRecordsview[index].check = event.target.checked; let index = event.target.getAttribute('data-index'); this.consumableorderdetailsRecordsview[index].check = event.target.checked; } //采购数量change事件 @@ -933,7 +959,7 @@ //保存订单 saveOrder(event) { this.showSpinner = true; console.log("start save"); console.log('start save'); save({ contractNameStr: this.contractName, cocStr: JSON.stringify(this.coc), @@ -951,20 +977,23 @@ OSHFLGStr: this.OSHFLG }).then((result) => { this.showSpinner = false; if (result.result == "Success") { if (result.result == 'Success') { this.esetId = result.eSetId; const config = { type: "standard__webPage", type: 'standard__webPage', attributes: { url: "/lexconsumable?ESetid=" + this.esetId + "&type=" + this.pageType '/lexconsumable?ESetid=' + this.esetId + '&type=' + this.pageType } }; this[NavigationMixin.Navigate](config); } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); this.showMyToast("保存失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('保存失败', result.errorMsg, 'error'); } }); } @@ -988,20 +1017,23 @@ OSHFLGStr: this.OSHFLG }).then((result) => { this.showSpinner = false; if (result.result == "Success") { if (result.result == 'Success') { this.esetId = result.eSetId; const config = { type: "standard__webPage", type: 'standard__webPage', attributes: { url: "/lexconsumable?ESetid=" + this.esetId + "&type=" + this.pageType '/lexconsumable?ESetid=' + this.esetId + '&type=' + this.pageType } }; this[NavigationMixin.Navigate](config); } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); this.showMyToast("保存失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('保存失败', result.errorMsg, 'error'); } }); } @@ -1009,9 +1041,9 @@ //编辑 editOrder(event) { setEditAble({ eSetidStr: this.esetId }).then((result) => { if (result.result == "Success") { if (result.result == 'Success') { const config = { type: "standard__webPage", type: 'standard__webPage', attributes: { url: result.url } @@ -1019,8 +1051,8 @@ this[NavigationMixin.Navigate](config); } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); this.showMyToast("编辑失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('编辑失败', result.errorMsg, 'error'); } }); } @@ -1029,9 +1061,10 @@ printOrder(event) { var site = window.location.origin; const config = { type: "standard__webPage", type: 'standard__webPage', attributes: { url: site + "/consumable/PrintConsumblePDF?ESetid=" + this.esetId url: site + '/consumable/PrintConsumblePDF?ESetid=' + this.esetId } }; this[NavigationMixin.Navigate](config); @@ -1046,9 +1079,9 @@ submitOrder(event) { sorder({ eSetidStr: this.esetId, accountidStr: this.accountid }) .then((result) => { if (result.result == "Success") { if (result.result == 'Success') { const config = { type: "standard__webPage", type: 'standard__webPage', attributes: { url: result.url } @@ -1058,27 +1091,27 @@ this.showSpinner = false; this.errorMsgs = result.errorMsgList; this.warningMsgs = result.warningMsgList; console.log("Error:" + result.errorMsg); if (result.errorMsg.indexOf("请上传订货配置单附件") != -1) { result.errorMsg = "请上传订货配置单附件"; console.log('Error:' + result.errorMsg); if (result.errorMsg.indexOf('请上传订货配置单附件') != -1) { result.errorMsg = '请上传订货配置单附件'; } this.showMyToast("提交失败", result.errorMsg, "error"); this.showMyToast('提交失败', result.errorMsg, 'error'); } }) .catch((error) => { console.log("Error:" + error); console.log('Error:' + error); }); } //删除订单 deleteOrder(event) { if (!window.confirm("删除是不可恢复的,你确认要删除吗?")) { if (!window.confirm('删除是不可恢复的,你确认要删除吗?')) { return; } delConsumable({ eSetidStr: this.esetId }).then((result) => { if (result.result == "Success") { if (result.result == 'Success') { const config = { type: "standard__webPage", type: 'standard__webPage', attributes: { url: result.url } @@ -1086,8 +1119,8 @@ this[NavigationMixin.Navigate](config); } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); this.showMyToast("删除失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('删除失败', result.errorMsg, 'error'); } }); } @@ -1103,7 +1136,11 @@ this.showOfferPriceInputBtn = false; } if ( !(this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice) !( this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice ) ) { this.showPrintSheetBtn = true; this.showUploadSheetBtn = true; @@ -1116,8 +1153,10 @@ this.showDeleteBtn = false; } if ( (this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice) && this.coc.Order_status__c != "驳回" (this.editDelCommitBtnDisabled || this.editAble || this.edoffersPrice) && this.coc.Order_status__c != '驳回' ) { this.showSaveOrderbtn1 = true; } else { @@ -1128,9 +1167,9 @@ //再申请 reapplyOrder(event) { backOrder({ eSetidStr: this.esetId }).then((result) => { if (result.result == "Success") { if (result.result == 'Success') { const config = { type: "standard__webPage", type: 'standard__webPage', attributes: { url: result.url } @@ -1138,8 +1177,8 @@ this[NavigationMixin.Navigate](config); } else { this.showSpinner = false; console.log("Error:" + result.errorMsg); this.showMyToast("再申请失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('再申请失败', result.errorMsg, 'error'); } }); } @@ -1149,16 +1188,16 @@ if (event.target.files.length > 0) { this.filesUploaded = event.target.files; this.fileName = event.target.files[0].name; console.log("this.fileName:" + this.fileName); console.log('this.fileName:' + this.fileName); } } //是否显示附件移除 get attDelBtn() { if ( this.fileName != "" && this.fileName != '' && this.fileName != null && this.fileName != "请选择一个文件上传" this.fileName != '请选择一个文件上传' ) { return true; } else { @@ -1176,7 +1215,7 @@ //移除附件 removeAtt() { this.filesUploaded = []; this.fileName = ""; this.fileName = ''; } //上传附件 @@ -1184,21 +1223,22 @@ if (this.filesUploaded.length > 0) { this.file = this.filesUploaded[0]; if (this.file.size > this.MAX_FILE_SIZE) { window.console.log("文件过大"); window.console.log('文件过大'); return; } this.fileReader = new FileReader(); this.fileReader.onloadend = () => { this.fileContents = this.fileReader.result; let base64 = "base64,"; this.content = this.fileContents.indexOf(base64) + base64.length; let base64 = 'base64,'; this.content = this.fileContents.indexOf(base64) + base64.length; this.fileContents = this.fileContents.substring(this.content); this.saveToFile(); }; this.fileReader.readAsDataURL(this.file); } else { this.fileName = "请选择一个文件上传"; this.fileName = '请选择一个文件上传'; } } @@ -1212,50 +1252,50 @@ }) .then((result) => { this.showPopSpinner = false; if (result.result == "Success") { if (result.result == 'Success') { this.closePop(); window.location.reload(); } else { console.log("Error:" + result.errorMsg); this.showMyToast("上传失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('上传失败', result.errorMsg, 'error'); } }) .catch((error) => { this.showPopSpinner = false; this.showMyToast("上传失败", error, "error"); this.showMyToast('上传失败', error, 'error'); }); } //删除附件 deleteAtt(event) { this.showSpinner = true; var recordId = event.target.getAttribute("data-fileid"); console.log("attid:" + recordId); var recordId = event.target.getAttribute('data-fileid'); console.log('attid:' + recordId); deleteAtt({ contentVersionId: recordId, cocId: this.esetId }) .then((result) => { this.showSpinner = false; if (result.result == "Success") { if (result.result == 'Success') { window.location.reload(); } else { console.log("Error:" + result.errorMsg); this.showMyToast("删除失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('删除失败', result.errorMsg, 'error'); } }) .catch((error) => { this.showSpinner = false; console.log("Error:" + error); this.showMyToast("删除失败", JSON.stringify(error), "error"); console.log('Error:' + error); this.showMyToast('删除失败', JSON.stringify(error), 'error'); }); } //预览附件 previweAtt(event) { var recordId = event.target.getAttribute("data-fileid"); var recordId = event.target.getAttribute('data-fileid'); console.log(recordId); this[NavigationMixin.Navigate]({ type: "standard__namedPage", type: 'standard__namedPage', attributes: { pageName: "filePreview" pageName: 'filePreview' }, state: { recordIds: recordId, @@ -1268,23 +1308,27 @@ showSearchHos(event) { initHospital() .then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.showAttHosPop = true; this.hospitalList = result.attList; for (var i in this.hospitalList) { if (this.hospitalList[i].State_Master__c) { this.hospitalList[i]["StateMaster"] = this.hospitalList[i]['StateMaster'] = this.hospitalList[i].State_Master__r.Name; } } } else { console.log("Error:" + result.errorMsg); this.showMyToast("初始化检索医院页面失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast( '初始化检索医院页面失败', result.errorMsg, 'error' ); } }) .catch((error) => { console.log("Error:" + error); this.showMyToast("初始化检索医院页面失败", error, "error"); console.log('Error:' + error); this.showMyToast('初始化检索医院页面失败', error, 'error'); }); } @@ -1295,22 +1339,22 @@ accountId: this.accountid }) .then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.hospitalList = result.attList; for (var i in this.hospitalList) { if (this.hospitalList[i].State_Master__c) { this.hospitalList[i]["StateMaster"] = this.hospitalList[i]['StateMaster'] = this.hospitalList[i].State_Master__r.Name; } } } else { console.log("Error:" + result.errorMsg); this.showMyToast("搜索失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('搜索失败', result.errorMsg, 'error'); } }) .catch((error) => { console.log("Error:" + error); this.showMyToast("搜索失败", error, "error"); console.log('Error:' + error); this.showMyToast('搜索失败', error, 'error'); }); } @@ -1322,8 +1366,8 @@ //关闭弹窗 closeHospitalPop() { this.showAttHosPop = false; this.chooseHospital = ""; this.chooseHospitalId = ""; this.chooseHospital = ''; this.chooseHospitalId = ''; } // //选择医院 @@ -1347,14 +1391,14 @@ const row = event.detail.row; this.chooseHospitalId = row.Id; this.chooseHospital = row.Name; console.log("row.Id:" + row.Id); console.log("row.Name:" + row.Name); console.log('row.Id:' + row.Id); console.log('row.Name:' + row.Name); this.confirmHospital(); } //确认选择医院 confirmHospital() { if (this.chooseHospital != "" && this.chooseHospital != null) { if (this.chooseHospital != '' && this.chooseHospital != null) { this.hospitalId = this.chooseHospitalId; this.tempidHp = this.chooseHospitalId; this.hospitalName = this.chooseHospital; @@ -1362,12 +1406,12 @@ //消除警告 var arr = []; for (var i in this.warningMsgs) { if (this.warningMsgs[i] != "请选择医院") { if (this.warningMsgs[i] != '请选择医院') { arr.push(this.warningMsgs[i]); } } this.warningMsgs = arr; if (this.tempidHp != "tempId" && this.tempidHp != "") { if (this.tempidHp != 'tempId' && this.tempidHp != '') { searchorderdetails({ methodTypeStr: this.pageType, accountIdStr: this.accountid, @@ -1379,31 +1423,39 @@ editAbleStr: this.editAble }) .then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; this.currentPage = 1; this.currentRecord = []; this.showCurrentReocrd(); this.getAllChecked(); this.showMyToast("搜索成功", result.errorMsg, "success"); this.showMyToast( '搜索成功', result.errorMsg, 'success' ); } else { console.log("Error:" + result.errorMsg); if (result.errorMsg == "没有搜索到相关数据") { this.showMyToast(result.errorMsg, "", "error"); console.log('Error:' + result.errorMsg); if (result.errorMsg == '没有搜索到相关数据') { this.showMyToast(result.errorMsg, '', 'error'); } else { this.showMyToast("搜索产品失败", result.errorMsg, "error"); this.showMyToast( '搜索产品失败', result.errorMsg, 'error' ); } } }) .catch((error) => { console.log("Error:" + error); this.showMyToast("搜索产品失败", error, "error"); console.log('Error:' + error); this.showMyToast('搜索产品失败', error, 'error'); }); this.tempidHp = "tempId"; this.tempidHp = 'tempId'; } } else { this.showMyToast("请选择医院", "", "error"); this.showMyToast('请选择医院', '', 'error'); } } @@ -1411,23 +1463,27 @@ showSearchCon() { initContract({ ctype: this.agencyProType1 }) .then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.showConPop = true; this.contractList = result.attList; for (var i in this.contractList) { if (this.contractList[i].State_Master__c) { this.contractList[i]["StateMaster"] = this.contractList[i]['StateMaster'] = this.contractList[i].State_Master__r.Name; } } } else { console.log("Error:" + result.errorMsg); this.showMyToast("初始化检索合同页面失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast( '初始化检索合同页面失败', result.errorMsg, 'error' ); } }) .catch((error) => { console.log("Error:" + error); this.showMyToast("初始化检索合同页面失败", error, "error"); console.log('Error:' + error); this.showMyToast('初始化检索合同页面失败', error, 'error'); }); } @@ -1440,22 +1496,22 @@ OSHFLGStr: this.OSHFLG }) .then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.contractList = result.attList; for (var i in this.contractList) { if (this.contractList[i].State_Master__c) { this.contractList[i]["StateMaster"] = this.contractList[i]['StateMaster'] = this.contractList[i].State_Master__r.Name; } } } else { console.log("Error:" + result.errorMsg); this.showMyToast("搜索失败", result.errorMsg, "error"); console.log('Error:' + result.errorMsg); this.showMyToast('搜索失败', result.errorMsg, 'error'); } }) .catch((error) => { console.log("Error:" + error); this.showMyToast("搜索失败", error, "error"); console.log('Error:' + error); this.showMyToast('搜索失败', error, 'error'); }); } @@ -1466,8 +1522,8 @@ //关闭弹窗 closeContractPop() { this.showConPop = false; this.chooseContract = ""; this.chooseContractId = ""; this.chooseContract = ''; this.chooseContractId = ''; } //选择合同 @@ -1483,23 +1539,23 @@ const row = event.detail.row; this.chooseContractId = row.Id; this.chooseContract = row.Name; console.log("row.Id:" + row.Id); console.log("row.Name:" + row.Name); console.log('row.Id:' + row.Id); console.log('row.Name:' + row.Name); this.confirmContract(); } //确认选择合同 confirmContract() { if (this.chooseContract != "" && this.chooseContract != null) { if (this.chooseContract != '' && this.chooseContract != null) { this.contractId = this.chooseContractId; this.tempidPp = this.chooseContractId; this.contractName = this.chooseContract; this.closeContractPop(); if ( this.tempidPp != "tempId" && this.tempidPp != "" && this.contractId != "" && this.pageType == "promotionorder" this.tempidPp != 'tempId' && this.tempidPp != '' && this.contractId != '' && this.pageType == 'promotionorder' ) { searchorderdetails({ methodTypeStr: this.pageType, @@ -1512,51 +1568,63 @@ editAbleStr: this.editAble }) .then((result) => { if (result.result == "Success") { if (result.result == 'Success') { this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; this.currentPage = 1; this.currentRecord = []; this.showCurrentReocrd(); this.getAllChecked(); this.showMyToast("搜索成功", result.errorMsg, "success"); this.showMyToast( '搜索成功', result.errorMsg, 'success' ); } else { console.log("Error:" + result.errorMsg); if (result.errorMsg == "没有搜索到相关数据") { this.showMyToast(result.errorMsg, "", "error"); console.log('Error:' + result.errorMsg); if (result.errorMsg == '没有搜索到相关数据') { this.showMyToast(result.errorMsg, '', 'error'); } else { this.showMyToast("搜索产品失败", result.errorMsg, "error"); this.showMyToast( '搜索产品失败', result.errorMsg, 'error' ); } } }) .catch((error) => { console.log("Error:" + error); this.showMyToast("搜索产品失败", error, "error"); console.log('Error:' + error); this.showMyToast('搜索产品失败', error, 'error'); }); this.tempidPp = "tempId"; this.tempidPp = 'tempId'; } } else { this.showMyToast("请选择合同", "", "error"); this.showMyToast('请选择合同', '', '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 != "") { if (message != '') { content = "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>"; '<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") .querySelector('c-common-toast') .showToast(variant, content, iconName, 10000); // var mode; // if(this.isNoteStay){ @@ -1577,14 +1645,15 @@ showCurrentReocrd() { var startIndex = 0; var endIndex = 0; console.log("len:" + this.consumableorderdetailsRecordsview.length); console.log('len:' + this.consumableorderdetailsRecordsview.length); if ( this.consumableorderdetailsRecordsview != null && this.consumableorderdetailsRecordsview.length > 0 ) { var currentRecord = []; var currentCount = 0; var mu = this.consumableorderdetailsRecordsview.length % this.pageSize; var mu = this.consumableorderdetailsRecordsview.length % this.pageSize; if (this.currentPage == this.totalPage) { if (mu != 0) { currentCount = mu; @@ -1594,14 +1663,14 @@ } else { currentCount = this.pageSize; } console.log("this.totalPage:" + this.totalPage); console.log("this.pageSize:" + this.pageSize); console.log("mu:" + mu); console.log("currentCount:" + currentCount); console.log('this.totalPage:' + this.totalPage); console.log('this.pageSize:' + this.pageSize); console.log('mu:' + mu); console.log('currentCount:' + currentCount); startIndex = (this.currentPage - 1) * this.pageSize; endIndex = parseInt(startIndex) + parseInt(currentCount) - 1; console.log("startIndex:" + startIndex); console.log("endIndex:" + endIndex); console.log('startIndex:' + startIndex); console.log('endIndex:' + endIndex); if (this.editAble) { for (var i in this.currentRecord) { if (this.currentRecord[i].check) { @@ -1620,7 +1689,9 @@ } } if (count == 0) { currentRecord.push(this.consumableorderdetailsRecordsview[i]); currentRecord.push( this.consumableorderdetailsRecordsview[i] ); } } this.recordStart = startIndex + 1; @@ -1641,14 +1712,18 @@ } get totalPage() { if (this.consumableorderdetailsRecordsview.length % this.pageSize == 0) { if ( this.consumableorderdetailsRecordsview.length % this.pageSize == 0 ) { return Math.trunc( this.consumableorderdetailsRecordsview.length / this.pageSize ); } else { return ( Math.trunc( this.consumableorderdetailsRecordsview.length / this.pageSize this.consumableorderdetailsRecordsview.length / this.pageSize ) + 1 ); } @@ -1684,7 +1759,7 @@ //page size change pageSizeChange(event) { console.log("pagesize:" + event.detail); console.log('pagesize:' + event.detail); this.pageSize = event.detail; this.currentPage = 1; this.currentRecord = []; force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
@@ -1,27 +1,27 @@ import { LightningElement, wire, api, track } from "lwc"; import { ShowToastEvent } from "lightning/platformShowToastEvent"; import init from "@salesforce/apex/LexConsumableAccountController.init"; import changeFiscalYearView from "@salesforce/apex/LexConsumableAccountController.changeFiscalYearView"; import changelistView from "@salesforce/apex/LexConsumableAccountController.changelistView"; import accountInit from "@salesforce/apex/LexConsumableAccountInfoController.init"; import { LightningElement, wire, api, track } from 'lwc'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import init from '@salesforce/apex/LexConsumableAccountController.init'; import changeFiscalYearView from '@salesforce/apex/LexConsumableAccountController.changeFiscalYearView'; import changelistView from '@salesforce/apex/LexConsumableAccountController.changelistView'; import accountInit from '@salesforce/apex/LexConsumableAccountInfoController.init'; //table css import { loadStyle } from "lightning/platformResourceLoader"; import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable"; import { loadStyle } from 'lightning/platformResourceLoader'; import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable'; const columns = [ { label: "客户名", fieldName: "NameUrl", label: '客户名', fieldName: 'NameUrl', hideDefaultActions: true, wrapText: true, initialWidth: 200, sortable: true, type: "url", type: 'url', typeAttributes: { label: { fieldName: "Name" fieldName: 'Name' }, target: "_blank" target: '_blank' } }, // { @@ -39,36 +39,36 @@ // }, // }, { label: "省", fieldName: "StateMasterName", label: '省', fieldName: 'StateMasterName', hideDefaultActions: true, wrapText: true, sortable: true }, { label: "销售本部医院", fieldName: "Salesdepartment_HP__c", label: '销售本部医院', fieldName: 'Salesdepartment_HP__c', hideDefaultActions: true, sortable: true, wrapText: true }, { label: "创建日期", fieldName: "CreatedDate", label: '创建日期', fieldName: 'CreatedDate', hideDefaultActions: true, sortable: true, wrapText: true, type: "date", type: 'date', typeAttributes: { timeZone: "Asia/Shanghai", day: "numeric", month: "numeric", year: "numeric" timeZone: 'Asia/Shanghai', day: 'numeric', month: 'numeric', year: 'numeric' } }, { label: "有效/无效", fieldName: "Is_Active__c", label: '有效/无效', fieldName: 'Is_Active__c', hideDefaultActions: true, sortable: true, wrapText: true @@ -82,8 +82,8 @@ // initialWidth: 130, // }, { label: "政府等级", fieldName: "Grade__c", label: '政府等级', fieldName: 'Grade__c', hideDefaultActions: true, sortable: true, wrapText: true @@ -110,22 +110,22 @@ // }, // }, { label: "市", fieldName: "CityMasterName", label: '市', fieldName: 'CityMasterName', hideDefaultActions: true, sortable: true, wrapText: true }, { label: "县/区", fieldName: "Town__c", label: '县/区', fieldName: 'Town__c', hideDefaultActions: true, sortable: true, wrapText: true }, { label: "客户电话", fieldName: "Phone", label: '客户电话', fieldName: 'Phone', hideDefaultActions: true, sortable: true, wrapText: true @@ -134,15 +134,15 @@ const topColumns = [ { label: "客户名", label: '客户名', hideDefaultActions: true, fieldName: "accountName", fieldName: 'accountName', wrapText: true, type: "customShowAccountUrl", type: 'customShowAccountUrl', typeAttributes: { accountName: { fieldName: "accountName" }, accountUrl: { fieldName: "accountUrl" }, isDisable: { fieldName: "isDisable" } accountName: { fieldName: 'accountName' }, accountUrl: { fieldName: 'accountUrl' }, isDisable: { fieldName: 'isDisable' } } }, // { @@ -158,34 +158,34 @@ // }, // }, { label: "市", fieldName: "CityMasterName", label: '市', fieldName: 'CityMasterName', hideDefaultActions: true, wrapText: true }, { label: "县/区", fieldName: "Town__c", label: '县/区', fieldName: 'Town__c', hideDefaultActions: true, wrapText: true }, { label: "销量占比", fieldName: "proportion", label: '销量占比', fieldName: 'proportion', hideDefaultActions: true, wrapText: true, initialWidth: 100, cellAttributes: { alignment: "right" } cellAttributes: { alignment: 'right' } }, { label: "操作", fieldName: "Town__c", type: "weeklyReport", label: '操作', fieldName: 'Town__c', type: 'weeklyReport', initialWidth: 150, typeAttributes: { recordId: { fieldName: "Id" }, hospitalName: { fieldName: "Name" }, isShowButton: { fieldName: "isShowButton" } recordId: { fieldName: 'Id' }, hospitalName: { fieldName: 'Name' }, isShowButton: { fieldName: 'isShowButton' } }, hideDefaultActions: true } @@ -195,13 +195,13 @@ topColumns = topColumns; @track isShowSpinner = false; @track pageRecords = []; @track accountId = ""; @track agencyProType = ""; @track agencyProTypestr = ""; @track accountId = ''; @track agencyProType = ''; @track agencyProTypestr = ''; @track listViewOptions = [ { label: "01. 医院_Hospital", value: "01. 医院_Hospital" label: '01. 医院_Hospital', value: '01. 医院_Hospital' }, // { // label: "61. 医院_Hospital草案中的医院", @@ -212,22 +212,22 @@ // value: "62. 医院_Hospital申请中的医院", // }, { label: "63. 医院_Hospital上周创建的医院", value: "63. 医院_Hospital上周创建的医院" label: '63. 医院_Hospital上周创建的医院', value: '63. 医院_Hospital上周创建的医院' } ]; @track viewOption = "01. 医院_Hospital"; @track viewOption = '01. 医院_Hospital'; @track isShowAccountInfo = false; @track topAccountData = []; //前端排序 defaultSortDirection = "asc"; sortDirection = "asc"; defaultSortDirection = 'asc'; sortDirection = 'asc'; sortedBy; //分页start @track sortBy = ""; @track sortBy = ''; @track pageSize = 10; error; records; @@ -243,59 +243,59 @@ @track recordEnd = 0; //end @track AccId = ""; @track printUrl = ""; @track AccId = ''; @track printUrl = ''; @track accountDataInfo = { name: "", ownerName: "", site: "", isActive: "", aliasName2: "", banOnUseReason: "", grade: "", attributeType: "", oCMCategory: "", specialityType: "", stateMasterName: "", phone: "", cityMasterName: "", phoneCall: "", town: "", fax: "", street: "", postalCode: "", address: "", parentName: "" name: '', ownerName: '', site: '', isActive: '', aliasName2: '', banOnUseReason: '', grade: '', attributeType: '', oCMCategory: '', specialityType: '', stateMasterName: '', phone: '', cityMasterName: '', phoneCall: '', town: '', fax: '', street: '', postalCode: '', address: '', parentName: '' }; stylesLoaded = false; //财年 @track fiscalYearOptions = [ { label: "本财年", value: "thisYear" }, { label: "上一财年", value: "lastYear" }, { label: "上一财年+本财年", value: "allYear" } { label: '本财年', value: 'thisYear' }, { label: '上一财年', value: 'lastYear' }, { label: '上一财年+本财年', value: 'allYear' } ]; @track fiscalYearOption = "thisYear"; @track fiscalYearOption = 'thisYear'; @track topInfo = []; renderedCallback() { if (!this.stylesLoaded) { Promise.all([loadStyle(this, WrappedHeaderTable)]) .then(() => { console.log("Custom styles loaded"); console.log('Custom styles loaded'); this.stylesLoaded = true; }) .catch((error) => { console.error("Error loading custom styles"); console.error('Error loading custom styles'); }); } } //获取链接参数 getQueryString(name) { console.log("getQueryString name " + name); let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); console.log('getQueryString name ' + name); let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); let r = window.location.search.substr(1).match(reg); if (r != null) { return decodeURIComponent(r[2]); @@ -305,63 +305,77 @@ connectedCallback() { this.isShowSpinner = true; this.AccId = this.getQueryString("AccId"); this.AccId = this.AccId == null ? "" : this.AccId; if (this.AccId != "") { console.log("this.AccId = " + this.AccId); this.AccId = this.getQueryString('AccId'); this.AccId = this.AccId == null ? '' : this.AccId; if (this.AccId != '') { console.log('this.AccId = ' + this.AccId); accountInit({ accId: this.AccId }) .then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { console.log("r.entity.obj = " + JSON.stringify(r.entity.obj)); console.log('r = ' + JSON.stringify(r)); if (r.status == 'Success') { console.log( 'r.entity.obj = ' + JSON.stringify(r.entity.obj) ); this.accountDataInfo.name = r.entity.obj.Name; this.accountDataInfo.ownerName = r.entity.obj.Owner == null ? "" : r.entity.obj.Owner.Name; r.entity.obj.Owner == null ? '' : r.entity.obj.Owner.Name; this.accountDataInfo.site = r.entity.obj.site; this.accountDataInfo.isActive = r.entity.obj.Is_Active__c; this.accountDataInfo.aliasName2 = r.entity.obj.Alias_Name2__c; this.accountDataInfo.isActive = r.entity.obj.Is_Active__c; this.accountDataInfo.aliasName2 = r.entity.obj.Alias_Name2__c; this.accountDataInfo.banOnUseReason = r.entity.obj.Ban_On_Use_Reason__c; this.accountDataInfo.grade = r.entity.obj.Grade__c; this.accountDataInfo.attributeType = r.entity.obj.Attribute_Type__c; this.accountDataInfo.oCMCategory = r.entity.obj.OCM_Category__c; this.accountDataInfo.attributeType = r.entity.obj.Attribute_Type__c; this.accountDataInfo.oCMCategory = r.entity.obj.OCM_Category__c; this.accountDataInfo.specialityType = r.entity.obj.Speciality_Type__c; this.accountDataInfo.stateMasterName = r.entity.obj.State_Master__r == null ? "" ? '' : r.entity.obj.State_Master__r.Name; this.accountDataInfo.phone = r.entity.obj.Phone; this.accountDataInfo.cityMasterName = r.entity.obj.City_Master__r == null ? "" ? '' : r.entity.obj.City_Master__r.Name; this.accountDataInfo.phoneCall = r.entity.obj.PhoneCall__c; this.accountDataInfo.phoneCall = r.entity.obj.PhoneCall__c; this.accountDataInfo.town = r.entity.obj.Town__c; this.accountDataInfo.fax = r.entity.obj.Fax; this.accountDataInfo.street = r.entity.obj.Street__c; this.accountDataInfo.postalCode = r.entity.obj.Postal_Code__c; this.accountDataInfo.postalCode = r.entity.obj.Postal_Code__c; this.accountDataInfo.address = r.entity.obj.Address__c; this.accountDataInfo.parentName = r.entity.obj.Parent == null ? "" : r.entity.obj.Parent.Name; r.entity.obj.Parent == null ? '' : r.entity.obj.Parent.Name; console.log( "this.accountDataInfo = " + JSON.stringify(this.accountDataInfo) 'this.accountDataInfo = ' + JSON.stringify(this.accountDataInfo) ); this.printUrl = "/lexconsumableaccountinfoprint?AccId=" + this.AccId; '/lexconsumableaccountinfoprint?AccId=' + this.AccId; this.isShowAccountInfo = true; this.isShowSpinner = false; } else { console.log("r = " + JSON.stringify(r)); this.showMyToast("Error", r.msg, "Error"); console.log('r = ' + JSON.stringify(r)); this.showMyToast('Error', r.msg, 'Error'); } }) .catch((error) => { console.log("error = " + JSON.stringify(error)); this.showMyToast("Error", "初始化失败", "Error"); console.log('error = ' + JSON.stringify(error)); this.showMyToast('Error', '初始化失败', 'Error'); }); } else { init({ @@ -371,151 +385,166 @@ }) .then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { console.log('r = ' + JSON.stringify(r)); if (r.status == 'Success') { //分页 this.nextPageToken = r.entity.paginatedAccounts.nextPageToken; this.totalRecords = r.entity.paginatedAccounts.totalRecords; this.recordStart = r.entity.paginatedAccounts.recordStart; this.nextPageToken = r.entity.paginatedAccounts.nextPageToken; this.totalRecords = r.entity.paginatedAccounts.totalRecords; this.recordStart = r.entity.paginatedAccounts.recordStart; this.recordEnd = r.entity.paginatedAccounts.recordEnd; this.totalPages = Math.ceil( r.entity.paginatedAccounts.totalRecords / this.pageSize r.entity.paginatedAccounts.totalRecords / this.pageSize ); console.log("this.totalPages = " + this.totalPages); this.paginationVisibility = this.totalPages > 1 ? true : false; console.log('this.totalPages = ' + this.totalPages); this.paginationVisibility = this.totalPages > 1 ? true : false; this.pageRecords = r.entity.pageRecords; this.accountId = r.entity.accountId; this.agencyProType = r.entity.agencyProType; this.agencyProTypestr = r.entity.agencyProTypestr; console.log("this.agencyProTypestr = " + this.agencyProTypestr); console.log( 'this.agencyProTypestr = ' + this.agencyProTypestr ); for (var i in this.pageRecords) { this.pageRecords[i]["Is_Active__c"] = this.pageRecords[ i ].Is_Active__c.replace("効", "效"); this.pageRecords[i]["NameUrl"] = "/s/lexconsumableaccount?AccId=" + this.pageRecords[i].Id; this.pageRecords[i]["StateMasterName"] = this.pageRecords[i]['Is_Active__c'] = this.pageRecords[i].Is_Active__c.replace( '効', '效' ); this.pageRecords[i]['NameUrl'] = '/s/lexconsumableaccount?AccId=' + this.pageRecords[i].Id; this.pageRecords[i]['StateMasterName'] = this.pageRecords[i].State_Master__r.Name; this.pageRecords[i]["StateMasterUrl"] = "/" + this.pageRecords[i].State_Master__c; this.pageRecords[i]["CityMasterName"] = this.pageRecords[i]['StateMasterUrl'] = '/' + this.pageRecords[i].State_Master__c; this.pageRecords[i]['CityMasterName'] = this.pageRecords[i].City_Master__r.Name; this.pageRecords[i]["CityMasterNameUrl"] = "/" + this.pageRecords[i].City_Master__c; this.pageRecords[i]["RecordTypeName"] = this.pageRecords[i]['CityMasterNameUrl'] = '/' + this.pageRecords[i].City_Master__c; this.pageRecords[i]['RecordTypeName'] = this.pageRecords[i].RecordType.Name; } console.log( "this.listViewOptions = " + JSON.stringify(this.listViewOptions) 'this.listViewOptions = ' + JSON.stringify(this.listViewOptions) ); console.log( "r.entity.topInfo = " + JSON.stringify(r.entity.topInfo) 'r.entity.topInfo = ' + JSON.stringify(r.entity.topInfo) ); //top10客户 this.topInfo = r.entity.topInfo; console.log("this.topInfo = " + JSON.stringify(this.topInfo)); console.log( 'this.topInfo = ' + JSON.stringify(this.topInfo) ); this.topAccountData = this.topInfo.acList; console.log( "this.topAccountData = " + JSON.stringify(this.topAccountData) 'this.topAccountData = ' + JSON.stringify(this.topAccountData) ); console.log( "9/3 = " + this.keepTwoDecimalStr(this.amend(9, 3, "/").toFixed(2)) '9/3 = ' + this.keepTwoDecimalStr( this.amend(9, 3, '/').toFixed(2) ) ); let total = 100; try { for (var i in this.topAccountData) { this.topAccountData[i]["accountName"] = this.topAccountData[i]['accountName'] = this.topAccountData[i].Name; this.topAccountData[i]["accountUrl"] = "/s/lexconsumableaccount?AccId=" + this.topAccountData[i].Id; this.topAccountData[i]["isDisable"] = false; this.topAccountData[i]["StateMasterName"] = this.topAccountData[i]['accountUrl'] = '/s/lexconsumableaccount?AccId=' + this.topAccountData[i].Id; this.topAccountData[i]['isDisable'] = false; this.topAccountData[i]['StateMasterName'] = this.topAccountData[i].State_Master__r.Name; this.topAccountData[i]["StateMasterUrl"] = "/" + this.topAccountData[i].State_Master__c; this.topAccountData[i]["CityMasterName"] = this.topAccountData[i]['StateMasterUrl'] = '/' + this.topAccountData[i].State_Master__c; this.topAccountData[i]['CityMasterName'] = this.topAccountData[i].City_Master__r.Name; this.topAccountData[i]["CityMasterNameUrl"] = "/" + this.topAccountData[i].City_Master__c; this.topAccountData[i]["RecordTypeName"] = this.topAccountData[i]['CityMasterNameUrl'] = '/' + this.topAccountData[i].City_Master__c; this.topAccountData[i]['RecordTypeName'] = this.topAccountData[i].RecordType.Name; this.topAccountData[i]["isShowButton"] = true; this.topAccountData[i]['isShowButton'] = true; let number = this.keepTwoDecimalStr( ( this.amend( this.topInfo.deList[i], this.topInfo.saleAmount, "/" '/' ) * 100 ).toFixed(2) ); console.log( "this.amend = " + this.amend( this.topInfo.deList[i], this.topInfo.saleAmount, "/" ) * 100 ); console.log('this.amend = ' + this.amend(this.topInfo.deList[i],this.topInfo.saleAmount,'/') * 100); total -= number; this.topAccountData[i]["proportion"] = number + "%"; this.topAccountData[i]['proportion'] = number + '%'; } console.log( "this.topAccountData = " + JSON.stringify(this.topAccountData) 'this.topAccountData = ' + JSON.stringify(this.topAccountData) ); //其他 console.log( "(total.toFixed(2) > 0.00 ? total.toFixed(2) : 0.00) = " + (total.toFixed(2) > 0.0 ? total.toFixed(2) : "0.00") ); console.log('(total.toFixed(2) > 0.00 ? total.toFixed(2) : 0.00) = ' + (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00')) if (total != 100) { this.topAccountData.push({ accountName: "...", accountUrl: "/s/lexconsumableaccount", accountName: '...', accountUrl: '/s/lexconsumableaccount', isDisable: true, proportion: (total.toFixed(2) > 0.0 ? total.toFixed(2) : "0.00") + "%", CityMasterName: "...", CityMasterNameUrl: "/lexconsumableaccount", Town__c: "...", proportion: (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00') + '%', CityMasterName: '...', CityMasterNameUrl: '/lexconsumableaccount', Town__c: '...', isShowButton: false }); } else { let title = ""; let title = ''; for (var key in this.fiscalYearOptions) { if ( this.fiscalYearOption == this.fiscalYearOptions[key].value this.fiscalYearOption == this.fiscalYearOptions[key].value ) title = this.fiscalYearOptions[key].label; title = this.fiscalYearOptions[key].label; } this.showMyToast(title, "无数据", "Error"); this.showMyToast(title, '无数据', 'Error'); } this.isShowSpinner = false; } catch (error) { console.log("error = " + error.message); console.log('error = ' + error.message); } } else { console.log("r = " + JSON.stringify(r)); this.showMyToast("Error", r.msg, "Error"); console.log('r = ' + JSON.stringify(r)); this.showMyToast('Error', r.msg, 'Error'); } }) .catch((error) => { console.log("error = " + JSON.stringify(error)); this.showMyToast("Error", "销量前十客户初始化失败", "Error"); console.log('error = ' + JSON.stringify(error)); this.showMyToast( 'Error', '销量前十客户初始化失败', 'Error' ); }); } } amend(num1, num2, symbol) { console.log("num1 = " + num1); console.log("num2 = " + num2); console.log("symbol = " + symbol); console.log('num1 = ' + num1); console.log('num2 = ' + num2); console.log('symbol = ' + symbol); var str1 = num1.toString(), str2 = num2.toString(), result, @@ -523,28 +552,28 @@ str2Length; //解决整数没有小数点方法 try { str1Length = str1.split(".")[1].length; str1Length = str1.split('.')[1].length; } catch (error) { str1Length = 0; } try { str2Length = str2.split(".")[1].length; str2Length = str2.split('.')[1].length; } catch (error) { str2Length = 0; } var step = Math.pow(10, Math.max(str1Length, str2Length)); console.log(step); switch (symbol) { case "+": case '+': result = (num1 * step + num2 * step) / step; break; case "-": case '-': result = (num1 * step - num2 * step) / step; break; case "*": case '*': result = (num1 * step * (num2 * step)) / step / step; break; case "/": case '/': result = (num1 * step) / (num2 * step); break; default: @@ -556,27 +585,27 @@ keepTwoDecimalStr(num) { const result = Number(num.toString().match(/^\d+(?:\.\d{0,2})?/)); let s = result.toString(); let rs = s.indexOf("."); let rs = s.indexOf('.'); if (rs < 0) { rs = s.length; s += "."; s += '.'; } while (s.length <= rs + 2) { s += "0"; s += '0'; } return s; } dataChange(event) { let fieldName = event.target.getAttribute("data-field"); let fieldName = event.target.getAttribute('data-field'); let value = event.detail.value; console.log("fieldName = " + fieldName + " value = " + value); console.log('fieldName = ' + fieldName + ' value = ' + value); switch (fieldName) { case "viewOption": case 'viewOption': this.viewOption = value; this.changelistView(); break; case "fiscalYearOption": case 'fiscalYearOption': this.fiscalYearOption = value; this.changeFiscalYear(); break; @@ -590,77 +619,84 @@ }) .then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { console.log('r = ' + JSON.stringify(r)); if (r.status == 'Success') { //top10客户 this.topInfo = r.entity.topInfo; console.log("this.topInfo = " + JSON.stringify(this.topInfo)); console.log( 'this.topInfo = ' + JSON.stringify(this.topInfo) ); this.topAccountData = this.topInfo.acList; console.log( "this.topAccountData = " + JSON.stringify(this.topAccountData) 'this.topAccountData = ' + JSON.stringify(this.topAccountData) ); let total = 100; for (var i in this.topAccountData) { console.log("i = " + i); this.topAccountData[i]["accountName"] = this.topAccountData[i].Name; this.topAccountData[i]["accountUrl"] = "/s/lexconsumableaccount?AccId=" + this.topAccountData[i].Id; this.topAccountData[i]["isDisable"] = false; this.topAccountData[i]["StateMasterName"] = console.log('i = ' + i); this.topAccountData[i]['accountName'] = this.topAccountData[i].Name; this.topAccountData[i]['accountUrl'] = '/s/lexconsumableaccount?AccId=' + this.topAccountData[i].Id; this.topAccountData[i]['isDisable'] = false; this.topAccountData[i]['StateMasterName'] = this.topAccountData[i].State_Master__r.Name; this.topAccountData[i]["StateMasterUrl"] = "/" + this.topAccountData[i].State_Master__c; this.topAccountData[i]["CityMasterName"] = this.topAccountData[i]['StateMasterUrl'] = '/' + this.topAccountData[i].State_Master__c; this.topAccountData[i]['CityMasterName'] = this.topAccountData[i].City_Master__r.Name; this.topAccountData[i]["CityMasterNameUrl"] = "/" + this.topAccountData[i].City_Master__c; this.topAccountData[i]["RecordTypeName"] = this.topAccountData[i]['CityMasterNameUrl'] = '/' + this.topAccountData[i].City_Master__c; this.topAccountData[i]['RecordTypeName'] = this.topAccountData[i].RecordType.Name; this.topAccountData[i]["isShowButton"] = true; this.topAccountData[i]['isShowButton'] = true; let number = this.keepTwoDecimalStr( ( this.amend( this.topInfo.deList[i], this.topInfo.saleAmount, "/" '/' ) * 100 ).toFixed(2) ); total -= number; this.topAccountData[i]["proportion"] = number + "%"; this.topAccountData[i]['proportion'] = number + '%'; } // //其他 if (total != 100) { this.topAccountData.push({ accountName: "...", accountUrl: "/s/lexconsumableaccount", accountName: '...', accountUrl: '/s/lexconsumableaccount', isDisable: true, proportion: (total.toFixed(2) > 0.0 ? total.toFixed(2) : "0.00") + "%", CityMasterName: "...", CityMasterNameUrl: "/lexconsumableaccount", Town__c: "...", proportion: (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00') + '%', CityMasterName: '...', CityMasterNameUrl: '/lexconsumableaccount', Town__c: '...', isShowButton: false }); } else { let title = ""; let title = ''; for (var key in this.fiscalYearOptions) { if (this.fiscalYearOption == this.fiscalYearOptions[key].value) if ( this.fiscalYearOption == this.fiscalYearOptions[key].value ) title = this.fiscalYearOptions[key].label; } this.showMyToast(title, "无数据", "Error"); this.showMyToast(title, '无数据', 'Error'); } this.isShowSpinner = false; } else { console.log("r = " + JSON.stringify(r)); this.showMyToast("Error", r.msg, "Error"); console.log('r = ' + JSON.stringify(r)); this.showMyToast('Error', r.msg, 'Error'); } }) .catch((error) => { console.log("error = " + JSON.stringify(error)); this.showMyToast("Error", "销量前十客户初始化失败", "Error"); console.log('error = ' + JSON.stringify(error)); this.showMyToast('Error', '销量前十客户初始化失败', 'Error'); }); } @@ -677,66 +713,75 @@ }) .then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { console.log('r = ' + JSON.stringify(r)); if (r.status == 'Success') { //分页 this.nextPageToken = r.entity.paginatedAccounts.nextPageToken; this.nextPageToken = r.entity.paginatedAccounts.nextPageToken; this.totalRecords = r.entity.paginatedAccounts.totalRecords; this.recordStart = r.entity.paginatedAccounts.recordStart; this.recordEnd = r.entity.paginatedAccounts.recordEnd; this.totalPages = Math.ceil( r.entity.paginatedAccounts.totalRecords / this.pageSize ); console.log("this.totalPages = " + this.totalPages); this.paginationVisibility = this.totalPages > 1 ? true : false; console.log('this.totalPages = ' + this.totalPages); this.paginationVisibility = this.totalPages > 1 ? true : false; this.pageRecords = r.entity.pageRecords; console.log("this.pageRecords = " + JSON.stringify(this.pageRecords)); console.log( 'this.pageRecords = ' + JSON.stringify(this.pageRecords) ); for (var i in this.pageRecords) { this.pageRecords[i]["Is_Active__c"] = this.pageRecords[ this.pageRecords[i]['Is_Active__c'] = this.pageRecords[ i ].Is_Active__c.replace("効", "效"); this.pageRecords[i]["NameUrl"] = "/s/lexconsumableaccount?AccId=" + this.pageRecords[i].Id; this.pageRecords[i]["StateMasterName"] = ].Is_Active__c.replace('効', '效'); this.pageRecords[i]['NameUrl'] = '/s/lexconsumableaccount?AccId=' + this.pageRecords[i].Id; this.pageRecords[i]['StateMasterName'] = this.pageRecords[i].State_Master__r.Name; this.pageRecords[i]["StateMasterUrl"] = "/" + this.pageRecords[i].State_Master__c; this.pageRecords[i]["CityMasterName"] = this.pageRecords[i]['StateMasterUrl'] = '/' + this.pageRecords[i].State_Master__c; this.pageRecords[i]['CityMasterName'] = this.pageRecords[i].City_Master__r.Name; this.pageRecords[i]["CityMasterNameUrl"] = "/" + this.pageRecords[i].City_Master__c; this.pageRecords[i]["RecordTypeName"] = this.pageRecords[i]['CityMasterNameUrl'] = '/' + this.pageRecords[i].City_Master__c; this.pageRecords[i]['RecordTypeName'] = this.pageRecords[i].RecordType.Name; } this.isShowSpinner = false; } else { this.showMyToast("Error", r.msg, "Error"); this.showMyToast('Error', r.msg, 'Error'); } }) .catch((error) => { console.log("error = " + JSON.stringify(error.message)); console.log('error = ' + JSON.stringify(error.message)); }); } showMyToast(title, message, variant) { this.isShowSpinner = false; console.log("show custom message"); var iconName = ""; var content = ""; if (variant.toLowerCase() == "success") { iconName = "utility:check"; console.log('show custom message'); var iconName = ''; var content = ''; if (variant.toLowerCase() == 'success') { iconName = 'utility:check'; } else { iconName = "utility:error"; iconName = 'utility:error'; } if (message != "") { if (message != '') { content = "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>"; '<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") .querySelector('c-common-toast') .showToast(variant, content, iconName, 10000); } @@ -757,29 +802,29 @@ } onHandleSort(event) { console.log("event.detail.fieldName = " + event.detail.fieldName); console.log('event.detail.fieldName = ' + event.detail.fieldName) this.sortBy = event.detail.fieldName; switch (this.sortBy) { case "NameUrl": this.sortBy = "Name"; case 'NameUrl': this.sortBy = 'Name'; break; case "StateMasterName": this.sortBy = "State_Master__r.Name"; case 'StateMasterName': this.sortBy = 'State_Master__r.Name'; break; case "RecordTypeName": this.sortBy = "RecordType.Name"; case 'RecordTypeName': this.sortBy = 'RecordType.Name'; break; case "CityMasterName": this.sortBy = "City_Master__r.Name"; case 'CityMasterName': this.sortBy = 'City_Master__r.Name'; break; } 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); this.changelistView(); const { fieldName: sortedBy, sortDirection } = event.detail; this.sortByMethod(sortedBy, sortDirection === "asc" ? 1 : -1); this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1); this.sortDirection = sortDirection; this.sortedBy = sortedBy; } force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css
@@ -1,18 +1,18 @@ @import "c/lexCssUtility"; @import 'c/lexCssUtility'; .outerBorderCss { border: 1px solid #d4d4d4; border: 1px solid #D4D4D4; border-radius: 5px; border-top: 3px solid #565959; } .borderCss { border: 1px solid #d4d4d4; border: 1px solid #D4D4D4; border-radius: 5px; margin-bottom: 7px; border-top: 3px solid #565959; } .headerDorderCss { border-top: 1px solid #565959; border-bottom: 1px solid #d4d4d4; border-bottom: 1px solid #D4D4D4; padding: 3px; } .centerCss { force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html
@@ -4,106 +4,50 @@ <c-common-toast></c-common-toast> <template if:true={isShowSpinner}> <div class="slds-spinner_container"> <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand" > <span class="slds-assistive-text">Loading</span> <div class="slds-spinner__dot-a"></div> <div class="slds-spinner__dot-b"></div> </div> </div> <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand"> <span class="slds-assistive-text">Loading</span> <div class="slds-spinner__dot-a"></div> <div class="slds-spinner__dot-b"></div> </div> </div> </template> <!-- 搜索客户名 --> <template if:true={isModalOpen}> <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium" style="border: 1px solid #d4d4d4" > <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium" style="border: 1px solid #D4D4D4;"> <div class="slds-modal__container"> <header class="slds-modal__header" style="background-color: #f3f3f3"> <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeModal} > <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse" size="small" ></lightning-icon> <header class="slds-modal__header" style="background-color: #F3F3F3;"> <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeModal}> <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse" size="small"></lightning-icon> <span class="slds-assistive-text">Close</span> </button> <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate" > 经销商医院检索 </h2> <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">经销商医院检索</h2> </header> <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style="border: 1px solid #f3f3f3" > <table style="width: 100%"> <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style="border: 1px solid #F3F3F3;"> <table style="width: 100%;"> <tbody> <tr> <td style="width: 74px"> <div style="color: #696969; font-size: 16px; text-align: left" > 医院名称 </div> <td style="width: 74px;"> <div style="color:#696969;font-size:16px;text-align: left;">医院名称</div> </td> <td style="width: 60%"> <lightning-input class="inputFont" label="医院名称" variant="label-hidden" placeholder="请输入医院名称" value={searchHospitalName} data-field="searchHospitalName" onchange={dataChange} ></lightning-input> </td> <td style="width: 10px"></td> <td> <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px" label="搜索" onclick={searchHospital} > 搜索 </button> </td> <td style="width: 60%;"><lightning-input class="inputFont" label="医院名称" variant="label-hidden" placeholder="请输入医院名称" value={searchHospitalName} data-field="searchHospitalName" onchange={dataChange}></lightning-input></td> <td style="width: 10px;"></td> <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="height: 32px;" label="搜索" onclick={searchHospital}>搜索</button></td> </tr> </tbody> </table> <p style="height: 20px"></p> <p style="height: 20px;"></p> <!-- <p>已选择医院:{chooseHospital}</p> --> <div style=" border: 1px solid #d4d4d4; border-top: 3px solid #51606e; border-radius: 5px; margin-bottom: 7px; " > <div style="border-bottom: 1px solid #d4d4d4; padding: 3px"> style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;"> <div style="border-bottom: 1px solid #D4D4D4;padding:3px;"> <lightning-layout> <lightning-layout-item padding="around-small"> <p style="font-size: 18px"> @@ -113,30 +57,20 @@ </lightning-layout> <!-- <p style="font-size: 16px;"><strong>搜索结果</strong></p> --> </div> <div class="myTable" style="padding: 10px"> <div class="myTable" style="padding:10px;"> <!-- <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={hospitalList} columns={hosCols} onrowaction={chooseHos}></lightning-datatable> --> <lightning-datatable class="datatabel slds-border_top wrapped-header-datatable" key-field="id" data={hospitalList} columns={hospitalColumns} hide-checkbox-column="true" onrowaction={searchHandleRowAction} > <lightning-datatable class="datatabel slds-border_top wrapped-header-datatable" key-field="id" data={hospitalList} columns={hospitalColumns} hide-checkbox-column="true" onrowaction={searchHandleRowAction}> </lightning-datatable> </div> </div> </div> <footer class="slds-modal__footer"> <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="取消" onclick={closeModal} > 取消 </button> <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="取消" onclick={closeModal}>取消</button> </footer> </div> </section> @@ -145,58 +79,31 @@ <!-- 上传附件弹窗 --> <template if:true={showAttPop}> <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small" style="border: 1px solid #d4d4d4" > <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small" style="border: 1px solid #D4D4D4;"> <template if:true={showPopSpinner}> <lightning-spinner size="medium" variant="brand"></lightning-spinner> </template> <div class="slds-modal__container"> <header class="slds-modal__header" style="background-color: #f3f3f3"> <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closePop} > <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse" size="small" ></lightning-icon> <header class="slds-modal__header" style="background-color: #F3F3F3;"> <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closePop}> <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse" size="small"></lightning-icon> <span class="slds-assistive-text">Close</span> </button> <h2 id="modal-heading-02" class="slds-text-heading_medium slds-hyphenate" > 上传附件 </h2> <h2 id="modal-heading-02" class="slds-text-heading_medium slds-hyphenate">上传附件</h2> </header> <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-2" style="border: 1px solid #f3f3f3" > <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-2" style="border: 1px solid #F3F3F3;"> <div class="slds-m-top_medium slds-m-bottom_x-large"> <div class="slds-p-around_medium lgc-bg"> <lightning-input class="fileUpload" type="file" label="附件上传" <lightning-input class="fileUpload" type="file" label="附件上传" accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf" onchange={attChange} ></lightning-input> onchange={attChange}></lightning-input> </div> <p style="font-size: 16px"> 已选择文件:{fileName} <p style="font-size: 16px;">已选择文件:{fileName} <template if:true={attDelBtn}> <a onclick={removeAtt}>移除</a> </template> @@ -208,22 +115,10 @@ onclick={closePop}></lightning-button> <lightning-button style="margin-left: 10px;" variant="neutral" label="上传" onclick={handleSave}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px" label="取消" onclick={closePop} > 取消 </button> <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-left: 10px" label="上传" onclick={handleSave} > 上传 </button> <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;" label="取消" onclick={closePop}>取消</button> <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-left: 10px;" label="上传" onclick={handleSave}>上传</button> </footer> </div> </section> @@ -262,10 +157,7 @@ style="width: 150px"></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={saveConfirmJs} > 保存 </button> onclick={saveConfirmJs}>保存</button> </template> </td> <td colspan="4"> @@ -283,11 +175,7 @@ style="width: 150px" disabled={isEditDisabled}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={EditConsumable} disabled={isEditDisabled} > 编辑出库单 </button> onclick={EditConsumable} disabled={isEditDisabled}>编辑出库单</button> </template> </td> @@ -297,11 +185,7 @@ style="width: 150px;" disabled={isDeliveryDisabled}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={GoodsDeliveryJs} disabled={isDeliveryDisabled} > 出货/销售 </button> onclick={GoodsDeliveryJs} disabled={isDeliveryDisabled}>出货/销售</button> </template> </td> @@ -311,11 +195,7 @@ disabled={isOpenToInvoiceDisabled}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={openToInvoiceJs} disabled={isOpenToInvoiceDisabled} > 开票 </button> onclick={openToInvoiceJs} disabled={isOpenToInvoiceDisabled}>开票</button> </template> </td> @@ -323,14 +203,11 @@ <template if:false={EditAble}> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={uploadOrder} > 上传附件 </button> onclick={uploadOrder}>上传附件</button> </template> </td> </tr> <tr style="height: 5px"></tr> <tr style="height: 5px;"></tr> <tr> <td></td> <td> @@ -339,38 +216,28 @@ disabled={isPraseToPDFDisabled}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={PraseToPDFJs} disabled={isPraseToPDFDisabled} > 打印指示单 </button> onclick={PraseToPDFJs} disabled={isPraseToPDFDisabled}>打印指示单</button> </template> </td> <td> <template if:true={isOpenReportShow}> <!-- <lightning-button label="显示明细 " onclick={openReportJs} style="width: 150px" disabled={isOpenReportDisabled}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={openReportJs} disabled={isOpenReportDisabled} > 显示明细 </button> onclick={openReportJs} disabled={isOpenReportDisabled}>显示明细</button> </template> </td> <td> <template if:true={isDeleteShow}> <!-- <lightning-button label="删除" onclick={DeleteConsumable} style="width: 150px" disabled={isDeleteDisabled}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={DeleteConsumable} disabled={isDeleteDisabled} > 删除 </button> onclick={DeleteConsumable} disabled={isDeleteDisabled}>删除</button> </template> </td> <td></td> @@ -397,34 +264,27 @@ <div draggable="false"> <!-- SummonsStatus_c__c == '价格未定' --> <template if:true={summonsStatusPriceNotDetermined}> <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId} onload={handleLoad} > <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId} onload={handleLoad}> <!-- 出库单号 出库单状态 --> <lightning-layout multiple-rows="true"> <template if:true={isSummonsFlag}> <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item size="5"> <lightning-output-field field-name="Name" class="hehe-layoutItem" ></lightning-output-field> <lightning-output-field field-name="Name" class="hehe-layoutItem"></lightning-output-field> </lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px" > <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;"> <lightning-output-field field-name="SummonsStatus_c__c" ></lightning-output-field> field-name="SummonsStatus_c__c"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> </template> </lightning-layout> @@ -433,36 +293,33 @@ <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5"> <lightning-output-field field-name="SummonsForDirction__c" class="searchName" ></lightning-output-field> <lightning-output-field field-name="SummonsForDirction__c" class="searchName"></lightning-output-field> </lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px" > <lightning-output-field field-name="Billed_Status__c" class="searchName" ></lightning-output-field> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;"> <lightning-output-field field-name="Billed_Status__c" class="searchName"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> </lightning-layout> <!-- 二级经销商 --> <template if:true={isSummonsForDirctionTwoShow}> <lightning-layout multiple-rows="true"> <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5"> <lightning-output-field field-name="Order_Dealer_Info__c" ></lightning-output-field> field-name="Order_Dealer_Info__c"></lightning-output-field> </lightning-layout-item> </lightning-layout> </template> @@ -471,26 +328,20 @@ <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5"> <lightning-output-field class="hideHelpText" field-name="ShipmentAccount__c" ></lightning-output-field> <lightning-output-field class="hideHelpText" field-name="ShipmentAccount__c"></lightning-output-field> </lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px" > <lightning-input-field data-field={ConInvoice_Code__c} onchange={invoiceChange} field-name="ConInvoice_Code__c" class="inputFont" ></lightning-input-field> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;"> <lightning-input-field data-field={ConInvoice_Code__c} onchange={invoiceChange} field-name="ConInvoice_Code__c" class="inputFont"></lightning-input-field> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> </lightning-layout> <!-- 科室 出库金额 --> @@ -499,63 +350,53 @@ <lightning-layout-item class="hehe-layoutItem" size="5"> <lightning-output-field field-name="Order_ForCustomerText__c" ></lightning-output-field> field-name="Order_ForCustomerText__c"></lightning-output-field> </lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px" > <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;"> <lightning-output-field field-name="Shipment_total_amount__c" ></lightning-output-field> field-name="Shipment_total_amount__c"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> </lightning-layout> <!-- 没有确定价格 --> <lightning-layout multiple-rows="true"> <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5"> <lightning-output-field field-name="NoConfirmedPrice__c" ></lightning-output-field> field-name="NoConfirmedPrice__c"></lightning-output-field> </lightning-layout-item> </lightning-layout> </lightning-record-edit-form> </template> <!-- SummonsStatus_c__c != '价格未定' --> <template if:false={summonsStatusPriceNotDetermined}> <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId} onsubmit={handleSubmit} onload={handleLoad} > <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId} onsubmit={handleSubmit} onload={handleLoad}> <!-- 出库单号 出库单状态 --> <lightning-layout multiple-rows="true"> <template if:true={isSummonsFlag}> <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5"> <lightning-output-field field-name="Name" ></lightning-output-field> <lightning-output-field field-name="Name"></lightning-output-field> </lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px" > <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;"> <lightning-output-field field-name="SummonsStatus_c__c" ></lightning-output-field> field-name="SummonsStatus_c__c"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> @@ -567,36 +408,25 @@ <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5"> <lightning-input-field data-field="summonsForDirction" value={summonsForDirction} field-name="SummonsForDirction__c" required="true" onchange={ChangeDirction} class="inputFont" ></lightning-input-field> <lightning-input-field data-field="summonsForDirction" value={summonsForDirction} field-name="SummonsForDirction__c" required="true" onchange={ChangeDirction} class="inputFont"></lightning-input-field> </lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px" > <lightning-combobox data-field="secondaryDistributor" name="secondaryDistributor" label="二级经销商" value={secondaryDistributor} placeholder="请选择..." options={secondaryDistributorOptions} variant="label-inline" onchange={dataChange} disabled={isDisabledSecondaryDistributor} class="inputFont" ></lightning-combobox> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;"> <lightning-combobox data-field="secondaryDistributor" name="secondaryDistributor" label="二级经销商" value={secondaryDistributor} placeholder="请选择..." options={secondaryDistributorOptions} variant="label-inline" onchange={dataChange} disabled={isDisabledSecondaryDistributor} class="inputFont"></lightning-combobox> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> </lightning-layout> <!-- 客户名 经销商录入 --> @@ -605,65 +435,42 @@ <lightning-layout-item class="hehe-layoutItem" size="5"> <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right" > <lightning-icon size="x-small" class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"> <lightning-icon size="x-small" class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default" icon-name="utility:search" ></lightning-icon> <lightning-input type="text" name="HospitalName" label="客户名" value={HospitalName} variant="label-inline" onclick={searchHospitalNameModal} data-field="HospitalName" disabled={isDisabledHospitalName} onchange={clearAgencyI} class="inputFont" ></lightning-input> icon-name="utility:search"></lightning-icon> <lightning-input type="text" name="HospitalName" label="客户名" value={HospitalName} variant="label-inline" onclick={searchHospitalNameModal} data-field="HospitalName" disabled={isDisabledHospitalName} onchange={clearAgencyI} class="inputFont"></lightning-input> </div> </lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px" > <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;"> <template if:true={isMutualTransferGoods}> <c-lex-lookup onsearch={handleSearch} onselectionchange={handleSelectionChange} label="经销商(录入)" variant="label-inline" placeholder="搜索经销商" <c-lex-lookup onsearch={handleSearch} onselectionchange={handleSelectionChange} label="经销商(录入)" variant="label-inline" placeholder="搜索经销商" onisdisabledfordealertext={isDisabledForDealerText} account-value={accountValue} onblur={vpClear2Delay} disabled={isDisabledForDealerText} class="inputFont" > account-value={accountValue} onblur={vpClear2Delay} disabled={isDisabledForDealerText} class="inputFont"> </c-lex-lookup> </template> <template if:false={isMutualTransferGoods}> <lightning-input type="text" name="Order_ForDealerText__c" label="经销商(录入)" value={ForDealerText} onchange={dataChange} <lightning-input type="text" name="Order_ForDealerText__c" label="经销商(录入)" value={ForDealerText} onchange={dataChange} data-field="Order_ForDealerText__c" disabled={isDisabledForDealerText} variant="label-inline" class="inputFont" > disabled={isDisabledForDealerText} variant="label-inline" class="inputFont"> </lightning-input> </template> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> </lightning-layout> <!-- 科室 总金额 --> @@ -671,31 +478,20 @@ <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5"> <lightning-input-field onchange={dataChange} data-field="ForCustomerText" value={ForCustomerText} <lightning-input-field onchange={dataChange} data-field="ForCustomerText" value={ForCustomerText} field-name="Order_ForCustomerText__c" disabled={isDisabledForCustomerText} class="inputFont" ></lightning-input-field> class="inputFont"></lightning-input-field> </lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px" > <lightning-input type="text" name="sumPrice" label="总金额" value={sumPrice} variant="label-inline" onchange={dataChange} data-field="sumPrice" readonly ></lightning-input> <lightning-layout-item class="hehe-layoutItem" size="5" style="padding-left: 100px;"> <lightning-input type="text" name="sumPrice" label="总金额" value={sumPrice} variant="label-inline" onchange={dataChange} data-field="sumPrice" readonly></lightning-input> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> @@ -703,16 +499,17 @@ <!-- 没有确定价格 --> <lightning-layout multiple-rows="true"> <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item class="hehe-layoutItem" size="5"> <lightning-input-field value={NoConfirmedPrice} field-name="NoConfirmedPrice__c" data-field="NoConfirmedPrice" onchange={dataChange} ></lightning-input-field> <lightning-input-field value={NoConfirmedPrice} field-name="NoConfirmedPrice__c" data-field="NoConfirmedPrice" onchange={dataChange}></lightning-input-field> </lightning-layout-item> </lightning-layout> </lightning-record-edit-form> </template> @@ -736,31 +533,23 @@ <div style="padding: 7px"> <div lwc:dom="manual" class="resultDiv"></div> <div draggable="false"> <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId} onload={handleLoad2} > <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId} onload={handleLoad2}> <!-- 出库单号 出库单状态 --> <lightning-layout multiple-rows="true"> <template if:true={isSummonsFlag}> <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item size="5"> <lightning-output-field field-name="Name" class="hehe-layoutItem" ></lightning-output-field> <lightning-output-field field-name="Name" class="hehe-layoutItem"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="5" style="padding-left: 100px" > <lightning-output-field field-name="SummonsStatus_c__c" class="hehe-layoutItem" ></lightning-output-field> <lightning-layout-item size="5" style="padding-left: 100px;"> <lightning-output-field field-name="SummonsStatus_c__c" class="hehe-layoutItem"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> @@ -772,20 +561,18 @@ <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item size="5"> <lightning-output-field field-name="SummonsForDirction__c" class="hehe-layoutItem" ></lightning-output-field> <lightning-output-field field-name="SummonsForDirction__c" class="hehe-layoutItem"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="5" style="padding-left: 100px"> <lightning-output-field field-name="Billed_Status__c" class="hehe-layoutItem" ></lightning-output-field> <lightning-layout-item size="5" style="padding-left: 100px;"> <lightning-output-field field-name="Billed_Status__c" class="hehe-layoutItem"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> </lightning-layout> <!-- 二级经销商 --> @@ -794,10 +581,8 @@ <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item size="5"> <lightning-output-field field-name="Order_Dealer_Info__c" class="hehe-layoutItem" ></lightning-output-field> <lightning-output-field field-name="Order_Dealer_Info__c" class="hehe-layoutItem"></lightning-output-field> </lightning-layout-item> </lightning-layout> </template> @@ -807,27 +592,21 @@ <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item size="5" class="hehe-layoutItem"> <lightning-output-field class="hideHelpText" field-name="ShipmentAccount__c" ></lightning-output-field> <lightning-output-field class="hideHelpText" field-name="ShipmentAccount__c"></lightning-output-field> </lightning-layout-item> <template if:true={isConInvoiceShow}> <lightning-layout-item size="5" style="padding-left: 100px" > <lightning-input-field data-field={ConInvoice_Code__c} onchange={invoiceChange} field-name="ConInvoice_Code__c" class="hehe-layoutItem inputFont" ></lightning-input-field> <lightning-layout-item size="5" style="padding-left: 100px;"> <lightning-input-field data-field={ConInvoice_Code__c} onchange={invoiceChange} field-name="ConInvoice_Code__c" class="hehe-layoutItem inputFont"></lightning-input-field> </lightning-layout-item> </template> <lightning-layout-item size="1"></lightning-layout-item> </lightning-layout> <!-- 科室 出库金额 --> @@ -835,88 +614,60 @@ <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item size="5"> <lightning-output-field field-name="Order_ForCustomerText__c" class="hehe-layoutItem" ></lightning-output-field> <lightning-output-field field-name="Order_ForCustomerText__c" class="hehe-layoutItem"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="5" style="padding-left: 100px"> <lightning-output-field field-name="Shipment_total_amount__c" class="hehe-layoutItem" ></lightning-output-field> <lightning-layout-item size="5" style="padding-left: 100px;"> <lightning-output-field field-name="Shipment_total_amount__c" class="hehe-layoutItem"></lightning-output-field> </lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> </lightning-layout> <!-- 没有确定价格 --> <lightning-layout multiple-rows="true"> <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item size="5"> <lightning-output-field field-name="NoConfirmedPrice__c" class="hehe-layoutItem" ></lightning-output-field> <lightning-output-field field-name="NoConfirmedPrice__c" class="hehe-layoutItem"></lightning-output-field> </lightning-layout-item> </lightning-layout> <!-- 附件预览 --> <template if:false={EditAble}> <lightning-layout multiple-rows="true"> <lightning-layout-item size="1"> </lightning-layout-item> <lightning-layout-item size="1"> </lightning-layout-item> <lightning-layout-item size="10"> <lightning-card class="attListTitle" variant="Narrow" title="附件列表" icon-name="utility:attach" > <lightning-card class="attListTitle" variant="Narrow" title="附件列表" icon-name="utility:attach"> <lightning-layout slot="footer" multiple-rows="true"> <template for:each={fileData} for:item="item" for:index="index" > <lightning-layout-item padding="around-none" size="2" <template for:each={fileData} for:item="item" for:index="index"> <lightning-layout-item padding="around-none" size="2" key={item.recordId} style=" text-align: left; padding: 5px; word-wrap: break-word; word-break: break-all; " > <lightning-icon title={item.Title} style="margin-left: 20px" icon-name="doctype:gform" style="text-align: left;padding:5px;word-wrap:break-word; word-break:break-all;"> <lightning-icon title={item.Title} style="margin-left: 20px;" icon-name="doctype:gform" alternative-text={item.Title} size="large" ></lightning-icon ><br /> <div title={item.Title} style=" width: 100px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; " > size="large"></lightning-icon><br /> <div title={item.Title} style="width: 100px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;"> {item.Title} </div> <p> <!-- <a data-fileid ={item.documentId} onclick={previweAtt}> --> <a href={item.attUrl} target="_blank"> 预览 </a > · <a href={item.downloadUrl}> 下载 </a > · 预览 </a> · <a href={item.downloadUrl}> 下载 </a> · <a data-fileid={item.Id} onclick={deleteAtt}> 删除 </a> @@ -929,6 +680,7 @@ </lightning-layout-item> </lightning-layout> </template> </lightning-record-edit-form> </div> </div> @@ -938,164 +690,90 @@ <!-- 检索 --> <template if:true={isSearchShow}> <div class="borderCss"> <div style="padding: 3px"> <div style="padding: 3px;"> <div lwc:dom="manual" class="resultDiv"></div> <div draggable="false"> <lightning-layout multiple-rows style="margin-top: 10px"> <lightning-layout-item style="padding-left: 10px" flexibility="auto" > <lightning-layout multiple-rows style="margin-top: 10px;"> <lightning-layout-item style="padding-left: 10px;" flexibility="auto"> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label">消耗品名称</div> <lightning-input type="text" name="consumableName" label="消耗品名称" value={consumableName} variant="label-hidden" onchange={dataChange} data-field="consumableName" class="inputFont" style="width: 150px" ></lightning-input> <lightning-input type="text" name="consumableName" label="消耗品名称" value={consumableName} variant="label-hidden" onchange={dataChange} data-field="consumableName" class="inputFont" style="width:150px"></lightning-input> </div> </lightning-layout-item> <lightning-layout-item flexibility="auto"> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label" style="width: 80px"> 第3分类 </div> <lightning-combobox name="progress" label="第3分类" value={Category3} variant="label-hidden" options={category3Options} onchange={dataChange} data-field="Category3" style="min-width: 120px" class="inputFont" ></lightning-combobox> <div class="slds-form-element__label" style="width:80px">第3分类</div> <lightning-combobox name="progress" label="第3分类" value={Category3} variant="label-hidden" options={category3Options} onchange={dataChange} data-field="Category3" style="min-width: 120px;" class="inputFont"></lightning-combobox> </div> </lightning-layout-item> <lightning-layout-item flexibility="auto"> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label" style="width: 80px"> 第4分类 <div class="slds-form-element__label" style="width:80px">第4分类</div> <lightning-combobox name="progress" label="第4分类" value={Category4} variant="label-hidden" options={category4Options} onchange={dataChange} data-field="Category4" style="min-width: 120px;" class="inputFont"></lightning-combobox> </div> <lightning-combobox name="progress" label="第4分类" value={Category4} variant="label-hidden" options={category4Options} onchange={dataChange} data-field="Category4" style="min-width: 120px" class="inputFont" ></lightning-combobox> </div> </lightning-layout-item> <lightning-layout-item flexibility="auto"> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label" style="width: 80px"> 第5分类 <div class="slds-form-element__label" style="width:80px">第5分类</div> <lightning-combobox name="progress" label="第5分类" value={Category5} variant="label-hidden" onchange={dataChange} data-field="Category5" options={category5Options} style="min-width: 120px;" class="inputFont"></lightning-combobox> </div> <lightning-combobox name="progress" label="第5分类" value={Category5} variant="label-hidden" onchange={dataChange} data-field="Category5" options={category5Options} style="min-width: 120px" class="inputFont" ></lightning-combobox> </div> </lightning-layout-item> <template if:true={hasHosPro}> <lightning-layout-item flexibility="auto"> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label">医院特价</div> <lightning-combobox name="progress" label="医院特价" value={outOutPattern} variant="label-hidden" options={outOutPatternOptionList} onchange={dataChange} data-field="outOutPattern" style="min-width: 120px" class="inputFont" ></lightning-combobox> <lightning-combobox name="progress" label="医院特价" value={outOutPattern} variant="label-hidden" options={outOutPatternOptionList} onchange={dataChange} data-field="outOutPattern" style="min-width: 120px;" class="inputFont"></lightning-combobox> </div> </lightning-layout-item> </template> </lightning-layout> <lightning-layout multiple-rows style="margin-top: 10px"> <lightning-layout-item style="padding-left: 10px; visibility: hidden" flexibility="auto" > <lightning-layout multiple-rows style="margin-top: 10px;"> <lightning-layout-item style="padding-left: 10px;visibility:hidden;" flexibility="auto"> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label">消耗品名称</div> <lightning-input type="text" name="consumableName" label="消耗品名称" value={consumableName} variant="label-hidden" onchange={dataChange} data-field="consumableName" class="inputFont" style="width: 150px" ></lightning-input> <lightning-input type="text" name="consumableName" label="消耗品名称" value={consumableName} variant="label-hidden" onchange={dataChange} data-field="consumableName" class="inputFont" style="width:150px"></lightning-input> </div> </lightning-layout-item> <lightning-layout-item flexibility="auto" style="visibility: hidden" > <lightning-layout-item flexibility="auto" style="visibility:hidden;"> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label" style="width: 80px"> 第3分类 </div> <lightning-combobox name="progress" label="第3分类" value={Category3} variant="label-hidden" options={category3Options} onchange={dataChange} data-field="Category3" style="min-width: 120px" class="inputFont" ></lightning-combobox> <div class="slds-form-element__label" style="width:80px">第3分类</div> <lightning-combobox name="progress" label="第3分类" value={Category3} variant="label-hidden" options={category3Options} onchange={dataChange} data-field="Category3" style="min-width: 120px;" class="inputFont"></lightning-combobox> </div> </lightning-layout-item> <lightning-layout-item flexibility="auto" style="visibility: hidden" > <lightning-layout-item flexibility="auto" style="visibility:hidden;"> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label" style="width: 80px"> 第4分类 <div class="slds-form-element__label" style="width:80px">第4分类</div> <lightning-combobox name="progress" label="第4分类" value={Category4} variant="label-hidden" options={category4Options} onchange={dataChange} data-field="Category4" style="min-width: 120px;" class="inputFont"></lightning-combobox> </div> <lightning-combobox name="progress" label="第4分类" value={Category4} variant="label-hidden" options={category4Options} onchange={dataChange} data-field="Category4" style="min-width: 120px" class="inputFont" ></lightning-combobox> </div> </lightning-layout-item> <template if:false={hasHosPro}> <lightning-layout-item flexibility="auto"> @@ -1103,47 +781,21 @@ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder lexsearchStyle" onclick={searchProductJs} style="min-width: 80px; max-width: 100px" > 检索 </button> <button style=" margin-left: 10px; min-width: 80px; max-width: 100px; " style="min-width: 80px;max-width: 100px;">检索</button> <button style="margin-left:10px;min-width: 80px;max-width: 100px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder lexclearStyle" onclick={ClearJs} > 清空 </button> onclick={ClearJs}>清空</button> </div> </lightning-layout-item> </template> <template if:true={hasHosPro}> <lightning-layout-item flexibility="auto" style="visibility: hidden" > <lightning-layout-item flexibility="auto" style="visibility:hidden;"> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label" style="width: 80px" > 第5分类 </div> <lightning-combobox name="progress" label="第5分类" value={Category5} variant="label-hidden" onchange={dataChange} data-field="Category5" options={category5Options} style="min-width: 120px" class="inputFont" ></lightning-combobox> <div class="slds-form-element__label" style="width:80px">第5分类</div> <lightning-combobox name="progress" label="第5分类" value={Category5} variant="label-hidden" onchange={dataChange} data-field="Category5" options={category5Options} style="min-width: 120px;" class="inputFont"></lightning-combobox> </div> </lightning-layout-item> <lightning-layout-item flexibility="auto"> @@ -1151,21 +803,10 @@ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder lexsearchStyle" onclick={searchProductJs} style="min-width: 80px; max-width: 110px" > 检索 </button> <button style=" margin-left: 10px; min-width: 80px; max-width: 110px; " style="min-width: 80px;max-width: 110px;">检索</button> <button style="margin-left:10px;min-width: 80px;max-width: 110px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder lexclearStyle" onclick={ClearJs} > 清空 </button> onclick={ClearJs}>清空</button> </div> </lightning-layout-item> </template> @@ -1189,80 +830,45 @@ <div style="padding: 7px"> <template if:true={EditAble}> <template if:true={showTable}> <c-lex-custom-lightning-datatable key-field="Id" data={data} columns={columns} hide-checkbox-column={hideCheckboxColumn} onunitchange={handleUnitChange} <c-lex-custom-lightning-datatable key-field="Id" data={data} columns={columns} hide-checkbox-column={hideCheckboxColumn} onunitchange={handleUnitChange} onshipmentnumber={handleShipmentNumber} onshipmentunitprice={handleShipmentUnitPrice} onrowselection={getSelectedRows} selected-rows={selectedRows} default-sort-direction={defaultSortDirection} sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort} style="word-wrap: break-word; word-break: break-all" class="wrapped-header-datatable slds-is-selected" > onshipmentunitprice={handleShipmentUnitPrice} onrowselection={getSelectedRows} selected-rows={selectedRows} default-sort-direction={defaultSortDirection} sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort} style="word-wrap:break-word; word-break:break-all; " class="wrapped-header-datatable slds-is-selected"> </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> </template> <template if:false={EditAble}> <template if:true={showTable}> <c-lex-custom-lightning-datatable hide-checkbox-column key-field="Id" data={editData} columns={editColumns} onunitchange={handleUnitChange} <c-lex-custom-lightning-datatable hide-checkbox-column key-field="Id" data={editData} columns={editColumns} onunitchange={handleUnitChange} onshipmentnumber={handleShipmentNumber} onshipmentunitprice={handleShipmentUnitPrice} onrowselection={getSelectedRows} selected-rows={selectedRows} default-sort-direction={defaultSortDirection} sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort} style="word-wrap: break-word; word-break: break-all" class="wrapped-header-datatable slds-is-selected" > onshipmentunitprice={handleShipmentUnitPrice} onrowselection={getSelectedRows} selected-rows={selectedRows} default-sort-direction={defaultSortDirection} sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort} style="word-wrap:break-word; word-break:break-all; " class="wrapped-header-datatable slds-is-selected"> </c-lex-custom-lightning-datatable> <c-paginator onprevious={editHandlePrevious} onnext={editHandleNext} onpageschange={editHandlePageschange} onfirst={editHandleFirst} onlast={editHandleLast} page-size-options={pageSizeOptions} <c-paginator onprevious={editHandlePrevious} onnext={editHandleNext} onpageschange={editHandlePageschange} onfirst={editHandleFirst} onlast={editHandleLast} page-size-options={pageSizeOptions} previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled} record-start={recordStart} record-end={recordEnd} total-records={totalRecords} ></c-paginator> next-button-disabled={nextButtonDisabled} record-start={recordStart} record-end={recordEnd} total-records={totalRecords}></c-paginator> </template> </template> <template if:true={isEditShowSpinner}> <lightning-spinner alternative-text="Uploading now" ></lightning-spinner> <lightning-spinner alternative-text="Uploading now"></lightning-spinner> </template> </div> </div> @@ -1280,13 +886,9 @@ </lightning-layout> </div> <div style="padding: 7px"> <lightning-datatable key-field="id" data={consumableorderdetails2Records} columns={consumableorderdetails2RecordsColumns} hide-checkbox-column class="wrapped-header-datatable" > <lightning-datatable key-field="id" data={consumableorderdetails2Records} columns={consumableorderdetails2RecordsColumns} hide-checkbox-column class="wrapped-header-datatable"> </lightning-datatable> </div> </div> @@ -1343,7 +945,7 @@ </lightning-layout-item> </lightning-layout> </div> <div style="padding: 7px"> <div style="padding: 7px;"> <div lwc:dom="manual" class="resultDiv"></div> <div draggable="false"> <lightning-layout multiple-rows="true" style="height: 50px"> @@ -1353,23 +955,15 @@ <lightning-layout-item class="hehe-layoutItem" size="4"> <!-- <lightning-button label="销售" onclick={SaveP} style="margin-top:-10px"></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={SaveP} > 销售 </button> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={SaveP}>销售</button> </lightning-layout-item> </template> <template if:false={isSales}> <lightning-layout-item class="hehe-layoutItem" size="4"> <!-- <lightning-button label="出货" onclick={SaveE}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={SaveE} > 出货 </button> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={SaveE}>出货</button> </lightning-layout-item> </template> <lightning-layout-item class="hehe-layoutItem" size="4"> @@ -1377,7 +971,7 @@ </lightning-layout> <template if:true={isShowInformation}> <div class="borderCss" style="margin-top: 5px"> <div class="borderCss" style="margin-top: 5px;"> <div class="headerDorderCss"> <lightning-layout> <lightning-layout-item padding="around-small"> @@ -1390,93 +984,48 @@ <div style="padding: 7px"> <div lwc:dom="manual" class="resultDiv"></div> <div draggable="false"> <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId} onload={handleLoad2} > <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId} onload={handleLoad2}> <lightning-layout multiple-rows="true"> <lightning-layout-item size="3" padding="around-small" > <lightning-layout-item size="3" padding="around-small"> <!-- <lightning-output-field field-name="Name"></lightning-output-field> --> <div class="slds-grid slds-grid_vertical-align-center" > <div class="slds-form-element__label" style="padding: 0px" > 出库单号: </div> <lightning-output-field field-name="Name" variant="label-hidden" ></lightning-output-field> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label" style="padding: 0px;"> 出库单号:</div> <lightning-output-field field-name="Name" variant="label-hidden"></lightning-output-field> </div> </lightning-layout-item> <lightning-layout-item size="4" padding="around-small" > <lightning-layout-item size="4" padding="around-small"> <!-- <lightning-output-field field-name="ShipmentAccount__c" class="hideHelpText"></lightning-output-field> --> <div class="slds-grid slds-grid_vertical-align-center hehe-layoutItem" > <div class="slds-form-element__label" style="padding: 0px" > 客户名: </div> <lightning-output-field field-name="ShipmentAccount__c" variant="label-hidden" ></lightning-output-field> class="slds-grid slds-grid_vertical-align-center hehe-layoutItem"> <div class="slds-form-element__label" style="padding: 0px;"> 客户名:</div> <lightning-output-field field-name="ShipmentAccount__c" variant="label-hidden"></lightning-output-field> </div> </lightning-layout-item> <lightning-layout-item size="2" padding="around-small" > <lightning-layout-item size="2" padding="around-small"> <!-- <lightning-output-field field-name="Order_ForCustomerText__c"></lightning-output-field> --> <div class="slds-grid slds-grid_vertical-align-center" > <div class="slds-form-element__label" style="padding: 0px" > 科室: </div> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label" style="padding: 0px;"> 科室:</div> <lightning-output-field field-name="Order_ForCustomerText__c" variant="label-hidden" ></lightning-output-field> variant="label-hidden"></lightning-output-field> </div> </lightning-layout-item> <lightning-layout-item size="2" padding="around-small" > <lightning-layout-item size="2" padding="around-small"> <!-- <lightning-output-field field-name="SummonsForDirction__c"></lightning-output-field> --> <div class="slds-grid slds-grid_vertical-align-center" > <div class="slds-form-element__label" style="padding: 0px" > 目的: </div> <lightning-output-field field-name="SummonsForDirction__c" variant="label-hidden" ></lightning-output-field> <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label" style="padding: 0px;"> 目的:</div> <lightning-output-field field-name="SummonsForDirction__c" variant="label-hidden"></lightning-output-field> </div> </lightning-layout-item> </lightning-layout> @@ -1499,14 +1048,10 @@ <div style="padding: 7px"> <div lwc:dom="manual" class="resultDiv"></div> <div draggable="false"> <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId} > <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}> <lightning-layout multiple-rows="true"> <lightning-layout-item size="1" ></lightning-layout-item> <lightning-layout-item size="1"></lightning-layout-item> <lightning-layout-item padding="around-small"> <!-- <lightning-textarea name="Barcode" label="BarCode号" onchange={dataChange} variant="label-inline" @@ -1514,33 +1059,21 @@ value={Barcode}></lightning-textarea> --> <div class="slds-grid"> <div class="slds-form-element__label"> BarCode号 </div> <lightning-textarea name="Barcode" label="BarCode号" onchange={dataChange} variant="label-hidden" data-field="Barcode" value={Barcode} style="min-width: 400px" ></lightning-textarea> <div class="slds-form-element__label">BarCode号</div> <lightning-textarea name="Barcode" label="BarCode号" onchange={dataChange} variant="label-hidden" data-field="Barcode" value={Barcode} style="min-width: 400px;"></lightning-textarea> </div> </lightning-layout-item> <lightning-layout-item padding="around-small"> <div class="slds-grid slds-grid_vertical-align-center" > <div class="slds-grid slds-grid_vertical-align-center"> <div class="slds-form-element__label"> <!-- <lightning-button label="确认" onclick={SalesearchProductJs}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={SalesearchProductJs} > 获取明细 </button> onclick={SalesearchProductJs}>获取明细</button> </div> </div> </lightning-layout-item> @@ -1569,15 +1102,11 @@ style="word-wrap:break-word; word-break:break-all; " class="wrapped-header-datatable"> </lightning-datatable> --> <c-lex-custom-lightning-datatable key-field="Id" data={salesData} columns={salesColumns} onoutboundcount={handleOutboundCount} <c-lex-custom-lightning-datatable key-field="Id" data={salesData} columns={salesColumns} onoutboundcount={handleOutboundCount} hide-checkbox-column style="word-wrap: break-word; word-break: break-all" class="wrapped-header-datatable" > style="word-wrap:break-word; word-break:break-all; " class="wrapped-header-datatable"> </c-lex-custom-lightning-datatable> </div> </div> @@ -1596,14 +1125,10 @@ <div style="padding: 7px"> <div lwc:dom="manual" class="resultDiv"></div> <div draggable="false"> <lightning-datatable key-field="id" data={salesErrorData} columns={salesErrorColumns} hide-checkbox-column style="word-wrap: break-word; word-break: break-all" class="wrapped-header-datatable" > <lightning-datatable key-field="id" data={salesErrorData} columns={salesErrorColumns} hide-checkbox-column style="word-wrap:break-word; word-break:break-all; " class="wrapped-header-datatable"> </lightning-datatable> </div> </div> @@ -1617,10 +1142,7 @@ <!-- <lightning-button label="销售" onclick={SaveP}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={SaveP} > 销售 </button> onclick={SaveP}>销售</button> </lightning-layout-item> </template> <template if:false={isSales}> @@ -1628,10 +1150,7 @@ <!-- <lightning-button label="出货" onclick={SaveE}></lightning-button> --> <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={SaveE} > 出货 </button> onclick={SaveE}>出货</button> </lightning-layout-item> </template> <lightning-layout-item class="hehe-layoutItem" size="4"> force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
@@ -19,16 +19,16 @@ import { getObjectInfo } from "lightning/uiObjectInfoApi"; import hospitalInit from "@salesforce/apex/lexSearchAgencyHospitalController.init"; import serContact from "@salesforce/apex/lexSearchAgencyHospitalController.serContact"; import deleteAtt from "@salesforce/apex/LexSummonsCreatController.deleteAtt"; import deleteAtt from '@salesforce/apex/LexSummonsCreatController.deleteAtt'; import { NavigationMixin } from "lightning/navigation"; //table css import { loadStyle } from "lightning/platformResourceLoader"; import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable"; import ConsumableOutboundReportId from "@salesforce/label/c.ConsumableOutboundReportId"; import ConsumableOutboundReportId from '@salesforce/label/c.ConsumableOutboundReportId'; const customLabel = { ConsumableOutboundReportId }; } export default class LexSummonsCreat extends NavigationMixin(LightningElement) { @track label = customLabel; @@ -38,16 +38,16 @@ @track results = [ { Id: "1", Name: "z" Name: "z", }, { Id: "2", Name: "h" Name: "h", }, { Id: "3", Name: "j" } Name: "j", }, ]; @track COLS = [ @@ -55,9 +55,9 @@ label: "Account Name", type: "customName", typeAttributes: { accountName: { fieldName: "Name" } } } accountName: { fieldName: "Name" }, }, }, ]; @track columns = [ { @@ -74,28 +74,28 @@ cellAttributes: { alignment: "right" }, wrapText: true, initialWidth: 50, hideDefaultActions: true hideDefaultActions: true, }, { label: "CFDA状态", fieldName: "SFDA_Status__c", initialWidth: 105, wrapText: true, hideDefaultActions: true hideDefaultActions: true, }, { label: "注册证编码号", fieldName: "approbation_No", wrapText: true, initialWidth: 105, hideDefaultActions: true hideDefaultActions: true, }, { label: "注册证效期", wrapText: true, initialWidth: 115, fieldName: "expiration_Date", hideDefaultActions: true hideDefaultActions: true, }, { label: "第3分类", @@ -103,7 +103,7 @@ wrapText: true, initialWidth: 115, hideDefaultActions: true, sortable: true sortable: true, }, { label: "第4分类", @@ -111,7 +111,7 @@ wrapText: true, initialWidth: 115, hideDefaultActions: true, sortable: true sortable: true, }, { label: "第5分类", @@ -119,7 +119,7 @@ wrapText: true, initialWidth: 115, hideDefaultActions: true, sortable: true sortable: true, }, { label: "单位", @@ -129,7 +129,7 @@ typeAttributes: { unitValue: { fieldName: "unitValue" }, unitOptions: { fieldName: "unitOptions" }, recordId: { fieldName: "Id" } recordId: { fieldName: "Id" }, } }, { @@ -140,8 +140,8 @@ cellAttributes: { alignment: "right" }, typeAttributes: { recordId: { fieldName: "Id" }, shipmentNumber: { fieldName: "shipmentNumber" } } shipmentNumber: { fieldName: "shipmentNumber" }, }, }, { label: "出货单价(元)", @@ -150,8 +150,8 @@ initialWidth: 120, typeAttributes: { recordId: { fieldName: "Id" }, shippingUnitPrice: { fieldName: "shippingUnitPrice" } } shippingUnitPrice: { fieldName: "shippingUnitPrice" }, }, }, { label: "出货金额(元)", @@ -160,8 +160,8 @@ cellAttributes: { alignment: "right" }, hideDefaultActions: true, typeAttributes: { shipmentAmount: { fieldName: "shipmentAmount" } } shipmentAmount: { fieldName: "shipmentAmount" }, }, }, { label: "有效期内库存(盒)", @@ -169,7 +169,7 @@ cellAttributes: { alignment: "right" }, wrapText: true, initialWidth: 160, hideDefaultActions: true hideDefaultActions: true, }, { label: "有效期内库存(个)", @@ -177,8 +177,8 @@ cellAttributes: { alignment: "right" }, wrapText: true, initialWidth: 160, hideDefaultActions: true } hideDefaultActions: true, }, ]; @track editColumns = [ { @@ -186,7 +186,7 @@ fieldName: "Name__c", hideDefaultActions: true, wrapText: true, sortable: true sortable: true, }, { label: "规格", @@ -194,56 +194,56 @@ initialWidth: 50, cellAttributes: { alignment: "right" }, hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "CFDA状态", fieldName: "SFDA_Status__c", hideDefaultActions: true, initialWidth: 100, wrapText: true wrapText: true, }, { label: "注册证编码号", fieldName: "approbation_No", hideDefaultActions: true, initialWidth: 170, wrapText: true wrapText: true, }, { label: "注册证效期", fieldName: "expiration_Date", hideDefaultActions: true, initialWidth: 100, wrapText: true wrapText: true, }, { label: "第3分类", fieldName: "Category3__c", hideDefaultActions: true, sortable: true, wrapText: true wrapText: true, }, { label: "第4分类", fieldName: "Category4__c", hideDefaultActions: true, sortable: true, wrapText: true wrapText: true, }, { label: "第5分类", fieldName: "Category5__c", hideDefaultActions: true, sortable: true, wrapText: true wrapText: true, }, { label: "单位", fieldName: "Box_Piece__c", initialWidth: 50, hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "出货数量", @@ -251,7 +251,7 @@ initialWidth: 90, cellAttributes: { alignment: "right" }, hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "出货单价(元)", @@ -259,11 +259,11 @@ type: "number", initialWidth: 100, typeAttributes: { minimumFractionDigits: 2 minimumFractionDigits: 2, }, hideDefaultActions: true, wrapText: true } wrapText: true, }, ]; @track editData = []; @@ -278,19 +278,19 @@ typeAttributes: { label: "选择", name: "Id2", size: 1 } size: 1, }, }, { label: "医院名称", fieldName: "Name", hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "省份", fieldName: "stateMasterName", hideDefaultActions: true hideDefaultActions: true, } ]; @@ -304,31 +304,31 @@ @track ConsumableOut_report = ""; @track isMutualTransferGoods = false; @track Barcode = ""; @track summonsForDirction = ""; @track accountValue = ""; @track summonsForDirction = ''; @track accountValue = ''; @track consumableorderdetails2RecordsColumns = [ { label: "消耗品名称", fieldName: "ProdName", hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "批次号", fieldName: "orderdetails2SerialLotNo__c", hideDefaultActions: true hideDefaultActions: true, }, { label: "管理编码", fieldName: "orderdetails2TracingCode__c", hideDefaultActions: true hideDefaultActions: true, }, { label: "使用期限", fieldName: "orderdetails2Sterilization_limit__c", hideDefaultActions: true } hideDefaultActions: true, }, ]; @track consumableorderdetails2Records = []; @@ -341,9 +341,9 @@ type: "url", typeAttributes: { label: { fieldName: "Consumable_order_minor__c" }, target: "_blank" target: "_blank", }, wrapText: true wrapText: true, }, { label: "消耗品明细2名称", @@ -352,10 +352,10 @@ initialWidth: 150, typeAttributes: { label: { fieldName: "orderdetails2Name" }, target: "_blank" target: "_blank", }, hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "单位", @@ -369,13 +369,13 @@ fieldName: "ProdName", initialWidth: 100, hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "发货日期", fieldName: "Deliver_date__c", hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "BarCode", @@ -388,13 +388,13 @@ label: "使用期限", fieldName: "Sterilization_limit__c", hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "出货数量", fieldName: "outboundCount", fieldName: 'outboundCount', hideDefaultActions: true, cellAttributes: { alignment: "right" } cellAttributes: { alignment: "right" }, } ]; @track salesData = []; @@ -407,22 +407,22 @@ type: "url", typeAttributes: { label: { fieldName: "Consumable_order_minor__c" }, target: "_blank" target: "_blank", }, wrapText: true wrapText: true, }, { label: "消耗品明细2名称", fieldName: "orderdetails2Name", hideDefaultActions: true, initialWidth: 150, wrapText: true wrapText: true, }, { label: "消耗品名称", fieldName: "ProdName", hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "单位", @@ -442,14 +442,14 @@ label: "使用期限", fieldName: "Sterilization_limit__c", hideDefaultActions: true, wrapText: true wrapText: true, }, { label: "错误原因", fieldName: "ErrorReason", hideDefaultActions: true, wrapText: true } wrapText: true, }, ]; @track salesErrorData = []; @track salesAccountName = ""; @@ -503,7 +503,7 @@ @track Category5 = ""; @track category5Options = []; //发票id @track invoiceId = ""; @track invoiceId = ''; //二级经销商 @track secondaryDistributor = ""; @@ -561,25 +561,25 @@ fieldName: "url", type: "url", typeAttributes: { label: { fieldName: "Title" }, target: "_blank" }, hideDefaultActions: true hideDefaultActions: true, }, { label: "创建人", fieldName: "CreatedByName", hideDefaultActions: true hideDefaultActions: true, }, { label: "", type: "tableCellIcon", label: '', type: 'tableCellIcon', typeAttributes: { iconName: "utility:delete", iconName: 'utility:delete', recordId: { fieldName: "Id" fieldName: 'Id' } }, initialWidth: 50, hideDefaultActions: true } }, ]; filesUploaded = []; fileContents; @@ -590,8 +590,8 @@ //分页start //@track sortBy = ""; //@track sortDirection = "asc"; defaultSortDirection = "asc"; sortDirection = "asc"; defaultSortDirection = 'asc'; sortDirection = 'asc'; sortedBy; @track pageSize = 10; error; @@ -607,7 +607,7 @@ @track recordStart = 0; @track recordEnd = 0; //end @track SearchDone = ""; @track SearchDone = ''; @track hideCheckboxColumn = false; stylesLoaded = false; @@ -623,6 +623,7 @@ }); } } //InvoiceProNotLabel RrturnProLabel InvoicedLabel @wire(getObjectInfo, { objectApiName: OPPORTUNITY_OBJECT }) @@ -670,33 +671,26 @@ pageSizeLWC: this.pageSize, pageTokenLWC: this.currentPageToken, arriveorderLWC: this.arriveorder }) .then((r) => { }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { //分页 console.log( "r.entity.paginatedAccounts = " + JSON.stringify(r.entity.paginatedAccounts) ); console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts)); this.nextPageToken = r.entity.paginatedAccounts.nextPageToken; this.totalRecords = r.entity.paginatedAccounts.totalRecords; this.recordStart = r.entity.paginatedAccounts.recordStart; this.recordEnd = r.entity.paginatedAccounts.recordEnd; this.totalPages = Math.ceil( r.entity.paginatedAccounts.totalRecords / this.pageSize ); console.log("this.totalPages = " + this.totalPages); this.totalPages = Math.ceil(r.entity.paginatedAccounts.totalRecords / this.pageSize); console.log('this.totalPages = ' + this.totalPages); this.OECId = r.entity.HospitalInfo == null ? "" : r.entity.HospitalInfo; this.OECId = r.entity.HospitalInfo == null ? '' : r.entity.HospitalInfo; console.log("this.OECId = " + this.OECId); this.ConsumableOut_report = r.entity.ConsumableOut_report; console.log( "this.ConsumableOut_report = " + this.ConsumableOut_report ); console.log("this.ConsumableOut_report = " + this.ConsumableOut_report); this.accountid = r.entity.accountid; this.consumableproductdetailsRecords = r.entity.consumableproductdetailsRecords; @@ -705,32 +699,14 @@ this.accountName = r.entity.accountName; this.userWorkLocation = r.entity.userWorkLocation; this.EditAble = r.entity.EditAble; this.consumableorderdetails2Records = r.entity.consumableorderdetails2Records; this.consumableorderdetails2Records = r.entity.consumableorderdetails2Records; for (var i in this.consumableorderdetails2Records) { this.consumableorderdetails2Records[i]["ProdName"] = this.consumableorderdetails2Records[i].Prod.Name; this.consumableorderdetails2Records[i][ "orderdetails2SerialLotNo__c" ] = this.consumableorderdetails2Records[ i ].orderdetails2.SerialLotNo__c; this.consumableorderdetails2Records[i][ "orderdetails2TracingCode__c" ] = this.consumableorderdetails2Records[ i ].orderdetails2.TracingCode__c; this.consumableorderdetails2Records[i][ "orderdetails2Sterilization_limit__c" ] = this.consumableorderdetails2Records[ i ].orderdetails2.Sterilization_limit__c; this.consumableorderdetails2Records[i]["ProdName"] = this.consumableorderdetails2Records[i].Prod.Name; this.consumableorderdetails2Records[i]["orderdetails2SerialLotNo__c"] = this.consumableorderdetails2Records[i].orderdetails2.SerialLotNo__c; this.consumableorderdetails2Records[i]["orderdetails2TracingCode__c"] = this.consumableorderdetails2Records[i].orderdetails2.TracingCode__c; this.consumableorderdetails2Records[i]["orderdetails2Sterilization_limit__c"] = this.consumableorderdetails2Records[i].orderdetails2.Sterilization_limit__c; } this.isShowOutboundProductDetails = r.entity.consumableorderdetails2Count > 0 ? true : false; this.isShowOutboundProductDetails = r.entity.consumableorderdetails2Count > 0 ? true : false; console.log("this.agencyProType = " + this.agencyProType); console.log("this.EditAble = " + this.EditAble); //查询附件 @@ -742,9 +718,7 @@ object["value"] = key; this.category3Options.push(object); } console.log( "this.category3Options = " + JSON.stringify(this.category3Options) ); console.log("this.category3Options = " + JSON.stringify(this.category3Options)); //第4分类 for (var key in r.entity.category4OptionMap) { let object = {}; @@ -777,55 +751,34 @@ unitOptions.push(unitOption); } this.data[i]["unitOptions"] = unitOptions; this.data[i]["unitValue"] = this.data[i]["unitValue"] == null ? unitOptions[0].value : this.data[i]["unitValue"]; this.data[i]["unitValue"] = this.data[i]["unitValue"] == null ? unitOptions[0].value : this.data[i]["unitValue"]; if (this.EditAble) { this.data[i].orderdetails1["Box_Piece__c"] = this.data[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : this.data[i].orderdetails1["Box_Piece__c"]; this.data[i]["unitValue"] = this.data[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : this.data[i].orderdetails1["Box_Piece__c"]; console.log( 'this.data[i].orderdetails1["Box_Piece__c"] = ' + this.data[i].orderdetails1["Box_Piece__c"] ); this.data[i].orderdetails1["Shipment_Count__c"] = this.data[i].orderdetails1["Shipment_Count__c"] == null ? 0 : this.data[i].orderdetails1["Shipment_Count__c"]; this.data[i].orderdetails1["Delivery_List_RMB__c"] = this.data[i].orderdetails1["Delivery_List_RMB__c"] == null ? 0.0 : this.data[i].orderdetails1["Delivery_List_RMB__c"]; this.data[i].orderdetails1["Box_Piece__c"] = this.data[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : this.data[i].orderdetails1["Box_Piece__c"]; this.data[i]["unitValue"] = this.data[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : this.data[i].orderdetails1["Box_Piece__c"]; console.log('this.data[i].orderdetails1["Box_Piece__c"] = ' + this.data[i].orderdetails1["Box_Piece__c"]); this.data[i].orderdetails1["Shipment_Count__c"] = this.data[i].orderdetails1["Shipment_Count__c"] == null ? 0 : this.data[i].orderdetails1["Shipment_Count__c"]; this.data[i].orderdetails1["Delivery_List_RMB__c"] = this.data[i].orderdetails1["Delivery_List_RMB__c"] == null ? 0.0 : this.data[i].orderdetails1["Delivery_List_RMB__c"]; } else { this.data[i]["InvoiceProNot_count__c"] = this.data[i].orderdetails1.InvoiceProNot_count__c; this.data[i]["RrturnPro_count__c"] = this.data[i].orderdetails1.RrturnPro_count__c; this.data[i]["Invoiced_Procount__c"] = this.data[i].orderdetails1.Invoiced_Procount__c; this.data[i]["InvoiceProNot_count__c"] = this.data[i].orderdetails1.InvoiceProNot_count__c; this.data[i]["RrturnPro_count__c"] = this.data[i].orderdetails1.RrturnPro_count__c; this.data[i]["Invoiced_Procount__c"] = this.data[i].orderdetails1.Invoiced_Procount__c; } // this.data[i]["shipmentNumber"] = 0; // this.data[i]["shippingUnitPrice"] = 0.0; //this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"] == 0 ? '' : this.data[i].orderdetails1["Shipment_Count__c"]; //this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"] == 0 ? '' : this.data[i].orderdetails1["Delivery_List_RMB__c"]; this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"]; this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"]; this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"]; this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"]; this.data[i]["Id"] = this.data[i].Prod.Id; if (this.hasHosPro) { if (this.data[i]["hospitalSpecialOffer"]) { this.data[i]["Id"] = this.data[i].Prod.Id + "ishos"; this.data[i]["Id"] = this.data[i].Prod.Id + 'ishos'; } else { this.data[i]["Id"] = this.data[i].Prod.Id + "nothos"; this.data[i]["Id"] = this.data[i].Prod.Id + 'nothos'; } } this.data[i]["recordId"] = this.data[i].Prod.Id; @@ -834,56 +787,39 @@ this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c; this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c; this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; this.data[i]["Box_Piece__c"] = this.data[i].orderdetails1.Box_Piece__c; this.data[i]["shipmentAmount"] = this.data[i].orderdetails1.Shipment_amount__c; this.data[i]["Shipment_amount__c"] = this.data[i].orderdetails1.Shipment_amount__c; this.data[i]["Shipment_Count__c"] = this.data[i].orderdetails1.Shipment_Count__c; this.data[i]["Box_Piece__c"] = this.data[i].orderdetails1.Box_Piece__c; this.data[i]["shipmentAmount"] = this.data[i].orderdetails1.Shipment_amount__c; this.data[i]["Shipment_amount__c"] = this.data[i].orderdetails1.Shipment_amount__c; this.data[i]["Shipment_Count__c"] = this.data[i].orderdetails1.Shipment_Count__c; if (this.data[i]["check"]) { if (this.data[i]['check']) { this.selectedRows.push(this.data[i].Id); } } console.log("EditAble this.data = " + JSON.stringify(this.data)); console.log('EditAble this.data = ' + JSON.stringify(this.data)) } else { for (var i in this.editData) { this.editData[i]["unitValue"] = this.editData[i]["unitValue"]; this.editData[i]["InvoiceProNot_count__c"] = this.editData[i].orderdetails1.InvoiceProNot_count__c; this.editData[i]["RrturnPro_count__c"] = this.editData[i].orderdetails1.RrturnPro_count__c; this.editData[i]["Invoiced_Procount__c"] = this.editData[i].orderdetails1.Invoiced_Procount__c; this.editData[i]["shipmentNumber"] = this.editData[i].orderdetails1["Shipment_Count__c"]; this.editData[i]["shippingUnitPrice"] = this.editData[i].orderdetails1["Delivery_List_RMB__c"]; this.editData[i]["InvoiceProNot_count__c"] = this.editData[i].orderdetails1.InvoiceProNot_count__c; this.editData[i]["RrturnPro_count__c"] = this.editData[i].orderdetails1.RrturnPro_count__c; this.editData[i]["Invoiced_Procount__c"] = this.editData[i].orderdetails1.Invoiced_Procount__c; this.editData[i]["shipmentNumber"] = this.editData[i].orderdetails1["Shipment_Count__c"]; this.editData[i]["shippingUnitPrice"] = this.editData[i].orderdetails1["Delivery_List_RMB__c"]; this.editData[i]["recordId"] = this.editData[i].Prod.Id; this.editData[i]["Id"] = this.editData[i].Prod.Id; this.editData[i]["Name__c"] = this.editData[i].Prod.Name__c; this.editData[i]["SFDA_Status__c"] = this.editData[i].Prod.SFDA_Status__c; this.editData[i]["Category3__c"] = this.editData[i].Prod.Category3__c; this.editData[i]["Category4__c"] = this.editData[i].Prod.Category4__c; this.editData[i]["Category5__c"] = this.editData[i].Prod.Category5__c; this.editData[i]["Box_Piece__c"] = this.editData[i].orderdetails1.Box_Piece__c; this.editData[i]["shipmentAmount"] = this.editData[i].orderdetails1.Shipment_amount__c; this.editData[i]["SFDA_Status__c"] = this.editData[i].Prod.SFDA_Status__c; this.editData[i]["Category3__c"] = this.editData[i].Prod.Category3__c; this.editData[i]["Category4__c"] = this.editData[i].Prod.Category4__c; this.editData[i]["Category5__c"] = this.editData[i].Prod.Category5__c; this.editData[i]["Box_Piece__c"] = this.editData[i].orderdetails1.Box_Piece__c; this.editData[i]["shipmentAmount"] = this.editData[i].orderdetails1.Shipment_amount__c; //this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c; this.editData[i]["Delivery_List_RMB__c"] = this.editData[i].orderdetails1.Delivery_List_RMB__c; this.editData[i]["Shipment_Count__c"] = this.editData[i].orderdetails1.Shipment_Count__c; this.editData[i]["Delivery_List_RMB__c"] = this.editData[i].orderdetails1.Delivery_List_RMB__c; this.editData[i]["Shipment_Count__c"] = this.editData[i].orderdetails1.Shipment_Count__c; } console.log("end this.editData = " + JSON.stringify(this.editData)); console.log('end this.editData = ' + JSON.stringify(this.editData)); } console.log("this.data = " + JSON.stringify(this.data)); @@ -905,26 +841,18 @@ //disable debugger; debugger if (Object.values(r.entity.coc).length > 0) { this.cocLwc = r.entity.coc; console.log("this.cocLwc = " + JSON.stringify(this.cocLwc)); var coc = r.entity.coc; this.accountValue = coc.Order_ForDealerText__c == null ? "" : coc.Order_ForDealerText__c; this.ForDealerText = coc.Order_ForDealerText__c == null ? "" : coc.Order_ForDealerText__c; console.log("this.accountValue = " + this.accountValue); this.accountValue = coc.Order_ForDealerText__c == null ? '' : coc.Order_ForDealerText__c; this.ForDealerText = coc.Order_ForDealerText__c == null ? '' : coc.Order_ForDealerText__c; console.log('this.accountValue = ' + this.accountValue); this.cocId = coc.Id; console.log("cocId = " + this.cocId); console.log('cocId = ' + this.cocId); coc.SummonsStatus = coc.SummonsStatus_c__c; console.log( "this.cocLwc.Arrive_Order__c = " + this.cocLwc.Arrive_Order__c ); console.log('this.cocLwc.Arrive_Order__c = ' + this.cocLwc.Arrive_Order__c) if (this.cocLwc.Arrive_Order__c == null) { this.isBarcode = true; } else { @@ -957,10 +885,7 @@ ) { this.isPraseToPDFDisabled = false; } if ( coc.Billed_Status__c != "还没开票" || coc.SummonsStatus_c__c == "已完成" ) { if ((coc.Billed_Status__c != "还没开票" || coc.SummonsStatus_c__c == "已完成")) { this.isOpenReportDisabled = false; } if ( @@ -1039,16 +964,16 @@ type: "number", initialWidth: 105, typeAttributes: { minimumFractionDigits: 2 minimumFractionDigits: 2, }, hideDefaultActions: true hideDefaultActions: true, }; let object2 = { label: this.RrturnProLabel, fieldName: "RrturnPro_count__c", cellAttributes: { alignment: "right" }, initialWidth: 100, hideDefaultActions: true hideDefaultActions: true, }; let object3 = { label: this.InvoicedLabel, @@ -1056,23 +981,18 @@ type: "number", initialWidth: 100, typeAttributes: { minimumFractionDigits: 2 minimumFractionDigits: 2, }, hideDefaultActions: true hideDefaultActions: true, }; this.editColumns.push(object1); this.editColumns.push(object2); this.editColumns.push(object3); } else { this.ForCustomerText = this.cocLwc.Order_ForCustomerText__c; console.log( "EditAble = true this.ForCustomerText = " + this.ForCustomerText ); console.log('EditAble = true this.ForCustomerText = ' + this.ForCustomerText); this.summonsForDirction = this.cocLwc.SummonsForDirction__c; console.log( "EditAble = true this.summonsForDirction = " + this.summonsForDirction ); console.log('EditAble = true this.summonsForDirction = ' + this.summonsForDirction); let value = this.summonsForDirction; switch (value) { case "直接销售给医院": @@ -1081,7 +1001,7 @@ this.secondaryDistributor = ""; this.ForDealerText = ""; this.accountValue = ""; this.cocLwc["Order_ForDealerText__c"] = ""; this.cocLwc['Order_ForDealerText__c'] = ''; this.isDisabledForDealerText = true; this.isDisabledSecondaryDistributor = true; break; @@ -1124,8 +1044,8 @@ label: "医院特价", initialWidth: 80, fieldName: "hospitalSpecialOffer", type: "boolean", hideDefaultActions: true type: 'boolean', hideDefaultActions: true, }; this.columns.push(object1); this.editColumns.push(object1); @@ -1151,39 +1071,25 @@ ); this.HospitalName = r.entity.HospitalName; this.sumPrice = r.entity.sumPrice.toFixed(2) + "元"; debugger; console.log("this.Existarrive = " + this.Existarrive); console.log("this.EditAble = " + this.EditAble); console.log( "r.entity.coc.SummonsStatus_c__c = " + r.entity.coc.SummonsStatus_c__c ); if ( !this.Existarrive && this.EditAble && r.entity.coc.SummonsStatus_c__c != "价格未定" ) { debugger console.log('this.Existarrive = ' + this.Existarrive); console.log('this.EditAble = ' + this.EditAble); console.log('r.entity.coc.SummonsStatus_c__c = ' + r.entity.coc.SummonsStatus_c__c); if (!this.Existarrive && this.EditAble && r.entity.coc.SummonsStatus_c__c != '价格未定') { this.hideCheckboxColumn = false; } else { this.hideCheckboxColumn = true; } if ( !( this.arriveorder == "" && this.Existarrive == false && this.EditAble && this.cocLwc.SummonsStatus_c__c != "价格未定" ) ) { if (!(this.arriveorder == '' && this.Existarrive == false && this.EditAble && this.cocLwc.SummonsStatus_c__c != '价格未定')) { //让单位,出货数量 变为不可选的text类型 for (var i in this.columns) { if (this.columns[i].label == "单位") { this.columns[i].type = "text"; this.columns[i].fieldName = "unitValue"; if (this.columns[i].label == '单位') { this.columns[i].type = 'text'; this.columns[i].fieldName = 'unitValue'; } if (this.columns[i].label == "出货数量") { this.columns[i].type = "text"; this.columns[i].fieldName = "shipmentNumber"; if (this.columns[i].label == '出货数量') { this.columns[i].type = 'text'; this.columns[i].fieldName = 'shipmentNumber'; } } } @@ -1192,12 +1098,11 @@ console.log("ESetid = " + this.ESetid); } else { console.log("r = " + JSON.stringify(r)); this.showMyToast("初始化失败", r.msg, "Error"); this.showMyToast('初始化失败', r.msg, 'Error'); } }) .catch((error) => { }).catch((error) => { console.log("error = " + JSON.stringify(error)); this.showMyToast("错误", "初始化失败", "Error"); this.showMyToast('错误', '初始化失败', 'Error'); }); } @@ -1212,7 +1117,7 @@ this.isDisabledForCustomerText = false; this.secondaryDistributor = ""; this.ForDealerText = ""; this.cocLwc["Order_ForDealerText__c"] = ""; this.cocLwc['Order_ForDealerText__c'] = ''; this.isDisabledForDealerText = true; this.isDisabledSecondaryDistributor = true; this.isMutualTransferGoods = false; @@ -1291,17 +1196,17 @@ this.Category3 = value; //调用后台显示第四五分类 this.showAllCate(); if (this.Category3 == "") { this.Category4 = ""; this.Category5 = ""; if (this.Category3 == '') { this.Category4 = ''; this.Category5 = ''; } break; case "Category4": this.Category4 = value; //调用后台显示第五分类 this.showCate(); if (this.Category4 == "") { this.Category5 = ""; if (this.Category4 == '') { this.Category5 = ''; } break; case "Category5": @@ -1320,11 +1225,10 @@ } showAllCate() { console.log("showAllCate"); console.log('showAllCate') categoryAllload({ category3Lwc: this.Category3 }) .then((r) => { }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { @@ -1347,21 +1251,19 @@ } } else { console.log("r = " + JSON.stringify(r)); this.showMyToast("4/5分类查询失败", r.msg, "Error"); this.showMyToast('4/5分类查询失败', r.msg, 'Error'); } }) .catch((error) => { }).catch((error) => { console.log("error" + JSON.stringify(error)); }); } showCate() { console.log("showAllCate"); console.log('showAllCate') categoryload({ category3Lwc: this.Category3, category4Lwc: this.Category4 }) .then((r) => { }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { @@ -1384,50 +1286,44 @@ } } else { console.log("r = " + JSON.stringify(r)); this.showMyToast("Error", r.msg, "Error"); this.showMyToast('Error', r.msg, 'Error'); } }) .catch((error) => { }).catch((error) => { console.log("error" + JSON.stringify(error)); }); } invoiceChange(event) { this.invoiceId = event.target.value; console.log("this.invoiceId = " + this.invoiceId); console.log('this.invoiceId = ' + this.invoiceId); } showMyToast(title, message, variant) { this.isShowSpinner = false; this.showLoadingSpinner = false; this.isEditShowSpinner = false; console.log("show custom message"); var iconName = ""; var content = ""; if (variant.toLowerCase() == "success") { iconName = "utility:check"; console.log('show custom message'); var iconName = ''; var content = ''; if (variant.toLowerCase() == '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); } searchProductJs() { this.isEditShowSpinner = true; //this.showTable = false; //查询有哪些选择了的然后check const selectedRows = this.template .querySelector("c-lex-custom-lightning-datatable") .getSelectedRows(); console.log("selectedRows = " + selectedRows); const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows(); console.log('selectedRows = ' + selectedRows); for (var i in this.data) { this.data[i]["check"] = false; } @@ -1473,19 +1369,15 @@ r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { //分页 console.log( "r.entity.paginatedAccounts = " + JSON.stringify(r.entity.paginatedAccounts) ); console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts)); this.nextPageToken = r.entity.paginatedAccounts.nextPageToken; this.totalRecords = r.entity.paginatedAccounts.totalRecords; this.recordStart = r.entity.paginatedAccounts.recordStart; this.recordEnd = r.entity.paginatedAccounts.recordEnd; this.totalPages = Math.ceil( r.entity.paginatedAccounts.totalRecords / this.pageSize ); console.log("this.totalPages = " + this.totalPages); this.totalPages = Math.ceil(r.entity.paginatedAccounts.totalRecords / this.pageSize); console.log('this.totalPages = ' + this.totalPages); this.hasHosPro = r.entity.hasHosPro; console.log("this.hasHosPro = " + this.hasHosPro); @@ -1503,27 +1395,12 @@ unitOptions.push(unitOption); } tempData[i]["unitOptions"] = unitOptions; tempData[i]["unitValue"] = tempData[i]["unitValue"] == null ? unitOptions[0].value : tempData[i]["unitValue"]; tempData[i]["unitValue"] = tempData[i]["unitValue"] == null ? unitOptions[0].value : tempData[i]["unitValue"]; if (this.EditAble) { tempData[i].orderdetails1["Box_Piece__c"] = tempData[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : tempData[i].orderdetails1["Box_Piece__c"]; tempData[i]["unitValue"] = tempData[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : tempData[i].orderdetails1["Box_Piece__c"]; tempData[i].orderdetails1["Shipment_Count__c"] = tempData[i].orderdetails1["Shipment_Count__c"] == null ? 0 : tempData[i].orderdetails1["Shipment_Count__c"]; tempData[i].orderdetails1["Delivery_List_RMB__c"] = tempData[i].orderdetails1["Delivery_List_RMB__c"] == null ? 0.0 : tempData[i].orderdetails1["Delivery_List_RMB__c"]; tempData[i].orderdetails1["Box_Piece__c"] = tempData[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : tempData[i].orderdetails1["Box_Piece__c"]; tempData[i]["unitValue"] = tempData[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : tempData[i].orderdetails1["Box_Piece__c"]; tempData[i].orderdetails1["Shipment_Count__c"] = tempData[i].orderdetails1["Shipment_Count__c"] == null ? 0 : tempData[i].orderdetails1["Shipment_Count__c"]; tempData[i].orderdetails1["Delivery_List_RMB__c"] = tempData[i].orderdetails1["Delivery_List_RMB__c"] == null ? 0.0 : tempData[i].orderdetails1["Delivery_List_RMB__c"]; } else { tempData[i]["InvoiceProNot_count__c"] = tempData[i].orderdetails1.InvoiceProNot_count__c; @@ -1532,22 +1409,17 @@ tempData[i]["Invoiced_Procount__c"] = tempData[i].orderdetails1.Invoiced_Procount__c; } tempData[i]["shipmentNumber"] = tempData[i].orderdetails1["Shipment_Count__c"]; tempData[i]["shippingUnitPrice"] = tempData[i].orderdetails1["Delivery_List_RMB__c"]; tempData[i]["shipmentNumber"] = tempData[i].orderdetails1["Shipment_Count__c"]; tempData[i]["shippingUnitPrice"] = tempData[i].orderdetails1["Delivery_List_RMB__c"]; tempData[i]["Id"] = tempData[i].Prod.Id; console.log( 'tempData[i]["hospitalSpecialOffer"] = ' + tempData[i]["hospitalSpecialOffer"] ); console.log('tempData[i]["hospitalSpecialOffer"] = ' + tempData[i]["hospitalSpecialOffer"]) if (this.hasHosPro) { if (tempData[i]["hospitalSpecialOffer"]) { tempData[i]["Id"] = tempData[i].Prod.Id + "ishos"; tempData[i]["Id"] = tempData[i].Prod.Id + 'ishos'; } else { tempData[i]["Id"] = tempData[i].Prod.Id + "nothos"; tempData[i]["Id"] = tempData[i].Prod.Id + 'nothos'; } } @@ -1558,12 +1430,9 @@ tempData[i]["Category4__c"] = tempData[i].Prod.Category4__c; tempData[i]["Category5__c"] = tempData[i].Prod.Category5__c; tempData[i]["Box_Piece__c"] = tempData[i].orderdetails1.Box_Piece__c; tempData[i]["shipmentAmount"] = tempData[i].orderdetails1.Shipment_amount__c; tempData[i]["Shipment_amount__c"] = tempData[i].orderdetails1.Shipment_amount__c; tempData[i]["Shipment_Count__c"] = tempData[i].orderdetails1.Shipment_Count__c; tempData[i]["shipmentAmount"] = tempData[i].orderdetails1.Shipment_amount__c; tempData[i]["Shipment_amount__c"] = tempData[i].orderdetails1.Shipment_amount__c; tempData[i]["Shipment_Count__c"] = tempData[i].orderdetails1.Shipment_Count__c; if (tempData[i]["shippingUnitPrice"] && tempData[i]["shipmentNumber"]) tempData[i]["shipmentAmount"] = this.amend( @@ -1572,21 +1441,22 @@ "*" ); if (tempData[i]["check"]) { if (tempData[i]['check']) { this.selectedRows.push(tempData[i].Id); } } this.data = tempData; //如果hasHosPro = true 医院特价 console.log("this.hasHosPro = " + this.hasHosPro); console.log('this.hasHosPro = ' + this.hasHosPro); if (this.hasHosPro) { let object1 = { label: "医院特价", fieldName: "hospitalSpecialOffer", type: "boolean", type: 'boolean', initialWidth: 80, hideDefaultActions: true hideDefaultActions: true, }; this.columns.push(object1); this.editColumns.push(object1); @@ -1595,14 +1465,12 @@ this.editColumns = [...this.editColumns]; console.log("this.columns = " + JSON.stringify(this.columns)); console.log("this.data = " + JSON.stringify(this.data)); console.log( " this.selectedRows = " + JSON.stringify(this.selectedRows) ); console.log(" this.selectedRows = " + JSON.stringify(this.selectedRows)); //this.showTable = true; this.isEditShowSpinner = false; } else { console.log("r = " + JSON.stringify(r)); this.showMyToast("查询失败", r.msg, "Error"); this.showMyToast('查询失败', r.msg, 'Error'); } }); } @@ -1610,7 +1478,7 @@ searchHospitalNameModal() { console.log("searchHospitalNameModal"); hospitalInit({ ctype: this.agencyProType ctype: this.agencyProType, }).then((r) => { r = JSON.parse(JSON.stringify(r)); if (r.status == "Success") { @@ -1629,7 +1497,7 @@ console.log("this.searchHospitalName = " + this.searchHospitalName); serContact({ searchName: this.searchHospitalName, ctype: this.agencyProType ctype: this.agencyProType, }).then((r) => { r = JSON.parse(JSON.stringify(r)); if (r.status == "Success") { @@ -1711,33 +1579,22 @@ if (this.data[i].Id == numberDetail.data.recordId) { index = i; this.data[i].shipmentNumber = Number(numberDetail.data.shipmentnumber); this.data[i].orderdetails1["Shipment_Count__c"] = Number( numberDetail.data.shipmentnumber ); console.log( 'this.data[i].orderdetails1["Shipment_Count__c"] = ' + this.data[i].orderdetails1["Shipment_Count__c"] ); console.log( "this.selectedRows.indexOf(this.data[i].Id) = " + this.selectedRows.indexOf(this.data[i].Id) ); if (this.data[i].orderdetails1["Shipment_Count__c"] != "") { this.data[i].orderdetails1["Shipment_Count__c"] = Number(numberDetail.data.shipmentnumber); console.log('this.data[i].orderdetails1["Shipment_Count__c"] = ' + this.data[i].orderdetails1["Shipment_Count__c"]); console.log('this.selectedRows.indexOf(this.data[i].Id) = ' + this.selectedRows.indexOf(this.data[i].Id)); if (this.data[i].orderdetails1["Shipment_Count__c"] != '') { if (this.selectedRows.indexOf(this.data[i].Id) == -1) { this.selectedRows.push(this.data[i].Id); } this.data[i].check = true; } else { if (this.selectedRows.indexOf(this.data[i].Id) != -1) { this.selectedRows.splice( this.selectedRows.indexOf(this.data[i].Id), 1 ); this.selectedRows.splice(this.selectedRows.indexOf(this.data[i].Id), 1); } this.data[i].check = false; } this.selectedRows = [...this.selectedRows]; console.log("this.selectedRows = " + JSON.stringify(this.selectedRows)); console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows)); } } this.data = [...this.data]; @@ -1839,10 +1696,10 @@ getSelectedRows(event) { let selectedRowsEvent = event.detail.selectedRows; console.log("selectedRowsEvent = " + JSON.stringify(selectedRowsEvent)); console.log('selectedRowsEvent = ' + JSON.stringify(selectedRowsEvent)) this.selectedRows = []; for (var i in selectedRowsEvent) { this.selectedRows.push(selectedRowsEvent[i].Id); this.selectedRows.push(selectedRowsEvent[i].Id) } // for (var i in this.data) { // for (var j in selectedRowsEvent) { @@ -1893,10 +1750,8 @@ this.isShowSpinner = true; //查询有哪些选择了的然后check const selectedRows = this.template .querySelector("c-lex-custom-lightning-datatable") .getSelectedRows(); console.log("selectedRows = " + selectedRows); const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows(); console.log('selectedRows = ' + selectedRows); for (var i in this.data) { this.data[i]["check"] = false; } @@ -1944,11 +1799,10 @@ consumableproductdetailsRecordsLwc: this.consumableproductdetailsRecords, agencyProTypeLwc: this.agencyProType, userWorkLocationLwc: this.userWorkLocation }) .then((r) => { }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); debugger; debugger if (r.status == "Success") { // let url = "/lexsummonscreat?ESetid=" + r.entity.ESetId; // this[NavigationMixin.Navigate]({ @@ -1960,10 +1814,9 @@ window.location.href = "/s/lexsummonscreat?ESetid=" + r.entity.ESetId; } else { console.log("r.msg = " + r.msg); this.showMyToast("保存失败", r.msg, "Error"); this.showMyToast('保存失败', r.msg, 'Error'); } }) .catch((error) => { }).catch((error) => { console.log("error = " + JSON.stringify(error)); }); } @@ -1974,7 +1827,7 @@ console.log("this.ESetId = " + this.ESetid); PraseToPDF({ cocLwc: this.cocLwc, ESetId: this.ESetid ESetId: this.ESetid, }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); @@ -1982,7 +1835,7 @@ window.open("/customer/summonsPDF?ESetid=" + r.entity.ESetId); } else { console.log("r.msg = " + r.msg); this.showMyToast("打印失败", r.msg, "Error"); this.showMyToast('打印失败', r.msg, 'Error'); } }); } @@ -1993,17 +1846,10 @@ var reportId = this.ESetid; reportId = reportId.substring(0, 15); console.log("reportId = " + reportId); let reportFilters = '[{"operator":"equals","value":"' + reportId + '","column":"FK_CUSTENT_ID"}]'; let reportFilters = '[{"operator":"equals","value":"' + reportId + '","column":"FK_CUSTENT_ID"}]'; let reportUrl = this.label.ConsumableOutboundReportId; console.log("reportUrl = " + reportUrl); let url = "/s/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters); let url = "/s/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters); console.log("url = " + url); window.open(url); // this[NavigationMixin.Navigate]({ @@ -2039,12 +1885,10 @@ const lookupElement = event.target; console.log("event.detail = " + JSON.stringify(event.detail)); apexSearch({ searchTerm: event.detail.searchTerm }) .then((results) => { searchTerm: event.detail.searchTerm, }).then((results) => { lookupElement.setSearchResults(results); }) .catch((error) => { }).catch((error) => { console.log("error" + JSON.stringify(error)); }); } @@ -2070,7 +1914,7 @@ if (this.filesUploaded.length > 0) { this.file = this.filesUploaded[0]; if (this.file.size > this.MAX_FILE_SIZE) { this.showMyToast("保存失败", "文件过大", "Error"); this.showMyToast('保存失败', '文件过大', 'Error'); return; } this.showPopSpinner = true; @@ -2095,20 +1939,18 @@ saveFile({ recordId: this.ESetid, fileName: this.fileName, base64Data: encodeURIComponent(this.fileContents) }) .then((r) => { base64Data: encodeURIComponent(this.fileContents), }).then((r) => { this.showPopSpinner = false; r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); this.closePop(); this.showMyToast("上传成功", "", "Success"); this.showMyToast('上传成功', '', 'Success'); this.getFiles(); }) .catch((error) => { }).catch((error) => { this.showPopSpinner = false; console.log("error = " + error.message); this.showMyToast("失败", "上传失败", "Error"); this.showMyToast('失败', '上传失败', 'Error'); }); } @@ -2116,9 +1958,8 @@ console.log("getFiles"); this.showLoadingSpinner = true; getFiles({ recordId: this.ESetid }) .then((r) => { recordId: this.ESetid, }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); this.fileData = r.entity.cvList; @@ -2128,18 +1969,14 @@ this.fileData[i]["recordId"] = this.fileData[i].Id; this.fileData[i]["url"] = "/" + this.fileData[i].Id; this.fileData[i]["Title"] = this.fileData[i].Title; this.fileData[i]["attUrl"] = "/" + this.fileData[i].Id; this.fileData[i]["downloadUrl"] = "/sfc/servlet.shepherd/document/download/" + this.fileData[i].ContentDocumentId + "?operationContext=S1"; this.fileData[i]["attUrl"] = '/' + this.fileData[i].Id; this.fileData[i]['downloadUrl'] = '/sfc/servlet.shepherd/document/download/' + this.fileData[i].ContentDocumentId + '?operationContext=S1'; } console.log("this.fileData = " + this.fileData); this.showLoadingSpinner = false; }) .catch((error) => { }).catch((error) => { console.log("error = " + error.message); this.showMyToast("失败", "获取附件失败", "Error"); this.showMyToast('失败', '获取附件失败', 'Error'); }); } @@ -2147,10 +1984,8 @@ this.isShowSpinner = true; //查询有哪些选择了的然后check const selectedRows = this.template .querySelector("c-lex-custom-lightning-datatable") .getSelectedRows(); console.log("selectedRows = " + selectedRows); const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows(); console.log('selectedRows = ' + selectedRows); for (var i in this.data) { this.data[i]["check"] = false; } @@ -2179,36 +2014,32 @@ GoodsDelivery({ cocLwc: this.cocLwc, ESetId: this.ESetid, pageRecordsLwcLwc: cloneData }) .then((r) => { pageRecordsLwcLwc: cloneData, }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { console.log( "Summons_Order_type__c = " + this.cocLwc["Summons_Order_type__c"] ); this.isSales = this.cocLwc["Summons_Order_type__c"] == "销售" ? true : false; this.isSales = this.cocLwc["Summons_Order_type__c"] == "销售" ? true : false; this.GoodsDeliveryInit(); } else { console.log("r.msg = " + r.msg); this.showMyToast("错误", r.msg, "Error"); this.showMyToast('错误', r.msg, 'Error'); } this.isShippingSales = true; }) .catch((error) => { }).catch((error) => { console.log("error = " + error.message); this.showMyToast("失败", "跳转失败", "Error"); this.showMyToast('失败', '跳转失败', 'Error'); }); } GoodsDeliveryInit() { console.log("GoodsDeliveryInit"); GoodsDeliveryInit({ ESetId: this.ESetid }) .then((r) => { ESetId: this.ESetid, }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { @@ -2217,100 +2048,55 @@ this.salesUserWorkLocation = r.entity.userWorkLocation; this.salesAccountid = r.entity.accountid; this.salesOrderdetails = r.entity.orderdetails; console.log( "this.salesOrderdetails = " + JSON.stringify(this.salesOrderdetails) ); console.log('this.salesOrderdetails = ' + JSON.stringify(this.salesOrderdetails)) this.salesData = r.entity.consumableorderdetailsRecords; console.log("this.salesData = " + JSON.stringify(this.salesData)); console.log('this.salesData = ' + JSON.stringify(this.salesData)) this.salesErrorData = r.entity.consumableorderdetailsRecordserror; this.salesOrderpieceorboxMap = r.entity.orderpieceorboxMap; this.salesOrderpriceMap = r.entity.orderpriceMap; this.salesOrderagencypriceMap = r.entity.orderagencypriceMap; for (var i in this.salesData) { this.salesData[i]["Id"] = this.salesData[i].orderdetails2.Id; this.salesData[i]["Consumable_order_minor__c"] = this.salesData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesData[i].orderdetails2.Consumable_order_minor__r.Name : ""; this.salesData[i]["ConsumableorderminorUrl"] = this.salesData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesData[i].orderdetails2.Consumable_order_minor__c : ""; this.salesData[i]["orderdetails2Name"] = this.salesData[i].orderdetails2.Name; this.salesData[i]["orderdetails2NameUrl"] = "/" + this.salesData[i].orderdetails2.Id; this.salesData[i]["Box_Piece__c"] = this.salesData[i].orderdetails2.Box_Piece__c; this.salesData[i]["Consumable_order_minor__c"] = this.salesData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesData[i].orderdetails2.Consumable_order_minor__r.Name : ''; this.salesData[i]["ConsumableorderminorUrl"] = this.salesData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesData[i].orderdetails2.Consumable_order_minor__c : ''; this.salesData[i]["orderdetails2Name"] = this.salesData[i].orderdetails2.Name; this.salesData[i]["orderdetails2NameUrl"] = "/" + this.salesData[i].orderdetails2.Id; this.salesData[i]["Box_Piece__c"] = this.salesData[i].orderdetails2.Box_Piece__c; this.salesData[i]["ProdName"] = this.salesData[i].Prod.Name; this.salesData[i]["Deliver_date__c"] = this.salesData[i].orderdetails2.Deliver_date__c; this.salesData[i]["Bar_Code__c"] = this.salesData[i].orderdetails2.Bar_Code__c; this.salesData[i]["Sterilization_limit__c"] = this.salesData[i].orderdetails2.Sterilization_limit__c; if (this.salesData[i]["Box_Piece__c"] == "盒") { console.log( "this.salesData[i] = " + JSON.stringify(this.salesData[i]) ); this.salesData[i]["outboundCount"] = this.salesData[i].outboundCount; this.salesData[i]["Deliver_date__c"] = this.salesData[i].orderdetails2.Deliver_date__c; this.salesData[i]["Bar_Code__c"] = this.salesData[i].orderdetails2.Bar_Code__c; this.salesData[i]["Sterilization_limit__c"] = this.salesData[i].orderdetails2.Sterilization_limit__c; if (this.salesData[i]["Box_Piece__c"] == '盒') { console.log('this.salesData[i] = ' + JSON.stringify(this.salesData[i])) this.salesData[i]["outboundCount"] = this.salesData[i].outboundCount; } else { for (var j in this.salesOrderdetails) { console.log( "this.salesOrderdetails[j].Consumable_product__c = " + this.salesOrderdetails[j].Consumable_product__c ); console.log( "this.salesData[i].orderdetails2.Consumable_product__c = " + this.salesData[i].orderdetails2.Consumable_product__c ); if ( this.salesOrderdetails[j].Consumable_product__c == this.salesData[i].orderdetails2.Consumable_product__c ) { this.salesData[i]["outboundCount"] = this.salesOrderdetails[j].Shipment_Count__c; console.log('this.salesOrderdetails[j].Consumable_product__c = ' + this.salesOrderdetails[j].Consumable_product__c); console.log('this.salesData[i].orderdetails2.Consumable_product__c = ' + this.salesData[i].orderdetails2.Consumable_product__c); if (this.salesOrderdetails[j].Consumable_product__c == this.salesData[i].orderdetails2.Consumable_product__c) { this.salesData[i]["outboundCount"] = this.salesOrderdetails[j].Shipment_Count__c; } } } } for (var i in this.salesErrorData) { this.salesErrorData[i]["Id"] = this.salesErrorData[i].orderdetails2.Id; this.salesErrorData[i]["Consumable_order_minor__c"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesErrorData[i].orderdetails2.Consumable_order_minor__r .Name : ""; this.salesErrorData[i]["ConsumableorderminorUrl"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesErrorData[i].orderdetails2.Consumable_order_minor__c : ""; this.salesErrorData[i]["orderdetails2Name"] = this.salesErrorData[i].orderdetails2.Name; this.salesErrorData[i]["ProdName"] = this.salesErrorData[i].Prod.Name; this.salesErrorData[i]["Box_Piece__c"] = this.salesErrorData[i].orderdetails2.Box_Piece__c; this.salesErrorData[i]["Bar_Code__c"] = this.salesErrorData[i].orderdetails2.Bar_Code__c; this.salesErrorData[i]["Sterilization_limit__c"] = this.salesErrorData[i].orderdetails2.Sterilization_limit__c; this.salesErrorData[i]["Id"] = this.salesErrorData[i].orderdetails2.Id; this.salesErrorData[i]["Consumable_order_minor__c"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesErrorData[i].orderdetails2.Consumable_order_minor__r.Name : ''; this.salesErrorData[i]["ConsumableorderminorUrl"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesErrorData[i].orderdetails2.Consumable_order_minor__c : ''; this.salesErrorData[i]["orderdetails2Name"] = this.salesErrorData[i].orderdetails2.Name; this.salesErrorData[i]["ProdName"] = this.salesErrorData[i].Prod.Name; this.salesErrorData[i]["Box_Piece__c"] = this.salesErrorData[i].orderdetails2.Box_Piece__c; this.salesErrorData[i]["Bar_Code__c"] = this.salesErrorData[i].orderdetails2.Bar_Code__c; this.salesErrorData[i]["Sterilization_limit__c"] = this.salesErrorData[i].orderdetails2.Sterilization_limit__c; } this.isShowSpinner = false; } else { console.log("r.msg = " + r.msg); this.showMyToast("初始化失败", r.msg, "Error"); this.showMyToast('初始化失败', r.msg, 'Error'); } }) .catch((error) => { }).catch((error) => { console.log("error = " + error.message); this.showMyToast("错误", "初始化失败", "Error"); this.showMyToast('错误', '初始化失败', 'Error'); }); } @@ -2324,9 +2110,8 @@ userWorkLocation: this.salesUserWorkLocation, accountid: this.salesAccountid, orderdetails: this.salesOrderdetails, orderpieceorboxMap: this.salesOrderpieceorboxMap }) .then((r) => { orderpieceorboxMap: this.salesOrderpieceorboxMap, }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { @@ -2334,78 +2119,36 @@ this.salesErrorData = r.entity.consumableorderdetailsRecordserror; this.salesData = r.entity.consumableorderdetailsRecords; for (var i in this.salesErrorData) { this.salesErrorData[i]["Id"] = this.salesErrorData[i].orderdetails2.Id; this.salesErrorData[i]["Consumable_order_minor__c"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesErrorData[i].orderdetails2.Consumable_order_minor__r .Name : ""; this.salesErrorData[i]["ConsumableorderminorUrl"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesErrorData[i].orderdetails2.Consumable_order_minor__c : ""; this.salesErrorData[i]["orderdetails2Name"] = this.salesErrorData[i].orderdetails2.Name; this.salesErrorData[i]["ProdName"] = this.salesErrorData[i].Prod.Name; this.salesErrorData[i]["Box_Piece__c"] = this.salesErrorData[i].orderdetails2.Box_Piece__c; this.salesErrorData[i]["Bar_Code__c"] = this.salesErrorData[i].orderdetails2.Bar_Code__c; this.salesErrorData[i]["Sterilization_limit__c"] = this.salesErrorData[i].orderdetails2.Sterilization_limit__c; this.salesErrorData[i]["Id"] = this.salesErrorData[i].orderdetails2.Id; this.salesErrorData[i]["Consumable_order_minor__c"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesErrorData[i].orderdetails2.Consumable_order_minor__r.Name : ''; this.salesErrorData[i]["ConsumableorderminorUrl"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesErrorData[i].orderdetails2.Consumable_order_minor__c : ''; this.salesErrorData[i]["orderdetails2Name"] = this.salesErrorData[i].orderdetails2.Name; this.salesErrorData[i]["ProdName"] = this.salesErrorData[i].Prod.Name; this.salesErrorData[i]["Box_Piece__c"] = this.salesErrorData[i].orderdetails2.Box_Piece__c; this.salesErrorData[i]["Bar_Code__c"] = this.salesErrorData[i].orderdetails2.Bar_Code__c; this.salesErrorData[i]["Sterilization_limit__c"] = this.salesErrorData[i].orderdetails2.Sterilization_limit__c; } console.log("this.salesData = " + JSON.stringify(this.salesData)); console.log('this.salesData = ' + JSON.stringify(this.salesData)); for (var i in this.salesData) { this.salesData[i]["Id"] = this.salesData[i].orderdetails2.Id; this.salesData[i]["Consumable_order_minor__c"] = this.salesData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesData[i].orderdetails2.Consumable_order_minor__r.Name : ""; this.salesData[i]["ConsumableorderminorUrl"] = this.salesData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesData[i].orderdetails2.Consumable_order_minor__c : ""; this.salesData[i]["orderdetails2Name"] = this.salesData[i].orderdetails2.Name; this.salesData[i]["orderdetails2NameUrl"] = "/" + this.salesData[i].orderdetails2.Id; this.salesData[i]["Box_Piece__c"] = this.salesData[i].orderdetails2.Box_Piece__c; this.salesData[i]["Consumable_order_minor__c"] = this.salesData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesData[i].orderdetails2.Consumable_order_minor__r.Name : ''; this.salesData[i]["ConsumableorderminorUrl"] = this.salesData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesData[i].orderdetails2.Consumable_order_minor__c : ''; this.salesData[i]["orderdetails2Name"] = this.salesData[i].orderdetails2.Name; this.salesData[i]["orderdetails2NameUrl"] = "/" + this.salesData[i].orderdetails2.Id; this.salesData[i]["Box_Piece__c"] = this.salesData[i].orderdetails2.Box_Piece__c; this.salesData[i]["ProdName"] = this.salesData[i].Prod.Name; this.salesData[i]["Deliver_date__c"] = this.salesData[i].orderdetails2.Deliver_date__c; this.salesData[i]["Bar_Code__c"] = this.salesData[i].orderdetails2.Bar_Code__c; this.salesData[i]["Sterilization_limit__c"] = this.salesData[i].orderdetails2.Sterilization_limit__c; if (this.salesData[i]["Box_Piece__c"] == "盒") { console.log( "this.salesData[i] = " + JSON.stringify(this.salesData[i]) ); this.salesData[i]["outboundCount"] = this.salesData[i].outboundCount; this.salesData[i]["Deliver_date__c"] = this.salesData[i].orderdetails2.Deliver_date__c; this.salesData[i]["Bar_Code__c"] = this.salesData[i].orderdetails2.Bar_Code__c; this.salesData[i]["Sterilization_limit__c"] = this.salesData[i].orderdetails2.Sterilization_limit__c; if (this.salesData[i]["Box_Piece__c"] == '盒') { console.log('this.salesData[i] = ' + JSON.stringify(this.salesData[i])) this.salesData[i]["outboundCount"] = this.salesData[i].outboundCount; } else { for (var j in this.salesOrderdetails) { console.log( "this.salesOrderdetails[j].Consumable_product__c = " + this.salesOrderdetails[j].Consumable_product__c ); console.log( "this.salesData[i].orderdetails2.Consumable_product__c = " + this.salesData[i].orderdetails2.Consumable_product__c ); if ( this.salesOrderdetails[j].Consumable_product__c == this.salesData[i].orderdetails2.Consumable_product__c ) { this.salesData[i]["outboundCount"] = this.salesOrderdetails[j].Shipment_Count__c; console.log('this.salesOrderdetails[j].Consumable_product__c = ' + this.salesOrderdetails[j].Consumable_product__c); console.log('this.salesData[i].orderdetails2.Consumable_product__c = ' + this.salesData[i].orderdetails2.Consumable_product__c); if (this.salesOrderdetails[j].Consumable_product__c == this.salesData[i].orderdetails2.Consumable_product__c) { this.salesData[i]["outboundCount"] = this.salesOrderdetails[j].Shipment_Count__c; } } } @@ -2424,10 +2167,9 @@ this.isShowSpinner = false; } else { console.log("r.msg = " + r.msg); this.showMyToast("获取失败", r.msg, "Error"); this.showMyToast('获取失败', r.msg, 'Error'); } }) .catch((error) => { }).catch((error) => { console.log("error = " + JSON.stringify(error.message)); }); } @@ -2436,10 +2178,10 @@ let outboundDetail = event.detail; for (var i in this.salesData) { if (this.salesData[i].Id == outboundDetail.data.recordId) { this.salesData[i]["outboundCount"] = outboundDetail.data.count; this.salesData[i]['outboundCount'] = outboundDetail.data.count } } console.log("this.salesData = " + JSON.stringify(this.salesData)); console.log('this.salesData = ' + JSON.stringify(this.salesData)) } SaveP() { @@ -2466,9 +2208,8 @@ consumableorderdetailsRecordsLwc: JSON.stringify(cloneSalesData), orderdetailsLwc: this.salesOrderdetails, orderpriceMapLwc: this.salesOrderpriceMap, orderagencypriceMapLwc: this.salesOrderagencypriceMap }) .then((r) => { orderagencypriceMapLwc: this.salesOrderagencypriceMap, }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { @@ -2477,17 +2218,16 @@ this[NavigationMixin.Navigate]({ type: "standard__webPage", attributes: { url: "/lexsaleanddelivery" } url: "/lexsaleanddelivery", }, }); } else { console.log("r.msg = " + r.msg); this.showMyToast("销售失败", r.msg, "Error"); this.showMyToast('销售失败', r.msg, 'Error'); } }) .catch((error) => { }).catch((error) => { console.log("error = " + JSON.stringify(error.message)); this.showMyToast("错误", "销售失败", "Error"); this.showMyToast('错误', '销售失败', 'Error'); }); } @@ -2514,9 +2254,8 @@ consumableorderdetailsRecordsLwc: JSON.stringify(cloneSalesData), orderdetailsLwc: this.salesOrderdetails, orderpriceMapLwc: this.salesOrderpriceMap, orderagencypriceMapLwc: this.salesOrderagencypriceMap }) .then((r) => { orderagencypriceMapLwc: this.salesOrderagencypriceMap, }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { @@ -2525,34 +2264,27 @@ this[NavigationMixin.Navigate]({ type: "standard__webPage", attributes: { url: "/lexsaleanddelivery" } url: "/lexsaleanddelivery", }, }); } else { console.log("r.msg = " + r.msg); this.showMyToast("出货失败", r.msg, "Error"); this.showMyToast('出货失败', r.msg, 'Error'); } }) .catch((error) => { }).catch((error) => { console.log("error = " + JSON.stringify(error.message)); this.showMyToast("错误", "出货失败", "Error"); this.showMyToast('错误', '出货失败', 'Error'); }); } //发票 openToInvoiceJs() { let url = ""; console.log("this.invoiceId = " + this.invoiceId); if (this.invoiceId.length > 0 && this.invoiceId != "000000000000000") { url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&invoiceId=" + this.invoiceId + "&KeyWords=Redirect"; let url = ''; console.log('this.invoiceId = ' + this.invoiceId); if (this.invoiceId.length > 0 && this.invoiceId != '000000000000000') { url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&invoiceId=" + this.invoiceId + "&KeyWords=Redirect"; } else { url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&KeyWords=Redirect"; url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&KeyWords=Redirect"; } window.open(url); // this[NavigationMixin.Navigate]({ @@ -2568,9 +2300,8 @@ DeleteConsumable() { this.isShowSpinner = true; DelConsumable({ ESetId: this.ESetid }) .then((r) => { ESetId: this.ESetid, }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { @@ -2578,42 +2309,40 @@ this[NavigationMixin.Navigate]({ type: "standard__webPage", attributes: { url: url } url: url, }, }); } else { console.log("r.msg = " + r.msg); this.showMyToast("删除失败", r.msg, "Error"); this.showMyToast('删除失败', r.msg, 'Error'); } }) .catch((error) => { }).catch((error) => { console.log("error = " + error.message); this.showMyToast("错误", "删除失败", "Error"); this.showMyToast('错误', '删除失败', 'Error'); }); } handleLoad() { console.log("handleLoad"); console.log('handleLoad') try { const style = document.createElement("style"); style.innerText = ".hehe-layoutItem .slds-button__icon {display: none;}"; this.template.querySelector(".hideHelpText").appendChild(style); const style = document.createElement('style'); style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}'; this.template.querySelector('.hideHelpText').appendChild(style); } catch (error) { console.log(error); } } handleLoad2() { console.log("handleLoad2"); console.log('handleLoad2') try { const style = document.createElement("style"); style.innerText = ".hehe-layoutItem .slds-button__icon {display: none;}"; this.template.querySelector(".hideHelpText").appendChild(style); const style = document.createElement('style'); style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}'; this.template.querySelector('.hideHelpText').appendChild(style); const style2 = document.createElement("style"); style2.innerText = ".hehe-layoutItem .slds-form-element__label {padding : 0px}"; this.template.querySelector(".hideHelpText").appendChild(style2); const style2 = document.createElement('style'); style2.innerText = '.hehe-layoutItem .slds-form-element__label {padding : 0px}'; this.template.querySelector('.hideHelpText').appendChild(style2); } catch (error) { console.log(error); } @@ -2624,8 +2353,8 @@ this[NavigationMixin.Navigate]({ type: "standard__webPage", attributes: { url: url } url: url, }, }); } @@ -2639,17 +2368,13 @@ if (event.target.files.length > 0) { this.filesUploaded = event.target.files; this.fileName = event.target.files[0].name; console.log("this.fileName:" + this.fileName); console.log('this.fileName:' + this.fileName); } } //是否显示附件移除 get attDelBtn() { if ( this.fileName != "" && this.fileName != null && this.fileName != "请选择一个文件上传" ) { if (this.fileName != '' && this.fileName != null && this.fileName != '请选择一个文件上传') { return true; } else { return false; @@ -2666,14 +2391,14 @@ //移除附件 removeAtt() { this.filesUploaded = []; this.fileName = ""; this.fileName = ''; } ClearJs() { this.consumableName = ""; this.Category3 = ""; this.Category4 = ""; this.Category5 = ""; this.consumableName = ''; this.Category3 = ''; this.Category4 = ''; this.Category5 = ''; this.searchProductJs(); } @@ -2694,20 +2419,19 @@ } onHandleSort(event) { //将已经选好了的放到前面,不进行排序 if (this.EditAble) { const { fieldName: sortedBy, sortDirection } = event.detail; const cloneData = [...this.data]; cloneData.sort(this.sortBy(sortedBy, sortDirection === "asc" ? 1 : -1)); cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)); let index = 0; let selectedRows = this.template .querySelector("c-lex-custom-lightning-datatable") .getSelectedRows(); let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows(); let selectedRowsIds = []; for (var i in selectedRows) { selectedRowsIds.push(selectedRows[i].Id); } console.log("selectedRowsIds = " + JSON.stringify(selectedRowsIds)); console.log('selectedRowsIds = ' + JSON.stringify(selectedRowsIds)); for (var i = 0; i < cloneData.length; i++) { if (selectedRowsIds.indexOf(cloneData[i].Id) != -1) { if (i != 0) { @@ -2724,7 +2448,7 @@ } else { const { fieldName: sortedBy, sortDirection } = event.detail; const cloneData = [...this.editData]; cloneData.sort(this.sortBy(sortedBy, sortDirection === "asc" ? 1 : -1)); cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)); this.editData = cloneData; this.sortDirection = sortDirection; this.sortedBy = sortedBy; @@ -2732,14 +2456,12 @@ } handlePrevious() { this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize); this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize); this.searchProductJs(); } handleNext() { this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize); this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize); this.searchProductJs(); } handleFirst() { @@ -2748,8 +2470,7 @@ } handleLast() { this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0; this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0; this.searchProductJs(); } @@ -2760,15 +2481,15 @@ this.searchProductJs(); } editHandlePrevious() { this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize); this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize); this.searchEditProductJs(); } editHandleNext() { this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize); this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize); this.searchEditProductJs(); } editHandleFirst() { @@ -2777,8 +2498,7 @@ } editHandleLast() { this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0; this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0; this.searchEditProductJs(); } @@ -2797,70 +2517,50 @@ statusEdit: this.statusEdit, pageSizeLWC: this.pageSize, pageTokenLWC: this.currentPageToken }) .then((r) => { }).then((r) => { r = JSON.parse(JSON.stringify(r)); console.log("r = " + JSON.stringify(r)); if (r.status == "Success") { //分页 console.log( "r.entity.paginatedAccounts = " + JSON.stringify(r.entity.paginatedAccounts) ); console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts)); this.nextPageToken = r.entity.paginatedAccounts.nextPageToken; this.totalRecords = r.entity.paginatedAccounts.totalRecords; this.recordStart = r.entity.paginatedAccounts.recordStart; this.recordEnd = r.entity.paginatedAccounts.recordEnd; this.totalPages = Math.ceil( r.entity.paginatedAccounts.totalRecords / this.pageSize ); console.log("this.totalPages = " + this.totalPages); this.totalPages = Math.ceil(r.entity.paginatedAccounts.totalRecords / this.pageSize); console.log('this.totalPages = ' + this.totalPages); this.editData = r.entity.pageRecords; console.log("this.data start = " + JSON.stringify(this.data)); for (var i in this.editData) { this.editData[i]["unitValue"] = this.editData[i]["unitValue"]; this.editData[i]["InvoiceProNot_count__c"] = this.editData[i].orderdetails1.InvoiceProNot_count__c; this.editData[i]["RrturnPro_count__c"] = this.editData[i].orderdetails1.RrturnPro_count__c; this.editData[i]["Invoiced_Procount__c"] = this.editData[i].orderdetails1.Invoiced_Procount__c; this.editData[i]["shipmentNumber"] = this.editData[i].orderdetails1["Shipment_Count__c"]; this.editData[i]["shippingUnitPrice"] = this.editData[i].orderdetails1["Delivery_List_RMB__c"]; this.editData[i]["InvoiceProNot_count__c"] = this.editData[i].orderdetails1.InvoiceProNot_count__c; this.editData[i]["RrturnPro_count__c"] = this.editData[i].orderdetails1.RrturnPro_count__c; this.editData[i]["Invoiced_Procount__c"] = this.editData[i].orderdetails1.Invoiced_Procount__c; this.editData[i]["shipmentNumber"] = this.editData[i].orderdetails1["Shipment_Count__c"]; this.editData[i]["shippingUnitPrice"] = this.editData[i].orderdetails1["Delivery_List_RMB__c"]; this.editData[i]["recordId"] = this.editData[i].Prod.Id; this.editData[i]["Id"] = this.editData[i].Prod.Id; this.editData[i]["Name__c"] = this.editData[i].Prod.Name__c; this.editData[i]["SFDA_Status__c"] = this.editData[i].Prod.SFDA_Status__c; this.editData[i]["Category3__c"] = this.editData[i].Prod.Category3__c; this.editData[i]["Category4__c"] = this.editData[i].Prod.Category4__c; this.editData[i]["Category5__c"] = this.editData[i].Prod.Category5__c; this.editData[i]["Box_Piece__c"] = this.editData[i].orderdetails1.Box_Piece__c; this.editData[i]["shipmentAmount"] = this.editData[i].orderdetails1.Shipment_amount__c; this.editData[i]["SFDA_Status__c"] = this.editData[i].Prod.SFDA_Status__c; this.editData[i]["Category3__c"] = this.editData[i].Prod.Category3__c; this.editData[i]["Category4__c"] = this.editData[i].Prod.Category4__c; this.editData[i]["Category5__c"] = this.editData[i].Prod.Category5__c; this.editData[i]["Box_Piece__c"] = this.editData[i].orderdetails1.Box_Piece__c; this.editData[i]["shipmentAmount"] = this.editData[i].orderdetails1.Shipment_amount__c; //this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c; this.editData[i]["Delivery_List_RMB__c"] = this.editData[i].orderdetails1.Delivery_List_RMB__c; this.editData[i]["Shipment_Count__c"] = this.editData[i].orderdetails1.Shipment_Count__c; this.editData[i]["Delivery_List_RMB__c"] = this.editData[i].orderdetails1.Delivery_List_RMB__c; this.editData[i]["Shipment_Count__c"] = this.editData[i].orderdetails1.Shipment_Count__c; } this.showTable = true; this.isEditShowSpinner = false; } else { console.log("r = " + JSON.stringify(r)); this.showMyToast("搜索失败", r.msg, "Error"); this.showMyToast('搜索失败', r.msg, 'Error'); } }) .catch((error) => { this.showMyToast("错误", "搜索失败", "Error"); }).catch((error) => { this.showMyToast('错误', '搜索失败', 'Error'); }); } @@ -2877,21 +2577,19 @@ this.isShowSpinner = true; //var recordId = event.detail.data.recordId; var recordId = event.target.getAttribute("data-fileid"); console.log("attid:" + recordId); console.log('attid:' + recordId); deleteAtt({ contentVersionId: recordId }) .then((r) => { }).then(r => { r = JSON.parse(JSON.stringify(r)); if (r.status == "Success") { this.showMyToast("删除成功", "", "Success"); this.showMyToast('删除成功', '', 'Success'); this.getFiles(); } else { this.showMyToast("删除失败", r.msg, "Error"); this.showMyToast('删除失败', r.msg, 'Error'); } }).catch(error => { this.showMyToast('错误', error.message, 'Error'); }) .catch((error) => { this.showMyToast("错误", error.message, "Error"); }); } } force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
@@ -267,7 +267,7 @@ sorted-by={sortedBy} onsort={onHandleSort} hide-checkbox-column={hidecheckboxcolumn} style="word-wrap: break-word; word-break: break-all" style="word-wrap:break-word; word-break:break-all;" class="wrapped-header-datatable" > </c-lex-custom-lightning-datatable> force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
@@ -1,19 +1,19 @@ 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"; import categoryAllload from "@salesforce/apex/LexInventoryViewController.categoryAllload"; import { NavigationMixin } from "lightning/navigation"; 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'; import categoryAllload from '@salesforce/apex/LexInventoryViewController.categoryAllload'; import { NavigationMixin } from 'lightning/navigation'; //table css import { loadStyle } from "lightning/platformResourceLoader"; import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable"; import { loadStyle } from 'lightning/platformResourceLoader'; import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable'; export default class LexinventoryViewLWC extends NavigationMixin( LightningElement ) { //分页start @track sortBy = ""; @track sortBy = ''; //@track sortDirection = "asc"; @track pageSize = 10; error; @@ -31,7 +31,7 @@ //end @track data = []; @track message = ""; @track message = ''; @track Name; @track CategoryThree; @@ -44,7 +44,7 @@ @track accountName; @track agencyProType; @track userWorkLocation; @track value = ""; @track value = ''; @track showTable = false; @track hidecheckboxcolumn = true; @track check = false; @@ -59,37 +59,37 @@ @track columns = [ { label: "消耗品名称", fieldName: "Name__c", type: "Name", label: '消耗品名称', fieldName: 'Name__c', type: 'Name', sortable: true, hideDefaultActions: true, // initialWidth: 200, wrapText: true, cellAttributes: { alignment: "left" } cellAttributes: { alignment: 'left' } }, { label: "第三分类", fieldName: "Category3__c", label: '第三分类', fieldName: 'Category3__c', initialWidth: 102, cellAttributes: { alignment: "left" }, cellAttributes: { alignment: 'left' }, hideDefaultActions: true, sortable: true, wrapText: true }, { label: "第四分类", fieldName: "Category4__c", cellAttributes: { alignment: "left" }, label: '第四分类', fieldName: 'Category4__c', cellAttributes: { alignment: 'left' }, initialWidth: 102, hideDefaultActions: true, wrapText: true, sortable: true }, { label: "第五分类", fieldName: "Category5__c", cellAttributes: { alignment: "left" }, label: '第五分类', fieldName: 'Category5__c', cellAttributes: { alignment: 'left' }, initialWidth: 102, hideDefaultActions: true, wrapText: true, @@ -97,89 +97,89 @@ }, { label: "规格", fieldName: "packing_list", cellAttributes: { alignment: "right" }, label: '规格', fieldName: 'packing_list', cellAttributes: { alignment: 'right' }, initialWidth: 50, wrapText: true, hideDefaultActions: true }, { label: "单位", fieldName: "BoxPiece", cellAttributes: { alignment: "left" }, label: '单位', fieldName: 'BoxPiece', cellAttributes: { alignment: 'left' }, initialWidth: 50, wrapText: true, hideDefaultActions: true }, { label: "注册证编码号", fieldName: "approbation_No", cellAttributes: { alignment: "left" }, label: '注册证编码号', fieldName: 'approbation_No', cellAttributes: { alignment: 'left' }, wrapText: true, initialWidth: 104, hideDefaultActions: true }, { label: "注册有效期", fieldName: "expiration_Date", cellAttributes: { alignment: "left" }, label: '注册有效期', fieldName: 'expiration_Date', cellAttributes: { alignment: 'left' }, wrapText: true, hideDefaultActions: true, initialWidth: 95 }, { label: "CFDA状态", fieldName: "SFDA_Status__c", cellAttributes: { alignment: "left" }, label: 'CFDA状态', fieldName: 'SFDA_Status__c', cellAttributes: { alignment: 'left' }, initialWidth: 84, wrapText: true, hideDefaultActions: true }, { label: "使用期限", fieldName: "guaranteeperiod", cellAttributes: { alignment: "left" }, label: '使用期限', fieldName: 'guaranteeperiod', cellAttributes: { alignment: 'left' }, hideDefaultActions: true, initialWidth: 95 }, { label: "有效期内库存", type: "customInventoryColor", fieldName: "limitCount", label: '有效期内库存', type: 'customInventoryColor', fieldName: 'limitCount', sortable: true, cellAttributes: { alignment: "right" }, cellAttributes: { alignment: 'right' }, typeAttributes: { value: { fieldName: "limitCount" }, upperlimit: { fieldName: "upperlimit" }, lowerlimit: { fieldName: "lowerlimit" }, boxPrice: { fieldName: "BoxPiece" } value: { fieldName: 'limitCount' }, upperlimit: { fieldName: 'upperlimit' }, lowerlimit: { fieldName: 'lowerlimit' }, boxPrice: { fieldName: 'BoxPiece' } }, hideDefaultActions: true, initialWidth: 110 }, { label: "过期库存", fieldName: "overlimitCount", label: '过期库存', fieldName: 'overlimitCount', hideDefaultActions: true, cellAttributes: { alignment: "right" }, cellAttributes: { alignment: 'right' }, initialWidth: 78 } ]; defaultSortDirection = "asc"; sortDirection = "asc"; defaultSortDirection = 'asc'; sortDirection = 'asc'; sortedBy; renderedCallback() { if (!this.stylesLoaded) { Promise.all([loadStyle(this, WrappedHeaderTable)]) .then(() => { console.log("Custom styles loaded"); console.log('Custom styles loaded'); this.stylesLoaded = true; }) .catch((error) => { console.error("Error loading custom styles"); console.error('Error loading custom styles'); }); } } @@ -200,41 +200,55 @@ .then((result) => { result = JSON.parse(JSON.stringify(result)); console.log( "result.pageRecords = " + JSON.stringify(result.entity.pageRecords) 'result.pageRecords = ' + JSON.stringify(result.entity.pageRecords) ); console.log( "result.consumableorderdetailsRecords = " + JSON.stringify(result.entity.consumableorderdetailsRecords) '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)); if (result.status == "Success") { console.log('result.status = ' + result.status); console.log('result = ' + JSON.stringify(result)); console.log('result 1= ' + JSON.stringify(result.entity)); console.log( "result.entity.paginatedAccounts = " + 'result 2= ' + JSON.stringify(result.entity.pageRecords) ); if (result.status == 'Success') { 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.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 result.entity.paginatedAccounts.totalRecords / this.pageSize ); console.log("this.totalPages = " + this.totalPages); this.paginationVisibility = this.totalPages > 1 ? true : false; console.log('this.totalPages = ' + this.totalPages); this.paginationVisibility = this.totalPages > 1 ? true : false; this.loader = false; this.data = result.entity.pageRecords; this.productkucun = result.entity.productkucun; 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.Category4__c; this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c; 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.Category4__c; this.data[i]['Category5__c'] = this.data[i].Prod.Category5__c; this.data[i]['SFDA_Status__c'] = this.data[i].Prod.SFDA_Status__c; } this.showTable = true; this.orderDetZaikuList = result.entity.orderDetZaikuList; @@ -244,56 +258,61 @@ 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) ' this.optionscatone===>' + JSON.stringify(this.optionscatone) ); let option2ValueTemp = []; for (var key in result.entity.category4OptionMap) { let object = {}; object["label"] = result.entity.category4OptionMap[key]; object["value"] = key; object['label'] = result.entity.category4OptionMap[key]; object['value'] = key; option2ValueTemp.push(object); } this.category4Options = option2ValueTemp; let option3ValueTemp = []; for (var key in result.entity.category5OptionMap) { let object = {}; object["label"] = result.entity.category5OptionMap[key]; object["value"] = key; object['label'] = result.entity.category5OptionMap[key]; object['value'] = key; option3ValueTemp.push(object); } this.category5Options = option3ValueTemp; this.hasHos = result.entity.hasHos; console.log("this.hasHos" + this.hasHos); console.log('this.hasHos' + this.hasHos); //颜色标记 //hasHos = true 医院特价 if (this.hasHos) { let object1 = { label: "医院特价", fieldName: "hospitalSpecialOffer__c", label: '医院特价', fieldName: 'hospitalSpecialOffer__c', hideDefaultActions: true, type: "boolean", cellAttributes: { alignment: "left" }, 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.Category4__c; this.data[j]["Category5__c"] = this.data[j].Prod.Category5__c; this.data[j]["SFDA_Status__c"] = this.data[j].Prod.SFDA_Status__c; this.data[j]["hospitalSpecialOffer__c"] = 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.Category4__c; this.data[j]['Category5__c'] = this.data[j].Prod.Category5__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__c' + this.data[j].hospitalSpecialOffer ); } @@ -301,64 +320,64 @@ this.showSpinner = false; } else { // this.showToast("Error",'Error', result.msg); this.showMyToast("初始化失败", result.msg, "error"); this.showMyToast('初始化失败', result.msg, 'error'); } }) .catch((error) => { this.loader = false; this.showSpinner = false; console.log("error = " + JSON.stringify(error)); console.log('error = ' + JSON.stringify(error)); }); } handleChange(event) { let fieldName = event.target.getAttribute("data-field"); let fieldName = event.target.getAttribute('data-field'); let value = event.detail.value; console.log("======>fieldName" + fieldName); console.log("======>value" + value); console.log('======>fieldName' + fieldName); console.log('======>value' + value); switch (fieldName) { case "Name": case 'Name': this.Name = value; break; case "CategoryThree": case 'CategoryThree': this.CategoryThree = value; break; case "CategoryFour": case 'CategoryFour': this.CategoryFour = value; break; case "CategoryFive": case 'CategoryFive': this.CategoryFive = value; break; default: console.log("no data"); console.log('no data'); } } dataChange(event) { let fieldName = event.target.getAttribute("data-field"); let fieldName = event.target.getAttribute('data-field'); let value = event.detail.value; console.log("fieldName = " + fieldName + " value = " + value); console.log('fieldName = ' + fieldName + ' value = ' + value); switch (fieldName) { case "Name": case 'Name': this.Name = value; break; case "CategoryThree": case 'CategoryThree': this.CategoryThree = value; //调用后台显示第四五分类 this.showAllCate(); if (this.CategoryThree == "") { this.CategoryFour = ""; this.CategoryFive = ""; if (this.CategoryThree == '') { this.CategoryFour = ''; this.CategoryFive = ''; } break; case "CategoryFour": case 'CategoryFour': this.CategoryFour = value; //调用后台显示第五分类 this.showCate(); if (this.CategoryFour == "") { this.CategoryFive = ""; if (this.CategoryFour == '') { this.CategoryFive = ''; } break; case "CategoryFive": case 'CategoryFive': this.CategoryFive = value; break; } @@ -371,34 +390,35 @@ }) .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.category4Options = []; this.category5Options = []; //第4分类 for (var key in result.entity.category4OptionMap) { let object = {}; object["label"] = result.entity.category4OptionMap[key]; object["value"] = key; object['label'] = result.entity.category4OptionMap[key]; object['value'] = key; this.category4Options.push(object); } console.log( "this.category4Options = " + JSON.stringify(this.category4Options) 'this.category4Options = ' + JSON.stringify(this.category4Options) ); //第5分类 for (var key in result.entity.category5OptionMap) { let object = {}; object["label"] = result.entity.category5OptionMap[key]; object["value"] = key; object['label'] = result.entity.category5OptionMap[key]; object['value'] = key; this.category5Options.push(object); } } else { console.log("result = " + JSON.stringify(result)); this.showMyToast(result.msg, "", "error"); console.log('result = ' + JSON.stringify(result)); this.showMyToast(result.msg, '', 'error'); } }) .catch((error) => { console.log("error" + JSON.stringify(error)); console.log('error' + JSON.stringify(error)); }); } @@ -423,37 +443,47 @@ }) .then((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; 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 result.entity.paginatedAccounts.totalRecords / this.pageSize ); console.log( "result.entity.paginatedAccounts = " + 'result.entity.paginatedAccounts = ' + JSON.stringify(result.entity.paginatedAccounts) ); console.log("this.totalPages = " + this.totalPages); this.paginationVisibility = this.totalPages > 1 ? true : false; console.log("this.sortDirection = " + this.sortDirection); console.log('this.totalPages = ' + this.totalPages); this.paginationVisibility = this.totalPages > 1 ? true : false; console.log('this.sortDirection = ' + this.sortDirection); // this.showToast("Success",'搜索成功', result.msg); // 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.Category4__c; this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c; this.data[i]["hospitalSpecialOffer__c"] = 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.Category4__c; this.data[i]['Category5__c'] = this.data[i].Prod.Category5__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]["guaranteeperiod"] = this.data[i].guaranteeperiod; this.data[i]['guaranteeperiod'] = this.data[i].guaranteeperiod; } this.data = [...this.data]; console.log("this.data = " + JSON.stringify(this.data)); console.log('this.data = ' + JSON.stringify(this.data)); this.showTable = true; this.showSpinner = false; } else { @@ -469,41 +499,41 @@ } }) .catch((error) => { console.log("error = " + JSON.stringify(error)); console.log('error = ' + JSON.stringify(error)); this.showSpinner = false; }); } 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' } }); } @@ -511,15 +541,15 @@ clearAll() { this.showSpinner = true; this.showTable = false; this.Name = ""; this.CategoryThree = ""; this.CategoryFour = ""; this.CategoryFive = ""; this.template.querySelectorAll("lightning-combobox").forEach((each) => { 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, @@ -534,28 +564,38 @@ productkucunLWC: this.productkucun }) .then((result) => { console.log("result搜索 = " + JSON.stringify(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; 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 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.totalPages = ' + this.totalPages); this.paginationVisibility = this.totalPages > 1 ? true : false; console.log('this.sortDirection = ' + this.sortDirection); this.data = result.entity.pageRecords; 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.Category4__c; this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c; this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c; this.data[i]["guaranteeperiod"] = this.data[i].guaranteeperiod; 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.Category4__c; this.data[i]['Category5__c'] = this.data[i].Prod.Category5__c; this.data[i]['SFDA_Status__c'] = this.data[i].Prod.SFDA_Status__c; this.data[i]['guaranteeperiod'] = this.data[i].guaranteeperiod; } this.showSpinner = false; this.showTable = true; @@ -568,7 +608,7 @@ } }) .catch((error) => { console.log("error = " + JSON.stringify(error)); console.log('error = ' + JSON.stringify(error)); this.showSpinner = false; }); } @@ -590,12 +630,12 @@ } onHandleSort(event) { console.log("Sort"); console.log('Sort'); 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{ @@ -609,7 +649,7 @@ const { fieldName: sortedBy, sortDirection } = event.detail; const cloneData = [...this.data]; cloneData.sort( this.sortByMethod(sortedBy, sortDirection === "asc" ? 1 : -1) this.sortByMethod(sortedBy, sortDirection === 'asc' ? 1 : -1) ); this.data = cloneData; this.sortDirection = sortDirection; @@ -661,22 +701,26 @@ 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 != "") { if (message != '') { content = "<h2><strong>" + title + "<strong/></h2><h5>" + message + "</h5>"; '<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") .querySelector('c-common-toast') .showToast(variant, content, iconName, 10000); } }