Subversion Repositories SmartDukaan

Rev

Rev 35203 | Rev 35297 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35203 Rev 35289
Line 9... Line 9...
9
        font-weight: 400;
9
        font-weight: 400;
10
        text-transform: capitalize;
10
        text-transform: capitalize;
11
        color: #797979;
11
        color: #797979;
12
    }
12
    }
13
</style>
13
</style>
14
<script type="text/javascript">
-
 
15
    $('.chosen-select').chosen({
-
 
16
        search_contains: true
-
 
17
 
-
 
18
    });
-
 
19
    stateNames = [];
-
 
20
        #foreach($stateName in $stateNames)
-
 
21
        //console.log("$stateName");
-
 
22
        stateNames.push("$stateName");
-
 
23
        #end
-
 
24
 
-
 
25
    $(".addlocationbutton").click(function () {
-
 
26
        $("#addLocationModal").modal({backdrop: false});
-
 
27
    });
-
 
28
 
-
 
29
 
-
 
30
    $(".createUser").click(function () {
-
 
31
        $("#addUserModal").modal({backdrop: false});
-
 
32
    });
-
 
33
 
-
 
34
 
-
 
35
</script>
-
 
36
 
14
 
37
<section class="wrapper">
15
<section class="wrapper">
38
    <div class="row" style="background: white; font-size: 14px;">
16
    <div class="row" style="background: white; font-size: 14px;">
39
        <form id="update-retailer-details-form">
17
        <form id="update-retailer-details-form">
40
            <div class="col-lg-4" style="border-left: 1px solid #f0f0f0;">
18
            <div class="col-lg-4" style="border-left: 1px solid #f0f0f0;">
Line 159... Line 137...
159
                        <div class="col-lg-6 form-group">
137
                        <div class="col-lg-6 form-group">
160
                            <p class="normal-details">$userRoleNames</p>
138
                            <p class="normal-details">$userRoleNames</p>
161
                        </div>
139
                        </div>
162
                    #end
140
                    #end
163
                </div>
141
                </div>
164
                <!--<div class="row">
-
 
165
					<div class="col-lg-4 form-group">
-
 
166
						<p class="bold-details">PAN</p>
-
 
167
					</div>
-
 
168
					<div class="col-lg-3 form-group">
-
 
169
						<label class="btn btn-file"> #set($retailerDocumentId = 0)
-
 
170
							#if($retailer && $retailer.getDocumentId())
-
 
171
							#set($retailerDocumentId = $retailer.getDocumentId()) #end Browse<input
-
 
172
							type="file" id="retailerDocument" name="retailerDocument"
-
 
173
							documentId="$retailerDocumentId" style="display: none">
-
 
174
 
-
 
175
						</label>
-
 
176
					</div>
-
 
177
					#if($retailer && $retailer.getDocumentId())
-
 
178
					<div class="col-lg-2 form-group">
-
 
179
						<label class="btn btn-file-download">
-
 
180
							<button type="button" class="btn btn-default btn-sm"
-
 
181
								onclick="downloadRetailerDocument($retailer.getDocumentId(), $retailer.getId())">&nbsp;View&nbsp;</button>
-
 
182
						</label>
-
 
183
					</div>
-
 
184
					#end
-
 
185
				</div>-->
-
 
186
                <div class="row col-lg-12 form-group">
142
                <div class="row col-lg-12 form-group">
187
                    <div>
143
                    <div>
188
                        <label>Blocked Brands</label>
144
                        <label>Blocked Brands</label>
189
                    </div>
145
                    </div>
190
                    <select data-placeholder="Choose brands" multiple="multiple"
146
                    <select data-placeholder="Choose brands" multiple="multiple"
Line 405... Line 361...
405
                    <div class="col-lg-4 form-group">
361
                    <div class="col-lg-4 form-group">
406
                        <p class="bold-details">FOFO STORE CODE</p>
362
                        <p class="bold-details">FOFO STORE CODE</p>
407
                    </div>
363
                    </div>
408
                    <div class="col-lg-6 form-group">
364
                    <div class="col-lg-6 form-group">
409
                        #if($fofoStore) <input placeholder="fofostorecode"
365
                        #if($fofoStore) <input placeholder="fofostorecode"
410
                                               id="minInvestment" name="fofostorecode" type="text"
366
                                               id="fofostorecode" name="fofostorecode" type="text"
411
                                               value="$fofoStore.getCode()" class="form-control input-sm"
367
                                               value="$fofoStore.getCode()" class="form-control input-sm"
412
                                               style="font-weight: bold;" disabled> #else <input
368
                                               style="font-weight: bold;" disabled> #else <input
413
                                placeholder="fofostorecode" id="minInvestment"
369
                                placeholder="fofostorecode"
414
                                name="fofostorecode" type="text" value=""
370
                                name="fofostorecode" type="text" value=""
415
                                class="form-control input-sm" disabled> #end
371
                                class="form-control input-sm" disabled> #end
416
                    </div>
372
                    </div>
417
                </div>
373
                </div>
418
                #if(!$fofoStore)
374
                #if(!$fofoStore)
Line 824... Line 780...
824
            #end
780
            #end
825
                <div id="shopDetailsSize" size="$a"></div>
781
                <div id="shopDetailsSize" size="$a"></div>
826
            </div>
782
            </div>
827
            <div class="row">
783
            <div class="row">
828
                <div class="col-md-2 col-md-offset-5">
784
                <div class="col-md-2 col-md-offset-5">
829
                    <button id="updateDetails" class="btn btn-primary" type="submit">Update
785
                    <button id="updateDetails" class="btn btn-primary" type="submit">Update Details
830
                        Details
-
 
831
                    </button>
786
                    </button>
832
                </div>
787
                </div>
833
            </div>
788
            </div>
834
        </form>
789
        </form>
835
 
790
 
Line 953... Line 908...
953
        </div>
908
        </div>
954
    </div>
909
    </div>
955
</div>
910
</div>
956
 
911
 
957
</div>
912
</div>
-
 
913
<script type="text/javascript">
-
 
914
    $('.chosen-select').chosen({
-
 
915
        search_contains: true
-
 
916
 
-
 
917
    });
-
 
918
    stateNames = [];
-
 
919
        #foreach($stateName in $stateNames)
-
 
920
        //console.log("$stateName");
-
 
921
        stateNames.push("$stateName");
-
 
922
        #end
-
 
923
 
-
 
924
    $(".addlocationbutton").click(function () {
-
 
925
        $("#addLocationModal").modal({backdrop: false});
-
 
926
    });
-
 
927
 
-
 
928
 
-
 
929
    $(".createUser").click(function () {
-
 
930
        $("#addUserModal").modal({backdrop: false});
-
 
931
    });
-
 
932
        #if($trialForm)
-
 
933
        var trialForm = $trialForm;
-
 
934
        if (trialForm.status == "PENDING") {
-
 
935
            $(document).ready(function () {
-
 
936
                console.log(trialForm);
-
 
937
                $("#retailerDocument").attr("documentId", trialForm.aadhaarDocumentId);
-
 
938
                $("#firstName").val(trialForm.firstName);
-
 
939
                $("#lastName").val(trialForm.lastName);
-
 
940
                $("#retailerName").val(trialForm.businessName);
-
 
941
                $("#retailerNumber").val(trialForm.gstNumber);
-
 
942
                $("#retailerAddressName").val(trialForm.businessName);
-
 
943
                $("#retailerAddressLine1").val(trialForm.addressLine1);
-
 
944
                $("#retailerAddressLine2").val(trialForm.addressLine2);
-
 
945
                setTimeout(function () {
-
 
946
                    $("#retailerAddressPinCode").val(trialForm.pincode).trigger("change");
-
 
947
                }, 1000);
-
 
948
                $("#emailId").val(trialForm.email);
-
 
949
                $("#mobileNumber").val(trialForm.mobile);
-
 
950
                $("#fofoType").val("FRANCHISE");
-
 
951
                $("#retailerShopDocument0").attr("documentId", trialForm.panDocumentId);
-
 
952
                $("#shopName0").val(trialForm.businessName);
-
 
953
                $("#gstNumber").val(trialForm.gstNumber);
-
 
954
 
-
 
955
                //Important to set these fields
-
 
956
                $("#counterPotential").val(300000);
-
 
957
                $("#minInvestment").val(300000);
-
 
958
                $("#active").prop("checked", true);
-
 
959
                $("#fofoPartner").prop("checked", true);
-
 
960
                //$("#sameAsRetailerAddress0").prop("checked", true);
-
 
961
 
-
 
962
                $("#counterSize").val("THREE_LAC");
-
 
963
 
-
 
964
            });
-
 
965
        }
-
 
966
 
-
 
967
        #end
-
 
968
    $(function () {
-
 
969
        $('#update-retailer-details-form')
-
 
970
                .validate({
-
 
971
                    submitHandler: function (form, event) {
-
 
972
                        event.preventDefault();
-
 
973
                        debugger;
-
 
974
                        if (validateRetailerDetails()) {
-
 
975
                            alert("Please fix errors");
-
 
976
                            return false;
-
 
977
                        }
-
 
978
                        var json = retailerDetailsJson();
-
 
979
                        debugger;
-
 
980
                        console.log("Retailer Details");
-
 
981
                        console.log(json);
-
 
982
                        if (confirm("Are you sure you want to update Retailer Details!")) {
-
 
983
                            doAjaxRequestWithJsonHandler(
-
 
984
                                    `${context}/retailerDetails`,
-
 
985
                                    "PUT",
-
 
986
                                    json,
-
 
987
                                    function (response) {
-
 
988
                                        $(
-
 
989
                                                '#retailer-details-container')
-
 
990
                                                .html(
-
 
991
                                                        response);
-
 
992
                                        if (localStorage
-
 
993
                                                .getItem("retailerDocument") !== null) {
-
 
994
                                            localStorage
-
 
995
                                                    .removeItem("retailerDocument");
-
 
996
                                        }
-
 
997
                                        var shopDetailsSize = $(
-
 
998
                                                "#shopDetailsSize")
-
 
999
                                                .attr(
-
 
1000
                                                        "size");
-
 
1001
                                        for (var i = 0; i < shopDetailsSize; i++) {
-
 
1002
                                            if (localStorage
-
 
1003
                                                    .getItem("retailerShopDocument"
-
 
1004
                                                            + i) != null) {
-
 
1005
                                                localStorage
-
 
1006
                                                        .removeItem("retailerShopDocument"
-
 
1007
                                                                + i);
-
 
1008
                                            }
-
 
1009
                                        }
-
 
1010
                                        alert("Retailer Details has been successfully.");
-
 
1011
                                    });
-
 
1012
                            return false; // required to
-
 
1013
                            // block normal
-
 
1014
                            // submit since
-
 
1015
                            // you used ajax
-
 
1016
                        }
-
 
1017
                    }
-
 
1018
                });
-
 
1019
 
-
 
1020
    });
958
 
1021
 
959
<script type="text/javascript"
-
 
960
        src="resources/js/update-retailer-details.js?v=2${version}"></script>
-
 
961
1022
</script>
-
 
1023
962
1024