updates
parent
fd093cf6bd
commit
addedd09da
|
|
@ -233,6 +233,7 @@
|
||||||
<!-- .modal-body -->
|
<!-- .modal-body -->
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<input type="hidden" id="quotation_project_uid" />
|
<input type="hidden" id="quotation_project_uid" />
|
||||||
|
<input type="hidden" id="quotation_company_uid" />
|
||||||
<!-- .page-section -->
|
<!-- .page-section -->
|
||||||
<div class="page-section">
|
<div class="page-section">
|
||||||
<button type="button" id="QuotationListNewBtn" class="btn btn-primary btn-floated position-absolute" title="Add new client"><i class="fa fa-plus"></i></button>
|
<button type="button" id="QuotationListNewBtn" class="btn btn-primary btn-floated position-absolute" title="Add new client"><i class="fa fa-plus"></i></button>
|
||||||
|
|
@ -331,12 +332,37 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.form-group -->
|
</div><!-- /.form-group -->
|
||||||
|
|
||||||
|
<!-- .form-group -->
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-label-group">
|
||||||
|
<input id="quotation_date" type="text" class="form-control flatpickr-input" data-toggle="flatpickr" data-date-format="Y/m/d" readonly="readonly" placeholder="報價日期"><label for="quotation_date">報價日期</label>
|
||||||
|
<input type="hidden" id="quotation_date" />
|
||||||
|
</div>
|
||||||
|
</div><!-- /.form-group -->
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-label-group">
|
||||||
|
<input id="quotation_range" type="text" class="form-control flatpickr-input active" data-toggle="flatpickr" data-mode="range" data-date-format="Y/m/d" data-default-dates="['today', 'today']" readonly="readonly" placeholder="報價單有效期限">
|
||||||
|
<label for="quotation_range">報價單有效期限</label>
|
||||||
|
<input type="hidden" id="quotation_expStart" />
|
||||||
|
<input type="hidden" id="quotation_expEnd" />
|
||||||
|
<input type="hidden" id="quotation_expStart_old" />
|
||||||
|
<input type="hidden" id="quotation_expEnd_old" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!-- .form-group -->
|
<!-- .form-group -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-label-group">
|
<div class="form-label-group">
|
||||||
<input type="text" id="quotation_name" class="form-control" value="" placeholder="報價單名稱" maxlength="50" required=""> <label for="quotation_name">報價單名稱</label>
|
<input type="text" id="quotation_name" class="form-control" value="" placeholder="報價單名稱" maxlength="50" required=""> <label for="quotation_name">報價單名稱</label>
|
||||||
|
<input type="hidden" id="quotation_name_old" />
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.form-group -->
|
</div><!-- /.form-group -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="contactPerson_uid">窗口</label>
|
||||||
|
<select class="custom-select custom-select-sm" id="contactPerson_uid" name="contactPerson_uid" required="">
|
||||||
|
</select>
|
||||||
|
<input type="hidden" id="contactPerson_uid_old" />
|
||||||
|
</div>
|
||||||
<!-- grid row -->
|
<!-- grid row -->
|
||||||
<div id="quotatiion_div" class="row">
|
<div id="quotatiion_div" class="row">
|
||||||
<div class="card-body border-top">
|
<div class="card-body border-top">
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
<link rel="stylesheet" href="~/assets/vendor/at.js/css/jquery.atwho.min.css">
|
<link rel="stylesheet" href="~/assets/vendor/at.js/css/jquery.atwho.min.css">
|
||||||
<link rel="stylesheet" href="~/assets/vendor/bootstrap-select/css/bootstrap-select.min.css">
|
<link rel="stylesheet" href="~/assets/vendor/bootstrap-select/css/bootstrap-select.min.css">
|
||||||
<link rel="stylesheet" href="~/assets/vendor/flatpickr/flatpickr.min.css">
|
<link rel="stylesheet" href="~/assets/vendor/flatpickr/flatpickr.min.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="~/assets/vendor/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css">
|
<link rel="stylesheet" href="~/assets/vendor/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css">
|
||||||
<link rel="stylesheet" href="~/assets/vendor/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css">
|
<link rel="stylesheet" href="~/assets/vendor/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css">
|
||||||
<link rel="stylesheet" href="~/assets/vendor/nouisliderribute/nouislider.min.css">
|
<link rel="stylesheet" href="~/assets/vendor/nouisliderribute/nouislider.min.css">
|
||||||
|
|
@ -200,7 +201,7 @@
|
||||||
|
|
||||||
|
|
||||||
<script src="https://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
|
<script src="https://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
|
||||||
<script src="~/assets/javascript/custom/globalJS.js" asp-append-version="true"></script>
|
|
||||||
<script src="~/assets/vendor/popper.js/umd/popper.min.js"></script>
|
<script src="~/assets/vendor/popper.js/umd/popper.min.js"></script>
|
||||||
<script src="~/assets/vendor/bootstrap/js/bootstrap.min.js"></script> <!-- END BASE JS -->
|
<script src="~/assets/vendor/bootstrap/js/bootstrap.min.js"></script> <!-- END BASE JS -->
|
||||||
<!-- BEGIN PLUGINS JS -->
|
<!-- BEGIN PLUGINS JS -->
|
||||||
|
|
@ -212,6 +213,7 @@
|
||||||
<script src="~/assets/vendor/flatpickr/flatpickr.min.js"></script>
|
<script src="~/assets/vendor/flatpickr/flatpickr.min.js"></script>
|
||||||
<script src="~/assets/vendor/flatpickr/plugins/monthSelect/index.js"></script>
|
<script src="~/assets/vendor/flatpickr/plugins/monthSelect/index.js"></script>
|
||||||
<script src="https://npmcdn.com/flatpickr@4.6.3/dist/l10n/zh-tw.js"></script>
|
<script src="https://npmcdn.com/flatpickr@4.6.3/dist/l10n/zh-tw.js"></script>
|
||||||
|
<script src="~/assets/vendor/flatpickr/l10n/zh-tw.js"></script>
|
||||||
<script src="~/assets/vendor/wnumb/wNumb.min.js"></script>
|
<script src="~/assets/vendor/wnumb/wNumb.min.js"></script>
|
||||||
<script src="~/assets/vendor/nouisliderribute/nouislider.min.js"></script>
|
<script src="~/assets/vendor/nouisliderribute/nouislider.min.js"></script>
|
||||||
<script src="~/assets/vendor/blueimp-file-upload/js/vendor/jquery.ui.widget.js"></script>
|
<script src="~/assets/vendor/blueimp-file-upload/js/vendor/jquery.ui.widget.js"></script>
|
||||||
|
|
@ -242,6 +244,7 @@
|
||||||
<script src="~/assets/vendor/vanilla-text-mask/vanillaTextMask.js"></script>
|
<script src="~/assets/vendor/vanilla-text-mask/vanillaTextMask.js"></script>
|
||||||
<script src="~/assets/vendor/text-mask-addons/textMaskAddons.js"></script>
|
<script src="~/assets/vendor/text-mask-addons/textMaskAddons.js"></script>
|
||||||
<!-- END SELECT2-->
|
<!-- END SELECT2-->
|
||||||
|
<script src="~/assets/javascript/custom/globalJS.js" asp-append-version="true"></script>
|
||||||
<!-- BEGIN THEME JS -->
|
<!-- BEGIN THEME JS -->
|
||||||
<script src="~/assets/javascript/theme.min.js"></script> <!-- END THEME JS -->
|
<script src="~/assets/javascript/theme.min.js"></script> <!-- END THEME JS -->
|
||||||
<!-- BEGIN PAGE LEVEL JS -->
|
<!-- BEGIN PAGE LEVEL JS -->
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
(function ($, document) {
|
//const zhTw = require("../../vendor/fullcalendar/locale/zh-tw");
|
||||||
|
|
||||||
|
(function ($, document) {
|
||||||
(function ($) {
|
(function ($) {
|
||||||
$.UrlParam = function (name) {
|
$.UrlParam = function (name) {
|
||||||
//宣告正規表達式
|
//宣告正規表達式
|
||||||
|
|
@ -131,7 +133,7 @@ function clearChildren(element) {
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case "radio":
|
case "radio":
|
||||||
case "checkbox": break;
|
case "checkbox": break;
|
||||||
case "hidden": break;
|
case "hidden": e.value = ''; break;
|
||||||
case "button":
|
case "button":
|
||||||
case "submit":
|
case "submit":
|
||||||
case "text": e.value = ''; break;
|
case "text": e.value = ''; break;
|
||||||
|
|
@ -187,6 +189,8 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
|
flatpickr.localize(flatpickr.l10ns.zh_tw);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,21 @@ $(document).ready(function () {
|
||||||
fpStart.setDate(new Date(startTxt + '/1'))
|
fpStart.setDate(new Date(startTxt + '/1'))
|
||||||
fpEnd.setDate(new Date(endTxt + '/1'))
|
fpEnd.setDate(new Date(endTxt + '/1'))
|
||||||
|
|
||||||
|
$("#quotation_range").flatpickr({
|
||||||
|
mode: 'range',
|
||||||
|
onChange: function (selectedDates, dateStr, instance) {
|
||||||
|
if (selectedDates.length == 2) {
|
||||||
|
var dateStart = instance.formatDate(selectedDates[0], "Y/m/d");
|
||||||
|
var dateEnd = instance.formatDate(selectedDates[1], "Y/m/d");
|
||||||
|
|
||||||
|
$('#quotation_expStart').val(dateStart);
|
||||||
|
$('#quotation_expEnd').val(dateEnd);
|
||||||
|
|
||||||
|
// interact with selected dates here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
$('#projectSaveBtn').on('click', function () {
|
$('#projectSaveBtn').on('click', function () {
|
||||||
var company_uid = $('#company_select').val();
|
var company_uid = $('#company_select').val();
|
||||||
var project_name = $('#project_name').val();
|
var project_name = $('#project_name').val();
|
||||||
|
|
@ -111,6 +126,10 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#QuotationListNewBtn').on('click', function () {
|
$('#QuotationListNewBtn').on('click', function () {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#quotation_method').val('add');
|
$('#quotation_method').val('add');
|
||||||
$('#clientModelQuotationModal').modal("toggle");
|
$('#clientModelQuotationModal').modal("toggle");
|
||||||
});
|
});
|
||||||
|
|
@ -185,6 +204,42 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function loadContactPersion() {
|
||||||
|
var data = $('#dt-responsive').DataTable().row(projectRowPos).data();
|
||||||
|
var uid = $('#quotation_company_uid').val();
|
||||||
|
var formData = {
|
||||||
|
company_uid: uid
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/Api/contactPersonList",
|
||||||
|
type: "post",
|
||||||
|
data: formData,
|
||||||
|
success: function (data, textStatus, jqXHR) {
|
||||||
|
if (data.ret == "yes") {
|
||||||
|
var obj = data.contactPersons;
|
||||||
|
|
||||||
|
$("#contactPerson_uid").empty();
|
||||||
|
|
||||||
|
$.each(obj, function (i, item) {
|
||||||
|
$("#contactPerson_uid").append($("<option>", {
|
||||||
|
value: item.contactPerson_uid,
|
||||||
|
text: item.contactPerson_name + ' (Tel:' + item.contactPerson_tel + ', Email:' + item.contactPerson_email + ')'
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert(data.message);
|
||||||
|
|
||||||
|
if (data.err_code == "99999") {
|
||||||
|
location.href = "/Root/Login";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
|
alert('網路或伺服器發生錯誤,請稍後重試!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
function loadQuotation_custom() {
|
function loadQuotation_custom() {
|
||||||
var formData = {
|
var formData = {
|
||||||
dept_uid: $('#dept_select').val()
|
dept_uid: $('#dept_select').val()
|
||||||
|
|
@ -234,8 +289,10 @@ function buttonClick(obj) {
|
||||||
|
|
||||||
if (type == "preview") {
|
if (type == "preview") {
|
||||||
var data = $('#dt-responsive').DataTable().row(projectRowPos).data();
|
var data = $('#dt-responsive').DataTable().row(projectRowPos).data();
|
||||||
|
|
||||||
var project_name = data.project_name;
|
var project_name = data.project_name;
|
||||||
var company_name = data.company_name;
|
var company_name = data.company_name;
|
||||||
|
var company_uid = data.company_uid;
|
||||||
|
|
||||||
var project_info_div = '專案名稱: ' + project_name + ", 客戶公司:" + company_name;
|
var project_info_div = '專案名稱: ' + project_name + ", 客戶公司:" + company_name;
|
||||||
|
|
||||||
|
|
@ -259,7 +316,13 @@ function buttonClick(obj) {
|
||||||
$('#dt-responsive-quotation').dataTable().fnAddData(obj);
|
$('#dt-responsive-quotation').dataTable().fnAddData(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#quotation_project_uid').val(uid);
|
||||||
|
$('#quotation_company_uid').val(company_uid);
|
||||||
$('#project_info_div').text(project_info_div);
|
$('#project_info_div').text(project_info_div);
|
||||||
|
|
||||||
|
loadContactPersion();
|
||||||
$('#clientQuotationListModal').modal('toggle');
|
$('#clientQuotationListModal').modal('toggle');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue