You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

183 lines
10 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Steven
  5. * Date: 2017/5/26
  6. * Time: 14:26
  7. */
  8. use yii\helpers\Html;
  9. use yii\helpers\ArrayHelper;
  10. use common\components\zActiveForm;
  11. use backend\modules\motorcade\assets\motorcadeUIAsset;
  12. /* @var $this yii\web\View */
  13. motorcadeUIAsset::register($this);
  14. motorcadeUIAsset::addScript($this, '/js/supplier.js?v=0.0.1');
  15. $model = isset($data['busDepartment']) ? $data['busDepartment'] : [];
  16. $linkModel = isset($data['SupplierLink']) ? $data['SupplierLink'] : [];
  17. $this->registerJs('z.init()');
  18. ?>
  19. <style>
  20. .col_5 {
  21. width: 520px;
  22. }
  23. </style>
  24. <div style="color: #80889a;padding-left: 16px;" id="float-div">
  25. <?php
  26. $title = '';
  27. if ($op == 'view')
  28. $title = '查看客户';
  29. else if ($op == 'review')
  30. $title = '审核客户';
  31. else if ($op == 'modify')
  32. $title = '修改客户';
  33. else
  34. $title = '添加客户';
  35. ?>
  36. <div style="height: 56px;line-height: 56px;color: #80889a;font-size: 12px;">合作管理 / 客户管理 / <?= $title ?></div>
  37. <?php $form = zActiveForm::begin(['options' => ['class' => 'form-horizontal', 'data-pjax' => true]]); ?>
  38. <div class="panel panel-default" style="margin: 0 16px 16px 0;">
  39. <div class="panel-body">
  40. <!--内容区-->
  41. <div class="" style="padding-left: 50px;padding-top: 10px;">
  42. <!--类型-->
  43. <div class="form-group">
  44. <?= $form->field($model, 'depart_type', ['options' => ['class' => 'col_5']])->radioList(['469' => '企业', '470' => '个人'], ['class' => 'col-sm-5 radio-z']); ?>
  45. </div>
  46. <!--客户名称-->
  47. <div class="form-group">
  48. <div class="form-inline">
  49. <?= $form->field($model, 'depart_name', ['template' => '{label}<div class="col-sm-9 " style="display: inline-flex;"><div class="">{input}' .
  50. '</div>{hint}{error}</div>', 'options' => ['class' => 'col_5']])->textInput(['placeholder' => '输入客户名称', ['class' => 'form-control']]) ?>
  51. </div>
  52. </div>
  53. <!--公司全称-->
  54. <div class="form-group">
  55. <div class="form-inline">
  56. <?= $form->field($model, 'company_name', ['template' => '{label}<div class="col-sm-9 " style="display: inline-flex;"><div class="">{input}' .
  57. '</div>{hint}{error}</div>', 'options' => ['class' => 'col_5']])->textInput(['placeholder' => '输入公司全称', ['class' => 'form-control']]) ?>
  58. </div>
  59. </div>
  60. <!--业务员-->
  61. <div class="form-group">
  62. <div class="form-inline">
  63. <?= $form->field($model, 'sales_man_id', ['template' => '{label}<div class="col-sm-8" style="display: inline-flex">{input}' .
  64. '{hint}{error}</div>', 'options' => ['class' => 'col_5']])->dropDownList(ArrayHelper::map($data['Salesman'], 'ID', 'TRUE_NAME'), ['class' => 'form-control select_screen', 'style' => 'width:172px;']) ?>
  65. </div>
  66. </div>
  67. <!--结算方式-->
  68. <div class="form-group">
  69. <?= $form->field($model, 'settle_type', ['options' => ['class' => 'col_5']])->radioList(['474' => '挂账', '190' => '预付', '292' => '单结'], ['class' => 'col-sm-5 radio-z'])->error(false); ?>
  70. </div>
  71. <!--结算周期-->
  72. <div class="form-group">
  73. <?= $form->field($model, 'settle_cycle', ['options' => ['class' => 'col_5']])->radioList(['295' => '月结', '294' => '周结', '298' => '年付'], ['class' => 'col-sm-5 radio-z'])->error(false); ?>
  74. </div>
  75. <!--联系人-->
  76. <div class="form-group">
  77. <div class="form-inline">
  78. <div class="col_5">
  79. <label id="" class="control-label">联系人</label>
  80. <div class="col-sm-9">
  81. <button type="button" class="btn btn-primary" onclick="add_customer_contacts(this)">
  82. <span class="glyphicon glyphicon-plus"></span> 添加
  83. </button>
  84. </div>
  85. <div class="form-group" style="margin-left: 92px;margin-top: 16px;">
  86. <div class="form-inline" style="width:700px;">
  87. <table class="table table-bordered table-hover" style="text-align: center">
  88. <thead>
  89. <tr>
  90. <th> 姓名</th>
  91. <th> 电话</th>
  92. <th> 类型</th>
  93. <th> 操作</th>
  94. </tr>
  95. </thead>
  96. <tbody id="stroke_tbody">
  97. <?php
  98. foreach ($linkModel as $key => $link) {
  99. ?>
  100. <tr class="stroke_tr">
  101. <td>
  102. <?= $form->field($link, "[$key]id")->textInput()->hiddenInput(['value' => $link['id']]);
  103. echo Html::hiddenInput("tr_no", $key);
  104. ?>
  105. <div class="form-group">
  106. <div class="form-inline">
  107. <?= $form->field($link, "[$key]contact_name")->textInput(['placeholder' => '输入联系人姓名', ['class' => 'form-control']])->label(false)->error(false); ?>
  108. </div>
  109. </div>
  110. </td>
  111. <td>
  112. <div class="form-group">
  113. <div class="form-inline">
  114. <?= $form->field($link, "[$key]contact_mobile")->textInput(['placeholder' => '输入联系人电话', ['class' => 'form-control']])->label(false)->error(false); ?>
  115. </div>
  116. </div>
  117. </td>
  118. <td>
  119. <?= $form->field($link, "[$key]contact_type", ['template' => '<div class="col-sm-8" ><div class="form-group">{input}' .
  120. '</div>{hint}{error}</div>'], ['options' => ['class' => '']])->dropDownList(['606' => '车调', '607' => '采购', '608' => '财务'], ['class' => 'form-control'])->error(false) ?>
  121. </td>
  122. <td style="vertical-align: middle !important;">
  123. <button type="button" onclick="delete_contacts(this)"
  124. class="btn btn-danger">删除
  125. </button>
  126. </td>
  127. </tr>
  128. <?php
  129. }
  130. ?>
  131. </tbody>
  132. </table>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <!--操作按钮-->
  142. <div class="panel panel-default" style="margin: 0 16px 16px 30px;border: none">
  143. <div class="form-inline">
  144. <div class="col-sm-5">
  145. <?php if ($op == '' || $op == 'modify'): ?>
  146. <?= Html::submitButton($model->isNewRecord ? '保 存' : '保 存', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary', 'style' => 'width:82px;', 'onclick' => 'loading()']) ?>
  147. <?= Html::submitButton('取 消', ['class' => 'btn btn-default', 'data-dismiss' => 'modal', 'onclick' => 'window.open("about:blank", "_top").close()', 'style' => 'width:82px;margin-left:5px;']) ?>
  148. <?php elseif ($op == 'review'): ?>
  149. <?= Html::submitButton('通 过', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary', 'name' => 'pass', 'style' => 'width:82px;', 'onclick' => 'loading()']) ?>
  150. <?= Html::submitButton('驳 回', ['class' => 'btn btn-default', 'data-dismiss' => 'modal', 'style' => 'margin-left:5px;width:82px;', 'name' => 'reject', 'onclick' => 'loading()']) ?>
  151. <?php elseif ($op == 'view'): ?>
  152. <?= Html::submitButton('关 闭', ['class' => 'btn btn-default', 'id' => 'close', 'data-dismiss' => 'modal', 'onclick' => 'window.open("about:blank", "_top").close()', 'style' => 'width:82px;']) ?>
  153. <?php endif; ?>
  154. </div>
  155. </div>
  156. </div>
  157. <?php zActiveForm::end(); ?>
  158. </div>
  159. <?php if ($op == 'view'): ?>
  160. <script>
  161. window.onload = function () {
  162. $("input").each(function () {
  163. $(this).attr("disabled", "disabled")
  164. });
  165. $("button").each(function () {
  166. $(this).attr("disabled", "disabled")
  167. });
  168. $("select").each(function () {
  169. $(this).attr("disabled", "disabled")
  170. });
  171. $("#close").attr("disabled", false)
  172. }
  173. </script>
  174. <?php endif; ?>
  175. <script>
  176. </script>