|
@@ -78,6 +78,12 @@ class WaterMaterialScience extends AuthController
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
|
|
+ public function escalator()
|
|
|
+ {
|
|
|
+ $this->assign('role', 'escalator');
|
|
|
+ return $this->fetch();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public function list()
|
|
|
{
|
|
@@ -96,17 +102,20 @@ class WaterMaterialScience extends AuthController
|
|
|
*
|
|
|
* @return \think\Response
|
|
|
*/
|
|
|
- public function create($id = 0)
|
|
|
+ public function create($id = 0, $role = 0)
|
|
|
{
|
|
|
+ if ($role == 'roof'){
|
|
|
+ $type = 1;
|
|
|
+ }elseif ($role == 'side_plate'){
|
|
|
+ $type = 2;
|
|
|
+ }elseif ($role == 'floor'){
|
|
|
+ $type = 4;
|
|
|
+ }else{
|
|
|
+ return Json::fail('参数错误');
|
|
|
+ }
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称')->col(12);
|
|
|
- $f[] = Form::select('type', '选择分类', '')->options([
|
|
|
- ['value' => 0, 'label' => '请选择分类'],
|
|
|
- ['value' => 1, 'label' => '顶板'],
|
|
|
- ['value' => 2, 'label' => '侧板'],
|
|
|
- ['value' => 3, 'label' => '拉筋'],
|
|
|
- ['value' => 4, 'label' => '底板'],
|
|
|
- ])->filterable(true);
|
|
|
+ $f[] = Form::hidden('type', $type);
|
|
|
$f[] = Form::select('th_id', '选择厚度', '')->options(
|
|
|
array_merge([['value' => 0, 'label' => '请选择分类']], \app\admin\model\water\WaterThickness::order('id DESC')->field('id as value,name as label')->select()->toArray())
|
|
|
)->filterable(true);
|
|
@@ -129,15 +138,21 @@ class WaterMaterialScience extends AuthController
|
|
|
*
|
|
|
* @return \think\Response
|
|
|
*/
|
|
|
- public function creates($id = 0)
|
|
|
+ public function creates($id = 0, $role = 0)
|
|
|
{
|
|
|
+
|
|
|
+ if ($role == 'column'){
|
|
|
+ $type = 5;
|
|
|
+ }elseif ($role == 'fula'){
|
|
|
+ $type = 6;
|
|
|
+ }elseif ($role == 'lacing'){
|
|
|
+ $type = 3;
|
|
|
+ }else{
|
|
|
+ return Json::fail('参数错误');
|
|
|
+ }
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称')->col(12);
|
|
|
- $f[] = Form::select('type', '选择分类', '')->options([
|
|
|
- ['value' => 0, 'label' => '请选择分类'],
|
|
|
- ['value' => 5, 'label' => '立柱'],
|
|
|
- ['value' => 6, 'label' => '辅拉'],
|
|
|
- ])->filterable(true);
|
|
|
+ $f[] = Form::hidden('type', $type);
|
|
|
$f[] = Form::select('th_id', '选择厚度', '')->options(
|
|
|
array_merge([['value' => 0, 'label' => '请选择分类']], \app\admin\model\water\WaterThickness::order('id DESC')->field('id as value,name as label')->select()->toArray())
|
|
|
)->filterable(true);
|
|
@@ -157,13 +172,16 @@ class WaterMaterialScience extends AuthController
|
|
|
*
|
|
|
* @return \think\Response
|
|
|
*/
|
|
|
- public function create_warm($id = 0)
|
|
|
+ public function create_warm($id = 0, $role = 0)
|
|
|
{
|
|
|
+ if ($role == 'warm'){
|
|
|
+ $type = 7;
|
|
|
+ }else{
|
|
|
+ return Json::fail('参数错误');
|
|
|
+ }
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称')->col(12);
|
|
|
- $f[] = Form::select('type', '选择分类', '')->options([
|
|
|
- ['value' => 7, 'label' => '保温'],
|
|
|
- ])->filterable(true);
|
|
|
+ $f[] = Form::hidden('type', $type);
|
|
|
$f[] = Form::input('weight', '重量(kg)');
|
|
|
$f[] = Form::input('unit_price', '单价');
|
|
|
$f[] = Form::input('company', '单位');
|
|
@@ -181,13 +199,18 @@ class WaterMaterialScience extends AuthController
|
|
|
*
|
|
|
* @return \think\Response
|
|
|
*/
|
|
|
- public function create_channel($id = 0)
|
|
|
+ public function create_channel($id = 0, $role = 0)
|
|
|
{
|
|
|
+ if ($role == 'escalator'){
|
|
|
+ $type = 9;
|
|
|
+ }elseif ($role == 'channel'){
|
|
|
+ $type = 8;
|
|
|
+ }else{
|
|
|
+ return Json::fail('参数错误');
|
|
|
+ }
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称')->col(12);
|
|
|
- $f[] = Form::select('type', '选择分类', '')->options([
|
|
|
- ['value' => 8, 'label' => '槽钢'],
|
|
|
- ])->filterable(true);
|
|
|
+ $f[] = Form::hidden('type', $type);
|
|
|
$f[] = Form::input('weight', '重量(kg)');
|
|
|
$f[] = Form::input('unit_price', '单价');
|
|
|
$f[] = Form::input('company', '单位');
|
|
@@ -244,17 +267,6 @@ class WaterMaterialScience extends AuthController
|
|
|
$data = model::find($id);
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称', $data['name'])->col(12);
|
|
|
- $f[] = Form::select('type', '选择分类', (string)$data['type'])->options([
|
|
|
- ['value' => 0, 'label' => '请选择分类'],
|
|
|
- ['value' => 1, 'label' => '顶板'],
|
|
|
- ['value' => 2, 'label' => '侧板'],
|
|
|
- ['value' => 3, 'label' => '拉筋'],
|
|
|
- ['value' => 4, 'label' => '底板'],
|
|
|
- ['value' => 5, 'label' => '立柱'],
|
|
|
- ['value' => 6, 'label' => '辅拉'],
|
|
|
- ['value' => 7, 'label' => '保温'],
|
|
|
- ['value' => 8, 'label' => '槽钢'],
|
|
|
- ])->filterable(true);
|
|
|
$f[] = Form::select('th_id', '选择厚度', (string)$data['th_id'])->options(
|
|
|
array_merge([['value' => 0, 'label' => '请选择分类']], \app\admin\model\water\WaterThickness::order('id DESC')->field('id as value,name as label')->select()->toArray())
|
|
|
)->filterable(true);
|
|
@@ -280,17 +292,6 @@ class WaterMaterialScience extends AuthController
|
|
|
$data = model::find($id);
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称', $data['name'])->col(12);
|
|
|
- $f[] = Form::select('type', '选择分类', (string)$data['type'])->options([
|
|
|
- ['value' => 0, 'label' => '请选择分类'],
|
|
|
- ['value' => 1, 'label' => '顶板'],
|
|
|
- ['value' => 2, 'label' => '侧板'],
|
|
|
- ['value' => 3, 'label' => '拉筋'],
|
|
|
- ['value' => 4, 'label' => '底板'],
|
|
|
- ['value' => 5, 'label' => '立柱'],
|
|
|
- ['value' => 6, 'label' => '辅拉'],
|
|
|
- ['value' => 7, 'label' => '保温'],
|
|
|
- ['value' => 8, 'label' => '槽钢'],
|
|
|
- ])->filterable(true);
|
|
|
$f[] = Form::select('th_id', '选择厚度', (string)$data['th_id'])->options(
|
|
|
array_merge([['value' => 0, 'label' => '请选择分类']], \app\admin\model\water\WaterThickness::order('id DESC')->field('id as value,name as label')->select()->toArray())
|
|
|
)->filterable(true);
|
|
@@ -314,9 +315,6 @@ class WaterMaterialScience extends AuthController
|
|
|
$data = model::find($id);
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称', $data['name'])->col(12);
|
|
|
- $f[] = Form::select('type', '选择分类', (string)$data['type'])->options([
|
|
|
- ['value' => 7, 'label' => '保温'],
|
|
|
- ])->filterable(true);
|
|
|
$f[] = Form::input('weight', '重量(kg)', $data['weight']);
|
|
|
$f[] = Form::input('unit_price', '单价', $data['unit_price']);
|
|
|
$f[] = Form::input('company', '单位', $data['company']);
|
|
@@ -340,9 +338,6 @@ class WaterMaterialScience extends AuthController
|
|
|
$data = model::find($id);
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称', $data['name'])->col(12);
|
|
|
- $f[] = Form::select('type', '选择分类', (string)$data['type'])->options([
|
|
|
- ['value' => 8, 'label' => '槽钢'],
|
|
|
- ])->filterable(true);
|
|
|
$f[] = Form::input('weight', '重量(kg)', $data['weight']);
|
|
|
$f[] = Form::input('unit_price', '单价', $data['unit_price']);
|
|
|
$f[] = Form::input('company', '单位', $data['company']);
|
|
@@ -365,7 +360,6 @@ class WaterMaterialScience extends AuthController
|
|
|
$model = new model;
|
|
|
$data = Util::postMore([
|
|
|
'name',
|
|
|
- 'type',
|
|
|
'th_id',
|
|
|
'weight',
|
|
|
'unit_price',
|
|
@@ -377,7 +371,6 @@ class WaterMaterialScience extends AuthController
|
|
|
]);
|
|
|
$validate = Validate::rule('name', 'require')->rule([
|
|
|
'name' => 'require',
|
|
|
- 'type' => 'require',
|
|
|
'weight' => 'require',
|
|
|
'unit_price' => 'require',
|
|
|
'company' => 'require',
|
|
@@ -391,7 +384,6 @@ class WaterMaterialScience extends AuthController
|
|
|
]);
|
|
|
$details = $model->find($data['id']);
|
|
|
$details['name'] = $data['name'];
|
|
|
- $details['type'] = $data['type'];
|
|
|
$details['th_id'] = $data['th_id'];
|
|
|
$details['weight'] = $data['weight'];
|
|
|
$details['unit_price'] = $data['unit_price'];
|