25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

262 lines
12 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 张帅
  12. * PhpStorm set-prod-price.php
  13. * Create By 2017/3/20 17:28 $
  14. */
  15. use backend\modules\zzcs\assets\ZzcsNewAsset;
  16. use yii\widgets\Pjax;
  17. use yii\helpers\Html;
  18. use backend\modules\zzcs\models\OperaTouristCommon;
  19. ZzcsNewAsset::addCss($this, '/tourist/css/set_tourist_price.css?20180305');
  20. ZzcsNewAsset::addScript($this, '/tourist/js/set_tourist_price.js?v=20180305');
  21. ZzcsNewAsset::addCss($this, '/global/css/combo.select.css');
  22. ZzcsNewAsset::addScript($this, '/global/js/jquery.combo.select.js');
  23. ZzcsNewAsset::addScript($this, '/plug/layer/layer.js');
  24. ?>
  25. <style type="text/css">
  26. .popWindow {
  27. background-color: #9D9D9D;
  28. width: 100%;
  29. height: 100%;
  30. left: 0;
  31. top: 0;
  32. filter: alpha(opacity=50);
  33. opacity: 0.5;
  34. z-index: 1;
  35. position: absolute;
  36. }
  37. .maskLayer {
  38. width: 1480px;
  39. position: absolute;
  40. z-index: 2;
  41. }
  42. .span_head {
  43. padding: 10px;
  44. }
  45. .search_cost{border:1px solid lightgray;padding:10px 0px 20px 20px;height: 60px;max-width: 1098px}
  46. #to_org{
  47. border-radius: 0;
  48. -webkit-box-shadow: none!important;
  49. box-shadow: none!important;
  50. color: #858585;
  51. background-color: #fff;
  52. border: 1px solid #d5d5d5;
  53. font-family: inherit;
  54. font-size: inherit;
  55. line-height: inherit;
  56. height: 30px;
  57. }
  58. .org{
  59. font-family: 微软雅黑;
  60. font-size: 13px;
  61. color: #393939;
  62. line-height: 1.5;
  63. }
  64. </style>
  65. <div style="margin-bottom: 10px">
  66. <span class="span_head"><label>产品名称:</label><a style="color: color: #428bca;" href="/zzcs/tourist/update?tourist_id=<?php echo $tourist_id?>"><?= $tourist_model->tourist_name ?></a></span><br/>
  67. <span class="span_head"><label>内部编号:</label><?= $tourist_model->tourist_code ?></span>
  68. <span class="span_head"><label>行程天数:</label><?= OperaTouristCommon::getShowDayAndNight($tourist_model->day_num, $tourist_model->night_num) ?></span>
  69. <span class="span_head"><label>预订截至:</label><?= $tourist_model->pre_days . '天' . $tourist_model->pre_time ?></span>
  70. <span class="span_head"><label>状态:</label><?= $tourist_model->is_onsale == 1 ? '上架' : '下架' ?></span>
  71. </div>
  72. <div class="search_cost">
  73. <li class="search">
  74. <span class="org">渠道商:</span>
  75. <select name="" id="to_org" onchange="getDayPriceList()">
  76. <option value="0" selected >通用渠道</option>
  77. <?php foreach($to_org_list as $val){?>
  78. <option value="<?php echo $val['id']?>"><?php echo $val['supplier_name']?></option>
  79. <?php }?>
  80. </select>
  81. </li>
  82. </div>
  83. <div id="date_list">
  84. <div id="date_main">
  85. <span id="pre_month" class="TriangleLeft" onclick="getMonthInfo('pre')">
  86. </span>
  87. <span id="select_year_month">
  88. <select id="select_year" onchange="getMonthInfo('set')">
  89. <?php for ($i = 2016; $i <= 2026; $i++) { ?>
  90. <option value="<?php echo $i; ?>" <?php if ($now_date['year'] == $i) {
  91. echo 'selected="selected"';
  92. } ?>><?php echo $i; ?></option>
  93. <?php } ?>
  94. </select>
  95. <select id="select_month" onchange="getMonthInfo('set')">
  96. <?php for ($i = 1; $i <= 12; $i++) { ?>
  97. <?php $month_vel = strlen($i) == 1 ? '0' . $i : $i ?>
  98. <option value="<?php echo $month_vel; ?>" <?php if ($now_date['month'] == $i) {
  99. echo 'selected="selected"';
  100. } ?>><?php echo $i; ?></option>
  101. <?php } ?>
  102. </select>
  103. <sapn id="select_all">
  104. 全选
  105. <input type="checkbox" name="check_all" id="check_all" onclick="selectDateAll(this)">
  106. </sapn>
  107. </span>
  108. <span id="last_month" class="TriangleRight" onclick="getMonthInfo('last')">
  109. </span>
  110. </div>
  111. <?php Pjax::begin(['id' => 'main_table', 'timeout' => 30000000]) ?>
  112. <div class="table_list">
  113. <table id="table_list">
  114. <thead>
  115. <tr>
  116. <?php foreach ($week_arr as $key => $vel) { ?>
  117. <th class="<?php if ($key == 1 || $key == 7) {
  118. echo 'rest_day';
  119. } else {
  120. echo 'work_day';
  121. } ?>">
  122. <div class="date_week"><?php echo $vel['name']; ?></div>
  123. <?php if ($vel['show_status'] != 0) { ?>
  124. <input type="checkbox" name="week_day" class="week_day" week_type="<?php echo $key; ?>"
  125. onclick="selectWeekDay(this)">
  126. <?php } ?>
  127. </th>
  128. <?php } ?>
  129. </tr>
  130. </thead>
  131. <tbody>
  132. <?php foreach ($list as $week_key => $week_vel) { ?>
  133. <tr>
  134. <?php foreach ($week_vel as $day_key => $day_vel) { ?>
  135. <?php if (count($day_vel) > 0) { ?>
  136. <td t_data='<?php echo json_encode($day_vel['info']) ?>'
  137. class="<?php if ($day_vel['valid'] == 0) {
  138. echo 'no_valid';
  139. } else {
  140. if ($day_vel['is_onsale'] == 0) {
  141. echo 'no_sale';
  142. } else {
  143. echo 'on_sale';
  144. }
  145. } ?>"
  146. is_onsale="<?php echo $day_vel['is_onsale'] ?>"
  147. valid="<?php echo $day_vel['valid']; ?>"
  148. onclick="setProdPrice(this)"
  149. the_date="<?php echo $day_vel['date']; ?>"
  150. >
  151. <?php if ($day_vel['valid'] == 1) { ?>
  152. <input type="checkbox" name="date_day" class="date_day"
  153. the_date="<?php echo $day_vel['date']; ?>"
  154. the_x="<?php echo $day_vel['x']; ?>"
  155. the_y="<?php echo $day_vel['y']; ?>" onclick="selectDateDay(this)">
  156. <?php } ?>
  157. <div class="date_day_vel"><?php echo $day_vel['day'] ?></div>
  158. <?php ?>
  159. <ul class="ticket_info">
  160. <?php
  161. //如果价格为0则标红
  162. $color_adult_cost = $day_vel['info']['adult_cost'] == 0 ? '<span style="color: red">0</span>' : $day_vel['info']['adult_cost'];
  163. $color_child_cost = $day_vel['info']['child_cost'] == 0 ? '<span style="color: red">0</span>' : $day_vel['info']['child_cost'];
  164. //如果售价小于成本 则售价标红
  165. $color_adult_price = $day_vel['info']['adult_cost'] > $day_vel['info']['adult_price'] ? '<span style="color: red">' . $day_vel['info']['adult_price'] . '</span>' : $day_vel['info']['adult_price'];
  166. $color_child_price = $day_vel['info']['child_cost'] > $day_vel['info']['child_price'] ? '<span style="color: red">' . $day_vel['info']['child_price'] . '</span>' : $day_vel['info']['child_price'];
  167. $diff_para_desc_child = $day_vel['info']['diff_para_child'] . ($day_vel['info']['sale_type_child'] == 1 ? '元' : '%');
  168. $diff_para_desc_adult = $day_vel['info']['diff_para_adult'] . ($day_vel['info']['sale_type_adult'] == 1 ? '元' : '%');
  169. ?>
  170. <li><?= '成人价:' . $color_adult_price . '/' . $color_adult_cost ?></li>
  171. <li><?= '儿童价:' . $color_child_price . '/' . $color_child_cost ?></li>
  172. <li><?= '成人加价值:' . $diff_para_desc_adult ?></li>
  173. <li><?= '儿童加价值:' . $diff_para_desc_child ?></li>
  174. <li><?= '库存量:' . $day_vel['info']['limit_total_num'] . '/' . $day_vel['info']['limit_adult_num'] ?></li>
  175. <?php ?>
  176. </ul>
  177. <?php ?>
  178. </td>
  179. <?php } else { ?>
  180. <td></td>
  181. <?php } ?>
  182. <?php } ?>
  183. </tr>
  184. <?php } ?>
  185. </tbody>
  186. </table>
  187. </div>
  188. <?php Pjax::end() ?>
  189. <div id="date_title">
  190. <span id="set_type" class="btn btn-primary" onclick="updateSetType(this)" set_type="1">批量设置</span>
  191. <span id="down_line" class="btn btn-default" onclick="updateIsOnSale('down')">下架</span>
  192. <span id="up_line" class="btn btn-default" onclick="updateIsOnSale('up')">上架</span>
  193. </div>
  194. </div>
  195. <?= \yii\helpers\Html::hiddenInput('tourist_id', $tourist_id); ?>
  196. <?= \yii\helpers\Html::hiddenInput('to_org_id', $to_org_id); ?>
  197. <!--<div id="maskLayer" class="maskLayer" style="display: none;">-->
  198. <div id="set_price" style="" tp_t_data="">
  199. <div class="prod_price_info form-inline">
  200. <span class="form-group">成人加价:<div class="input-group"><input style="width: 103px;" id="diff_para_adult"
  201. type="text"
  202. class="prod_price form-control"
  203. onblur="this.value = fmoney(this.value,'float');"><div
  204. class="input-group-addon"><i class="unit unit_adult">%</i></div></div></span>
  205. <span style="margin-left: 22px;" class="form-group child">加价方式:
  206. <label style="width: 85px"><input name="sale_type_adult" type="radio" value="1"
  207. onclick="changeSaleType(this,1)"/>固定值</label>
  208. <label style="width: 85px"><input name="sale_type_adult" type="radio" value="2" checked
  209. onclick="changeSaleType(this,2)"/>百分比</label>
  210. </span>
  211. </br>
  212. <span class="form-group">儿童加价:<div class="input-group"><input style="width: 103px;" id="diff_para_child"
  213. type="text"
  214. class="prod_price form-control"
  215. onblur="this.value = fmoney(this.value,'float');"><div
  216. class="input-group-addon"><i class="unit unit_child">%</i></div></div></span>
  217. <span style="margin-left: 22px;" class="form-group child">加价方式:
  218. <label style="width: 85px"><input name="sale_type_child" type="radio" value="1"
  219. onclick="changeSaleType(this,1)"/>固定值</label>
  220. <label style="width: 85px"><input name="sale_type_child" type="radio" value="2" checked
  221. onclick="changeSaleType(this,2)"/>百分比</label>
  222. </span>
  223. </div>
  224. <span class="btn btn-primary" id="confirm" onclick="submitProdInfo()">确定</span>
  225. <span class="btn btn-default" id="reset" onclick="resetProdInfo()">重置</span>
  226. </div>
  227. <!--</div>-->
  228. <div id="popWindow" class="popWindow" style="display: none;" onclick="closeDiv()">
  229. </div>