007 interface improvements

This commit is contained in:
msyu 2025-06-20 20:57:01 +03:00
parent def6e53cf2
commit c38c014fc6
5 changed files with 82 additions and 49 deletions

View File

@ -69,7 +69,7 @@
<!--- <cfset this.datasources["#this.datasource#"]=getDS("#this.datasource#","datasource_#this.datasource#")/> ---> <!--- <cfset this.datasources["#this.datasource#"]=getDS("#this.datasource#","datasource_#this.datasource#")/> --->
<cfset request.RECORDS_PER_PAGE=500/> <cfset request.RECORDS_PER_PAGE=500/>
<cfset request.APP_VERSION="0.00.006"/> <cfset request.APP_VERSION="0.00.007"/>
<cflock scope="application" type="readonly" timeout=3> <cflock scope="application" type="readonly" timeout=3>
<cfset request.APP_NAME=this.Name/> <cfset request.APP_NAME=this.Name/>

View File

@ -225,21 +225,24 @@
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>Ключ строки</th> <th>Ключ строки</th>
<th>Услуга</th>
<th>Модель</th>
<th>Код услуги</th> <th>Код услуги</th>
<th>Версий</th> <th>Услуга</th>
<th>Имя для печати</th>
<th>Модель</th>
<th>Количество</th>
<th>Цена</th>
<th>Стоимость</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>Версий</th>
<th>Тек. соглашение</th> <th>Тек. соглашение</th>
<th>Тек. версия</th> <th>Тек. версия</th>
<th>Дата с</th> <th>Дата с</th>
<th>Дата по</th> <th>Дата по</th>
<th>Количество</th>
<th>Цена</th>
<th>Стоимость</th>
<th>Имя для печати</th>
<!--- <th>Компонентов</th> --->
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -248,12 +251,19 @@
<td> <td>
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/> <c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/>
</td> </td>
<td>#specification_item_uid#</td>
<td>#svc#</td> <td>#specification_item_uid#</td>
<td class="c">#pricing_model_short#</td> <td>#code#</td>
<td>#code#</td> <td>#svc#</td>
<td class="c">#item_version_count#</td> <td>#specification_item#</td>
<td class="c">#pricing_model_short#</td>
<td class="r">#quantity#</td>
<td class="r">#price#</td>
<td class="r">#cost#</td>
<td class="c"></td> <td class="c"></td>
<td class="c">#item_version_count#</td>
<td><a href="agreement.cfm?contract_id=#contract_id#&agreement_version=#agreement_version#&#tr.fwx#">#agreement# /#dateFormat(dt_agreement,'DD.MM.YYYY')#</td> <td><a href="agreement.cfm?contract_id=#contract_id#&agreement_version=#agreement_version#&#tr.fwx#">#agreement# /#dateFormat(dt_agreement,'DD.MM.YYYY')#</td>
<td class="c"> <td class="c">
<a href="specification_item_version.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#agreement_version#&#tr.fwx#">#agreement_version#</a> <a href="specification_item_version.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#agreement_version#&#tr.fwx#">#agreement_version#</a>
@ -261,10 +271,7 @@
</td> </td>
<td class="c">#dateFormat(dt_from,'DD.MM.YYYY')#</td> <td class="c">#dateFormat(dt_from,'DD.MM.YYYY')#</td>
<td class="c">#dateFormat(dt_to,'DD.MM.YYYY')#</td> <td class="c">#dateFormat(dt_to,'DD.MM.YYYY')#</td>
<td class="r">#quantity#</td>
<td class="r">#price#</td>
<td class="r">#cost#</td>
<td>#specification_item#</td>
<td class="c"> <td class="c">
<c:link_del canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/> <c:link_del canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/>
</td> </td>

View File

@ -17,6 +17,8 @@
<m:prepare_detail entity="specification_item" key="specification_item_uid" pageInfoOut="pageInfo"/> <m:prepare_detail entity="specification_item" key="specification_item_uid" pageInfoOut="pageInfo"/>
<cfparam name="agreement_version" default=""/>
<d:bean readonly=#!pageInfo.writePermitted()# table="#pageInfo.entity#" datasource="#request.DS#" output="d" status="status"> <d:bean readonly=#!pageInfo.writePermitted()# table="#pageInfo.entity#" datasource="#request.DS#" output="d" status="status">
<d:param field="specification_item_uid" type="guid" key autoincrement/> <d:param field="specification_item_uid" type="guid" key autoincrement/>
<d:param field="specification_id" type="integer" required/> <d:param field="specification_id" type="integer" required/>
@ -90,6 +92,7 @@
<cfoutput> <cfoutput>
<input type="hidden" name="specification_item_uid" value="#d.specification_item_uid#"/> <input type="hidden" name="specification_item_uid" value="#d.specification_item_uid#"/>
<input type="hidden" name="specification_id" value="#d.specification_id#"/> <input type="hidden" name="specification_id" value="#d.specification_id#"/>
<input type="hidden" name="agreement_version" value="#agreement_version#"/><!--- невидимый параметр контекста *** пересекается по имени с полем запроса в фактурной части --->
<input type="hidden" name="track" value="#tr.self#"/> <input type="hidden" name="track" value="#tr.self#"/>
<input type="hidden" name="pass" value=""/><!--- pass marker to prevent save on submit ---> <input type="hidden" name="pass" value=""/><!--- pass marker to prevent save on submit --->
@ -142,7 +145,7 @@
<cfquery name="qList" datasource="#request.DS#"> <cfquery name="qList" datasource="#request.DS#">
select s.pricing_model_id, s.pricing_model, s.pricing_model_short select s.pricing_model_id, s.pricing_model, s.pricing_model_short
from pricing_model s from pricing_model s
order by 2 order by 1
</cfquery> </cfquery>
<c:combo <c:combo
query=#qList# query=#qList#
@ -151,7 +154,6 @@
key="pricing_model_id" key="pricing_model_id"
selected="#d.pricing_model_id#" selected="#d.pricing_model_id#"
displayf="##pricing_model_short## [##pricing_model_id##] ##pricing_model##" displayf="##pricing_model_short## [##pricing_model_id##] ##pricing_model##"
empty=""
class="" class=""
/> />
<!--- <cfif d.svc_id GT 0> <!--- <cfif d.svc_id GT 0>
@ -207,7 +209,7 @@
Версии строки (#qSpecificationItemVersion.recordCount#) (история инстанса) Версии строки (#qSpecificationItemVersion.recordCount#) (история инстанса)
<cfif pageInfo.writePermitted()> <cfif pageInfo.writePermitted()>
<cfoutput> <cfoutput>
<cfset addUrl="specification_item_version.cfm?agreement_version=&specification_item_uid=#d.specification_item_uid#&#tr.fwx#"/> <cfset addUrl="specification_item_version.cfm?agreement_version=#agreement_version#&specification_item_uid=#d.specification_item_uid#&#tr.fwx#"/>
<button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'"> <button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'">
<a href="#addUrl#">Создать</a> <a href="#addUrl#">Создать</a>
</button> </button>

View File

@ -27,30 +27,36 @@
thisUrl="#request.thisPage#?specification_item_uid=#specification_item_uid#&agreement_version=#agreement_version#" thisUrl="#request.thisPage#?specification_item_uid=#specification_item_uid#&agreement_version=#agreement_version#"
defaultBackUrl="specification_item.cfm?specification_item_uid=#specification_item_uid#" defaultBackUrl="specification_item.cfm?specification_item_uid=#specification_item_uid#"
/> />
<!--- ситуация
мы создаем новую строку спецификации и сразу ее версию - при этом у нас в контексте может быть известно текущее соглашение, и еще из него нужно взять dt_from по умолчанию
либо мы создаем новую версию строки, а текущая версия уже занята - тогда нужно создавать
НЕУДОБНО: когда мы меняем номер соглашения у версии строки, у нас не меняется версия, а создается новая --->
<cfquery name="qLastVersion"> <cfquery name="qLastVersion">
select agreement_version, quantity, price, specification_item_version select agreement_version, quantity, price, specification_item_version
from specification_item_version from specification_item_version
where specification_item_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#specification_item_uid#" null=#!IsValid('guid',specification_item_uid)#/> where specification_item_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#specification_item_uid#" null=#!IsValid('guid',specification_item_uid)#/>
<cfif isValid('integer',agreement_version)>
AND agreement_version=<cfqueryparam cfsqltype="cf_sql_integer" value="#agreement_version#"/>
</cfif>
order by agreement_version desc limit 1 order by agreement_version desc limit 1
</cfquery> </cfquery>
<cfif qLastVersion.recordCount EQ 0> <cfif qLastVersion.recordCount EQ 0>
<cfset queryAddRow(qLastVersion,[0,1,0,""])/> <cfset queryAddRow(qLastVersion,[0,1,0,""])/>
<!--- <cfdump var=#lastVersion#/> --->
</cfif> </cfif>
<cfquery name="qAgreement"> <cfquery name="qAgreement">
select a.agreement, a.dt_agreement, a.contract_id select a.agreement, a.dt_agreement, a.contract_id
from specification_item si from specification_item si
join specification s on (si.specification_id=s.specification_id) join specification s on (si.specification_id=s.specification_id)
join agreement a on (s.contract_id=a.contract_id) join agreement a on (s.contract_id=a.contract_id)
where si.specification_item_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#specification_item_uid#" null=#!IsValid('guid',specification_item_uid)#/> where si.specification_item_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#specification_item_uid#" null=#!IsValid('guid',specification_item_uid)#/>
<cfif isValid('integer',agreement_version)>
AND agreement_version=<cfqueryparam cfsqltype="cf_sql_integer" value="#agreement_version#"/>
</cfif>
order by a.agreement_version desc limit 1 order by a.agreement_version desc limit 1
</cfquery> </cfquery>
<!--- <cfdump var=#qAgreement#/> --->
<!--- <cfdump var=#pageInfo#/>
<cfdump var=#specification_item_version#/>
<cfabort/> --->
<d:bean readonly=#!pageInfo.writePermitted()# table="#pageInfo.entity#" datasource="#request.DS#" output="d" status="status"> <d:bean readonly=#!pageInfo.writePermitted()# table="#pageInfo.entity#" datasource="#request.DS#" output="d" status="status">
<d:param field="specification_item_uid" type="guid" key/> <d:param field="specification_item_uid" type="guid" key/>

View File

@ -144,7 +144,8 @@
<div class="td"> <div class="td">
<a href="argeement.cfm?contract_id=#d.contract_id#&agreement_version=#agreement_version#&#tr.fwx#"> <a href="argeement.cfm?contract_id=#d.contract_id#&agreement_version=#agreement_version#&#tr.fwx#">
#qAgreement.agreement# [#qAgreement.agreement_version#] #dateFormat(qAgreement.dt_agreement,'DD.MM.YYYY')# #qAgreement.agreement# [#qAgreement.agreement_version#] #dateFormat(qAgreement.dt_agreement,'DD.MM.YYYY')#
</a> </a>
</div> </div>
</div> </div>
@ -178,6 +179,9 @@
</cfif> </cfif>
&nbsp; &nbsp;
</cfoutput> </cfoutput>
<a href="agreement.cfm?contract_id=#qContract.contract_id#&#tr.fwx#">
<img src="img/add.gif"/>
</a>
</div> </div>
</div> </div>
@ -208,6 +212,7 @@
,ver.specification_item_version as specification_item ,ver.specification_item_version as specification_item
,ver.quantity ,ver.quantity
,ver.price ,ver.price
,ver.quantity*ver.price as cost
,ver.dt_from ,ver.dt_from
,ver.dt_to ,ver.dt_to
from specification_item i from specification_item i
@ -255,7 +260,7 @@
Строки спецификации (#qItem.recordCount#) Строки спецификации (#qItem.recordCount#)
<cfif pageInfo.writePermitted()> <cfif pageInfo.writePermitted()>
<cfoutput> <cfoutput>
<cfset addUrl="specification_item.cfm?specification_item_uid=&specification_id=#d.specification_id#&#tr.fwx#"/> <cfset addUrl="specification_item.cfm?specification_item_uid=&specification_id=#d.specification_id#&agreement_version=#agreement_version#&#tr.fwx#"/>
<button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'"> <button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'">
<a href="#addUrl#">Создать</a> <a href="#addUrl#">Создать</a>
</button> </button>
@ -269,18 +274,25 @@
<tr> <tr>
<th></th> <th></th>
<th>Ключ строки</th> <th>Ключ строки</th>
<th>Услуга</th>
<th>Модель</th>
<th>Код услуги</th> <th>Код услуги</th>
<th>Версий</th> <th>Услуга</th>
<th>&nbsp;</th> <th>Имя для печати</th>
<th>Тек. соглашение</th> <th>Модель</th>
<th>Тек. версия</th> <th>Кол-во</th>
<th>Цена</th>
<th>Стоимость</th>
<th>Дата с</th> <th>Дата с</th>
<th>Дата по</th> <th>Дата по</th>
<th>Количество</th>
<th>Цена</th> <th>&nbsp;</th>
<th>Имя для печати</th>
<th>Версий</th>
<th>Тек. соглашение</th>
<th>Тек. версия</th>
<!--- <th>Компонентов</th> ---> <!--- <th>Компонентов</th> --->
<th></th> <th></th>
</tr> </tr>
@ -290,19 +302,25 @@
<td> <td>
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/> <c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/>
</td> </td>
<td>#specification_item_uid#</td> <td>#specification_item_uid#</td>
<td>#svc#</td> <td>#code#</td>
<td class="c">#pricing_model_short#</td> <td>#svc#</td>
<td>#code#</td> <td>#specification_item#</td>
<td class="c">#item_version_count#</td> <td class="c">#pricing_model_short#</td>
<td class="c"></td> <td class="r">#quantity#</td>
<td class="r">#price#</td>
<td class="r">#cost#</td>
<td class="c">#dateFormat(dt_from,'DD.MM.YYYY')#</td>
<td class="c">#dateFormat(dt_to,'DD.MM.YYYY')#</td>
<td class="c"></td>
<td class="c">#item_version_count#</td>
<td><a href="agreement.cfm?contract_id=#contract_id#&agreement_version=#agreement_version#&#tr.fwx#">#agreement# #dateFormat(dt_agreement,'DD.MM.YYYY')#</td> <td><a href="agreement.cfm?contract_id=#contract_id#&agreement_version=#agreement_version#&#tr.fwx#">#agreement# #dateFormat(dt_agreement,'DD.MM.YYYY')#</td>
<td class="c"><a href="specification_item_version.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#qItem.agreement_version#&#tr.fwx#">#qItem.agreement_version#</a> <cfif is_actual><img src="img/ok.png"/></cfif></td> <td class="c"><a href="specification_item_version.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#qItem.agreement_version#&#tr.fwx#">#qItem.agreement_version#</a> <cfif is_actual><img src="img/ok.png"/></cfif></td>
<td class="c">#dateFormat(dt_from,'DD.MM.YYYY')#</td>
<td class="c">#dateFormat(dt_to,'DD.MM.YYYY')#</td>
<td class="r">#quantity#</td>
<td class="r">#price#</td>
<td>#specification_item#</td>
<td class="c"> <td class="c">
<c:link_del canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/> <c:link_del canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/>
</td> </td>