receiveMerModify.zml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <#def designatedPath="/receiveMerManage.htm"/>
  2. ${request.getValidateScript()}
  3. ${zhiqim_manager_history("/receiveMerManage.htm")}
  4. ${zhiqim_manager_breadcrumb_parent("/receiveMerManage.htm", "接单商户管理", "修改接单商户")}
  5. ${zhiqim_manager_content()}
  6. <script>
  7. var typeIdArr = [];
  8. var policyModules = {};
  9. Z.onload(function(){
  10. typeIdArr = Z.AR.toArray('${orgMer.getDesignTypeIds()}', ",");
  11. doBiuldPolicy(typeIdArr);
  12. });
  13. function doBiuldPolicy(typeIdArr)
  14. {
  15. if (typeIdArr.length==0)
  16. {
  17. Z("#policy_div").html("");
  18. return;
  19. }
  20. var ajax = new Z.Ajax();
  21. ajax.setClassName("ReceiveMerPresenter");
  22. ajax.setMethodName("doQueryPolicy");
  23. ajax.addParam("typeIdIds", Z.AR.toString(typeIdArr));
  24. ajax.setFailureAlert();
  25. ajax.setSuccess(function(){
  26. var obj = Z.J.toObject(this.responseText);
  27. var typeList = obj.typeList;
  28. var dataMap = obj.dataMap;
  29. if (typeList.length == 0)
  30. {
  31. Z("#policy_div").html("");
  32. return;
  33. }
  34. var html = '<table class="z-table z-bordered-line zi-bd-t-none z-lh150p">';
  35. Z.each(typeList, function(type, i)
  36. {
  37. var policyList = dataMap[type.typeIdId];
  38. var spolicyList = policyModules[type.typeIdId]
  39. if (!spolicyList)
  40. spolicyList = [];
  41. if (policyList.length > 0)
  42. {
  43. var allchk = policyList.length == spolicyList.length ? 'checked' : '';
  44. html +='<tr>';
  45. html +=' <td class="zi-bd-b-none">';
  46. html +=' <div class="z-pd3 z-bold z-pointer"><input type="checkbox" '+allchk+' data-role="z-checkbox" onclick="doselctbox(this)"data-class="z-blue"/><span class="z-mg-l5" onclick="Z(this).parent().find(\'zcover>i.z-checkbox\').click();">'+type.typeIdName+'</span></div>';
  47. html +=' <div class="z-float-left z-pd10">';
  48. Z.each(policyList, function(policy, j)
  49. {
  50. var checked = Z.AR.contains(spolicyList, policy.policyId) ? 'checked' : '';
  51. html +=' <div class="z-float-left" style="width:110px"><span class="z-pd10 z-pointer z-text-ellipsis" style="max-width:100px" title="'+policy.policyName+'"><input type="checkbox" '+checked+' name="policyId'+type.typeIdId+'" data-role="z-checkbox" value="'+policy.policyId+'" data-class="z-blue"/><span class="z-pd5" onclick="Z(this).parent().find(\'zcover>i.z-checkbox\').click();">'+policy.policyName+'</span></span></div>';
  52. });
  53. html +=' </div>';
  54. html +=' </td>';
  55. html +=' </tr>';
  56. }
  57. });
  58. html +='</table>';
  59. Z("#policy_div").htmlc(html);
  60. });
  61. ajax.execute();
  62. }
  63. function doSelectDesignType(v)
  64. {
  65. if (Z.AR.contains(typeIdArr, v))
  66. {
  67. Z.AR.remove(typeIdArr, v);
  68. }
  69. else
  70. {
  71. typeIdArr.push(v);
  72. policyModules[v*1]=[];
  73. }
  74. if (Z("input[name=typeIdIds]").length == typeIdArr.length)
  75. {
  76. Z.D.id("selectAllType").checked=true;
  77. Z("i[data-id=selectAllType]").addClass("z-active");
  78. }
  79. else
  80. {
  81. Z.D.id("selectAllType").checked=false;
  82. Z("i[data-id=selectAllType]").removeClass("z-active");
  83. }
  84. doBiuldPolicy(typeIdArr);
  85. }
  86. function doselctbox(box, type)
  87. {
  88. var _div = Z(box).parent().parent().siblings("div");
  89. Z.each(_div.find('i.z-checkbox'), function(item, i)
  90. {
  91. if (Z(item).hasClass("z-active"))
  92. {
  93. if (!box.checked)
  94. {
  95. Z(item).click();
  96. }
  97. }
  98. else
  99. {
  100. if (box.checked)
  101. {
  102. Z(item).click();
  103. }
  104. }
  105. });
  106. if (type == 1)
  107. {
  108. doBiuldPolicy(typeIdArr)
  109. }
  110. }
  111. function doSelectAllDesignType(box)
  112. {
  113. var type = Z.V.isEmptyBlank(Z.FM.getCheckBoxValue("typeIds")) ? 1 : (Z("input[name=typeIds]").length != typeIdArr.length ? 1 : 2);
  114. if (box.checked && type == 2)
  115. type = 1;
  116. Z.FM.doSelectCheckBox('typeIds', type)
  117. typeIdArr = Z.AR.toArray(Z.FM.getCheckBoxValue("typeIds"), ",");
  118. doBiuldPolicy(typeIdArr);
  119. }
  120. function doBiuldPolicy(typeIdArr)
  121. {
  122. }
  123. </script>
  124. <form name="theForm" action="receiveMerUpdate.htm" method="post" onSubmit="return validateForm(this);" data-role="z-call-frame">
  125. <table class="z-table z-bordered z-h50-tr z-pd10 z-bg-white">
  126. <tr class="zi-h40 z-bg-gray z-bold">
  127. <td colspan="20">修改接单商户</td>
  128. </tr>
  129. <tr>
  130. <td width="25%">选择接单商户:</td>
  131. <td width="25%">
  132. <select id="orgId" name="orgId" class="z-select z-w200" data-role="z-select" data-class="${zmr_color_class}">
  133. <#for item : orgList>
  134. <#if item.getOrgId()==orgMer.getOrgId()>
  135. <option value="${item.getOrgId()}">${item.getOrgName()}</option>
  136. </#if>
  137. </#for>
  138. </select>
  139. </td>
  140. <td width="25%">商户排序优先级:<span class="z-text-red" style="color:#D0CECE;">数字越小排序越前</span></td>
  141. <td width="25%">
  142. <input id="merLevel" name="merLevel" value="${orgMer.getMerLevel()}" class="z-input z-w200" maxlength="6" data-options="type:Decimal;paste:true;" placeholder="排序优先级(填写数字)">
  143. <span class="z-text-red">*</span>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td>接单状态:</td>
  148. <td>
  149. <select id="isPauseRecieive" name="isPauseRecieive" class="z-select z-w200" data-role="z-select" data-class="${zmr_color_class}">
  150. <option value="false" <#if orgMer.isPauseRecieive() == false>selected</#if>>开启</option>
  151. <option value="true" <#if orgMer.isPauseRecieive()>selected</#if>>暂停</option>
  152. </select>
  153. </td>
  154. <td>商户状态:</td>
  155. <td>
  156. <select id="merStatus" name="merStatus" class="z-select z-w200" data-role="z-select" data-class="${zmr_color_class}">
  157. <option value="0" <#if orgMer.getMerStatus() == 0>selected</#if>>正常</option>
  158. <option value="1" <#if orgMer.getMerStatus() == 1>selected</#if>>停用</option>
  159. </select>
  160. </td>
  161. </tr>
  162. <tr>
  163. <td>个人同时最大接单量:<span class="z-text-red" style="color:#D0CECE;">个人正在设计订单总数(老用户订单派单除外)</span></td>
  164. <td>
  165. <input id="personalMaxOrder" name="personalMaxOrder" value="${orgMer.getPersonalMaxOrder()}" class="z-input z-w200" maxlength="6" data-options="type:Decimal;paste:true;" placeholder="最大接单量(填写数字)">
  166. <span class="z-text-red">*</span>
  167. </td>
  168. <td>个人非加急订单最大接单量:<span class="z-text-red" style="color:#D0CECE;">普通订单正在设计数量</span></td>
  169. <td>
  170. <input id="personalMaxOrdinaryOrder" name="personalMaxOrdinaryOrder" value="${orgMer.getPersonalMaxOrdinaryOrder()}" class="z-input z-w200" data-options="type:Decimal;paste:true;" maxlength="6" placeholder="最大未领单量(填写数字)">
  171. <span class="z-text-red">*</span>
  172. </td>
  173. </tr>
  174. <tr>
  175. <td>支持店铺:</td>
  176. <td colspan="3">
  177. <div class="z-pd3 z-bold z-pointer">
  178. <input type="checkbox" id="selectAllShop" data-role="z-checkbox" onclick="Z.FM.doSelectCheckBox('orderShop', this.checked ? 1 : 2);" <#if Lists.toStringList(orgMer.getOrderShop()).size()==shopList.size()> checked </#if> data-class="z-blue"/><span class="z-mg-l5" onclick="Z(this).parent().find('zcover>i.z-checkbox').click();">全选</span>
  179. </div>
  180. <div class="z-float-left z-pd6">
  181. <#var merShop = Lists.toStringList(orgMer.getOrderShop())/>
  182. <#for item : shopList>
  183. <div class="z-float-left z-pd6 z-mg-l20 z-text-ellipsis z-pointer " style="width:110px" title="${item}">
  184. <input type="checkbox" name="orderShop" onclick="" <#if merShop.contains(item)>checked</#if> class="z-checkbox" value="${item}" data-role="z-checkbox" data-class="${zmr_color_class}">
  185. <span onclick="Z(this).parent().find('zcover>i.z-checkbox').click()" class="z-pointer">${item}</span>
  186. </div>
  187. </#for>
  188. </div>
  189. </td>
  190. </tr>
  191. </table>
  192. ${zhiqim_manager_submit()}
  193. </form>
  194. ${zhiqim_manager_content_end()}