lizhen_gitee 7 months ago
parent
commit
15ad91d756

+ 74 - 0
application/admin/controller/Maintain.php

@@ -0,0 +1,74 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 维修单
+ *
+ * @icon fa fa-circle-o
+ */
+class Maintain extends Backend
+{
+
+    /**
+     * Maintain模型对象
+     * @var \app\admin\model\Maintain
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\Maintain;
+        $this->view->assign("statusList", $this->model->getStatusList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //当前是否为关联查询
+        $this->relationSearch = true;
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if ($this->request->isAjax()) {
+            //如果发送的来源是Selectpage,则转发到Selectpage
+            if ($this->request->request('keyField')) {
+                return $this->selectpage();
+            }
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+            $list = $this->model
+                    ->with(['company','user','usercompany','worker'])
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->paginate($limit);
+
+            foreach ($list as $row) {
+                
+                $row->getRelation('company')->visible(['companyname']);
+				$row->getRelation('user')->visible(['nickname','mobile']);
+				$row->getRelation('usercompany')->visible(['projectname']);
+				$row->getRelation('worker')->visible(['truename','mobile']);
+            }
+
+            $result = array("total" => $list->total(), "rows" => $list->items());
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+
+}

+ 62 - 0
application/admin/lang/zh-cn/maintain.php

@@ -0,0 +1,62 @@
+<?php
+
+return [
+    'Id'                  => 'ID',
+    'Orderno'             => '订单号',
+    'Uc_id'               => '客户id',
+    'Company_id'          => '维保公司ID',
+    'User_id'             => '用户ID',
+    'Createtime'          => '创建时间',
+    'Updatetime'          => '更新时间',
+    'Info'                => '详情',
+    'Filedata'            => '上传附件',
+    'Mobile'              => '联系方式',
+    'Address'             => '联系地址',
+    'Status'              => '状态',
+    'Status 0'            => '待报价',
+    'Set status to 0'     => '设为待报价',
+    'Status 2'            => '已取消',
+    'Set status to 2'     => '设为已取消',
+    'Status 20'           => '报价待审',
+    'Set status to 20'    => '设为报价待审',
+    'Status 22'           => '报价审核驳回',
+    'Set status to 22'    => '设为报价审核驳回',
+    'Status 30'           => '用户待确认',
+    'Set status to 30'    => '设为用户待确认',
+    'Status 40'           => '待指派',
+    'Set status to 40'    => '设为待指派',
+    'Status 50'           => '已选师傅',
+    'Set status to 50'    => '设为已选师傅',
+    'Status 60'           => '材料已申请待领取',
+    'Set status to 60'    => '设为材料已申请待领取',
+    'Status 70'           => '材料已领取待上门',
+    'Set status to 70'    => '设为材料已领取待上门',
+    'Status 80'           => '已上门',
+    'Set status to 80'    => '设为已上门',
+    'Status 90'           => '已完成待验收',
+    'Set status to 90'    => '设为已完成待验收',
+    'Status 92'           => '验收驳回',
+    'Set status to 92'    => '设为验收驳回',
+    'Status 100'          => '验收通过已完成',
+    'Set status to 100'   => '设为验收通过已完成',
+    'Canceltime'          => '取消时间',
+    'Finishtime'          => '验收/完成时间',
+    'Baojia_confirmtime'  => '报价确认时间',
+    'Worker_id'           => '维修师傅ID',
+    'Cailiao_time'        => '材料申请时间',
+    'Lingqu_time'         => '材料领取时间',
+    'Lingqu_images'       => '材料领取照片',
+    'Shangmen_time'       => '上门时间',
+    'Weixiu_times'        => '维修上门次数',
+    'Weixiu_id'           => '维修id',
+    'Wancheng_time'       => '维修完成时间',
+    'Eva_info'            => '评价详情',
+    'Eva_time'            => '评价时间',
+    'Eva_score'           => '评价得分',
+    'Company.companyname' => '公司名',
+    'User.nickname'       => '商户名',
+    'User.mobile'         => '手机号',
+    'Usercompany.projectname' => '项目名称',
+    'Worker.truename'     => '姓名',
+    'Worker.mobile'       => '手机号'
+];

+ 173 - 0
application/admin/model/Maintain.php

@@ -0,0 +1,173 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class Maintain extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $table = 'maintain';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'integer';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'status_text',
+        'canceltime_text',
+        'finishtime_text',
+        'baojia_confirmtime_text',
+        'cailiao_time_text',
+        'lingqu_time_text',
+        'shangmen_time_text',
+        'wancheng_time_text',
+        'eva_time_text'
+    ];
+    
+
+    
+    public function getStatusList()
+    {
+        return ['0' => __('Status 0'), '2' => __('Status 2'), '20' => __('Status 20'), '22' => __('Status 22'), '30' => __('Status 30'), '40' => __('Status 40'), '50' => __('Status 50'), '60' => __('Status 60'), '70' => __('Status 70'), '80' => __('Status 80'), '90' => __('Status 90'), '92' => __('Status 92'), '100' => __('Status 100')];
+    }
+
+
+    public function getStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+    public function getCanceltimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getFinishtimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['finishtime']) ? $data['finishtime'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getBaojiaConfirmtimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['baojia_confirmtime']) ? $data['baojia_confirmtime'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getCailiaoTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['cailiao_time']) ? $data['cailiao_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getLingquTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['lingqu_time']) ? $data['lingqu_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getShangmenTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['shangmen_time']) ? $data['shangmen_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getWanchengTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['wancheng_time']) ? $data['wancheng_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getEvaTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['eva_time']) ? $data['eva_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setCanceltimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setFinishtimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setBaojiaConfirmtimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setCailiaoTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setLingquTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setShangmenTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setWanchengTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setEvaTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+    public function company()
+    {
+        return $this->belongsTo('Company', 'company_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+
+
+    public function user()
+    {
+        return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+
+
+    public function usercompany()
+    {
+        return $this->belongsTo('Usercompany', 'uc_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+
+
+    public function worker()
+    {
+        return $this->belongsTo('Worker', 'worker_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+}

+ 27 - 0
application/admin/validate/Maintain.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class Maintain extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 161 - 0
application/admin/view/maintain/add.html

@@ -0,0 +1,161 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Orderno')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-orderno" class="form-control" name="row[orderno]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Uc_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-uc_id" data-rule="required" data-source="user/company/index" class="form-control selectpage" name="row[uc_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Company_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-company_id" data-rule="required" data-source="company/index" class="form-control selectpage" name="row[company_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-info" class="form-control" name="row[info]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Filedata')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-filedata" class="form-control " rows="5" name="row[filedata]" cols="50"></textarea>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mobile" class="form-control" name="row[mobile]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-address" class="form-control" name="row[address]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Canceltime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-canceltime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[canceltime]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Finishtime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-finishtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[finishtime]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Baojia_confirmtime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-baojia_confirmtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[baojia_confirmtime]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Worker_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-worker_id" data-rule="required" data-source="worker/index" class="form-control selectpage" name="row[worker_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Cailiao_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-cailiao_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[cailiao_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Lingqu_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-lingqu_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[lingqu_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Lingqu_images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-lingqu_images" class="form-control" size="50" name="row[lingqu_images]" type="text" value="0">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-lingqu_images" class="btn btn-danger faupload" data-input-id="c-lingqu_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-lingqu_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-lingqu_images" class="btn btn-primary fachoose" data-input-id="c-lingqu_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-lingqu_images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-lingqu_images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Shangmen_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-shangmen_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[shangmen_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weixiu_times')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weixiu_times" class="form-control" name="row[weixiu_times]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weixiu_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weixiu_id" data-rule="required" data-source="weixiu/index" class="form-control selectpage" name="row[weixiu_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Wancheng_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-wancheng_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[wancheng_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Eva_info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-eva_info" class="form-control" name="row[eva_info]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Eva_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-eva_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[eva_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Eva_score')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-eva_score" class="form-control" name="row[eva_score]" type="number" value="5">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 161 - 0
application/admin/view/maintain/edit.html

@@ -0,0 +1,161 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Orderno')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-orderno" class="form-control" name="row[orderno]" type="text" value="{$row.orderno|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Uc_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-uc_id" data-rule="required" data-source="user/company/index" class="form-control selectpage" name="row[uc_id]" type="text" value="{$row.uc_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Company_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-company_id" data-rule="required" data-source="company/index" class="form-control selectpage" name="row[company_id]" type="text" value="{$row.company_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-info" class="form-control" name="row[info]" type="text" value="{$row.info|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Filedata')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-filedata" class="form-control " rows="5" name="row[filedata]" cols="50">{$row.filedata|htmlentities}</textarea>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mobile" class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-address" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Canceltime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-canceltime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[canceltime]" type="text" value="{:$row.canceltime?datetime($row.canceltime):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Finishtime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-finishtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[finishtime]" type="text" value="{:$row.finishtime?datetime($row.finishtime):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Baojia_confirmtime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-baojia_confirmtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[baojia_confirmtime]" type="text" value="{:$row.baojia_confirmtime?datetime($row.baojia_confirmtime):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Worker_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-worker_id" data-rule="required" data-source="worker/index" class="form-control selectpage" name="row[worker_id]" type="text" value="{$row.worker_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Cailiao_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-cailiao_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[cailiao_time]" type="text" value="{:$row.cailiao_time?datetime($row.cailiao_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Lingqu_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-lingqu_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[lingqu_time]" type="text" value="{:$row.lingqu_time?datetime($row.lingqu_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Lingqu_images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-lingqu_images" class="form-control" size="50" name="row[lingqu_images]" type="text" value="{$row.lingqu_images|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-lingqu_images" class="btn btn-danger faupload" data-input-id="c-lingqu_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-lingqu_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-lingqu_images" class="btn btn-primary fachoose" data-input-id="c-lingqu_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-lingqu_images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-lingqu_images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Shangmen_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-shangmen_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[shangmen_time]" type="text" value="{:$row.shangmen_time?datetime($row.shangmen_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weixiu_times')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weixiu_times" class="form-control" name="row[weixiu_times]" type="number" value="{$row.weixiu_times|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weixiu_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weixiu_id" data-rule="required" data-source="weixiu/index" class="form-control selectpage" name="row[weixiu_id]" type="text" value="{$row.weixiu_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Wancheng_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-wancheng_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[wancheng_time]" type="text" value="{:$row.wancheng_time?datetime($row.wancheng_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Eva_info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-eva_info" class="form-control" name="row[eva_info]" type="text" value="{$row.eva_info|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Eva_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-eva_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[eva_time]" type="text" value="{:$row.eva_time?datetime($row.eva_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Eva_score')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-eva_score" class="form-control" name="row[eva_score]" type="number" value="{$row.eva_score|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>

+ 46 - 0
application/admin/view/maintain/index.html

@@ -0,0 +1,46 @@
+<div class="panel panel-default panel-intro">
+    
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="status">
+            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="statusList" item="vo"}
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
+
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('maintain/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('maintain/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('maintain/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('maintain/multi')?'':'hide'}">
+                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
+                            <ul class="dropdown-menu text-left" role="menu">
+                                {foreach name="statusList" item="vo"}
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>
+                                {/foreach}
+                            </ul>
+                        </div>
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('maintain/edit')}"
+                           data-operate-del="{:$auth->check('maintain/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 87 - 0
public/assets/js/backend/maintain.js

@@ -0,0 +1,87 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'maintain/index' + location.search,
+                    add_url: 'maintain/add',
+                    edit_url: 'maintain/edit',
+                    del_url: 'maintain/del',
+                    multi_url: 'maintain/multi',
+                    import_url: 'maintain/import',
+                    table: 'maintain',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                fixedColumns: true,
+                fixedRightNumber: 1,
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'orderno', title: __('Orderno'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+                        {field: 'uc_id', title: __('Uc_id')},
+                        {field: 'usercompany.projectname', title: __('Usercompany.projectname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+
+                        {field: 'company_id', title: __('Company_id')},
+                        {field: 'company.companyname', title: __('Company.companyname'), operate: 'LIKE'},
+
+                        {field: 'user_id', title: __('User_id')},
+                        {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
+                        {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
+
+                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+//                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'info', title: __('Info'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+                        {field: 'mobile', title: __('Mobile'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+                        {field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+                        {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"2":__('Status 2'),"20":__('Status 20'),"22":__('Status 22'),"30":__('Status 30'),"40":__('Status 40'),"50":__('Status 50'),"60":__('Status 60'),"70":__('Status 70'),"80":__('Status 80'),"90":__('Status 90'),"92":__('Status 92'),"100":__('Status 100')}, formatter: Table.api.formatter.status},
+//                        {field: 'canceltime', title: __('Canceltime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'finishtime', title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'baojia_confirmtime', title: __('Baojia_confirmtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'worker_id', title: __('Worker_id')},
+                        {field: 'worker.truename', title: __('Worker.truename'), operate: 'LIKE'},
+                        {field: 'worker.mobile', title: __('Worker.mobile'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+
+//                        {field: 'cailiao_time', title: __('Cailiao_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+//                        {field: 'lingqu_time', title: __('Lingqu_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+//                        {field: 'lingqu_images', title: __('Lingqu_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
+                        {field: 'shangmen_time', title: __('Shangmen_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'weixiu_times', title: __('Weixiu_times')},
+//                        {field: 'weixiu_id', title: __('Weixiu_id')},
+                        {field: 'wancheng_time', title: __('Wancheng_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+//                        {field: 'eva_info', title: __('Eva_info'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+//                        {field: 'eva_time', title: __('Eva_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'eva_score', title: __('Eva_score')},
+
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});