diff --git a/assets/css/main.css b/assets/css/main.css
index 5b1dfdc..d63ded3 100644
--- a/assets/css/main.css
+++ b/assets/css/main.css
@@ -3291,7 +3291,7 @@ footer:after {
.insetCommChat {
width: 100%;
float: left;
- margin: 20px 0 -7px 0;
+ margin: 9px 0 -7px 0;
}
.topCommChat{
@@ -3479,7 +3479,7 @@ footer:after {
.wrMessages {
padding: 0;
- background-color: #F7F7F7;
+ /*background-color: #F7F7F7;*/
border-right: 1px solid #DADADA;
/*border-left: 1px solid #DADADA;*/
}
@@ -3487,8 +3487,10 @@ footer:after {
.messageBlock {
width: 100%;
float: left;
- margin: 0 0 0 0;
- padding: 0 0;
+ background-color: #F7F7F7;
+ /*margin: 0 0 0 0;*/
+ /*padding: 0 0;*/
+ padding-bottom: 20px;
}
.messageBlock > p {
@@ -3686,6 +3688,8 @@ footer:after {
.documentsChat {
width: 100%;
float: left;
+ border-top: 1px solid black;
+ border-bottom: 1px solid black;
}
.documentsChat > p {
@@ -3915,19 +3919,19 @@ footer:after {
/*transform: rotate(90deg);*/
/*}*/
-.orAct .dimovChat {
- -webkit-transform: rotate(90deg);
- -moz-transform: rotate(90deg);
- transform: rotate(90deg);
-}
+/*.orAct .dimovChat {*/
+ /*-webkit-transform: rotate(90deg);*/
+ /*-moz-transform: rotate(90deg);*/
+ /*transform: rotate(90deg);*/
+/*}*/
/*.orderBlock:hover .hideOBB {*/
/*display: block;*/
/*}*/
-.orAct .hideOBB {
- display: block !important;
-}
+/*.orAct .hideOBB {*/
+ /*display: block !important;*/
+/*}*/
.wrstepschat {
float: left;
@@ -3953,11 +3957,12 @@ footer:after {
/*display: inline-block;*/
font-size: 24px;
font-family: 'pfbeausanspro-reg', sans-serif;
- padding: 26px 0px;
+ padding: 26px 0 40px 0;
width: 100%;
color: black;
background-color: #F3F3F3;
text-align: center;
+ position: relative;
}
.tab-content .header-wrapper .header{
@@ -3979,8 +3984,9 @@ footer:after {
width: 100%;
float: left;
padding: 15px;
- border-top: 1px solid black;
- border-bottom: 1px solid black;
+ padding-bottom: 0;
+ /*border-top: 1px solid black;*/
+ /*border-bottom: 1px solid black;*/
z-index: 9;
position: relative;
/*margin-bottom: -1px;*/
@@ -3988,7 +3994,7 @@ footer:after {
.titleStepss {
width: 100%;
- /*float: left;*/
+ padding-left: 15px;
font-size: 18px;
font-family: 'Arial-MT-Regular', sans-serif;
margin: 0 0 15px 0;
@@ -3997,7 +4003,7 @@ footer:after {
.textStepss {
width: 100%;
- /*float: left;*/
+ padding-left: 15px;
font-size: 14px;
line-height: 17px;
font-family: 'Arial-MT-Regular', sans-serif;
@@ -5801,9 +5807,9 @@ input[type="radio"]:checked + span {
/*border-bottom: 1px solid #2c2c2c;*/
/*margin-bottom: 14px;*/
/*}*/
-#order-stages > div:nth-last-child(2), #order-stages > div:last-child{
- border: none;
-}
+/*#order-stages > div:nth-last-child(2), #order-stages > div:last-child{*/
+ /*border: none;*/
+/*}*/
.linkSort button{
font-size: 14px;
font-family: 'Arial-MT-Regular', sans-serif;
diff --git a/assets/img/icons/icon_books.png b/assets/img/icons/icon_books.png
index 4d2221c..9ab33cf 100644
Binary files a/assets/img/icons/icon_books.png and b/assets/img/icons/icon_books.png differ
diff --git a/assets/img/icons/icon_hand_pen.png b/assets/img/icons/icon_hand_pen.png
new file mode 100644
index 0000000..77d7e9b
Binary files /dev/null and b/assets/img/icons/icon_hand_pen.png differ
diff --git a/assets/img/icons/icon_print.png b/assets/img/icons/icon_print.png
index 42648fb..f3afceb 100644
Binary files a/assets/img/icons/icon_print.png and b/assets/img/icons/icon_print.png differ
diff --git a/assets/js/build/chat_contractor_oop.js b/assets/js/build/chat_contractor_oop.js
index a579dcc..af00718 100644
--- a/assets/js/build/chat_contractor_oop.js
+++ b/assets/js/build/chat_contractor_oop.js
@@ -48,19 +48,19 @@
var _ChatContractorPageController = __webpack_require__(1);
- var _BINDS = __webpack_require__(17);
+ var _BINDS = __webpack_require__(21);
- var _documents = __webpack_require__(19);
+ var _documents = __webpack_require__(24);
- var _notes = __webpack_require__(20);
+ var _notes = __webpack_require__(23);
- var _parts = __webpack_require__(21);
+ var _parts = __webpack_require__(25);
- var _archiveProjects = __webpack_require__(22);
+ var _archiveProjects = __webpack_require__(26);
- var _chats = __webpack_require__(23);
+ var _chats = __webpack_require__(27);
- var _wsChatConnect = __webpack_require__(24);
+ var _wsChatConnect = __webpack_require__(28);
window.connect = _wsChatConnect.connect;
window.socket = undefined;
@@ -72,12 +72,14 @@
};
window.chatController = new _ChatContractorPageController.ChatPageController();
(0, _BINDS.bindOrders)();
+ (0, _BINDS.bindOrderInfo)();
(0, _BINDS.bindTeams)();
(0, _BINDS.bindOnTabs)();
(0, _BINDS.bindUserContacts)();
(0, _BINDS.bindGetUserMessages)();
(0, _archiveProjects.bindArchiveProjects)();
(0, _BINDS.bindDeleteContact)();
+ (0, _BINDS.bindCtrlEnterSendMessage)();
// Chats
(0, _chats.chatContactsInit)();
@@ -114,9 +116,9 @@
var _StagesContractorController = __webpack_require__(2);
- var _MessagesControllers = __webpack_require__(15);
+ var _MessagesControllers = __webpack_require__(19);
- var _DocumentsControllers = __webpack_require__(16);
+ var _DocumentsControllers = __webpack_require__(20);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -129,41 +131,6 @@
this.statesController = undefined;
this.messagesController = undefined;
this.documentsController = undefined;
- // TODO: не забыть!
-
- // $('.order-block').on('click', function (event) {
- // console.log("CLICK!!!");
- // event.preventDefault();
- // let $this = $(this);
- // $('.order-block').each(function (i, v) {
- // $(v).removeClass('orAct');
- // });
- // $this.addClass('orAct');
- // let orderId = $this.data('id');
- // let projectId = $this.data('project-id');
- // let recipentId = $this.data('recipent-id');
- // let orderName = $this.data('order-name');
- // // console.log('orderId = ', orderId);
- // new StagesController(orderId, projectId, recipentId, orderName);
- // new MessagesController(orderId);
- // window.location.hash = `order${orderId}`;
- //
- // $("#chat-order-add #orderId").val(orderId);
- // $("#add-form-order-note #orderNote").val(orderId);
- // $("#orderArbitrationId").val(orderId);
- // $("#projectReviewId").val(projectId);
- // // console.log("recipentId = ", recipentId);
- // $("#chat-order-add #recipentId").val(recipentId);
- // $("#targetCustomerId").val(recipentId);
- // $("#add-form-order-note #recipentNote").val(recipentId);
- //
- // });
- // $('.order-block .dimovChat').on('click', function (event) {
- // event.preventDefault();
- // event.stopPropagation();
- // // TODO: доделать сворачивание/разворачивание блока
- // // console.log('click on tr');
- // });
}
_createClass(ChatPageController, [{
@@ -200,7 +167,7 @@
var _loaders = __webpack_require__(4);
- var _Stages = __webpack_require__(14);
+ var _Stages = __webpack_require__(18);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -227,6 +194,7 @@
};
//Contractor
+ //TODO: Вынесли общую логику в родительский класс
var StagesController = function () {
function StagesController(orderId, projectId, recipentId, orderName, secureOrder) {
@@ -267,6 +235,10 @@
$reserve: $('#reserveSpace'), //2. Резервирование (Отобразить)
$works: $('#completeWork') //3. Выполненная работа
};
+ this.temp = {
+ approve_stage_header_text: this.stages_elements.$approve.find('.js-stage-header').html(),
+ reserve_help_text: this.stages_elements.$approve.find('.js-help-text').html()
+ };
this.init();
}
@@ -302,14 +274,43 @@
// $("#orderBlock" + this.orderId).trigger('click');
this.init();
}
+ }, {
+ key: 'reload',
+ value: function reload() {
+ /**
+ * Перезагружаем страницу Чата(при удалении заказа)
+ */
+ window.location = '/chat/#order';
+ location.reload();
+ }
+ }, {
+ key: '_buildPage',
+ value: function _buildPage() {
+ // console.log("Build PAge");
+ // Restore html to default
+ this.stages_elements.$approve.find('.js-stage-header').html(this.temp.approve_stage_header_text);
+ this.stages_elements.$reserve.find('.js-help-text').html(this.temp.reserve_help_text);
+ this.stages_elements.$approve.find('.js-select').addClass("select");
+ this.stages_elements.$reserve.find('.js-select').addClass("select");
+ this.stages_elements.$works.find('.js-select').addClass("select");
+
+ this.stages_elements.$reserve.hide();
+ this.stages_elements.$works.hide();
+ if (this.data.stages.length == 0) {
+ this.buildStartStage();
+ } else {
+ var stageStatus = this.data.stages[0].status;
+ // console.log('stageStatus = ', stageStatus);
+ this.STAGE_STATUSES[stageStatus]();
+ }
+ this._bindEvents();
+ }
}, {
key: 'buildStartStage',
value: function buildStartStage() {
/**
* Стадия: "Проект Предложен"(нет этапов)
*/
- // Выделить цифру 1. красным
- // $('#conditions-approve').find('.select')
this.stages_elements.$approve.show();
this.stages_elements.$reserve.show();
this.stages_elements.$works.show();
@@ -326,8 +327,9 @@
if (this.secureOrder) {
this.stages_elements.$reserve.find('.js-help-text').show();
} else {
- this.stages_elements.$reserve.find('.js-help-text').hide();
- // this.stages_elements.$reserve.find('.js-help-text').html('Резервирование не предусмотрено, безопасная сделака не активна');
+ this.stages_elements.$reserve.find('.js-help-text').show();
+ this.stages_elements.$reserve.find('.js-select').removeClass('select');
+ this.stages_elements.$reserve.find('.js-help-text').html('Резервирование не предусмотрено, безопасная сделака не активна ');
}
} // Нет Этапов / "Не согласован"
@@ -344,7 +346,7 @@
key: 'buildSendApproveStage',
value: function buildSendApproveStage() {
console.log("Stage: send_approve");
- this._renderStage('stage_approved_tmpl', true);
+ this._renderStage('stage_contractor_approve_tmpl', true);
this.$orderStagesContainer.parent().show();
this.buttons.btnApprove.show();
this.buttons.btnChange.show();
@@ -365,6 +367,7 @@
this.buttons.btnsArbitration.last().show();
this._renderStage('stage_approved_tmpl', true);
this.stages_elements.$approve.find('.js-help-text').hide();
+ this.stages_elements.$approve.find('.js-select').removeClass('select');
this.stages_elements.$reserve.show();
if (this.secureOrder) {
this._renderStageReserved('reserved_tmpl');
@@ -379,31 +382,24 @@
key: 'buildProcessStage',
value: function buildProcessStage() {
console.log('Stage: in_process');
+ // Block-Stage-1
+ this.stages_elements.$approve.find('.js-stage-header').html('Согласованные условия');
+ this.stages_elements.$approve.find('.js-select').removeClass('select');
this.buildAgreedStage();
+ // Block-Stage-2
this.stages_elements.$reserve.find('.js-help-text').hide();
+ // Block-Stage-3
this.stages_elements.$works.show();
+
+ this._renderStageInWork('work_in_process_tmpl');
if (this.secureOrder) {
- this._renderStageInWork('work_in_process_tmpl');
+ // this._renderStageInWork('work_in_process_tmpl');
} else {
- this.stages_elements.$reserve.find('.stages-paid').html("");
+ this.stages_elements.$reserve.hide();
}
} // Статус "В процессе"/"Завершен"/"Закрыт"
- }, {
- key: '_buildPage',
- value: function _buildPage() {
- // console.log("Build PAge");
- this.stages_elements.$reserve.hide();
- this.stages_elements.$works.hide();
- if (this.data.stages.length == 0) {
- this.buildStartStage();
- } else {
- var stageStatus = this.data.stages[0].status;
- // console.log('stageStatus = ', stageStatus);
- this.STAGE_STATUSES[stageStatus]();
- }
- this._bindEvents();
- }
+
}, {
key: '_renderStage',
value: function _renderStage(template_name) {
@@ -518,6 +514,7 @@
});
this.stages_work.push(stage);
}
+ // console.log("has_user_review = ", this.data.has_user_review);
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
@@ -533,7 +530,6 @@
}
}
- console.log("has_user_review = ", this.data.has_user_review);
if (!this.data.has_user_review) {
var btnReviewOpenModel = $(this.btnSendReviewTmpl());
btnReviewOpenModel.unbind().on('click', this._onBtnReviewOpenModal.bind(this));
@@ -585,6 +581,11 @@
value: function _onLoadData(json) {
this.data = json;
this._buildPage();
+ if (this.data.project.state == 'deleted') {
+ for (var key in this.buttons) {
+ this.buttons[key].hide();
+ }
+ }
}
}, {
key: '_bindEvents',
@@ -618,7 +619,7 @@
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = '\u0423\u0441\u043B\u043E\u0432\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 ' + self.orderName + ' \u043F\u0440\u0438\u043D\u044F\u0442\u044B';
+ message.data.msg = '\u0423\u0441\u043B\u043E\u0432\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 "' + self.orderName + '" \u043F\u0440\u0438\u043D\u044F\u0442\u044B';
console.log("Send-WS Условия приняты");
socket.send_stages_approve(message);
//TODO: раскомментировать дурацкое окно
@@ -640,7 +641,7 @@
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = '\u0417\u0430\u043A\u0430\u0437 ' + self.orderName + ' \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D \u0434\u043B\u044F \u0432\u043D\u0435\u0441\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439';
+ message.data.msg = '\u0417\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D \u0434\u043B\u044F \u0432\u043D\u0435\u0441\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439';
console.log("Send-WS Внести изменения");
socket.send_stages_approve(message);
});
@@ -683,7 +684,7 @@
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = '\u042D\u0442\u0430\u043F ' + json.name + ' \u0437\u0430\u043A\u0440\u044B\u0442';
+ message.data.msg = '\u042D\u0442\u0430\u043F "' + json.name + '" \u0437\u0430\u043A\u0440\u044B\u0442';
console.log("Send-WS Закрытие этапа");
socket.send_stages_approve(message);
}).catch(function (xhr) {
@@ -717,22 +718,26 @@
data: formData,
dataType: 'json',
success: function success(json) {
- console.log('Отзыв успешно отправлен, json -->', json);
+ // console.log('Отзыв успешно отправлен, json -->', json);
// $('#review-add').modal('hide');
// self.stages_elements.$works.find('.js-btnSendReview').hide();
$('#review-add').modal('hide');
- self.redraw();
-
var message = message_format;
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = '\u041E\u0442\u0437\u044B\u0432 \u043D\u0430 \u0437\u0430\u043A\u0430\u0437 ' + self.orderName + ' \u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D';
+ message.data.msg = '\u041E\u0442\u0437\u044B\u0432 \u043D\u0430 \u0437\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D';
console.log("Send-WS Оставить отзыв");
+ // TODO: в этом сообщении отослать команду на reload if(json.count_reviews == 2)
socket.send_stages_approve(message);
// $("a[href='#tab2']").trigger('click');
- window.location = '/chat/#order';
- location.reload();
+ if (json.count_reviews == 1) {
+ self.redraw();
+ } else {
+ self.reload();
+ }
+ // window.location = '/chat/#order';
+ // location.reload();
},
error: function error(e) {
console.log('error');
@@ -741,6 +746,14 @@
});
} // "Оставить отзыв"
+ }, {
+ key: '_changeOrderProtect',
+ value: function _changeOrderProtect(secure) {
+ this.secureOrder = secure;
+ console.log('secure = ', this.secureOrder);
+ this.redraw();
+ } // Если заказчик изменил secure
+
}, {
key: '_onBtnArbitration',
@@ -852,6 +865,22 @@
var _note_tmpl2 = _interopRequireDefault(_note_tmpl);
+ var _order_info_tmpl = __webpack_require__(14);
+
+ var _order_info_tmpl2 = _interopRequireDefault(_order_info_tmpl);
+
+ var _stage_contractor_approve_tmpl = __webpack_require__(15);
+
+ var _stage_contractor_approve_tmpl2 = _interopRequireDefault(_stage_contractor_approve_tmpl);
+
+ var _document_before_upload_tmpl = __webpack_require__(16);
+
+ var _document_before_upload_tmpl2 = _interopRequireDefault(_document_before_upload_tmpl);
+
+ var _switch_to_protected_tmpl = __webpack_require__(17);
+
+ var _switch_to_protected_tmpl2 = _interopRequireDefault(_switch_to_protected_tmpl);
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function loadTemplate(template_name) {
@@ -864,7 +893,11 @@
bntCompleteStage_tmpl: _bntCompleteStage_tmpl2.default,
btnSendReview_tmpl: _btnSendReview_tmpl2.default,
document_attach_file_tmpl: _document_attach_file_tmpl2.default,
- note_tmpl: _note_tmpl2.default
+ note_tmpl: _note_tmpl2.default,
+ order_info_tmpl: _order_info_tmpl2.default,
+ stage_contractor_approve_tmpl: _stage_contractor_approve_tmpl2.default,
+ document_before_upload_tmpl: _document_before_upload_tmpl2.default,
+ switch_to_protected_tmpl: _switch_to_protected_tmpl2.default
};
if (!templates[template_name]) throw new Error('Template ' + template_name + ' does not exist');
@@ -888,14 +921,14 @@
};
function _template() {
- return '\n
\n
\u042D\u0422\u0410\u041F ' + this.stage_num + '
\n
\n
';
+ return '\n\n \n
\n
\n \u042D\u0422\u0410\u041F ' + this.stage_num + ' \n
\n
\n ' + (this.stage_status ? this.stage_status : 'не согласован') + ' \n
\n
\n
\n
\n
';
};
/***/ },
/* 6 */
/***/ function(module, exports) {
- "use strict";
+ 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
@@ -906,7 +939,7 @@
};
function _template() {
- return "\n\n
\n
\n \u042D\u0422\u0410\u041F " + this.stage_num + " \n
\n
\n " + this.stage_status + " \n
\n
\n
\n\n
\n " + this.stage.name + "\n
\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
\n " + this.stage.result + "\n
\n \u0426\u0435\u043D\u0430\n
\n " + this.stage.cost + " \u20BD\n
\n \u0421\u0440\u043E\u043A\n
\n \u0434\u043E " + this.stage.term + "\n
\n\n
";
+ return '\n\n
\n
\n \u042D\u0422\u0410\u041F ' + this.stage_num + ' \n
\n
\n ' + (this.stage_status ? this.stage_status : 'не согласован') + ' \n
\n
\n
\n\n
\n ' + this.stage.name + '\n
\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
\n ' + this.stage.result + '\n
\n \u0426\u0435\u043D\u0430\n
\n ' + this.stage.cost + ' \u20BD\n
\n \u0421\u0440\u043E\u043A\n
\n \u0434\u043E ' + this.stage.term + '\n
\n
\n \u0421\u0440\u043E\u043A \u044D\u0442\u0430\u043F\u0430 \u0440\u0430\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\n
\n\n
';
};
/***/ },
@@ -1032,11 +1065,83 @@
};
function _template() {
- return "\n
\n " + this.text + "\n \n
\n
\n";
+ return "\n\n
\n " + this.text + "\n \n
\n
\n";
};
/***/ },
/* 14 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ exports.default = function (ctx) {
+ return _template.call(ctx, ctx);
+ };
+
+ function _template() {
+ return '\n\n \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \n ' + this.order.project.name + ' \n \n\n \u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0430\u044F \u0441\u0434\u0435\u043B\u043A\u0430 \n ' + (this.order.secure ? 'Выбрана' : 'Не выбрана') + ' \n \n\n \u0422\u0438\u043F \u0437\u0434\u0430\u043D\u0438\u044F \n ' + (this.order.project.realty.building_classification ? this.order.project.realty.building_classification.name : 'не задан') + ' \n \n \u041A\u043B\u0430\u0441\u0441\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F \u0437\u0434\u0430\u043D\u0438\u044F \n ' + (this.order.project.realty.construction_type ? this.order.project.realty.construction_type.name : 'не задана') + ' \n ';
+ };
+
+/***/ },
+/* 15 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ exports.default = function (ctx) {
+ return _template.call(ctx, ctx);
+ };
+
+ function _template() {
+ return "\n\n
\n
\n \u042D\u0422\u0410\u041F " + this.stage_num + " \n
\n
\n " + this.stage_status + " \n
\n
\n
\n\n
\n " + this.stage.name + "\n
\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
\n " + this.stage.result + "\n
\n \u0426\u0435\u043D\u0430\n
\n " + this.stage.cost + " \u20BD\n
\n \u0421\u0440\u043E\u043A\n
\n \u0434\u043E " + this.stage.term + "\n
\n
\n \u0421\u0440\u043E\u043A \u044D\u0442\u0430\u043F\u0430 \u0440\u0430\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\n
\n\n
";
+ };
+
+/***/ },
+/* 16 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ exports.default = function (ctx) {
+ return _template.call(ctx, ctx);
+ };
+
+ function _template() {
+ return "\n\n
;";
+ };
+
+/***/ },
+/* 17 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ exports.default = function (ctx) {
+ return _template.call(ctx, ctx);
+ };
+
+ function _template() {
+ return "\n\n
\u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0430\u044F \u0441\u0434\u0435\u043B\u043A\u0430 \u043D\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u0430 \n
\n
\n \n
\n
\n \n \u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0439 \u0441\u0434\u0435\u043B\u043A\u0438\n \n
\n
\n
";
+ };
+
+/***/ },
+/* 18 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1239,15 +1344,14 @@
/**
* "Согласовать" Этапы (Исполнителем)
*/
- console.log("secureOrder = ", secureOrder);
- console.log("set new status =", secureOrder ? 'agreed' : 'in_process');
+ // console.log("secureOrder = ", secureOrder);
+ // console.log("set new status =", secureOrder ? 'agreed': 'in_process');
return Promise.resolve($.ajax({
url: '/api/stages/' + this.stageId + '/',
type: 'PATCH',
beforeSend: function beforeSend(xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
},
- //TODO: слать только изменения
data: {
status: secureOrder ? 'agreed' : 'in_process'
},
@@ -1269,7 +1373,6 @@
beforeSend: function beforeSend(xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
},
- //TODO: слать только изменения
data: { status: 'not_agreed' },
dataType: 'json'
}).done(function (json) {
@@ -1415,7 +1518,6 @@
beforeSend: function beforeSend(xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
},
- //TODO: слать только изменения
data: { status: 'closed' },
dataType: 'json'
}).done(function (json) {
@@ -1436,7 +1538,7 @@
exports.StageInWork = StageInWork;
/***/ },
-/* 15 */
+/* 19 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1502,7 +1604,7 @@
className = '';
}
if (v.is_system) {
- senderName = 'Системное';
+ senderName = senderName == 'Вы' ? 'Системное от Вас' : '\u0421\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0435 \u043E\u0442 ' + senderName;
className = 'systemChat';
}
var message = $(self.messageTemplate({ className: className, senderName: senderName, message: v }));
@@ -1519,7 +1621,7 @@
exports.MessagesController = MessagesController;
/***/ },
-/* 16 */
+/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1606,7 +1708,7 @@
exports.DocumentsController = DocumentsController;
/***/ },
-/* 17 */
+/* 21 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1614,14 +1716,16 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
- exports.bindDeleteContact = exports.bindTeams = exports.bindGetUserMessages = exports.bindUserContacts = exports.bindOnTabs = exports.bindArbitrationSend = exports.bindOrders = undefined;
+ exports.bindCtrlEnterSendMessage = exports.bindDeleteContact = exports.bindTeams = exports.bindGetUserMessages = exports.bindUserContacts = exports.bindOnTabs = exports.bindArbitrationSend = exports.bindOrderInfo = exports.bindOrders = undefined;
var _utils = __webpack_require__(3);
- var _messageCounters = __webpack_require__(18);
+ var _messageCounters = __webpack_require__(22);
var _loaders = __webpack_require__(4);
+ var _notes = __webpack_require__(23);
+
function dialog(message, yesCallback, notCallback) {
$("#dialog_delete .modal-title").html(message);
$("#dialog_delete").modal('show');
@@ -1641,6 +1745,7 @@
$('.order-block').on('click', function (event) {
event.preventDefault();
var $this = $(this);
+ $("#chat-order-add").show();
(0, _messageCounters.onClickCardWithCount)($this);
$('.order-block').each(function (i, v) {
$(v).removeClass('orAct');
@@ -1662,14 +1767,75 @@
$("#chat-order-add #recipentId").val(recipentId);
window.chatController.create(orderId, projectId, recipentId, orderName, secureOrder);
+
+ $.ajax({
+ url: '/api/note/',
+ type: 'GET',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ data: {
+ 'order': orderId
+ },
+ dataType: 'json',
+ success: function success(json) {
+ var noteHtmlInbox = '';
+ var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl');
+ // console.log("note json -->", json);
+ $.each(json.results, function (i, v) {
+ noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id });
+ });
+ $(".order-notes-block").html(noteHtmlInbox);
+ (0, _notes.bindRemoveNotes)();
+ }
+ });
});
$('.order-block .dimovChat').on('click', function (event) {
event.preventDefault();
event.stopPropagation();
+ // .toggle();
+ var $arrow = $(event.target);
+ var $info = $arrow.siblings('.hideOBB');
+ if ($info.hasClass("open")) {
+ $arrow.css('transform', 'rotate(0deg)');
+ $info.hide();
+ } else {
+ $arrow.css('transform', 'rotate(90deg)');
+ $info.show();
+ }
+ $info.toggleClass("open");
// console.log('click on tr');
});
}
+ function bindOrderInfo() {
+ $(".messageBlock").on('click', '.full-order-info', function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var orderId = $(this).closest('.orderBlock').data('id');
+ if (!orderId) {
+ orderId = $(this).closest('.trashedOrderBlock').data('id');
+ }
+ $.ajax({
+ url: '/api/orders/' + orderId + '/',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ dataType: 'json',
+ success: function success(data) {
+ var outTable_tmpl = (0, _loaders.loadTemplate)('order_info_tmpl');
+ var outTable = outTable_tmpl({ order: data });
+
+ $("#order-info table").html(outTable);
+ $("#order-info").modal('show');
+ },
+ error: function error(e, jqxhr) {
+ console.log(e);
+ }
+ });
+ });
+ }
+
function bindTeams() {
$('.team-block').on('click', function () {
(0, _messageCounters.onClickCardWithCount)($(this));
@@ -1759,13 +1925,14 @@
data: { 'team': teamId },
dataType: 'json',
success: function success(json) {
- console.log(json.results);
+ // console.log(json.results);
var noteHtmlInbox = '';
var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl');
$.each(json.results, function (i, v) {
- noteHtmlInbox += note_tmpl({ text: v.text });
+ noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id });
});
$(".team-notes-block").html(noteHtmlInbox);
+ (0, _notes.bindRemoveNotes)();
}
});
});
@@ -1786,7 +1953,7 @@
data: formData,
dataType: 'json',
success: function success(json) {
- console.log(json);
+ // console.log(json);
$("#arbitration-add").modal('hide');
$.jGrowl("Обращение в арбитраж добавлено", {
life: 4000
@@ -1805,7 +1972,7 @@
* Биндит обработчики на Закладки
*/
$('a[data-toggle="tab"]').unbind().on('show.bs.tab', function (e) {
- console.log("TAB!");
+ // console.log("TAB!");
var activeTab = $(this).attr('href').substring(1);
var liveHash = URI(location.href).hash();
@@ -1835,7 +2002,7 @@
case 'tab3':
setTimeout(function () {
- console.log("on active TAB team");
+ // console.log("on active TAB team");
if (liveHash.indexOf("#teamorder") != -1) {
var teamHashId = liveHash.replace("#teamorder", "");
$("#teamOrderBlock" + teamHashId).trigger('click');
@@ -1970,7 +2137,7 @@
dataType: 'json',
success: function success(json) {
- console.log(json);
+ // console.log(json);
$.each(json.results, function (i, v) {
docList.innerHTML += '' + v.file + '
';
@@ -1994,13 +2161,14 @@
},
dataType: 'json',
success: function success(json) {
- console.log(json.results);
+ // console.log(json.results);
var noteHtmlInbox = '';
var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl');
$.each(json.results, function (i, v) {
- noteHtmlInbox += note_tmpl({ text: v.text });
+ noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id });
});
$(".contractor-notes-block").html(noteHtmlInbox);
+ (0, _notes.bindRemoveNotes)();
}
});
});
@@ -2040,16 +2208,29 @@
});
}
+ function bindCtrlEnterSendMessage() {
+ $('textarea.js-chat').keydown(function (e) {
+ var $target = $(e.target);
+ if (e.ctrlKey && e.keyCode == 13) {
+ // console.log("Send button -->", $target.parent().find('.btn-send'))
+ var $btn_send = $target.parent().find('.btn-send');
+ $btn_send.trigger('click');
+ }
+ });
+ }
+
exports.bindOrders = bindOrders;
+ exports.bindOrderInfo = bindOrderInfo;
exports.bindArbitrationSend = bindArbitrationSend;
exports.bindOnTabs = bindOnTabs;
exports.bindUserContacts = bindUserContacts;
exports.bindGetUserMessages = bindGetUserMessages;
exports.bindTeams = bindTeams;
exports.bindDeleteContact = bindDeleteContact;
+ exports.bindCtrlEnterSendMessage = bindCtrlEnterSendMessage;
/***/ },
-/* 18 */
+/* 22 */
/***/ function(module, exports) {
'use strict';
@@ -2106,7 +2287,7 @@
var $container = void 0;
if (message.answer_type == "add_message_contact") {
$container = $('.contact-count-' + message.sender_id);
- } else if (message.answer_type == "add_message_order") {
+ } else if (message.answer_type == "add_message_order" || message.answer_type == "approve_stages") {
$container = $('#count-order-' + message.order_id);
} else if (message.answer_type == "add_message_team") {
$container = $('#count-team-' + message.team_id);
@@ -2129,7 +2310,137 @@
exports.onClickCardWithCount = onClickCardWithCount;
/***/ },
-/* 19 */
+/* 23 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.bindRemoveNotes = exports.bindTeamNotes = exports.bindOrderNotes = exports.bindContractorNotes = undefined;
+
+ var _loaders = __webpack_require__(4);
+
+ var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl');
+
+ function bindContractorNotes() {
+ $('#add-note-contractor').on('click', function (e) {
+ e.preventDefault();
+ $.ajax({
+ url: '/api/note/',
+ type: 'POST',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
+ },
+ data: $("#add-form-contractor-note").serialize(),
+ dataType: 'json',
+ success: function success(json) {
+ // console.log(json);
+ $("#add-form-contractor-note #chat2").val("");
+ var li = note_tmpl({ text: json.text, note_id: json.id });
+ $(li).appendTo(".contractor-notes-block");
+ bindRemoveNotes();
+ },
+ error: function error(e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
+ });
+ }
+
+ function bindOrderNotes() {
+ /**
+ * Create new Note
+ */
+ $('#add-note-button').on('click', function (e) {
+ e.preventDefault();
+ $.ajax({
+ url: '/api/note/',
+ type: 'POST',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
+ },
+ data: $("#add-form-order-note").serialize(),
+ dataType: 'json',
+ success: function success(json) {
+ // $("" + json.text + " ").appendTo(".order-notes-block");
+ // console.log('note json = ', json);
+ var li = note_tmpl({ text: json.text, note_id: json.id });
+ $(li).appendTo(".order-notes-block");
+ $("#add-form-order-note #chat2").val("");
+ bindRemoveNotes();
+ },
+ error: function error(e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
+ });
+ }
+
+ function bindTeamNotes() {
+ $('#add-team-note-button').on('click', function (e) {
+ e.preventDefault();
+ $.ajax({
+ url: '/api/note/',
+ type: 'POST',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
+ },
+ data: $("#add-form-team-note").serialize(),
+ dataType: 'json',
+ success: function success(json) {
+ var li = note_tmpl({ text: json.text, note_id: json.id });
+ $(li).appendTo(".team-notes-block");
+ $("#add-form-team-note #chat2").val("");
+ bindRemoveNotes();
+ },
+ error: function error(e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
+ });
+ }
+
+ function bindRemoveNotes() {
+ // console.log('num notes = ', $('.remove-note').length);
+ $('.remove-note').unbind().on('click', function (e) {
+ var $note = $(e.target).parent();
+ var noteId = $(e.target).data('id');
+ // console.log('click remove note');
+ $.ajax({
+ url: '/api/note/' + noteId,
+ type: 'DELETE',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
+ },
+ dataType: 'json',
+ success: function success(json) {
+ $note.remove();
+ // console.log('Note deleted!');
+
+ // let li = note_tmpl({text: json.text, note_id: json.id});
+ // $(li).appendTo(".team-notes-block");
+ // $("#add-form-team-note #chat2").val("");
+ },
+ error: function error(e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
+ });
+ }
+
+ exports.bindContractorNotes = bindContractorNotes;
+ exports.bindOrderNotes = bindOrderNotes;
+ exports.bindTeamNotes = bindTeamNotes;
+ exports.bindRemoveNotes = bindRemoveNotes;
+
+/***/ },
+/* 24 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -2141,6 +2452,10 @@
var _utils = __webpack_require__(3);
+ var _loaders = __webpack_require__(4);
+
+ var document_before_upload_tmpl = (0, _loaders.loadTemplate)('document_before_upload_tmpl');
+
function uploadDocumentsContactInit() {
$("#upload-document-contact").bind('fileuploadsubmit', function (e, data) {
data.formData = {
@@ -2153,15 +2468,18 @@
url: '/chat/create/',
crossDomain: false,
beforeSend: function beforeSend(xhr, settings) {
- console.log("Upload form data -->", this.formData);
+ // console.log("Upload form data -->", this.formData);
$('#progress .progress-bar').css('width', '0%');
xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
},
dataType: 'json',
done: function done(e, data) {
$.each(data.result.files, function (index, file) {
- var htmlImg = '';
- var document_send = $(htmlImg).appendTo("#document-send-contact");
+ // var htmlImg = '' +
+ // '
';
+ var htmlImg = document_before_upload_tmpl({ file: file });
+ $(htmlImg).appendTo("#document-send-contact");
});
},
fail: function fail(e) {
@@ -2181,7 +2499,7 @@
recipent: $("#chat-order-add #recipentId").val(),
order: $("#chat-order-add #orderId").val()
};
- console.log(data.formData);
+ // console.log(data.formData);
});
$('#upload-document-order').fileupload({
@@ -2194,8 +2512,10 @@
dataType: 'json',
done: function done(e, data) {
$.each(data.result.files, function (index, file) {
- var htmlImg = '';
- var document_send = $(htmlImg).appendTo("#document-send-order");
+ // var htmlImg = '';
+ var htmlImg = document_before_upload_tmpl({ file: file });
+ $(htmlImg).appendTo("#document-send-order");
});
},
fail: function fail(e) {
@@ -2216,7 +2536,7 @@
order: $("#team-chat-form #orderTeamId").val(),
team: $("#team-chat-form #teamId").val()
};
- console.log(data.formData);
+ // console.log(data.formData);
});
$('#upload-document-team').fileupload({
@@ -2232,8 +2552,10 @@
var currentValue = $("#documentSendIds").val();
currentValue += file.id + ';';
$("#documentSendIds").val(currentValue);
- var htmlImg = '';
- var document_send = $(htmlImg).appendTo("#document-send");
+ // var htmlImg = '';
+ var htmlImg = document_before_upload_tmpl({ file: file });
+ $(htmlImg).appendTo("#document-send");
});
},
fail: function fail(e) {
@@ -2261,7 +2583,7 @@
dataType: 'json',
success: function success(json) {
_this.parent().remove();
- console.log(json);
+ // console.log(json);
},
error: function error(e, jqxhr) {
console.log(jqxhr);
@@ -2276,99 +2598,7 @@
exports.bindRemoveDocuments = bindRemoveDocuments;
/***/ },
-/* 20 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.bindTeamNotes = exports.bindOrderNotes = exports.bindContractorNotes = undefined;
-
- var _loaders = __webpack_require__(4);
-
- var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl');
-
- function bindContractorNotes() {
- $('#add-note-contractor').on('click', function (e) {
- e.preventDefault();
- $.ajax({
- url: '/api/note/',
- type: 'POST',
- beforeSend: function beforeSend(xhr) {
- xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
- },
- data: $("#add-form-contractor-note").serialize(),
- dataType: 'json',
- success: function success(json) {
- console.log(json);
- $("#add-form-contractor-note #chat2").val("");
- var li = note_tmpl({ text: json.text });
- $(li).appendTo(".contractor-notes-block");
- },
- error: function error(e) {
- console.log('error');
- console.log(e);
- }
- });
- });
- }
-
- function bindOrderNotes() {
- $('#add-note-button').on('click', function (e) {
- e.preventDefault();
- $.ajax({
- url: '/api/note/',
- type: 'POST',
- beforeSend: function beforeSend(xhr) {
- xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
- },
- data: $("#add-form-order-note").serialize(),
- dataType: 'json',
- success: function success(json) {
- // $("" + json.text + " ").appendTo(".order-notes-block");
- var li = note_tmpl({ text: json.text });
- $(li).appendTo(".order-notes-block");
- $("#add-form-order-note #chat2").val("");
- },
- error: function error(e) {
- console.log('error');
- console.log(e);
- }
- });
- });
- }
-
- function bindTeamNotes() {
- $('#add-team-note-button').on('click', function (e) {
- e.preventDefault();
- $.ajax({
- url: '/api/note/',
- type: 'POST',
- beforeSend: function beforeSend(xhr) {
- xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
- },
- data: $("#add-form-team-note").serialize(),
- dataType: 'json',
- success: function success(json) {
- $("" + json.text + " ").appendTo(".team-notes-block");
- $("#add-form-team-note #chat2").val("");
- },
- error: function error(e) {
- console.log('error');
- console.log(e);
- }
- });
- });
- }
-
- exports.bindContractorNotes = bindContractorNotes;
- exports.bindOrderNotes = bindOrderNotes;
- exports.bindTeamNotes = bindTeamNotes;
-
-/***/ },
-/* 21 */
+/* 25 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
@@ -2386,7 +2616,7 @@
$("a[href='#tab2']").trigger('click');
// console.log("click on ", "#orderBlock" + currentHash.replace("#order", ""));
var obj_id = currentHash.replace("#order", "");
- console.log("obj_id = ", obj_id);
+ // console.log("obj_id = ", obj_id);
if (obj_id) {
$("#orderBlock" + currentHash.replace("#order", "")).trigger('click');
} else {
@@ -2404,7 +2634,7 @@
exports.restoreTabFromHash = restoreTabFromHash;
/***/ },
-/* 22 */
+/* 26 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -2437,10 +2667,10 @@
}
});
- // Нажимаем на заказ в архмвных заказах
+ // Нажимаем на заказ в архивных заказах
$(".messageBlock").on('click', '.trashedOrderBlock', function () {
var $this = $(this);
- $("#chat-order-add").css("display", "none");
+ $("#chat-order-add").hide();
$('.order-block, .trashedOrderBlock').each(function () {
$(this).removeClass('orAct');
});
@@ -2458,6 +2688,9 @@
location.hash = '#order' + orderId;
// console.log(orderId);
window.chatController.create(orderId);
+ // hide all buttons
+ // console.log('chat-buttons -->', $(".chat-button"));
+ // $(".chat-button").hide();
// $.ajax({
// url: '/api/message',
// type: 'GET',
@@ -2496,7 +2729,7 @@
exports.bindArchiveProjects = bindArchiveProjects;
/***/ },
-/* 23 */
+/* 27 */
/***/ function(module, exports) {
'use strict';
@@ -2527,7 +2760,7 @@
documentLinks += 'Приложенный файл. скачать: ' + $(this).text() + ' ';
documentAttachFiles += '' + '' + $(this).text() + ' ' + '
';
});
- console.log("sendLinkIds = ", sendLinkIds);
+ // console.log("sendLinkIds = ", sendLinkIds);
socket.send_message({
"format_type": "add_message_contact",
"data": {
@@ -2643,7 +2876,7 @@
exports.chatTeamsInit = chatTeamsInit;
/***/ },
-/* 24 */
+/* 28 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -2655,7 +2888,7 @@
var _loaders = __webpack_require__(4);
- var _messageCounters = __webpack_require__(18);
+ var _messageCounters = __webpack_require__(22);
function getUserPlace() {
/**
@@ -2682,8 +2915,8 @@
*/
// message.answer_type=place.tab
var eq = ['add_message_contact=user', 'add_message_order=order', 'add_message_team=myteam', 'approve_stages=order'];
- console.log([message.answer_type, place.tab].join('='));
- console.log(message.order_id, '==', place.id, message.order_id == place.id);
+ // console.log([message.answer_type, place.tab].join('='));
+ // console.log(message.order_id, '==', place.id, message.order_id == place.id);
if (eq.indexOf([message.answer_type, place.tab].join('=')) != -1 && (message.order_id == place.id || message.recipent_id == place.id || message.sender_id == place.id || message.team_id == place.id)) {
return true;
@@ -2724,7 +2957,7 @@
classMessage = '';
}
if (data.is_system) {
- senderName = 'Системное';
+ senderName = senderName == 'Вы' ? 'Системное от Вас' : '\u0421\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0435 \u043E\u0442 ' + senderName;
classMessage = 'systemChat';
}
@@ -2738,7 +2971,12 @@
$documents_container.append(data.docs_attach);
- if (data.answer_type == 'approve_stages') {
+ if (data.answer_type == 'approve_stages' && data.sender_id != userId) {
+ if (data.msg.indexOf('перевел заказ') != -1) {
+ var secure = false;
+ if (data.msg.indexOf('безопасную сделку') != -1) secure = true;
+ window.chatController.statesController._changeOrderProtect(secure);
+ }
window.chatController.statesController.redraw();
}
} else {
@@ -2758,7 +2996,6 @@
};
socket.send_stages_approve = function (messageData) {
- // TODO: Пометить сообщения как "системные"
socket.send(JSON.stringify(messageData));
};
});
diff --git a/assets/js/build/chat_customer_oop.js b/assets/js/build/chat_customer_oop.js
index 4d49282..d4d5517 100644
--- a/assets/js/build/chat_customer_oop.js
+++ b/assets/js/build/chat_customer_oop.js
@@ -46,17 +46,21 @@
'use strict';
- var _ChatCustomerPageController = __webpack_require__(25);
+ var _ChatCustomerPageController = __webpack_require__(29);
- var _BINDS = __webpack_require__(17);
+ var _BINDS = __webpack_require__(21);
- var _parts = __webpack_require__(21);
+ var _parts = __webpack_require__(25);
- var _chats = __webpack_require__(23);
+ var _chats = __webpack_require__(27);
- var _wsChatConnect = __webpack_require__(24);
+ var _documents = __webpack_require__(24);
- var _archiveProjects = __webpack_require__(22);
+ var _wsChatConnect = __webpack_require__(28);
+
+ var _notes = __webpack_require__(23);
+
+ var _archiveProjects = __webpack_require__(26);
window.connect = _wsChatConnect.connect;
window.socket = undefined;
@@ -76,16 +80,26 @@
window.chatController = new _ChatCustomerPageController.ChatPageController();
(0, _BINDS.bindOrders)();
+ (0, _BINDS.bindOrderInfo)();
(0, _BINDS.bindOnTabs)();
(0, _parts.restoreTabFromHash)();
(0, _BINDS.bindUserContacts)();
(0, _BINDS.bindGetUserMessages)();
(0, _archiveProjects.bindArchiveProjects)();
(0, _BINDS.bindDeleteContact)();
+ (0, _BINDS.bindCtrlEnterSendMessage)();
//Chats
(0, _chats.chatContactsInit)();
(0, _chats.chatOrdersInit)();
+
+ //Documents
+ (0, _documents.uploadDocumentsContactInit)();
+ (0, _documents.uploadDocumentsOrderInit)();
+
+ //Notes
+ (0, _notes.bindContractorNotes)();
+ (0, _notes.bindOrderNotes)();
});
/***/ },
@@ -181,6 +195,22 @@
var _note_tmpl2 = _interopRequireDefault(_note_tmpl);
+ var _order_info_tmpl = __webpack_require__(14);
+
+ var _order_info_tmpl2 = _interopRequireDefault(_order_info_tmpl);
+
+ var _stage_contractor_approve_tmpl = __webpack_require__(15);
+
+ var _stage_contractor_approve_tmpl2 = _interopRequireDefault(_stage_contractor_approve_tmpl);
+
+ var _document_before_upload_tmpl = __webpack_require__(16);
+
+ var _document_before_upload_tmpl2 = _interopRequireDefault(_document_before_upload_tmpl);
+
+ var _switch_to_protected_tmpl = __webpack_require__(17);
+
+ var _switch_to_protected_tmpl2 = _interopRequireDefault(_switch_to_protected_tmpl);
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function loadTemplate(template_name) {
@@ -193,7 +223,11 @@
bntCompleteStage_tmpl: _bntCompleteStage_tmpl2.default,
btnSendReview_tmpl: _btnSendReview_tmpl2.default,
document_attach_file_tmpl: _document_attach_file_tmpl2.default,
- note_tmpl: _note_tmpl2.default
+ note_tmpl: _note_tmpl2.default,
+ order_info_tmpl: _order_info_tmpl2.default,
+ stage_contractor_approve_tmpl: _stage_contractor_approve_tmpl2.default,
+ document_before_upload_tmpl: _document_before_upload_tmpl2.default,
+ switch_to_protected_tmpl: _switch_to_protected_tmpl2.default
};
if (!templates[template_name]) throw new Error('Template ' + template_name + ' does not exist');
@@ -217,14 +251,14 @@
};
function _template() {
- return '\n\n
\u042D\u0422\u0410\u041F ' + this.stage_num + '
\n
\n
';
+ return '\n\n \n
\n
\n \u042D\u0422\u0410\u041F ' + this.stage_num + ' \n
\n
\n ' + (this.stage_status ? this.stage_status : 'не согласован') + ' \n
\n
\n
\n
\n
';
};
/***/ },
/* 6 */
/***/ function(module, exports) {
- "use strict";
+ 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
@@ -235,7 +269,7 @@
};
function _template() {
- return "\n\n
\n
\n \u042D\u0422\u0410\u041F " + this.stage_num + " \n
\n
\n " + this.stage_status + " \n
\n
\n
\n\n
\n " + this.stage.name + "\n
\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
\n " + this.stage.result + "\n
\n \u0426\u0435\u043D\u0430\n
\n " + this.stage.cost + " \u20BD\n
\n \u0421\u0440\u043E\u043A\n
\n \u0434\u043E " + this.stage.term + "\n
\n\n
";
+ return '\n\n
\n
\n \u042D\u0422\u0410\u041F ' + this.stage_num + ' \n
\n
\n ' + (this.stage_status ? this.stage_status : 'не согласован') + ' \n
\n
\n
\n\n
\n ' + this.stage.name + '\n
\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
\n ' + this.stage.result + '\n
\n \u0426\u0435\u043D\u0430\n
\n ' + this.stage.cost + ' \u20BD\n
\n \u0421\u0440\u043E\u043A\n
\n \u0434\u043E ' + this.stage.term + '\n
\n
\n \u0421\u0440\u043E\u043A \u044D\u0442\u0430\u043F\u0430 \u0440\u0430\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\n
\n\n
';
};
/***/ },
@@ -361,11 +395,83 @@
};
function _template() {
- return "\n
\n " + this.text + "\n \n
\n
\n";
+ return "\n\n
\n " + this.text + "\n \n
\n
\n";
};
/***/ },
/* 14 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ exports.default = function (ctx) {
+ return _template.call(ctx, ctx);
+ };
+
+ function _template() {
+ return '\n\n \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \n ' + this.order.project.name + ' \n \n\n \u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0430\u044F \u0441\u0434\u0435\u043B\u043A\u0430 \n ' + (this.order.secure ? 'Выбрана' : 'Не выбрана') + ' \n \n\n \u0422\u0438\u043F \u0437\u0434\u0430\u043D\u0438\u044F \n ' + (this.order.project.realty.building_classification ? this.order.project.realty.building_classification.name : 'не задан') + ' \n \n \u041A\u043B\u0430\u0441\u0441\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F \u0437\u0434\u0430\u043D\u0438\u044F \n ' + (this.order.project.realty.construction_type ? this.order.project.realty.construction_type.name : 'не задана') + ' \n ';
+ };
+
+/***/ },
+/* 15 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ exports.default = function (ctx) {
+ return _template.call(ctx, ctx);
+ };
+
+ function _template() {
+ return "\n\n
\n
\n \u042D\u0422\u0410\u041F " + this.stage_num + " \n
\n
\n " + this.stage_status + " \n
\n
\n
\n\n
\n " + this.stage.name + "\n
\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
\n " + this.stage.result + "\n
\n \u0426\u0435\u043D\u0430\n
\n " + this.stage.cost + " \u20BD\n
\n \u0421\u0440\u043E\u043A\n
\n \u0434\u043E " + this.stage.term + "\n
\n
\n \u0421\u0440\u043E\u043A \u044D\u0442\u0430\u043F\u0430 \u0440\u0430\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\n
\n\n
";
+ };
+
+/***/ },
+/* 16 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ exports.default = function (ctx) {
+ return _template.call(ctx, ctx);
+ };
+
+ function _template() {
+ return "\n\n
;";
+ };
+
+/***/ },
+/* 17 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ exports.default = function (ctx) {
+ return _template.call(ctx, ctx);
+ };
+
+ function _template() {
+ return "\n\n
\u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0430\u044F \u0441\u0434\u0435\u043B\u043A\u0430 \u043D\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u0430 \n
\n
\n \n
\n
\n \n \u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0439 \u0441\u0434\u0435\u043B\u043A\u0438\n \n
\n
\n
";
+ };
+
+/***/ },
+/* 18 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -568,15 +674,14 @@
/**
* "Согласовать" Этапы (Исполнителем)
*/
- console.log("secureOrder = ", secureOrder);
- console.log("set new status =", secureOrder ? 'agreed' : 'in_process');
+ // console.log("secureOrder = ", secureOrder);
+ // console.log("set new status =", secureOrder ? 'agreed': 'in_process');
return Promise.resolve($.ajax({
url: '/api/stages/' + this.stageId + '/',
type: 'PATCH',
beforeSend: function beforeSend(xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
},
- //TODO: слать только изменения
data: {
status: secureOrder ? 'agreed' : 'in_process'
},
@@ -598,7 +703,6 @@
beforeSend: function beforeSend(xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
},
- //TODO: слать только изменения
data: { status: 'not_agreed' },
dataType: 'json'
}).done(function (json) {
@@ -744,7 +848,6 @@
beforeSend: function beforeSend(xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
},
- //TODO: слать только изменения
data: { status: 'closed' },
dataType: 'json'
}).done(function (json) {
@@ -765,7 +868,7 @@
exports.StageInWork = StageInWork;
/***/ },
-/* 15 */
+/* 19 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -831,7 +934,7 @@
className = '';
}
if (v.is_system) {
- senderName = 'Системное';
+ senderName = senderName == 'Вы' ? 'Системное от Вас' : '\u0421\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0435 \u043E\u0442 ' + senderName;
className = 'systemChat';
}
var message = $(self.messageTemplate({ className: className, senderName: senderName, message: v }));
@@ -848,8 +951,7 @@
exports.MessagesController = MessagesController;
/***/ },
-/* 16 */,
-/* 17 */
+/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -857,14 +959,103 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
- exports.bindDeleteContact = exports.bindTeams = exports.bindGetUserMessages = exports.bindUserContacts = exports.bindOnTabs = exports.bindArbitrationSend = exports.bindOrders = undefined;
+ exports.DocumentsController = undefined;
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _utils = __webpack_require__(3);
- var _messageCounters = __webpack_require__(18);
+ var _loaders = __webpack_require__(4);
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var DocumentsController = function () {
+ function DocumentsController(orderId) {
+ _classCallCheck(this, DocumentsController);
+
+ console.log('Create MessagesController');
+ var self = this;
+ this.orderId = orderId;
+ this.$container = $('#documentOrderSpace');
+ this.$container.html("");
+
+ this.messageTemplate = (0, _loaders.loadTemplate)('document_attach_file_tmpl');
+ this.dataPromise = this.getMessagesData();
+ this.dataPromise.then(self._onLoadData.bind(self));
+ }
+
+ _createClass(DocumentsController, [{
+ key: 'getMessagesData',
+ value: function getMessagesData() {
+ var self = this;
+ return Promise.resolve($.ajax({
+ url: '/api/documents',
+ type: 'GET',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ data: {
+ 'order': self.orderId,
+ 'is_delete': false,
+ 'is_send': true
+ },
+ dataType: 'json',
+ // success: function (json) {
+ //
+ // },
+ error: function error(e) {
+ console.log(e);
+ }
+ }));
+ }
+ }, {
+ key: 'addDocument',
+ value: function addDocument(json) {}
+ }, {
+ key: '_onLoadData',
+ value: function _onLoadData(json) {
+ var self = this;
+ // console.log('mesages json = ', json);
+ // console.log('$inbox = ', this.$inbox);
+ // console.log("messages render start");
+ this.$container.html("");
+ $.each(json.results, function (i, v) {
+ var document = $(self.messageTemplate({
+ href: '/chat/download/\' + ' + v.file,
+ text: v.file,
+ document_id: v.id
+ }));
+ self.$container.append(document);
+ });
+ // console.log("messages render complete");
+ // self.$inbox.scrollTop(self.$inbox.prop("scrollHeight"));
+ }
+ }]);
+
+ return DocumentsController;
+ }();
+
+ exports.DocumentsController = DocumentsController;
+
+/***/ },
+/* 21 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.bindCtrlEnterSendMessage = exports.bindDeleteContact = exports.bindTeams = exports.bindGetUserMessages = exports.bindUserContacts = exports.bindOnTabs = exports.bindArbitrationSend = exports.bindOrderInfo = exports.bindOrders = undefined;
+
+ var _utils = __webpack_require__(3);
+
+ var _messageCounters = __webpack_require__(22);
var _loaders = __webpack_require__(4);
+ var _notes = __webpack_require__(23);
+
function dialog(message, yesCallback, notCallback) {
$("#dialog_delete .modal-title").html(message);
$("#dialog_delete").modal('show');
@@ -884,6 +1075,7 @@
$('.order-block').on('click', function (event) {
event.preventDefault();
var $this = $(this);
+ $("#chat-order-add").show();
(0, _messageCounters.onClickCardWithCount)($this);
$('.order-block').each(function (i, v) {
$(v).removeClass('orAct');
@@ -905,14 +1097,75 @@
$("#chat-order-add #recipentId").val(recipentId);
window.chatController.create(orderId, projectId, recipentId, orderName, secureOrder);
+
+ $.ajax({
+ url: '/api/note/',
+ type: 'GET',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ data: {
+ 'order': orderId
+ },
+ dataType: 'json',
+ success: function success(json) {
+ var noteHtmlInbox = '';
+ var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl');
+ // console.log("note json -->", json);
+ $.each(json.results, function (i, v) {
+ noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id });
+ });
+ $(".order-notes-block").html(noteHtmlInbox);
+ (0, _notes.bindRemoveNotes)();
+ }
+ });
});
$('.order-block .dimovChat').on('click', function (event) {
event.preventDefault();
event.stopPropagation();
+ // .toggle();
+ var $arrow = $(event.target);
+ var $info = $arrow.siblings('.hideOBB');
+ if ($info.hasClass("open")) {
+ $arrow.css('transform', 'rotate(0deg)');
+ $info.hide();
+ } else {
+ $arrow.css('transform', 'rotate(90deg)');
+ $info.show();
+ }
+ $info.toggleClass("open");
// console.log('click on tr');
});
}
+ function bindOrderInfo() {
+ $(".messageBlock").on('click', '.full-order-info', function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var orderId = $(this).closest('.orderBlock').data('id');
+ if (!orderId) {
+ orderId = $(this).closest('.trashedOrderBlock').data('id');
+ }
+ $.ajax({
+ url: '/api/orders/' + orderId + '/',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ dataType: 'json',
+ success: function success(data) {
+ var outTable_tmpl = (0, _loaders.loadTemplate)('order_info_tmpl');
+ var outTable = outTable_tmpl({ order: data });
+
+ $("#order-info table").html(outTable);
+ $("#order-info").modal('show');
+ },
+ error: function error(e, jqxhr) {
+ console.log(e);
+ }
+ });
+ });
+ }
+
function bindTeams() {
$('.team-block').on('click', function () {
(0, _messageCounters.onClickCardWithCount)($(this));
@@ -1002,13 +1255,14 @@
data: { 'team': teamId },
dataType: 'json',
success: function success(json) {
- console.log(json.results);
+ // console.log(json.results);
var noteHtmlInbox = '';
var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl');
$.each(json.results, function (i, v) {
- noteHtmlInbox += note_tmpl({ text: v.text });
+ noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id });
});
$(".team-notes-block").html(noteHtmlInbox);
+ (0, _notes.bindRemoveNotes)();
}
});
});
@@ -1029,7 +1283,7 @@
data: formData,
dataType: 'json',
success: function success(json) {
- console.log(json);
+ // console.log(json);
$("#arbitration-add").modal('hide');
$.jGrowl("Обращение в арбитраж добавлено", {
life: 4000
@@ -1048,7 +1302,7 @@
* Биндит обработчики на Закладки
*/
$('a[data-toggle="tab"]').unbind().on('show.bs.tab', function (e) {
- console.log("TAB!");
+ // console.log("TAB!");
var activeTab = $(this).attr('href').substring(1);
var liveHash = URI(location.href).hash();
@@ -1078,7 +1332,7 @@
case 'tab3':
setTimeout(function () {
- console.log("on active TAB team");
+ // console.log("on active TAB team");
if (liveHash.indexOf("#teamorder") != -1) {
var teamHashId = liveHash.replace("#teamorder", "");
$("#teamOrderBlock" + teamHashId).trigger('click');
@@ -1213,7 +1467,7 @@
dataType: 'json',
success: function success(json) {
- console.log(json);
+ // console.log(json);
$.each(json.results, function (i, v) {
docList.innerHTML += '' + v.file + '
';
@@ -1237,13 +1491,14 @@
},
dataType: 'json',
success: function success(json) {
- console.log(json.results);
+ // console.log(json.results);
var noteHtmlInbox = '';
var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl');
$.each(json.results, function (i, v) {
- noteHtmlInbox += note_tmpl({ text: v.text });
+ noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id });
});
$(".contractor-notes-block").html(noteHtmlInbox);
+ (0, _notes.bindRemoveNotes)();
}
});
});
@@ -1283,16 +1538,29 @@
});
}
+ function bindCtrlEnterSendMessage() {
+ $('textarea.js-chat').keydown(function (e) {
+ var $target = $(e.target);
+ if (e.ctrlKey && e.keyCode == 13) {
+ // console.log("Send button -->", $target.parent().find('.btn-send'))
+ var $btn_send = $target.parent().find('.btn-send');
+ $btn_send.trigger('click');
+ }
+ });
+ }
+
exports.bindOrders = bindOrders;
+ exports.bindOrderInfo = bindOrderInfo;
exports.bindArbitrationSend = bindArbitrationSend;
exports.bindOnTabs = bindOnTabs;
exports.bindUserContacts = bindUserContacts;
exports.bindGetUserMessages = bindGetUserMessages;
exports.bindTeams = bindTeams;
exports.bindDeleteContact = bindDeleteContact;
+ exports.bindCtrlEnterSendMessage = bindCtrlEnterSendMessage;
/***/ },
-/* 18 */
+/* 22 */
/***/ function(module, exports) {
'use strict';
@@ -1349,7 +1617,7 @@
var $container = void 0;
if (message.answer_type == "add_message_contact") {
$container = $('.contact-count-' + message.sender_id);
- } else if (message.answer_type == "add_message_order") {
+ } else if (message.answer_type == "add_message_order" || message.answer_type == "approve_stages") {
$container = $('#count-order-' + message.order_id);
} else if (message.answer_type == "add_message_team") {
$container = $('#count-team-' + message.team_id);
@@ -1372,9 +1640,295 @@
exports.onClickCardWithCount = onClickCardWithCount;
/***/ },
-/* 19 */,
-/* 20 */,
-/* 21 */
+/* 23 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.bindRemoveNotes = exports.bindTeamNotes = exports.bindOrderNotes = exports.bindContractorNotes = undefined;
+
+ var _loaders = __webpack_require__(4);
+
+ var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl');
+
+ function bindContractorNotes() {
+ $('#add-note-contractor').on('click', function (e) {
+ e.preventDefault();
+ $.ajax({
+ url: '/api/note/',
+ type: 'POST',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
+ },
+ data: $("#add-form-contractor-note").serialize(),
+ dataType: 'json',
+ success: function success(json) {
+ // console.log(json);
+ $("#add-form-contractor-note #chat2").val("");
+ var li = note_tmpl({ text: json.text, note_id: json.id });
+ $(li).appendTo(".contractor-notes-block");
+ bindRemoveNotes();
+ },
+ error: function error(e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
+ });
+ }
+
+ function bindOrderNotes() {
+ /**
+ * Create new Note
+ */
+ $('#add-note-button').on('click', function (e) {
+ e.preventDefault();
+ $.ajax({
+ url: '/api/note/',
+ type: 'POST',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
+ },
+ data: $("#add-form-order-note").serialize(),
+ dataType: 'json',
+ success: function success(json) {
+ // $("" + json.text + " ").appendTo(".order-notes-block");
+ // console.log('note json = ', json);
+ var li = note_tmpl({ text: json.text, note_id: json.id });
+ $(li).appendTo(".order-notes-block");
+ $("#add-form-order-note #chat2").val("");
+ bindRemoveNotes();
+ },
+ error: function error(e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
+ });
+ }
+
+ function bindTeamNotes() {
+ $('#add-team-note-button').on('click', function (e) {
+ e.preventDefault();
+ $.ajax({
+ url: '/api/note/',
+ type: 'POST',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
+ },
+ data: $("#add-form-team-note").serialize(),
+ dataType: 'json',
+ success: function success(json) {
+ var li = note_tmpl({ text: json.text, note_id: json.id });
+ $(li).appendTo(".team-notes-block");
+ $("#add-form-team-note #chat2").val("");
+ bindRemoveNotes();
+ },
+ error: function error(e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
+ });
+ }
+
+ function bindRemoveNotes() {
+ // console.log('num notes = ', $('.remove-note').length);
+ $('.remove-note').unbind().on('click', function (e) {
+ var $note = $(e.target).parent();
+ var noteId = $(e.target).data('id');
+ // console.log('click remove note');
+ $.ajax({
+ url: '/api/note/' + noteId,
+ type: 'DELETE',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
+ },
+ dataType: 'json',
+ success: function success(json) {
+ $note.remove();
+ // console.log('Note deleted!');
+
+ // let li = note_tmpl({text: json.text, note_id: json.id});
+ // $(li).appendTo(".team-notes-block");
+ // $("#add-form-team-note #chat2").val("");
+ },
+ error: function error(e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
+ });
+ }
+
+ exports.bindContractorNotes = bindContractorNotes;
+ exports.bindOrderNotes = bindOrderNotes;
+ exports.bindTeamNotes = bindTeamNotes;
+ exports.bindRemoveNotes = bindRemoveNotes;
+
+/***/ },
+/* 24 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.bindRemoveDocuments = exports.uploadDocumentsTeamInit = exports.uploadDocumentsOrderInit = exports.uploadDocumentsContactInit = undefined;
+
+ var _utils = __webpack_require__(3);
+
+ var _loaders = __webpack_require__(4);
+
+ var document_before_upload_tmpl = (0, _loaders.loadTemplate)('document_before_upload_tmpl');
+
+ function uploadDocumentsContactInit() {
+ $("#upload-document-contact").bind('fileuploadsubmit', function (e, data) {
+ data.formData = {
+ sender: $("#contact-chat-form #senderContactId").val(),
+ recipent: $("#contact-chat-form #recipentContactId").val()
+ };
+ });
+
+ $('#upload-document-contact').fileupload({
+ url: '/chat/create/',
+ crossDomain: false,
+ beforeSend: function beforeSend(xhr, settings) {
+ // console.log("Upload form data -->", this.formData);
+ $('#progress .progress-bar').css('width', '0%');
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ dataType: 'json',
+ done: function done(e, data) {
+ $.each(data.result.files, function (index, file) {
+ // var htmlImg = '' +
+ // '
';
+ var htmlImg = document_before_upload_tmpl({ file: file });
+ $(htmlImg).appendTo("#document-send-contact");
+ });
+ },
+ fail: function fail(e) {
+ console.log(e);
+ },
+ progressall: function progressall(e, data) {
+ var progress = parseInt(data.loaded / data.total * 100, 10);
+ $('#progress .progress-bar').css('width', progress + '%');
+ }
+ }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
+ }
+
+ function uploadDocumentsOrderInit() {
+ $("#upload-document-order").bind('fileuploadsubmit', function (e, data) {
+ data.formData = {
+ sender: $("#chat-order-add #senderId").val(),
+ recipent: $("#chat-order-add #recipentId").val(),
+ order: $("#chat-order-add #orderId").val()
+ };
+ // console.log(data.formData);
+ });
+
+ $('#upload-document-order').fileupload({
+ url: '/chat/create/',
+ crossDomain: false,
+ beforeSend: function beforeSend(xhr, settings) {
+ $('#progress .progress-bar').css('width', '0%');
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ dataType: 'json',
+ done: function done(e, data) {
+ $.each(data.result.files, function (index, file) {
+ // var htmlImg = '';
+ var htmlImg = document_before_upload_tmpl({ file: file });
+ $(htmlImg).appendTo("#document-send-order");
+ });
+ },
+ fail: function fail(e) {
+ console.log(e);
+ },
+ progressall: function progressall(e, data) {
+ var progress = parseInt(data.loaded / data.total * 100, 10);
+ $('#progress .progress-bar').css('width', progress + '%');
+ }
+ }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
+ }
+
+ function uploadDocumentsTeamInit() {
+ $("#upload-document-team").bind('fileuploadsubmit', function (e, data) {
+ data.formData = {
+ sender: $("#team-chat-form #senderTeamId").val(),
+ recipent: $("#team-chat-form #recipentTeamId").val(),
+ order: $("#team-chat-form #orderTeamId").val(),
+ team: $("#team-chat-form #teamId").val()
+ };
+ // console.log(data.formData);
+ });
+
+ $('#upload-document-team').fileupload({
+ url: '/chat/create/',
+ crossDomain: false,
+ beforeSend: function beforeSend(xhr, settings) {
+ $('#progress .progress-bar').css('width', '0%');
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ dataType: 'json',
+ done: function done(e, data) {
+ $.each(data.result.files, function (index, file) {
+ var currentValue = $("#documentSendIds").val();
+ currentValue += file.id + ';';
+ $("#documentSendIds").val(currentValue);
+ // var htmlImg = '';
+ var htmlImg = document_before_upload_tmpl({ file: file });
+ $(htmlImg).appendTo("#document-send");
+ });
+ },
+ fail: function fail(e) {
+ console.log(e);
+ },
+ progressall: function progressall(e, data) {
+ var progress = parseInt(data.loaded / data.total * 100, 10);
+ $('#progress .progress-bar').css('width', progress + '%');
+ }
+ }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
+ }
+
+ function bindRemoveDocuments() {
+ $('.tab-content').on('click', '.remove-document', function (e) {
+ e.preventDefault();
+ var dataId = $(this).attr('data-id');
+ var _this = $(this);
+ $.ajax({
+ url: '/api/documents/' + dataId + '/',
+ type: 'PATCH',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ data: { is_delete: true },
+ dataType: 'json',
+ success: function success(json) {
+ _this.parent().remove();
+ // console.log(json);
+ },
+ error: function error(e, jqxhr) {
+ console.log(jqxhr);
+ }
+ });
+ });
+ }
+
+ exports.uploadDocumentsContactInit = uploadDocumentsContactInit;
+ exports.uploadDocumentsOrderInit = uploadDocumentsOrderInit;
+ exports.uploadDocumentsTeamInit = uploadDocumentsTeamInit;
+ exports.bindRemoveDocuments = bindRemoveDocuments;
+
+/***/ },
+/* 25 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
@@ -1392,7 +1946,7 @@
$("a[href='#tab2']").trigger('click');
// console.log("click on ", "#orderBlock" + currentHash.replace("#order", ""));
var obj_id = currentHash.replace("#order", "");
- console.log("obj_id = ", obj_id);
+ // console.log("obj_id = ", obj_id);
if (obj_id) {
$("#orderBlock" + currentHash.replace("#order", "")).trigger('click');
} else {
@@ -1410,7 +1964,7 @@
exports.restoreTabFromHash = restoreTabFromHash;
/***/ },
-/* 22 */
+/* 26 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1443,10 +1997,10 @@
}
});
- // Нажимаем на заказ в архмвных заказах
+ // Нажимаем на заказ в архивных заказах
$(".messageBlock").on('click', '.trashedOrderBlock', function () {
var $this = $(this);
- $("#chat-order-add").css("display", "none");
+ $("#chat-order-add").hide();
$('.order-block, .trashedOrderBlock').each(function () {
$(this).removeClass('orAct');
});
@@ -1464,6 +2018,9 @@
location.hash = '#order' + orderId;
// console.log(orderId);
window.chatController.create(orderId);
+ // hide all buttons
+ // console.log('chat-buttons -->', $(".chat-button"));
+ // $(".chat-button").hide();
// $.ajax({
// url: '/api/message',
// type: 'GET',
@@ -1502,7 +2059,7 @@
exports.bindArchiveProjects = bindArchiveProjects;
/***/ },
-/* 23 */
+/* 27 */
/***/ function(module, exports) {
'use strict';
@@ -1533,7 +2090,7 @@
documentLinks += 'Приложенный файл. скачать: ' + $(this).text() + ' ';
documentAttachFiles += '' + '' + $(this).text() + ' ' + '
';
});
- console.log("sendLinkIds = ", sendLinkIds);
+ // console.log("sendLinkIds = ", sendLinkIds);
socket.send_message({
"format_type": "add_message_contact",
"data": {
@@ -1649,7 +2206,7 @@
exports.chatTeamsInit = chatTeamsInit;
/***/ },
-/* 24 */
+/* 28 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1661,7 +2218,7 @@
var _loaders = __webpack_require__(4);
- var _messageCounters = __webpack_require__(18);
+ var _messageCounters = __webpack_require__(22);
function getUserPlace() {
/**
@@ -1688,8 +2245,8 @@
*/
// message.answer_type=place.tab
var eq = ['add_message_contact=user', 'add_message_order=order', 'add_message_team=myteam', 'approve_stages=order'];
- console.log([message.answer_type, place.tab].join('='));
- console.log(message.order_id, '==', place.id, message.order_id == place.id);
+ // console.log([message.answer_type, place.tab].join('='));
+ // console.log(message.order_id, '==', place.id, message.order_id == place.id);
if (eq.indexOf([message.answer_type, place.tab].join('=')) != -1 && (message.order_id == place.id || message.recipent_id == place.id || message.sender_id == place.id || message.team_id == place.id)) {
return true;
@@ -1730,7 +2287,7 @@
classMessage = '';
}
if (data.is_system) {
- senderName = 'Системное';
+ senderName = senderName == 'Вы' ? 'Системное от Вас' : '\u0421\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0435 \u043E\u0442 ' + senderName;
classMessage = 'systemChat';
}
@@ -1744,7 +2301,12 @@
$documents_container.append(data.docs_attach);
- if (data.answer_type == 'approve_stages') {
+ if (data.answer_type == 'approve_stages' && data.sender_id != userId) {
+ if (data.msg.indexOf('перевел заказ') != -1) {
+ var secure = false;
+ if (data.msg.indexOf('безопасную сделку') != -1) secure = true;
+ window.chatController.statesController._changeOrderProtect(secure);
+ }
window.chatController.statesController.redraw();
}
} else {
@@ -1764,7 +2326,6 @@
};
socket.send_stages_approve = function (messageData) {
- // TODO: Пометить сообщения как "системные"
socket.send(JSON.stringify(messageData));
};
});
@@ -1776,7 +2337,7 @@
exports.connect = connect;
/***/ },
-/* 25 */
+/* 29 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1788,11 +2349,11 @@
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- var _StagesCustomerController = __webpack_require__(26);
+ var _StagesCustomerController = __webpack_require__(30);
- var _MessagesControllers = __webpack_require__(15);
+ var _MessagesControllers = __webpack_require__(19);
- var _messageCounters = __webpack_require__(18);
+ var _DocumentsControllers = __webpack_require__(20);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -1804,15 +2365,17 @@
// console.log("NEW Chat CUSTOMER PageController");
this.statesController = undefined;
this.messagesController = undefined;
- // TODO: не забыть!
- // recalculateMessages();
+ this.documentsController = undefined;
}
_createClass(ChatPageController, [{
key: 'create',
value: function create(orderId, projectId, recipentId, orderName, secureOrder) {
- this.statesController = new _StagesCustomerController.StagesController(orderId, projectId, recipentId, orderName, secureOrder);
+ var kwargs = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : { archive: false };
+
+ this.statesController = new _StagesCustomerController.StagesController(orderId, projectId, recipentId, orderName, secureOrder, kwargs);
this.messagesController = new _MessagesControllers.MessagesController(orderId);
+ this.documentsController = new _DocumentsControllers.DocumentsController(orderId);
}
}]);
@@ -1822,7 +2385,7 @@
exports.ChatPageController = ChatPageController;
/***/ },
-/* 26 */
+/* 30 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1838,7 +2401,7 @@
var _loaders = __webpack_require__(4);
- var _Stages = __webpack_require__(14);
+ var _Stages = __webpack_require__(18);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -1864,8 +2427,13 @@
};
+ //Customer
+ //TODO: Вынесли общую логику в родительский класс
+
var StagesController = function () {
function StagesController(orderId, projectId, recipentId, orderName, secureOrder) {
+ var kwargs = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
+
_classCallCheck(this, StagesController);
var self = this;
@@ -1874,6 +2442,7 @@
this.projectId = projectId;
this.recipentId = recipentId;
this.secureOrder = secureOrder;
+ // this.is_archive_project
this.data = {}; //JSON
this.stages = [];
this.stages_reserved = [];
@@ -1888,6 +2457,8 @@
};
this.btnCompleteTmpl = (0, _loaders.loadTemplate)('bntCompleteStage_tmpl');
this.btnSendReviewTmpl = (0, _loaders.loadTemplate)('btnSendReview_tmpl');
+ this.switch_to_protected_tmpl = (0, _loaders.loadTemplate)('switch_to_protected_tmpl');
+
this.$orderStagesContainer = $('#order-stages');
this.$orderStagesContainer.html('');
this.$stagesCount = $('#countStage');
@@ -1906,6 +2477,9 @@
$reserve: $('#reserveSpace'), //2. Резервирование
$works: $('#completeWork') //3. Выполненная работа
};
+ this.temp = {
+ approve_stage_header_text: this.stages_elements.$approve.find('.js-stage-header').html()
+ };
this.init();
}
@@ -1941,6 +2515,39 @@
// $("#orderBlock" + this.orderId).trigger('click');
this.init();
}
+ }, {
+ key: 'reload',
+ value: function reload() {
+ /**
+ * Перезагружаем страницу Чата(при удалении заказа)
+ */
+ window.location = '/chat/#order';
+ location.reload();
+ }
+ }, {
+ key: '_buildPage',
+ value: function _buildPage() {
+ console.log("Build Page!");
+ // Restore html to default
+ this.stages_elements.$approve.find('.js-stage-header').html(this.temp.approve_stage_header_text);
+ console.log("restore this -->", this.stages_elements.$approve.find('.js-select'));
+ this.stages_elements.$approve.find('.js-select').addClass("select");
+ this.stages_elements.$reserve.find('.js-select').addClass("select");
+ this.stages_elements.$works.find('.js-select').addClass("select");
+ var $swith_to_protected = this.$orderStagesContainer.siblings('.switch');
+ if ($swith_to_protected.length) $swith_to_protected.remove();
+
+ this.stages_elements.$reserve.hide();
+ this.stages_elements.$works.hide();
+ if (this.data.stages.length == 0) {
+ this.buildStartStage();
+ } else {
+ var stageStatus = this.data.stages[0].status;
+ // console.log('stageStatus = ', stageStatus);
+ this.STAGE_STATUSES[stageStatus]();
+ }
+ this._bindEvents();
+ }
}, {
key: 'buildStartStage',
value: function buildStartStage() {
@@ -1956,11 +2563,17 @@
this.$stagesCount.removeAttr('disabled');
this.$stagesCount.val(1);
this.$stagesCount.trigger('change');
+ this.stages_elements.$approve.find('.js-select').addClass('select');
// this.stages_elements.$approve.find('.js-help-text').show();
// this.stages_elements.$reserve.find('.js-help-text').show();
// this.stages_elements.$reserve.find('.stages-paid').hide();
// this.stages_elements.$works.find('.js-help-text').show();
// this.stages_elements.$works.find('#stagesWork').show();
+ if (!this.secureOrder) {
+ // console.log("add switch to protect");
+ this.$orderStagesContainer.after(this.switch_to_protected_tmpl());
+ $('#switch-to-protected').unbind().on('change', this._onChangeToProtect.bind(this));
+ }
} // Нет Этапов
}, {
@@ -1971,6 +2584,11 @@
this.buttons.btnApprove.show();
this.buttons.btnChange.hide();
this.buttons.btnToArchive.hide();
+ if (!this.secureOrder) {
+ // console.log("add switch to protect");
+ this.$orderStagesContainer.after(this.switch_to_protected_tmpl());
+ $('#switch-to-protected').unbind().on('change', this._onChangeToProtect.bind(this));
+ }
} // Статус "Не согласован"
}, {
@@ -1996,6 +2614,7 @@
this.$stagesCount.parent().hide();
this._renderStage('stage_approved_tmpl', true);
this.stages_elements.$approve.find('.js-help-text').hide();
+ this.stages_elements.$approve.find('.js-select').removeClass('select');
this.stages_elements.$reserve.find('.js-help-text').show();
this.stages_elements.$reserve.show();
this.buttons.btnReserve.show();
@@ -2008,26 +2627,20 @@
value: function buildProcessStage() {
console.log('Stage: in_process');
this.buildAgreedStage();
+ // Block-Stage-1
+ this.stages_elements.$approve.find('.js-select').removeClass('select');
+ // Block-Stage-2
+ this.stages_elements.$reserve.find('.js-select').removeClass('select');
this.stages_elements.$reserve.find('.js-btnArbitration').hide();
+ // Block-Stage-3
this.stages_elements.$works.show();
this._renderStageInWork('work_in_process_tmpl');
+ if (this.secureOrder) {} else {
+ this.stages_elements.$reserve.hide();
+ }
} // Статус "В процессе"/"Завершен"/"Закрыт"
- }, {
- key: '_buildPage',
- value: function _buildPage() {
- // console.log("Build PAge");
- this.stages_elements.$reserve.hide();
- this.stages_elements.$works.hide();
- if (this.data.stages.length == 0) {
- this.buildStartStage();
- } else {
- var stageStatus = this.data.stages[0].status;
- // console.log('stageStatus = ', stageStatus);
- this.STAGE_STATUSES[stageStatus]();
- }
- this._bindEvents();
- }
+
}, {
key: '_renderStage',
value: function _renderStage(template_name) {
@@ -2135,8 +2748,7 @@
var stage = new _Stages.StageInWork($container, {
template_name: template_name,
- data: stage_data,
- note_text: 'Закройте этап или подробно опишите замечания в чате'
+ data: stage_data
});
this.stages_work.push(stage);
}
@@ -2174,7 +2786,7 @@
if (_stage_data.status == 'closed') continue;
var _stage = new _Stages.StageInWork($container, {
- template_name: template_name, data: _stage_data
+ template_name: template_name, data: _stage_data, note_text: 'Закройте этап или подробно опишите замечания в чате'
});
if (_stage_data.status == 'completed') {
var $btn = $(this.btnCompleteTmpl({ stage: _stage_data, text: 'Закрыть этап' }));
@@ -2205,6 +2817,11 @@
value: function _onLoadData(json) {
this.data = json;
this._buildPage();
+ if (this.data.project.state == 'deleted') {
+ for (var key in this.buttons) {
+ this.buttons[key].hide();
+ }
+ }
}
}, {
key: '_changeNumStages',
@@ -2336,7 +2953,7 @@
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = '\u0423\u0441\u043B\u043E\u0432\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 ' + self.orderName + ' \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435';
+ message.data.msg = '\u0423\u0441\u043B\u043E\u0432\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 "' + self.orderName + '" \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435';
console.log("Send-WS Отправить на согласование");
socket.send_stages_approve(message);
//TODO: раскомментировать дурацкое окно
@@ -2363,7 +2980,7 @@
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = '\u0417\u0430\u043A\u0430\u0437 ' + self.orderName + ' \u043E\u0442\u043E\u0437\u0432\u0430\u043D \u0434\u043B\u044F \u0432\u043D\u0435\u0441\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439';
+ message.data.msg = '\u0417\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043E\u0442\u043E\u0437\u0432\u0430\u043D \u0434\u043B\u044F \u0432\u043D\u0435\u0441\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439';
console.log("Send-WS Внести изменения");
socket.send_stages_approve(message);
});
@@ -2386,7 +3003,7 @@
dataType: 'json'
}).done(function (json) {
console.log('delete complete');
- window.location.href = window.location.href.replace(getHash(), "");
+ // window.location.href = window.location.href.replace(getHash(), "");
var message = message_format;
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
@@ -2394,6 +3011,7 @@
message.data.msg = '\u0417\u0430\u043A\u0430\u0437\u0430 ' + self.orderName + ' \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D \u0432 \u0430\u0440\u0445\u0438\u0432';
console.log("Send-WS Отправить в архив");
socket.send_stages_approve(message);
+ self.reload();
}).fail(function (xhr, errorMsg, error) {
console.log("delete fail, json -->", xhr);
});
@@ -2508,7 +3126,7 @@
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = '\u0417\u0430\u043A\u0430\u0437\u0447\u0438\u043A \u0437\u0430\u043A\u0440\u044B\u043B \u044D\u0442\u0430\u043F ' + json.name;
+ message.data.msg = '\u0417\u0430\u043A\u0430\u0437\u0447\u0438\u043A \u0437\u0430\u043A\u0440\u044B\u043B \u044D\u0442\u0430\u043F "' + json.name + '"';
console.log("Send-WS Оплата Этапа/Этапов");
socket.send_stages_approve(message);
self.redraw();
@@ -2546,12 +3164,16 @@
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = '\u041E\u0442\u0437\u044B\u0432 \u043D\u0430 \u0437\u0430\u043A\u0430\u0437 ' + self.orderName + ' \u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D';
+ message.data.msg = '\u041E\u0442\u0437\u044B\u0432 \u043D\u0430 \u0437\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D';
console.log("Send-WS Оставить отзыв");
+ // TODO: в этом сообщении отослать команду на reload if(json.count_reviews == 2)
socket.send_stages_approve(message);
- window.location = '/chat/#order';
- location.reload();
- // $("a[href='#tab2']").trigger('click');
+ // console.log('json = ', json);
+ if (json.count_reviews == 1) {
+ self.redraw();
+ } else {
+ self.reload();
+ }
},
error: function error(e) {
console.log('error');
@@ -2560,6 +3182,34 @@
});
} // "Оставить отзыв"
+ }, {
+ key: '_onChangeToProtect',
+ value: function _onChangeToProtect(event) {
+ var self = this;
+ var checked = $(event.target).prop('checked');
+ console.log('checked = ', checked);
+ $.ajax({
+ url: '/api/orders/' + this.orderId + '/',
+ type: 'PATCH',
+ beforeSend: function beforeSend(xhr) {
+ xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken'));
+ },
+ data: { secure: checked },
+ dataType: 'json',
+ success: function success(json) {
+ console.log("Protect switch success, json = ", json);
+ var message = message_format;
+ message.data.sender_id = userId;
+ message.data.recipent_id = self.recipentId;
+ message.data.order_id = self.orderId;
+ // Key words "перевел заказ" - на них завязан анализатор на стороне Исполнителя (костыль)
+ message.data.msg = '\u0417\u0430\u043A\u0430\u0437\u0447\u0438\u043A \u043F\u0435\u0440\u0435\u0432\u0435\u043B \u0437\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043D\u0430 ' + (checked ? 'безопасную сделку' : 'прямую оплату') + ' ';
+ console.log("Send-WS Оставить отзыв");
+ socket.send_stages_approve(message);
+ }
+ });
+ } // "Перевести на Безопасный заказ"
+
}, {
key: '_onBtnArbitration',
diff --git a/assets/js/build/contractor_filter.js b/assets/js/build/contractor_filter.js
index b2ec298..6245d28 100644
--- a/assets/js/build/contractor_filter.js
+++ b/assets/js/build/contractor_filter.js
@@ -47,13 +47,13 @@
'use strict';
- var _custom_check = __webpack_require__(27);
+ var _custom_check = __webpack_require__(31);
- var _extended_field = __webpack_require__(28);
+ var _extended_field = __webpack_require__(32);
- var _ajax_set_filter = __webpack_require__(29);
+ var _ajax_set_filter = __webpack_require__(33);
- var _filter_toggle = __webpack_require__(30);
+ var _filter_toggle = __webpack_require__(34);
function paginateTo(pageNum) {
var $form = $('#filter-form');
@@ -75,7 +75,7 @@
/***/ },
-/***/ 27:
+/***/ 31:
/***/ function(module, exports) {
"use strict";
@@ -105,7 +105,7 @@
/***/ },
-/***/ 28:
+/***/ 32:
/***/ function(module, exports) {
'use strict';
@@ -136,7 +136,7 @@
/***/ },
-/***/ 29:
+/***/ 33:
/***/ function(module, exports) {
'use strict';
@@ -200,7 +200,7 @@
/***/ },
-/***/ 30:
+/***/ 34:
/***/ function(module, exports) {
'use strict';
diff --git a/assets/js/build/create_project.js b/assets/js/build/create_project.js
index 4ef741f..5fb443b 100644
--- a/assets/js/build/create_project.js
+++ b/assets/js/build/create_project.js
@@ -40,29 +40,30 @@
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
-/******/ ([
-/* 0 */
+/******/ ({
+
+/***/ 0:
/***/ function(module, exports, __webpack_require__) {
'use strict';
- var _file_upload = __webpack_require__(31);
+ var _file_upload = __webpack_require__(35);
- var _extended_field = __webpack_require__(28);
+ var _extended_field = __webpack_require__(32);
- var _custom_check = __webpack_require__(27);
+ var _custom_check = __webpack_require__(31);
- var _read_more = __webpack_require__(32);
+ var _read_more = __webpack_require__(36);
- var _only_one_checkbox = __webpack_require__(33);
+ var _only_one_checkbox = __webpack_require__(37);
- var _popups = __webpack_require__(34);
+ var _popups = __webpack_require__(38);
- var _scroll_on_required = __webpack_require__(35);
+ var _scroll_on_required = __webpack_require__(39);
- var _ajax_registration = __webpack_require__(36);
+ var _ajax_registration = __webpack_require__(40);
- var _test_seeds = __webpack_require__(37);
+ var _test_seeds = __webpack_require__(41);
function showHideRealry() {
var check = $('#checkbox-sb-realty');
@@ -97,9 +98,8 @@
});
/***/ },
-/* 1 */,
-/* 2 */,
-/* 3 */
+
+/***/ 3:
/***/ function(module, exports) {
'use strict';
@@ -143,30 +143,8 @@
exports.getCookie = getCookie;
/***/ },
-/* 4 */,
-/* 5 */,
-/* 6 */,
-/* 7 */,
-/* 8 */,
-/* 9 */,
-/* 10 */,
-/* 11 */,
-/* 12 */,
-/* 13 */,
-/* 14 */,
-/* 15 */,
-/* 16 */,
-/* 17 */,
-/* 18 */,
-/* 19 */,
-/* 20 */,
-/* 21 */,
-/* 22 */,
-/* 23 */,
-/* 24 */,
-/* 25 */,
-/* 26 */,
-/* 27 */
+
+/***/ 31:
/***/ function(module, exports) {
"use strict";
@@ -195,7 +173,8 @@
exports.customCheckInit = customCheckInit;
/***/ },
-/* 28 */
+
+/***/ 32:
/***/ function(module, exports) {
'use strict';
@@ -225,9 +204,8 @@
exports.extendedFieldInit = extendedFieldInit;
/***/ },
-/* 29 */,
-/* 30 */,
-/* 31 */
+
+/***/ 35:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -275,7 +253,8 @@
exports.fileUploadInit = fileUploadInit;
/***/ },
-/* 32 */
+
+/***/ 36:
/***/ function(module, exports) {
"use strict";
@@ -295,7 +274,8 @@
exports.readMoreInit = readMoreInit;
/***/ },
-/* 33 */
+
+/***/ 37:
/***/ function(module, exports) {
"use strict";
@@ -326,7 +306,8 @@
exports.onlyOneCheckboxInit = onlyOneCheckboxInit;
/***/ },
-/* 34 */
+
+/***/ 38:
/***/ function(module, exports) {
'use strict';
@@ -381,7 +362,8 @@
exports.addMessage = addMessage;
/***/ },
-/* 35 */
+
+/***/ 39:
/***/ function(module, exports) {
'use strict';
@@ -401,7 +383,8 @@
exports.scrollOnRequiredInit = scrollOnRequiredInit;
/***/ },
-/* 36 */
+
+/***/ 40:
/***/ function(module, exports) {
'use strict';
@@ -499,7 +482,8 @@
exports.ajaxRegistrationInit = ajaxRegistrationInit;
/***/ },
-/* 37 */
+
+/***/ 41:
/***/ function(module, exports) {
"use strict";
@@ -514,4 +498,5 @@
exports.print = print;
/***/ }
-/******/ ]);
\ No newline at end of file
+
+/******/ });
\ No newline at end of file
diff --git a/assets/js/build/create_worksell.js b/assets/js/build/create_worksell.js
index 1312f0f..5732130 100644
--- a/assets/js/build/create_worksell.js
+++ b/assets/js/build/create_worksell.js
@@ -47,15 +47,15 @@
'use strict';
- var _image_upload = __webpack_require__(38);
+ var _image_upload = __webpack_require__(42);
- var _scroll_on_required = __webpack_require__(35);
+ var _scroll_on_required = __webpack_require__(39);
- var _popups = __webpack_require__(34);
+ var _popups = __webpack_require__(38);
- var _ajax_registration = __webpack_require__(36);
+ var _ajax_registration = __webpack_require__(40);
- var _ajax_send_form_data = __webpack_require__(39);
+ var _ajax_send_form_data = __webpack_require__(43);
$(function () {
(0, _image_upload.imageUploadInit)();
@@ -114,7 +114,7 @@
/***/ },
-/***/ 34:
+/***/ 38:
/***/ function(module, exports) {
'use strict';
@@ -170,7 +170,7 @@
/***/ },
-/***/ 35:
+/***/ 39:
/***/ function(module, exports) {
'use strict';
@@ -191,7 +191,7 @@
/***/ },
-/***/ 36:
+/***/ 40:
/***/ function(module, exports) {
'use strict';
@@ -290,7 +290,7 @@
/***/ },
-/***/ 38:
+/***/ 42:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -370,7 +370,7 @@
/***/ },
-/***/ 39:
+/***/ 43:
/***/ function(module, exports, __webpack_require__) {
"use strict";
diff --git a/assets/js/build/custom_components.js b/assets/js/build/custom_components.js
index b44253f..bd473d2 100644
--- a/assets/js/build/custom_components.js
+++ b/assets/js/build/custom_components.js
@@ -47,9 +47,9 @@
'use strict';
- var _custom_select = __webpack_require__(40);
+ var _custom_select = __webpack_require__(44);
- var _custom_check = __webpack_require__(27);
+ var _custom_check = __webpack_require__(31);
$(function () {
(0, _custom_select.customSelectInit)();
@@ -58,7 +58,7 @@
/***/ },
-/***/ 27:
+/***/ 31:
/***/ function(module, exports) {
"use strict";
@@ -88,7 +88,7 @@
/***/ },
-/***/ 40:
+/***/ 44:
/***/ function(module, exports) {
'use strict';
diff --git a/assets/js/build/customer_profile.js b/assets/js/build/customer_profile.js
index aeffe42..5df21d1 100644
--- a/assets/js/build/customer_profile.js
+++ b/assets/js/build/customer_profile.js
@@ -47,13 +47,13 @@
'use strict';
- var _show_hide = __webpack_require__(41);
+ var _show_hide = __webpack_require__(45);
- var _bootstrap_tabs = __webpack_require__(42);
+ var _bootstrap_tabs = __webpack_require__(46);
- var _sort_by = __webpack_require__(43);
+ var _sort_by = __webpack_require__(47);
- var _custom_check = __webpack_require__(27);
+ var _custom_check = __webpack_require__(31);
$(function () {
(0, _bootstrap_tabs.restoreTab)();
@@ -111,7 +111,7 @@
/***/ },
-/***/ 27:
+/***/ 31:
/***/ function(module, exports) {
"use strict";
@@ -141,7 +141,7 @@
/***/ },
-/***/ 41:
+/***/ 45:
/***/ function(module, exports) {
"use strict";
@@ -158,7 +158,7 @@
/***/ },
-/***/ 42:
+/***/ 46:
/***/ function(module, exports) {
"use strict";
@@ -194,7 +194,7 @@
/***/ },
-/***/ 43:
+/***/ 47:
/***/ function(module, exports, __webpack_require__) {
"use strict";
diff --git a/assets/js/build/debugUtilsInit.js b/assets/js/build/debugUtilsInit.js
index ce4e128..ba8d88c 100644
--- a/assets/js/build/debugUtilsInit.js
+++ b/assets/js/build/debugUtilsInit.js
@@ -47,7 +47,7 @@
'use strict';
- var _utils_debug = __webpack_require__(44);
+ var _utils_debug = __webpack_require__(48);
// DEBUG
window.print = {};
@@ -55,7 +55,7 @@
/***/ },
-/***/ 44:
+/***/ 48:
/***/ function(module, exports) {
'use strict';
diff --git a/assets/js/build/home_page.js b/assets/js/build/home_page.js
index e6f7512..8818af5 100644
--- a/assets/js/build/home_page.js
+++ b/assets/js/build/home_page.js
@@ -47,7 +47,7 @@
'use strict';
- var _popupYoutube = __webpack_require__(45);
+ var _popupYoutube = __webpack_require__(49);
$(function () {
(0, _popupYoutube.popupYoutubeInit)();
@@ -55,7 +55,7 @@
/***/ },
-/***/ 45:
+/***/ 49:
/***/ function(module, exports) {
'use strict';
diff --git a/assets/js/build/init_contractor_filter.js b/assets/js/build/init_contractor_filter.js
index d267aef..17b75ab 100644
--- a/assets/js/build/init_contractor_filter.js
+++ b/assets/js/build/init_contractor_filter.js
@@ -47,15 +47,15 @@
'use strict';
- var _SelectedContainer = __webpack_require__(46);
+ var _SelectedContainer = __webpack_require__(50);
var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer);
- var _NoTreeSelect = __webpack_require__(50);
+ var _NoTreeSelect = __webpack_require__(54);
var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect);
- var _TreeSelect = __webpack_require__(52);
+ var _TreeSelect = __webpack_require__(56);
var _TreeSelect2 = _interopRequireDefault(_TreeSelect);
@@ -122,7 +122,7 @@
/***/ },
-/***/ 46:
+/***/ 50:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -137,15 +137,15 @@
var _desc, _value, _class; // `
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -378,7 +378,7 @@
/***/ },
-/***/ 47:
+/***/ 51:
/***/ function(module, exports) {
"use strict";
@@ -534,7 +534,7 @@
/***/ },
-/***/ 48:
+/***/ 52:
/***/ function(module, exports) {
"use strict";
@@ -591,7 +591,7 @@
/***/ },
-/***/ 49:
+/***/ 53:
/***/ function(module, exports) {
"use strict";
@@ -676,7 +676,7 @@
/***/ },
-/***/ 50:
+/***/ 54:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -690,9 +690,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
@@ -754,7 +754,7 @@
/***/ },
-/***/ 51:
+/***/ 55:
/***/ function(module, exports) {
"use strict";
@@ -1306,7 +1306,7 @@
/***/ },
-/***/ 52:
+/***/ 56:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1320,9 +1320,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
diff --git a/assets/js/build/init_create_worksell.js b/assets/js/build/init_create_worksell.js
index b101cd1..1295477 100644
--- a/assets/js/build/init_create_worksell.js
+++ b/assets/js/build/init_create_worksell.js
@@ -47,27 +47,27 @@
'use strict';
- var _SelectedContainer = __webpack_require__(46);
+ var _SelectedContainer = __webpack_require__(50);
var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer);
- var _SelectedContainerCreate = __webpack_require__(53);
+ var _SelectedContainerCreate = __webpack_require__(57);
var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate);
- var _NoTreeSelect = __webpack_require__(50);
+ var _NoTreeSelect = __webpack_require__(54);
var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect);
- var _TreeSelect = __webpack_require__(52);
+ var _TreeSelect = __webpack_require__(56);
var _TreeSelect2 = _interopRequireDefault(_TreeSelect);
- var _SingleTreeSelect = __webpack_require__(54);
+ var _SingleTreeSelect = __webpack_require__(58);
var _SingleTreeSelect2 = _interopRequireDefault(_SingleTreeSelect);
- var _SelectOrCreate = __webpack_require__(55);
+ var _SelectOrCreate = __webpack_require__(59);
var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate);
@@ -169,7 +169,7 @@
/***/ },
-/***/ 46:
+/***/ 50:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -184,15 +184,15 @@
var _desc, _value, _class; // `
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -425,7 +425,7 @@
/***/ },
-/***/ 47:
+/***/ 51:
/***/ function(module, exports) {
"use strict";
@@ -581,7 +581,7 @@
/***/ },
-/***/ 48:
+/***/ 52:
/***/ function(module, exports) {
"use strict";
@@ -638,7 +638,7 @@
/***/ },
-/***/ 49:
+/***/ 53:
/***/ function(module, exports) {
"use strict";
@@ -723,7 +723,7 @@
/***/ },
-/***/ 50:
+/***/ 54:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -737,9 +737,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
@@ -801,7 +801,7 @@
/***/ },
-/***/ 51:
+/***/ 55:
/***/ function(module, exports) {
"use strict";
@@ -1353,7 +1353,7 @@
/***/ },
-/***/ 52:
+/***/ 56:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1367,9 +1367,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
@@ -1479,7 +1479,7 @@
/***/ },
-/***/ 53:
+/***/ 57:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1495,11 +1495,11 @@
var _desc, _value, _class;
- var _SelectedContainer2 = __webpack_require__(46);
+ var _SelectedContainer2 = __webpack_require__(50);
var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -1581,7 +1581,7 @@
/***/ },
-/***/ 54:
+/***/ 58:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1593,9 +1593,9 @@
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- var _AbsBaseSelect = __webpack_require__(51);
+ var _AbsBaseSelect = __webpack_require__(55);
- var _TreeSelect2 = __webpack_require__(52);
+ var _TreeSelect2 = __webpack_require__(56);
var _TreeSelect3 = _interopRequireDefault(_TreeSelect2);
@@ -1677,7 +1677,7 @@
/***/ },
-/***/ 55:
+/***/ 59:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1691,9 +1691,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
diff --git a/assets/js/build/init_customer_project_create.js b/assets/js/build/init_customer_project_create.js
index c6ea8eb..f4ae04b 100644
--- a/assets/js/build/init_customer_project_create.js
+++ b/assets/js/build/init_customer_project_create.js
@@ -47,27 +47,27 @@
'use strict';
- var _SelectedContainer = __webpack_require__(46);
+ var _SelectedContainer = __webpack_require__(50);
var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer);
- var _SelectedContainerCreate = __webpack_require__(53);
+ var _SelectedContainerCreate = __webpack_require__(57);
var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate);
- var _NoTreeSelect = __webpack_require__(50);
+ var _NoTreeSelect = __webpack_require__(54);
var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect);
- var _TreeSelect = __webpack_require__(52);
+ var _TreeSelect = __webpack_require__(56);
var _TreeSelect2 = _interopRequireDefault(_TreeSelect);
- var _SingleTreeSelect = __webpack_require__(54);
+ var _SingleTreeSelect = __webpack_require__(58);
var _SingleTreeSelect2 = _interopRequireDefault(_SingleTreeSelect);
- var _SelectOrCreate = __webpack_require__(55);
+ var _SelectOrCreate = __webpack_require__(59);
var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate);
@@ -216,7 +216,7 @@
/***/ },
-/***/ 46:
+/***/ 50:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -231,15 +231,15 @@
var _desc, _value, _class; // `
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -472,7 +472,7 @@
/***/ },
-/***/ 47:
+/***/ 51:
/***/ function(module, exports) {
"use strict";
@@ -628,7 +628,7 @@
/***/ },
-/***/ 48:
+/***/ 52:
/***/ function(module, exports) {
"use strict";
@@ -685,7 +685,7 @@
/***/ },
-/***/ 49:
+/***/ 53:
/***/ function(module, exports) {
"use strict";
@@ -770,7 +770,7 @@
/***/ },
-/***/ 50:
+/***/ 54:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -784,9 +784,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
@@ -848,7 +848,7 @@
/***/ },
-/***/ 51:
+/***/ 55:
/***/ function(module, exports) {
"use strict";
@@ -1400,7 +1400,7 @@
/***/ },
-/***/ 52:
+/***/ 56:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1414,9 +1414,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
@@ -1526,7 +1526,7 @@
/***/ },
-/***/ 53:
+/***/ 57:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1542,11 +1542,11 @@
var _desc, _value, _class;
- var _SelectedContainer2 = __webpack_require__(46);
+ var _SelectedContainer2 = __webpack_require__(50);
var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -1628,7 +1628,7 @@
/***/ },
-/***/ 54:
+/***/ 58:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1640,9 +1640,9 @@
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- var _AbsBaseSelect = __webpack_require__(51);
+ var _AbsBaseSelect = __webpack_require__(55);
- var _TreeSelect2 = __webpack_require__(52);
+ var _TreeSelect2 = __webpack_require__(56);
var _TreeSelect3 = _interopRequireDefault(_TreeSelect2);
@@ -1724,7 +1724,7 @@
/***/ },
-/***/ 55:
+/***/ 59:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1738,9 +1738,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
diff --git a/assets/js/build/init_modal_realty_edit.js b/assets/js/build/init_modal_realty_edit.js
index 40767ed..b3f7826 100644
--- a/assets/js/build/init_modal_realty_edit.js
+++ b/assets/js/build/init_modal_realty_edit.js
@@ -47,27 +47,27 @@
'use strict';
- var _SelectedContainer = __webpack_require__(46);
+ var _SelectedContainer = __webpack_require__(50);
var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer);
- var _SelectedContainerCreate = __webpack_require__(53);
+ var _SelectedContainerCreate = __webpack_require__(57);
var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate);
- var _NoTreeSelect = __webpack_require__(50);
+ var _NoTreeSelect = __webpack_require__(54);
var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect);
- var _TreeSelect = __webpack_require__(52);
+ var _TreeSelect = __webpack_require__(56);
var _TreeSelect2 = _interopRequireDefault(_TreeSelect);
- var _SingleTreeSelect = __webpack_require__(54);
+ var _SingleTreeSelect = __webpack_require__(58);
var _SingleTreeSelect2 = _interopRequireDefault(_SingleTreeSelect);
- var _SelectOrCreate = __webpack_require__(55);
+ var _SelectOrCreate = __webpack_require__(59);
var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate);
@@ -276,7 +276,7 @@
/***/ },
-/***/ 46:
+/***/ 50:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -291,15 +291,15 @@
var _desc, _value, _class; // `
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -532,7 +532,7 @@
/***/ },
-/***/ 47:
+/***/ 51:
/***/ function(module, exports) {
"use strict";
@@ -688,7 +688,7 @@
/***/ },
-/***/ 48:
+/***/ 52:
/***/ function(module, exports) {
"use strict";
@@ -745,7 +745,7 @@
/***/ },
-/***/ 49:
+/***/ 53:
/***/ function(module, exports) {
"use strict";
@@ -830,7 +830,7 @@
/***/ },
-/***/ 50:
+/***/ 54:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -844,9 +844,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
@@ -908,7 +908,7 @@
/***/ },
-/***/ 51:
+/***/ 55:
/***/ function(module, exports) {
"use strict";
@@ -1460,7 +1460,7 @@
/***/ },
-/***/ 52:
+/***/ 56:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1474,9 +1474,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
@@ -1586,7 +1586,7 @@
/***/ },
-/***/ 53:
+/***/ 57:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1602,11 +1602,11 @@
var _desc, _value, _class;
- var _SelectedContainer2 = __webpack_require__(46);
+ var _SelectedContainer2 = __webpack_require__(50);
var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -1688,7 +1688,7 @@
/***/ },
-/***/ 54:
+/***/ 58:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1700,9 +1700,9 @@
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- var _AbsBaseSelect = __webpack_require__(51);
+ var _AbsBaseSelect = __webpack_require__(55);
- var _TreeSelect2 = __webpack_require__(52);
+ var _TreeSelect2 = __webpack_require__(56);
var _TreeSelect3 = _interopRequireDefault(_TreeSelect2);
@@ -1784,7 +1784,7 @@
/***/ },
-/***/ 55:
+/***/ 59:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1798,9 +1798,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
diff --git a/assets/js/build/init_portfolio_create_edit.js b/assets/js/build/init_portfolio_create_edit.js
index c6dd2c7..22f6b58 100644
--- a/assets/js/build/init_portfolio_create_edit.js
+++ b/assets/js/build/init_portfolio_create_edit.js
@@ -47,23 +47,23 @@
'use strict';
- var _SelectedContainer = __webpack_require__(46);
+ var _SelectedContainer = __webpack_require__(50);
var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer);
- var _SelectedContainerCreate = __webpack_require__(53);
+ var _SelectedContainerCreate = __webpack_require__(57);
var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate);
- var _NoTreeSelect = __webpack_require__(50);
+ var _NoTreeSelect = __webpack_require__(54);
var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect);
- var _TreeSelect = __webpack_require__(52);
+ var _TreeSelect = __webpack_require__(56);
var _TreeSelect2 = _interopRequireDefault(_TreeSelect);
- var _SelectOrCreate = __webpack_require__(55);
+ var _SelectOrCreate = __webpack_require__(59);
var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate);
@@ -124,7 +124,7 @@
/***/ },
-/***/ 46:
+/***/ 50:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -139,15 +139,15 @@
var _desc, _value, _class; // `
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -380,7 +380,7 @@
/***/ },
-/***/ 47:
+/***/ 51:
/***/ function(module, exports) {
"use strict";
@@ -536,7 +536,7 @@
/***/ },
-/***/ 48:
+/***/ 52:
/***/ function(module, exports) {
"use strict";
@@ -593,7 +593,7 @@
/***/ },
-/***/ 49:
+/***/ 53:
/***/ function(module, exports) {
"use strict";
@@ -678,7 +678,7 @@
/***/ },
-/***/ 50:
+/***/ 54:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -692,9 +692,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
@@ -756,7 +756,7 @@
/***/ },
-/***/ 51:
+/***/ 55:
/***/ function(module, exports) {
"use strict";
@@ -1308,7 +1308,7 @@
/***/ },
-/***/ 52:
+/***/ 56:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1322,9 +1322,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
@@ -1434,7 +1434,7 @@
/***/ },
-/***/ 53:
+/***/ 57:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1450,11 +1450,11 @@
var _desc, _value, _class;
- var _SelectedContainer2 = __webpack_require__(46);
+ var _SelectedContainer2 = __webpack_require__(50);
var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -1536,7 +1536,7 @@
/***/ },
-/***/ 55:
+/***/ 59:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1550,9 +1550,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
diff --git a/assets/js/build/init_worksell_filter.js b/assets/js/build/init_worksell_filter.js
index f31a639..153d6e1 100644
--- a/assets/js/build/init_worksell_filter.js
+++ b/assets/js/build/init_worksell_filter.js
@@ -47,15 +47,15 @@
'use strict';
- var _SelectedContainer = __webpack_require__(46);
+ var _SelectedContainer = __webpack_require__(50);
var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer);
- var _NoTreeSelect = __webpack_require__(50);
+ var _NoTreeSelect = __webpack_require__(54);
var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect);
- var _TreeSelect = __webpack_require__(52);
+ var _TreeSelect = __webpack_require__(56);
var _TreeSelect2 = _interopRequireDefault(_TreeSelect);
@@ -122,7 +122,7 @@
/***/ },
-/***/ 46:
+/***/ 50:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -137,15 +137,15 @@
var _desc, _value, _class; // `
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
- var _decorators = __webpack_require__(49);
+ var _decorators = __webpack_require__(53);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -378,7 +378,7 @@
/***/ },
-/***/ 47:
+/***/ 51:
/***/ function(module, exports) {
"use strict";
@@ -534,7 +534,7 @@
/***/ },
-/***/ 48:
+/***/ 52:
/***/ function(module, exports) {
"use strict";
@@ -591,7 +591,7 @@
/***/ },
-/***/ 49:
+/***/ 53:
/***/ function(module, exports) {
"use strict";
@@ -676,7 +676,7 @@
/***/ },
-/***/ 50:
+/***/ 54:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -690,9 +690,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _NoTreeData = __webpack_require__(48);
+ var _NoTreeData = __webpack_require__(52);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
@@ -754,7 +754,7 @@
/***/ },
-/***/ 51:
+/***/ 55:
/***/ function(module, exports) {
"use strict";
@@ -1306,7 +1306,7 @@
/***/ },
-/***/ 52:
+/***/ 56:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1320,9 +1320,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(51);
+ var _AbsBaseSelect2 = __webpack_require__(55);
- var _DataTree = __webpack_require__(47);
+ var _DataTree = __webpack_require__(51);
var _DataTree2 = _interopRequireDefault(_DataTree);
diff --git a/assets/js/build/portfolio_create_edit.js b/assets/js/build/portfolio_create_edit.js
index 54b253e..8a7a7c2 100644
--- a/assets/js/build/portfolio_create_edit.js
+++ b/assets/js/build/portfolio_create_edit.js
@@ -47,11 +47,11 @@
'use strict';
- var _image_upload = __webpack_require__(38);
+ var _image_upload = __webpack_require__(42);
- var _scroll_on_required = __webpack_require__(35);
+ var _scroll_on_required = __webpack_require__(39);
- var _ajax_send_form_data = __webpack_require__(39);
+ var _ajax_send_form_data = __webpack_require__(43);
$(function () {
(0, _image_upload.imageUploadInit)();
@@ -107,7 +107,7 @@
/***/ },
-/***/ 35:
+/***/ 39:
/***/ function(module, exports) {
'use strict';
@@ -128,7 +128,7 @@
/***/ },
-/***/ 38:
+/***/ 42:
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -208,7 +208,7 @@
/***/ },
-/***/ 39:
+/***/ 43:
/***/ function(module, exports, __webpack_require__) {
"use strict";
diff --git a/assets/js/build/project_filter.js b/assets/js/build/project_filter.js
index 650c753..68fb0fb 100644
--- a/assets/js/build/project_filter.js
+++ b/assets/js/build/project_filter.js
@@ -47,11 +47,11 @@
'use strict';
- var _custom_check = __webpack_require__(27);
+ var _custom_check = __webpack_require__(31);
- var _extended_field = __webpack_require__(28);
+ var _extended_field = __webpack_require__(32);
- var _ajax_set_filter = __webpack_require__(29);
+ var _ajax_set_filter = __webpack_require__(33);
function paginateTo(pageNum) {
var $form = $('#filter-form');
@@ -72,7 +72,7 @@
/***/ },
-/***/ 27:
+/***/ 31:
/***/ function(module, exports) {
"use strict";
@@ -102,7 +102,7 @@
/***/ },
-/***/ 28:
+/***/ 32:
/***/ function(module, exports) {
'use strict';
@@ -133,7 +133,7 @@
/***/ },
-/***/ 29:
+/***/ 33:
/***/ function(module, exports) {
'use strict';
diff --git a/assets/js/build/registration.js b/assets/js/build/registration.js
index 41b0ee2..e0ff477 100644
--- a/assets/js/build/registration.js
+++ b/assets/js/build/registration.js
@@ -47,7 +47,7 @@
'use strict';
- var _popups = __webpack_require__(34);
+ var _popups = __webpack_require__(38);
function checkHash() {
// on load of the page: switch to the currently selected tab
@@ -65,7 +65,7 @@
/***/ },
-/***/ 34:
+/***/ 38:
/***/ function(module, exports) {
'use strict';
diff --git a/assets/js/build/user_profile_edit.js b/assets/js/build/user_profile_edit.js
index 5c9fe2d..4f449ca 100644
--- a/assets/js/build/user_profile_edit.js
+++ b/assets/js/build/user_profile_edit.js
@@ -47,13 +47,13 @@
'use strict';
- var _avatar_upload = __webpack_require__(56);
+ var _avatar_upload = __webpack_require__(60);
- var _bootstrap_tabs = __webpack_require__(42);
+ var _bootstrap_tabs = __webpack_require__(46);
- var _user_check_statuses = __webpack_require__(57);
+ var _user_check_statuses = __webpack_require__(61);
- var _custom_select = __webpack_require__(40);
+ var _custom_select = __webpack_require__(44);
$(function () {
(0, _avatar_upload.avatarUploadInit)();
@@ -64,7 +64,7 @@
/***/ },
-/***/ 40:
+/***/ 44:
/***/ function(module, exports) {
'use strict';
@@ -108,7 +108,7 @@
/***/ },
-/***/ 42:
+/***/ 46:
/***/ function(module, exports) {
"use strict";
@@ -144,7 +144,7 @@
/***/ },
-/***/ 56:
+/***/ 60:
/***/ function(module, exports) {
'use strict';
@@ -197,7 +197,7 @@
/***/ },
-/***/ 57:
+/***/ 61:
/***/ function(module, exports) {
'use strict';
diff --git a/assets/js/build/worksell_filter.js b/assets/js/build/worksell_filter.js
index b2ec298..6245d28 100644
--- a/assets/js/build/worksell_filter.js
+++ b/assets/js/build/worksell_filter.js
@@ -47,13 +47,13 @@
'use strict';
- var _custom_check = __webpack_require__(27);
+ var _custom_check = __webpack_require__(31);
- var _extended_field = __webpack_require__(28);
+ var _extended_field = __webpack_require__(32);
- var _ajax_set_filter = __webpack_require__(29);
+ var _ajax_set_filter = __webpack_require__(33);
- var _filter_toggle = __webpack_require__(30);
+ var _filter_toggle = __webpack_require__(34);
function paginateTo(pageNum) {
var $form = $('#filter-form');
@@ -75,7 +75,7 @@
/***/ },
-/***/ 27:
+/***/ 31:
/***/ function(module, exports) {
"use strict";
@@ -105,7 +105,7 @@
/***/ },
-/***/ 28:
+/***/ 32:
/***/ function(module, exports) {
'use strict';
@@ -136,7 +136,7 @@
/***/ },
-/***/ 29:
+/***/ 33:
/***/ function(module, exports) {
'use strict';
@@ -200,7 +200,7 @@
/***/ },
-/***/ 30:
+/***/ 34:
/***/ function(module, exports) {
'use strict';
diff --git a/assets/js/src/chat/BINDS.js b/assets/js/src/chat/BINDS.js
index 025478d..96f27f5 100644
--- a/assets/js/src/chat/BINDS.js
+++ b/assets/js/src/chat/BINDS.js
@@ -1,6 +1,7 @@
import {getCookie} from '../utils'
import {onClickCardWithCount} from './messageCounters'
import {loadTemplate} from './loaders'
+import {bindRemoveNotes} from './notes'
function dialog(message, yesCallback, notCallback) {
$("#dialog_delete .modal-title").html(message);
@@ -21,6 +22,7 @@ function bindOrders() {
$('.order-block').on('click', function (event) {
event.preventDefault();
let $this = $(this);
+ $("#chat-order-add").show();
onClickCardWithCount($this);
$('.order-block').each(function (i, v) {
$(v).removeClass('orAct');
@@ -42,14 +44,75 @@ function bindOrders() {
$("#chat-order-add #recipentId").val(recipentId);
window.chatController.create(orderId, projectId, recipentId, orderName, secureOrder);
+
+ $.ajax({
+ url: '/api/note/',
+ type: 'GET',
+ beforeSend: function (xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
+ },
+ data: {
+ 'order': orderId,
+ },
+ dataType: 'json',
+ success: function (json) {
+ var noteHtmlInbox = '';
+ var note_tmpl = loadTemplate('note_tmpl');
+ // console.log("note json -->", json);
+ $.each(json.results, function (i, v) {
+ noteHtmlInbox += note_tmpl({text: v.text, note_id: v.id});
+ });
+ $(".order-notes-block").html(noteHtmlInbox);
+ bindRemoveNotes();
+ }
+ });
});
$('.order-block .dimovChat').on('click', function (event) {
event.preventDefault();
event.stopPropagation();
+ // .toggle();
+ let $arrow = $(event.target);
+ let $info = $arrow.siblings('.hideOBB');
+ if ($info.hasClass("open")) {
+ $arrow.css('transform', 'rotate(0deg)');
+ $info.hide();
+ } else {
+ $arrow.css('transform', 'rotate(90deg)');
+ $info.show();
+ }
+ $info.toggleClass("open");
// console.log('click on tr');
});
}
+function bindOrderInfo() {
+ $(".messageBlock").on('click', '.full-order-info', function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var orderId = $(this).closest('.orderBlock').data('id');
+ if (!orderId) {
+ orderId = $(this).closest('.trashedOrderBlock').data('id');
+ }
+ $.ajax({
+ url: '/api/orders/' + orderId + '/',
+ beforeSend: function (xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
+ },
+ dataType: 'json',
+ success: function (data) {
+ let outTable_tmpl = loadTemplate('order_info_tmpl');
+ var outTable = outTable_tmpl({order: data});
+
+ $("#order-info table").html(outTable);
+ $("#order-info").modal('show');
+ },
+ error: function (e, jqxhr) {
+ console.log(e);
+ }
+ });
+ });
+}
+
function bindTeams() {
$('.team-block').on('click', function () {
onClickCardWithCount($(this));
@@ -145,10 +208,11 @@ function bindTeams() {
var noteHtmlInbox = '';
var note_tmpl = loadTemplate('note_tmpl');
$.each(json.results, function (i, v) {
- noteHtmlInbox += note_tmpl({text: v.text});
+ noteHtmlInbox += note_tmpl({text: v.text, note_id: v.id});
});
$(".team-notes-block").html(noteHtmlInbox);
+ bindRemoveNotes();
}
});
@@ -385,9 +449,10 @@ function bindGetUserMessages() {
var noteHtmlInbox = '';
var note_tmpl = loadTemplate('note_tmpl');
$.each(json.results, function (i, v) {
- noteHtmlInbox += note_tmpl({text: v.text});
+ noteHtmlInbox += note_tmpl({text: v.text, note_id: v.id});
});
$(".contractor-notes-block").html(noteHtmlInbox);
+ bindRemoveNotes();
}
});
@@ -434,12 +499,25 @@ function bindDeleteContact() {
});
}
+function bindCtrlEnterSendMessage() {
+ $('textarea.js-chat').keydown(function (e) {
+ let $target = $(e.target);
+ if (e.ctrlKey && e.keyCode == 13) {
+ // console.log("Send button -->", $target.parent().find('.btn-send'))
+ let $btn_send = $target.parent().find('.btn-send');
+ $btn_send.trigger('click');
+ }
+ })
+}
+
export {
bindOrders,
+ bindOrderInfo,
bindArbitrationSend,
bindOnTabs,
bindUserContacts,
bindGetUserMessages,
bindTeams,
bindDeleteContact,
+ bindCtrlEnterSendMessage,
}
\ No newline at end of file
diff --git a/assets/js/src/chat/ChatContractorPageController.js b/assets/js/src/chat/ChatContractorPageController.js
index 6e18d8c..241a295 100644
--- a/assets/js/src/chat/ChatContractorPageController.js
+++ b/assets/js/src/chat/ChatContractorPageController.js
@@ -1 +1 @@
-import {StagesController} from './StagesContractorController'
import {MessagesController} from './MessagesControllers'
import {DocumentsController} from './DocumentsControllers'
class ChatPageController {
constructor() {
let self = this;
console.log("NEW CONTRACTOR ChatPageController");
this.statesController = undefined;
this.messagesController = undefined;
this.documentsController = undefined;
// TODO: не забыть!
// $('.order-block').on('click', function (event) {
// console.log("CLICK!!!");
// event.preventDefault();
// let $this = $(this);
// $('.order-block').each(function (i, v) {
// $(v).removeClass('orAct');
// });
// $this.addClass('orAct');
// let orderId = $this.data('id');
// let projectId = $this.data('project-id');
// let recipentId = $this.data('recipent-id');
// let orderName = $this.data('order-name');
// // console.log('orderId = ', orderId);
// new StagesController(orderId, projectId, recipentId, orderName);
// new MessagesController(orderId);
// window.location.hash = `order${orderId}`;
//
// $("#chat-order-add #orderId").val(orderId);
// $("#add-form-order-note #orderNote").val(orderId);
// $("#orderArbitrationId").val(orderId);
// $("#projectReviewId").val(projectId);
// // console.log("recipentId = ", recipentId);
// $("#chat-order-add #recipentId").val(recipentId);
// $("#targetCustomerId").val(recipentId);
// $("#add-form-order-note #recipentNote").val(recipentId);
//
// });
// $('.order-block .dimovChat').on('click', function (event) {
// event.preventDefault();
// event.stopPropagation();
// // TODO: доделать сворачивание/разворачивание блока
// // console.log('click on tr');
// });
}
create(orderId, projectId, recipentId, orderName, secureOrder) {
this.statesController = new StagesController(orderId, projectId, recipentId, orderName, secureOrder);
this.messagesController = new MessagesController(orderId);
this.documentsController = new DocumentsController(orderId);
}
// refresh()
}
export {ChatPageController}
\ No newline at end of file
+import {StagesController} from './StagesContractorController'
import {MessagesController} from './MessagesControllers'
import {DocumentsController} from './DocumentsControllers'
class ChatPageController {
constructor() {
let self = this;
console.log("NEW CONTRACTOR ChatPageController");
this.statesController = undefined;
this.messagesController = undefined;
this.documentsController = undefined;
}
create(orderId, projectId, recipentId, orderName, secureOrder) {
this.statesController = new StagesController(orderId, projectId, recipentId, orderName, secureOrder);
this.messagesController = new MessagesController(orderId);
this.documentsController = new DocumentsController(orderId);
}
// refresh()
}
export {ChatPageController}
\ No newline at end of file
diff --git a/assets/js/src/chat/ChatCustomerPageController.js b/assets/js/src/chat/ChatCustomerPageController.js
index 679d9c3..f8f9df5 100644
--- a/assets/js/src/chat/ChatCustomerPageController.js
+++ b/assets/js/src/chat/ChatCustomerPageController.js
@@ -1 +1 @@
-import {StagesController} from './StagesCustomerController'
import {MessagesController} from './MessagesControllers'
import {recalculateMessages} from './messageCounters'
class ChatPageController {
constructor() {
let self = this;
// console.log("NEW Chat CUSTOMER PageController");
this.statesController = undefined;
this.messagesController = undefined;
// TODO: не забыть!
// recalculateMessages();
}
create(orderId, projectId, recipentId, orderName, secureOrder) {
this.statesController = new StagesController(orderId, projectId, recipentId, orderName, secureOrder);
this.messagesController = new MessagesController(orderId);
}
}
export {ChatPageController}
\ No newline at end of file
+import {StagesController} from './StagesCustomerController'
import {MessagesController} from './MessagesControllers'
import {DocumentsController} from './DocumentsControllers'
class ChatPageController {
constructor() {
let self = this;
// console.log("NEW Chat CUSTOMER PageController");
this.statesController = undefined;
this.messagesController = undefined;
this.documentsController = undefined;
}
create(orderId, projectId, recipentId, orderName, secureOrder, kwargs={archive:false}) {
this.statesController = new StagesController(orderId, projectId, recipentId, orderName, secureOrder, kwargs);
this.messagesController = new MessagesController(orderId);
this.documentsController = new DocumentsController(orderId);
}
}
export {ChatPageController}
\ No newline at end of file
diff --git a/assets/js/src/chat/MessagesControllers.js b/assets/js/src/chat/MessagesControllers.js
index 8bb1d10..368a0ae 100644
--- a/assets/js/src/chat/MessagesControllers.js
+++ b/assets/js/src/chat/MessagesControllers.js
@@ -33,9 +33,6 @@ class MessagesController {
_onLoadData(json) {
const self = this;
- // console.log('mesages json = ', json);
- // console.log('$inbox = ', this.$inbox);
- // console.log("messages render start");
self.$inbox.html("");
$.each(json.results, function (i, v) {
var senderName = 'Вы';
@@ -46,7 +43,7 @@ class MessagesController {
className = '';
}
if (v.is_system) {
- senderName = 'Системное';
+ senderName = (senderName == 'Вы') ? 'Системное от Вас': `Системное от ${senderName}`;
className = 'systemChat'
}
let message = $(self.messageTemplate({className: className, senderName: senderName, message: v}));
diff --git a/assets/js/src/chat/Stages.js b/assets/js/src/chat/Stages.js
index feb09f9..61da520 100644
--- a/assets/js/src/chat/Stages.js
+++ b/assets/js/src/chat/Stages.js
@@ -188,7 +188,6 @@ class StageForm {
beforeSend: function (xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
},
- //TODO: слать только изменения
data: {
status: secureOrder ? 'agreed': 'in_process',
},
@@ -209,7 +208,6 @@ class StageForm {
beforeSend: function (xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
},
- //TODO: слать только изменения
data: {status: 'not_agreed'},
dataType: 'json',
})
@@ -322,7 +320,6 @@ class StageInWork {
beforeSend: function (xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
},
- //TODO: слать только изменения
data: {status: 'closed'},
dataType: 'json',
})
diff --git a/assets/js/src/chat/StagesContractorController.js b/assets/js/src/chat/StagesContractorController.js
index bb947d8..86842ba 100644
--- a/assets/js/src/chat/StagesContractorController.js
+++ b/assets/js/src/chat/StagesContractorController.js
@@ -25,6 +25,7 @@ const STATUSES = {
};
//Contractor
+//TODO: Вынесли общую логику в родительский класс
class StagesController {
constructor(orderId, projectId, recipentId, orderName, secureOrder) {
const self = this;
@@ -62,6 +63,10 @@ class StagesController {
$reserve: $('#reserveSpace'), //2. Резервирование (Отобразить)
$works: $('#completeWork') //3. Выполненная работа
};
+ this.temp = {
+ approve_stage_header_text: this.stages_elements.$approve.find('.js-stage-header').html(),
+ reserve_help_text: this.stages_elements.$approve.find('.js-help-text').html(),
+ };
this.init();
}
@@ -98,13 +103,39 @@ class StagesController {
this.init();
}
+ reload() {
+ /**
+ * Перезагружаем страницу Чата(при удалении заказа)
+ */
+ window.location = '/chat/#order';
+ location.reload();
+ }
+
+ _buildPage() {
+ // console.log("Build PAge");
+ // Restore html to default
+ this.stages_elements.$approve.find('.js-stage-header').html(this.temp.approve_stage_header_text);
+ this.stages_elements.$reserve.find('.js-help-text').html(this.temp.reserve_help_text);
+ this.stages_elements.$approve.find('.js-select').addClass("select");
+ this.stages_elements.$reserve.find('.js-select').addClass("select");
+ this.stages_elements.$works.find('.js-select').addClass("select");
+
+ this.stages_elements.$reserve.hide();
+ this.stages_elements.$works.hide();
+ if (this.data.stages.length == 0) {
+ this.buildStartStage()
+ } else {
+ let stageStatus = this.data.stages[0].status;
+ // console.log('stageStatus = ', stageStatus);
+ this.STAGE_STATUSES[stageStatus]();
+ }
+ this._bindEvents();
+ }
buildStartStage() {
/**
* Стадия: "Проект Предложен"(нет этапов)
*/
- // Выделить цифру 1. красным
- // $('#conditions-approve').find('.select')
this.stages_elements.$approve.show();
this.stages_elements.$reserve.show();
this.stages_elements.$works.show();
@@ -121,8 +152,11 @@ class StagesController {
if (this.secureOrder){
this.stages_elements.$reserve.find('.js-help-text').show();
} else {
- this.stages_elements.$reserve.find('.js-help-text').hide();
- // this.stages_elements.$reserve.find('.js-help-text').html('Резервирование не предусмотрено, безопасная сделака не активна');
+ this.stages_elements.$reserve.find('.js-help-text').show();
+ this.stages_elements.$reserve.find('.js-select').removeClass('select');
+ this.stages_elements.$reserve.find('.js-help-text').html(
+ 'Резервирование не предусмотрено, безопасная сделака не активна '
+ );
}
} // Нет Этапов / "Не согласован"
@@ -138,7 +172,7 @@ class StagesController {
buildSendApproveStage() {
console.log("Stage: send_approve");
- this._renderStage('stage_approved_tmpl', true);
+ this._renderStage('stage_contractor_approve_tmpl', true);
this.$orderStagesContainer.parent().show();
this.buttons.btnApprove.show();
this.buttons.btnChange.show();
@@ -157,6 +191,7 @@ class StagesController {
this.buttons.btnsArbitration.last().show();
this._renderStage('stage_approved_tmpl', true);
this.stages_elements.$approve.find('.js-help-text').hide();
+ this.stages_elements.$approve.find('.js-select').removeClass('select');
this.stages_elements.$reserve.show();
if (this.secureOrder){
this._renderStageReserved('reserved_tmpl');
@@ -169,29 +204,23 @@ class StagesController {
buildProcessStage() {
console.log('Stage: in_process');
+ // Block-Stage-1
+ this.stages_elements.$approve.find('.js-stage-header').html('Согласованные условия');
+ this.stages_elements.$approve.find('.js-select').removeClass('select');
this.buildAgreedStage();
+ // Block-Stage-2
this.stages_elements.$reserve.find('.js-help-text').hide();
+ // Block-Stage-3
this.stages_elements.$works.show();
+
+ this._renderStageInWork('work_in_process_tmpl');
if (this.secureOrder) {
- this._renderStageInWork('work_in_process_tmpl');
+ // this._renderStageInWork('work_in_process_tmpl');
} else {
- this.stages_elements.$reserve.find('.stages-paid').html("");
+ this.stages_elements.$reserve.hide();
}
} // Статус "В процессе"/"Завершен"/"Закрыт"
- _buildPage() {
- // console.log("Build PAge");
- this.stages_elements.$reserve.hide();
- this.stages_elements.$works.hide();
- if (this.data.stages.length == 0) {
- this.buildStartStage()
- } else {
- let stageStatus = this.data.stages[0].status;
- // console.log('stageStatus = ', stageStatus);
- this.STAGE_STATUSES[stageStatus]();
- }
- this._bindEvents();
- }
_renderStage(template_name, disable = false) {
let i = 0;
@@ -287,6 +316,11 @@ class StagesController {
_onLoadData(json) {
this.data = json;
this._buildPage();
+ if (this.data.project.state == 'deleted') {
+ for (let key in this.buttons){
+ this.buttons[key].hide();
+ }
+ }
}
_bindEvents() {
@@ -315,7 +349,7 @@ class StagesController {
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = `Условия заказа ${self.orderName} приняты`;
+ message.data.msg = `Условия заказа "${self.orderName}" приняты`;
console.log("Send-WS Условия приняты");
socket.send_stages_approve(message);
//TODO: раскомментировать дурацкое окно
@@ -333,7 +367,7 @@ class StagesController {
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = `Заказ ${self.orderName} отправлен для внесения изменений`;
+ message.data.msg = `Заказ "${self.orderName}" отправлен для внесения изменений`;
console.log("Send-WS Внести изменения");
socket.send_stages_approve(message);
});
@@ -376,7 +410,7 @@ class StagesController {
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = `Этап ${json.name} закрыт`;
+ message.data.msg = `Этап "${json.name}" закрыт`;
console.log("Send-WS Закрытие этапа");
socket.send_stages_approve(message);
})
@@ -412,18 +446,22 @@ class StagesController {
// $('#review-add').modal('hide');
// self.stages_elements.$works.find('.js-btnSendReview').hide();
$('#review-add').modal('hide');
- self.redraw();
-
let message = message_format;
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = `Отзыв на заказ ${self.orderName} оставлен`;
+ message.data.msg = `Отзыв на заказ "${self.orderName}" оставлен`;
console.log("Send-WS Оставить отзыв");
+ // TODO: в этом сообщении отослать команду на reload if(json.count_reviews == 2)
socket.send_stages_approve(message);
// $("a[href='#tab2']").trigger('click');
- window.location = '/chat/#order';
- location.reload();
+ if(json.count_reviews == 1){
+ self.redraw();
+ }else {
+ self.reload();
+ }
+ // window.location = '/chat/#order';
+ // location.reload();
},
error: function (e) {
console.log('error');
@@ -432,6 +470,12 @@ class StagesController {
});
} // "Оставить отзыв"
+ _changeOrderProtect(secure) {
+ this.secureOrder = secure;
+ console.log('secure = ', this.secureOrder);
+ this.redraw();
+ }// Если заказчик изменил secure
+
_onBtnArbitration(event) {
event.preventDefault();
diff --git a/assets/js/src/chat/StagesCustomerController.js b/assets/js/src/chat/StagesCustomerController.js
index 5541d05..0f4f9d2 100644
--- a/assets/js/src/chat/StagesCustomerController.js
+++ b/assets/js/src/chat/StagesCustomerController.js
@@ -24,15 +24,17 @@ const STATUSES = {
};
-
+//Customer
+//TODO: Вынесли общую логику в родительский класс
class StagesController {
- constructor(orderId, projectId, recipentId, orderName, secureOrder) {
+ constructor(orderId, projectId, recipentId, orderName, secureOrder, kwargs = {}) {
const self = this;
this.orderId = orderId;
this.orderName = orderName;
this.projectId = projectId;
this.recipentId = recipentId;
this.secureOrder = secureOrder;
+ // this.is_archive_project
this.data = {}; //JSON
this.stages = [];
this.stages_reserved = [];
@@ -47,6 +49,8 @@ class StagesController {
};
this.btnCompleteTmpl = loadTemplate('bntCompleteStage_tmpl');
this.btnSendReviewTmpl = loadTemplate('btnSendReview_tmpl');
+ this.switch_to_protected_tmpl = loadTemplate('switch_to_protected_tmpl');
+
this.$orderStagesContainer = $('#order-stages');
this.$orderStagesContainer.html('');
this.$stagesCount = $('#countStage');
@@ -65,6 +69,9 @@ class StagesController {
$reserve: $('#reserveSpace'), //2. Резервирование
$works: $('#completeWork') //3. Выполненная работа
};
+ this.temp = {
+ approve_stage_header_text: this.stages_elements.$approve.find('.js-stage-header').html(),
+ };
this.init();
}
@@ -101,6 +108,37 @@ class StagesController {
this.init();
}
+ reload() {
+ /**
+ * Перезагружаем страницу Чата(при удалении заказа)
+ */
+ window.location = '/chat/#order';
+ location.reload();
+ }
+
+ _buildPage() {
+ console.log("Build Page!");
+ // Restore html to default
+ this.stages_elements.$approve.find('.js-stage-header').html(this.temp.approve_stage_header_text);
+ console.log("restore this -->", this.stages_elements.$approve.find('.js-select'));
+ this.stages_elements.$approve.find('.js-select').addClass("select");
+ this.stages_elements.$reserve.find('.js-select').addClass("select");
+ this.stages_elements.$works.find('.js-select').addClass("select");
+ let $swith_to_protected = this.$orderStagesContainer.siblings('.switch');
+ if ($swith_to_protected.length) $swith_to_protected.remove();
+
+ this.stages_elements.$reserve.hide();
+ this.stages_elements.$works.hide();
+ if (this.data.stages.length == 0) {
+ this.buildStartStage()
+ } else {
+ let stageStatus = this.data.stages[0].status;
+ // console.log('stageStatus = ', stageStatus);
+ this.STAGE_STATUSES[stageStatus]();
+ }
+ this._bindEvents();
+ }
+
buildStartStage() {
/**
* Стадия: "Проект Предложен"(нет этапов)
@@ -114,11 +152,17 @@ class StagesController {
this.$stagesCount.removeAttr('disabled');
this.$stagesCount.val(1);
this.$stagesCount.trigger('change');
+ this.stages_elements.$approve.find('.js-select').addClass('select');
// this.stages_elements.$approve.find('.js-help-text').show();
// this.stages_elements.$reserve.find('.js-help-text').show();
// this.stages_elements.$reserve.find('.stages-paid').hide();
// this.stages_elements.$works.find('.js-help-text').show();
// this.stages_elements.$works.find('#stagesWork').show();
+ if (!this.secureOrder) {
+ // console.log("add switch to protect");
+ this.$orderStagesContainer.after(this.switch_to_protected_tmpl());
+ $('#switch-to-protected').unbind().on('change', this._onChangeToProtect.bind(this));
+ }
} // Нет Этапов
@@ -128,6 +172,11 @@ class StagesController {
this.buttons.btnApprove.show();
this.buttons.btnChange.hide();
this.buttons.btnToArchive.hide();
+ if (!this.secureOrder) {
+ // console.log("add switch to protect");
+ this.$orderStagesContainer.after(this.switch_to_protected_tmpl());
+ $('#switch-to-protected').unbind().on('change', this._onChangeToProtect.bind(this));
+ }
} // Статус "Не согласован"
buildSendApproveStage() {
@@ -149,6 +198,7 @@ class StagesController {
this.$stagesCount.parent().hide();
this._renderStage('stage_approved_tmpl', true);
this.stages_elements.$approve.find('.js-help-text').hide();
+ this.stages_elements.$approve.find('.js-select').removeClass('select');
this.stages_elements.$reserve.find('.js-help-text').show();
this.stages_elements.$reserve.show();
this.buttons.btnReserve.show();
@@ -160,24 +210,21 @@ class StagesController {
buildProcessStage() {
console.log('Stage: in_process');
this.buildAgreedStage();
+ // Block-Stage-1
+ this.stages_elements.$approve.find('.js-select').removeClass('select');
+ // Block-Stage-2
+ this.stages_elements.$reserve.find('.js-select').removeClass('select');
this.stages_elements.$reserve.find('.js-btnArbitration').hide();
+ // Block-Stage-3
this.stages_elements.$works.show();
this._renderStageInWork('work_in_process_tmpl');
- } // Статус "В процессе"/"Завершен"/"Закрыт"
+ if (this.secureOrder) {
- _buildPage() {
- // console.log("Build PAge");
- this.stages_elements.$reserve.hide();
- this.stages_elements.$works.hide();
- if (this.data.stages.length == 0) {
- this.buildStartStage()
} else {
- let stageStatus = this.data.stages[0].status;
- // console.log('stageStatus = ', stageStatus);
- this.STAGE_STATUSES[stageStatus]();
+ this.stages_elements.$reserve.hide();
}
- this._bindEvents();
- }
+ } // Статус "В процессе"/"Завершен"/"Закрыт"
+
_renderStage(template_name, disable = false) {
let i = 0;
@@ -232,7 +279,6 @@ class StagesController {
{
template_name,
data: stage_data,
- note_text: 'Закройте этап или подробно опишите замечания в чате'
});
this.stages_work.push(stage);
}
@@ -250,7 +296,7 @@ class StagesController {
if (stage_data.status == 'closed') continue;
let stage = new StageInWork($container,
{
- template_name, data: stage_data
+ template_name, data: stage_data, note_text: 'Закройте этап или подробно опишите замечания в чате'
});
if (stage_data.status == 'completed') {
let $btn = $(this.btnCompleteTmpl({stage: stage_data, text: 'Закрыть этап'}));
@@ -267,6 +313,11 @@ class StagesController {
_onLoadData(json) {
this.data = json;
this._buildPage();
+ if (this.data.project.state == 'deleted') {
+ for (let key in this.buttons) {
+ this.buttons[key].hide();
+ }
+ }
}
_changeNumStages(event) {
@@ -345,7 +396,7 @@ class StagesController {
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = `Условия заказа ${self.orderName} отправлены на согласование`;
+ message.data.msg = `Условия заказа "${self.orderName}" отправлены на согласование`;
console.log("Send-WS Отправить на согласование");
socket.send_stages_approve(message);
//TODO: раскомментировать дурацкое окно
@@ -366,7 +417,7 @@ class StagesController {
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = `Заказ ${self.orderName} отозван для внесения изменений`;
+ message.data.msg = `Заказ "${self.orderName}" отозван для внесения изменений`;
console.log("Send-WS Внести изменения");
socket.send_stages_approve(message);
});
@@ -388,7 +439,7 @@ class StagesController {
})
.done(function (json) {
console.log('delete complete');
- window.location.href = window.location.href.replace(getHash(), "");
+ // window.location.href = window.location.href.replace(getHash(), "");
let message = message_format;
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
@@ -396,6 +447,7 @@ class StagesController {
message.data.msg = `Заказа ${self.orderName} отправлен в архив`;
console.log("Send-WS Отправить в архив");
socket.send_stages_approve(message);
+ self.reload();
})
.fail(function (xhr, errorMsg, error) {
console.log("delete fail, json -->", xhr);
@@ -481,7 +533,7 @@ class StagesController {
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = `Заказчик закрыл этап ${json.name}`;
+ message.data.msg = `Заказчик закрыл этап "${json.name}"`;
console.log("Send-WS Оплата Этапа/Этапов");
socket.send_stages_approve(message);
self.redraw();
@@ -517,12 +569,16 @@ class StagesController {
message.data.sender_id = userId;
message.data.recipent_id = self.recipentId;
message.data.order_id = self.orderId;
- message.data.msg = `Отзыв на заказ ${self.orderName} оставлен`;
+ message.data.msg = `Отзыв на заказ "${self.orderName}" оставлен`;
console.log("Send-WS Оставить отзыв");
+ // TODO: в этом сообщении отослать команду на reload if(json.count_reviews == 2)
socket.send_stages_approve(message);
- window.location = '/chat/#order';
- location.reload();
- // $("a[href='#tab2']").trigger('click');
+ // console.log('json = ', json);
+ if(json.count_reviews == 1){
+ self.redraw();
+ }else {
+ self.reload();
+ }
},
error: function (e) {
console.log('error');
@@ -531,6 +587,32 @@ class StagesController {
});
} // "Оставить отзыв"
+ _onChangeToProtect(event) {
+ const self = this;
+ let checked = $(event.target).prop('checked');
+ console.log('checked = ', checked);
+ $.ajax({
+ url: '/api/orders/' + this.orderId + '/',
+ type: 'PATCH',
+ beforeSend: function (xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
+ },
+ data: {secure: checked},
+ dataType: 'json',
+ success: function (json) {
+ console.log("Protect switch success, json = ", json);
+ let message = message_format;
+ message.data.sender_id = userId;
+ message.data.recipent_id = self.recipentId;
+ message.data.order_id = self.orderId;
+ // Key words "перевел заказ" - на них завязан анализатор на стороне Исполнителя (костыль)
+ message.data.msg = `Заказчик перевел заказ "${self.orderName}" на ${checked ? 'безопасную сделку': 'прямую оплату'} `;
+ console.log("Send-WS Оставить отзыв");
+ socket.send_stages_approve(message);
+ }
+ })
+ } // "Перевести на Безопасный заказ"
+
_onBtnArbitration(event) {
event.preventDefault();
diff --git a/assets/js/src/chat/archiveProjects.js b/assets/js/src/chat/archiveProjects.js
index aabd223..aa4ae30 100644
--- a/assets/js/src/chat/archiveProjects.js
+++ b/assets/js/src/chat/archiveProjects.js
@@ -25,59 +25,17 @@ function bindArchiveProjects() {
});
- // Нажимаем на заказ в архмвных заказах
+ // Нажимаем на заказ в архивных заказах
$(".messageBlock").on('click', '.trashedOrderBlock', function () {
let $this = $(this);
- $("#chat-order-add").css("display", "none");
+ $("#chat-order-add").hide();
$('.order-block, .trashedOrderBlock').each(function () {
$(this).removeClass('orAct');
});
$this.addClass('orAct');
- // var inbox = document.getElementById('message-chat-order-space');
- // var docList = document.getElementById('documentOrderSpace');
- // inbox.innerHTML = '';
- // docList.innerHTML = '';
-
-
let orderId = $this.data('id');
- // let projectId = $this.data('project-id');
- // let recipentId = $this.data('recipent-id');
- // let orderName = $this.data('order-name');
location.hash = '#order' + orderId;
- // console.log(orderId);
window.chatController.create(orderId);
- // $.ajax({
- // url: '/api/message',
- // type: 'GET',
- // beforeSend: function (xhr) {
- // xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
- // },
- // data: {'order': orderId, 'team__isnull': 'true'},
- // dataType: 'json',
- // success: function (json) {
- // $.each(json.results, function (i, v) {
- // var senderName = 'Вы';
- // var className = 'youChat';
- //
- // if (v.sender.id !== userId) {
- // senderName = v.sender.username;
- // className = '';
- // }
- //
- // inbox.innerHTML += '' +
- // '
' + senderName + '
' + v.created + ' ' +
- // '
' + v.text + '
';
- //
- // });
- // var height = inbox.scrollHeight;
- // inbox.scrollTop = height;
- // }
- // });
-
- // $("#order-stages").html("");
- // $("#completeWork").hide();
- // $("#add-form-order-note").hide();
- // $("#reserveSpace").hide();
});
}
diff --git a/assets/js/src/chat/documents.js b/assets/js/src/chat/documents.js
index 5045aec..04c284b 100644
--- a/assets/js/src/chat/documents.js
+++ b/assets/js/src/chat/documents.js
@@ -1,4 +1,7 @@
import {getCookie} from '../utils'
+import {loadTemplate} from './loaders'
+
+let document_before_upload_tmpl = loadTemplate('document_before_upload_tmpl');
function uploadDocumentsContactInit() {
$("#upload-document-contact").bind('fileuploadsubmit', function (e, data) {
@@ -23,9 +26,8 @@ function uploadDocumentsContactInit() {
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
- var htmlImg = '';
- var document_send = $(htmlImg).appendTo("#document-send-contact");
+ let htmlImg = document_before_upload_tmpl({file: file});
+ $(htmlImg).appendTo("#document-send-contact");
});
},
fail: function (e) {
@@ -49,7 +51,6 @@ function uploadDocumentsOrderInit() {
recipent: $("#chat-order-add #recipentId").val(),
order: $("#chat-order-add #orderId").val(),
}
- // console.log(data.formData);
});
$('#upload-document-order').fileupload({
@@ -65,9 +66,8 @@ function uploadDocumentsOrderInit() {
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
- var htmlImg = '';
- var document_send = $(htmlImg).appendTo("#document-send-order");
+ let htmlImg = document_before_upload_tmpl({file: file});
+ $(htmlImg).appendTo("#document-send-order");
});
},
fail: function (e) {
@@ -111,9 +111,8 @@ function uploadDocumentsTeamInit() {
var currentValue = $("#documentSendIds").val();
currentValue += file.id + ';';
$("#documentSendIds").val(currentValue);
- var htmlImg = '';
- var document_send = $(htmlImg).appendTo("#document-send");
+ let htmlImg = document_before_upload_tmpl({file: file});
+ $(htmlImg).appendTo("#document-send");
});
},
fail: function (e) {
diff --git a/assets/js/src/chat/loaders.js b/assets/js/src/chat/loaders.js
index 7b76cb6..bbc86df 100644
--- a/assets/js/src/chat/loaders.js
+++ b/assets/js/src/chat/loaders.js
@@ -7,6 +7,10 @@ import bntCompleteStage_tmpl from './templates/buttons/bntCompleteStage_tmpl.htm
import btnSendReview_tmpl from './templates/buttons/btnSendReview_tmpl.html'
import document_attach_file_tmpl from './templates/links/document_attach_file_tmpl.html'
import note_tmpl from './templates/note_tmpl.html'
+import order_info_tmpl from './templates/order_info_tmpl.html'
+import stage_contractor_approve_tmpl from './templates/stage_contractor_approve_tmpl.html'
+import document_before_upload_tmpl from './templates/links/document_before_upload_tmpl.html'
+import switch_to_protected_tmpl from './templates/switch_to_protected_tmpl.html'
function loadTemplate(template_name) {
let templates = {
@@ -19,6 +23,10 @@ function loadTemplate(template_name) {
btnSendReview_tmpl: btnSendReview_tmpl,
document_attach_file_tmpl: document_attach_file_tmpl,
note_tmpl: note_tmpl,
+ order_info_tmpl: order_info_tmpl,
+ stage_contractor_approve_tmpl: stage_contractor_approve_tmpl,
+ document_before_upload_tmpl: document_before_upload_tmpl,
+ switch_to_protected_tmpl: switch_to_protected_tmpl,
};
if (!templates[template_name]) throw new Error(`Template ${template_name} does not exist`);
diff --git a/assets/js/src/chat/messageCounters.js b/assets/js/src/chat/messageCounters.js
index b4169de..9e5cded 100644
--- a/assets/js/src/chat/messageCounters.js
+++ b/assets/js/src/chat/messageCounters.js
@@ -21,7 +21,7 @@ function countPlus(message, place) {
let $container;
if (message.answer_type == "add_message_contact"){
$container = $(`.contact-count-${message.sender_id}`);
- } else if (message.answer_type == "add_message_order"){
+ } else if (message.answer_type == "add_message_order" || message.answer_type == "approve_stages"){
$container = $(`#count-order-${message.order_id}`);
} else if (message.answer_type == "add_message_team") {
$container = $(`#count-team-${message.team_id}`);
diff --git a/assets/js/src/chat/notes.js b/assets/js/src/chat/notes.js
index 1ec480b..7184686 100644
--- a/assets/js/src/chat/notes.js
+++ b/assets/js/src/chat/notes.js
@@ -15,8 +15,9 @@ function bindContractorNotes() {
success: function (json) {
// console.log(json);
$("#add-form-contractor-note #chat2").val("");
- let li = note_tmpl({text: json.text});
+ let li = note_tmpl({text: json.text, note_id: json.id});
$(li).appendTo(".contractor-notes-block");
+ bindRemoveNotes();
},
error: function (e) {
console.log('error');
@@ -27,51 +28,87 @@ function bindContractorNotes() {
}
function bindOrderNotes() {
+ /**
+ * Create new Note
+ */
$('#add-note-button').on('click', function (e) {
- e.preventDefault();
- $.ajax({
- url: '/api/note/',
- type: 'POST',
- beforeSend: function (xhr) {
- xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
- },
- data: $("#add-form-order-note").serialize(),
- dataType: 'json',
- success: function (json) {
- // $("" + json.text + " ").appendTo(".order-notes-block");
- let li = note_tmpl({text: json.text});
- $(li).appendTo(".order-notes-block");
- $("#add-form-order-note #chat2").val("");
- },
- error: function (e) {
- console.log('error');
- console.log(e);
- }
+ e.preventDefault();
+ $.ajax({
+ url: '/api/note/',
+ type: 'POST',
+ beforeSend: function (xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
+ },
+ data: $("#add-form-order-note").serialize(),
+ dataType: 'json',
+ success: function (json) {
+ // $("" + json.text + " ").appendTo(".order-notes-block");
+ // console.log('note json = ', json);
+ let li = note_tmpl({text: json.text, note_id: json.id});
+ $(li).appendTo(".order-notes-block");
+ $("#add-form-order-note #chat2").val("");
+ bindRemoveNotes();
+ },
+ error: function (e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
});
-});
}
function bindTeamNotes() {
$('#add-team-note-button').on('click', function (e) {
- e.preventDefault();
- $.ajax({
- url: '/api/note/',
- type: 'POST',
- beforeSend: function (xhr) {
- xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
- },
- data: $("#add-form-team-note").serialize(),
- dataType: 'json',
- success: function (json) {
- $("" + json.text + " ").appendTo(".team-notes-block");
- $("#add-form-team-note #chat2").val("");
- },
- error: function (e) {
- console.log('error');
- console.log(e);
- }
+ e.preventDefault();
+ $.ajax({
+ url: '/api/note/',
+ type: 'POST',
+ beforeSend: function (xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
+ },
+ data: $("#add-form-team-note").serialize(),
+ dataType: 'json',
+ success: function (json) {
+ let li = note_tmpl({text: json.text, note_id: json.id});
+ $(li).appendTo(".team-notes-block");
+ $("#add-form-team-note #chat2").val("");
+ bindRemoveNotes();
+ },
+ error: function (e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
});
-});
}
-export {bindContractorNotes, bindOrderNotes, bindTeamNotes}
\ No newline at end of file
+function bindRemoveNotes() {
+ // console.log('num notes = ', $('.remove-note').length);
+ $('.remove-note').unbind().on('click', function (e) {
+ let $note = $(e.target).parent();
+ let noteId = $(e.target).data('id');
+ // console.log('click remove note');
+ $.ajax({
+ url: `/api/note/${noteId}`,
+ type: 'DELETE',
+ beforeSend: function (xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
+ },
+ dataType: 'json',
+ success: function (json) {
+ $note.remove();
+ // console.log('Note deleted!');
+
+ // let li = note_tmpl({text: json.text, note_id: json.id});
+ // $(li).appendTo(".team-notes-block");
+ // $("#add-form-team-note #chat2").val("");
+ },
+ error: function (e) {
+ console.log('error');
+ console.log(e);
+ }
+ });
+ })
+}
+
+export {bindContractorNotes, bindOrderNotes, bindTeamNotes, bindRemoveNotes}
\ No newline at end of file
diff --git a/assets/js/src/chat/templates/links/document_before_upload_tmpl.html b/assets/js/src/chat/templates/links/document_before_upload_tmpl.html
new file mode 100644
index 0000000..2edcde7
--- /dev/null
+++ b/assets/js/src/chat/templates/links/document_before_upload_tmpl.html
@@ -0,0 +1,7 @@
+
+
+
;
\ No newline at end of file
diff --git a/assets/js/src/chat/templates/note_tmpl.html b/assets/js/src/chat/templates/note_tmpl.html
index e13300f..4174343 100644
--- a/assets/js/src/chat/templates/note_tmpl.html
+++ b/assets/js/src/chat/templates/note_tmpl.html
@@ -1,3 +1,4 @@
+
${this.text}
diff --git a/assets/js/src/chat/templates/order_info_tmpl.html b/assets/js/src/chat/templates/order_info_tmpl.html
new file mode 100644
index 0000000..ce12b7e
--- /dev/null
+++ b/assets/js/src/chat/templates/order_info_tmpl.html
@@ -0,0 +1,16 @@
+
+
+ Название
+ ${this.order.project.name}
+
+
+ Безопасная сделка
+ ${this.order.secure ? 'Выбрана': 'Не выбрана'}
+
+
+ Тип здания
+ ${this.order.project.realty.building_classification ? this.order.project.realty.building_classification.name : 'не задан'}
+
+ Классификация здания
+ ${this.order.project.realty.construction_type ? this.order.project.realty.construction_type.name: 'не задана'}
+
\ No newline at end of file
diff --git a/assets/js/src/chat/templates/stage_approved_tmpl.html b/assets/js/src/chat/templates/stage_approved_tmpl.html
index 31f12be..4e93438 100644
--- a/assets/js/src/chat/templates/stage_approved_tmpl.html
+++ b/assets/js/src/chat/templates/stage_approved_tmpl.html
@@ -5,7 +5,7 @@
ЭТАП ${this.stage_num}
- ${this.stage_status}
+ ${this.stage_status?this.stage_status:'не согласован'}
@@ -25,5 +25,8 @@
до ${this.stage.term}
+
+ Срок этапа расчитывается с момента резервирования средств
+
\ No newline at end of file
diff --git a/assets/js/src/chat/templates/stage_contractor_approve_tmpl.html b/assets/js/src/chat/templates/stage_contractor_approve_tmpl.html
new file mode 100644
index 0000000..6857d6c
--- /dev/null
+++ b/assets/js/src/chat/templates/stage_contractor_approve_tmpl.html
@@ -0,0 +1,32 @@
+
+
+
+
+ ЭТАП ${this.stage_num}
+
+
+ ${this.stage_status}
+
+
+
+
+
+ ${this.stage.name}
+
+ Результат этапа
+
+ ${this.stage.result}
+
+ Цена
+
+ ${this.stage.cost} ₽
+
+ Срок
+
+ до ${this.stage.term}
+
+
+ Срок этапа расчитывается с момента резервирования средств
+
+
+
\ No newline at end of file
diff --git a/assets/js/src/chat/templates/stage_tmpl.html b/assets/js/src/chat/templates/stage_tmpl.html
index ac21205..9101554 100644
--- a/assets/js/src/chat/templates/stage_tmpl.html
+++ b/assets/js/src/chat/templates/stage_tmpl.html
@@ -1,6 +1,15 @@
-
ЭТАП ${this.stage_num}
+
+
+
+ ЭТАП ${this.stage_num}
+
+
+ ${this.stage_status?this.stage_status:'не согласован'}
+
+
+