|
@@ -105,6 +105,7 @@ class WaterMaterialScience extends AuthController
|
|
|
$f[] = Form::input('company', '单位');
|
|
|
$f[] = Form::input('long', '长');
|
|
|
$f[] = Form::input('wide', '宽');
|
|
|
+ $f[] = Form::radio('is_gc', '公差', 0)->options([['value' => 0, 'label' => '正常'], ['value' => 1, 'label' => '大公差']]);
|
|
|
$form = Form::make_post_form('添加', $f, Url::buildUrl('save'));
|
|
|
$this->assign(compact('form'));
|
|
|
return $this->fetch('public/form-builder');
|
|
@@ -137,6 +138,7 @@ class WaterMaterialScience extends AuthController
|
|
|
$f[] = Form::input('weight', '重量(kg)');
|
|
|
$f[] = Form::input('unit_price', '单价');
|
|
|
$f[] = Form::input('company', '单位');
|
|
|
+ $f[] = Form::radio('is_gc', '公差', 0)->options([['value' => 0, 'label' => '正常'], ['value' => 1, 'label' => '大公差']]);
|
|
|
$form = Form::make_post_form('添加', $f, Url::buildUrl('save'));
|
|
|
$this->assign(compact('form'));
|
|
|
return $this->fetch('public/form-builder');
|
|
@@ -156,6 +158,7 @@ class WaterMaterialScience extends AuthController
|
|
|
'company',
|
|
|
'long',
|
|
|
'wide',
|
|
|
+ 'is_gc'
|
|
|
]);
|
|
|
$validate = Validate::rule('name', 'require')->rule([
|
|
|
'name' => 'require',
|
|
@@ -209,6 +212,7 @@ class WaterMaterialScience extends AuthController
|
|
|
$f[] = Form::input('company', '单位', $data['company']);
|
|
|
$f[] = Form::input('long', '长', $data['long']);
|
|
|
$f[] = Form::input('wide', '宽', $data['wide']);
|
|
|
+ $f[] = Form::radio('is_gc', '公差', $data['is_gc'])->options([['value' => 0, 'label' => '正常'], ['value' => 1, 'label' => '大公差']]);
|
|
|
$f[] = Form::hidden('id', $id);
|
|
|
$form = Form::make_post_form('修改', $f, Url::buildUrl('update'));
|
|
|
$this->assign(compact('form'));
|
|
@@ -240,6 +244,7 @@ class WaterMaterialScience extends AuthController
|
|
|
$f[] = Form::input('weight', '重量(kg)', $data['weight']);
|
|
|
$f[] = Form::input('unit_price', '单价', $data['unit_price']);
|
|
|
$f[] = Form::input('company', '单位', $data['company']);
|
|
|
+ $f[] = Form::radio('is_gc', '公差', $data['is_gc'])->options([['value' => 0, 'label' => '正常'], ['value' => 1, 'label' => '大公差']]);
|
|
|
$f[] = Form::hidden('id', $id);
|
|
|
$form = Form::make_post_form('修改', $f, Url::buildUrl('update'));
|
|
|
$this->assign(compact('form'));
|
|
@@ -267,6 +272,7 @@ class WaterMaterialScience extends AuthController
|
|
|
'long',
|
|
|
'wide',
|
|
|
'id',
|
|
|
+ 'is_gc'
|
|
|
]);
|
|
|
$validate = Validate::rule('name', 'require')->rule([
|
|
|
'name' => 'require',
|
|
@@ -291,6 +297,7 @@ class WaterMaterialScience extends AuthController
|
|
|
$details['weight'] = $data['weight'];
|
|
|
$details['unit_price'] = $data['unit_price'];
|
|
|
$details['company'] = $data['company'];
|
|
|
+ $details['is_gc'] = $data['is_gc'];
|
|
|
$res = $details->save();
|
|
|
if ($res) return Json::successful('修改成功');
|
|
|
return Json::fail('修改失败');
|