diff --git a/application/admin/controller/manystore/Index.php b/application/admin/controller/manystore/Index.php
index 5360889..57cd125 100644
--- a/application/admin/controller/manystore/Index.php
+++ b/application/admin/controller/manystore/Index.php
@@ -62,7 +62,7 @@ class Index extends Backend
protected $error_auth = false;
protected $qSwitch = true;
- protected $qFields = ["user_id","name","address_detail","type","tel","legal_entity","shop_apply_id"];
+ protected $qFields = ["images","image","logo","user_id","name","address_detail","type","tel","legal_entity","shop_apply_id"];
protected function checkAssemblyParameters(){
diff --git a/application/admin/controller/manystore/ShopApply.php b/application/admin/controller/manystore/ShopApply.php
index 5eba6db..6e046a3 100644
--- a/application/admin/controller/manystore/ShopApply.php
+++ b/application/admin/controller/manystore/ShopApply.php
@@ -24,6 +24,13 @@ class ShopApply extends Backend
$this->model = new \app\admin\model\manystore\ShopApply;
$this->view->assign("typeList", $this->model->getTypeList());
+ $this->view->assign("default_data_json", json_encode( [
+// 'name' => '默认机构名称',
+ 'logo' => config("site.shop_default_image"),
+ 'image' => config("site.shop_default_timage"),
+ 'images' => config("site.shop_default_images"),
+ ], JSON_UNESCAPED_UNICODE) );
+
}
diff --git a/application/admin/controller/user/invoice/Header.php b/application/admin/controller/user/invoice/Header.php
index 476d962..09d0425 100644
--- a/application/admin/controller/user/invoice/Header.php
+++ b/application/admin/controller/user/invoice/Header.php
@@ -3,6 +3,10 @@
namespace app\admin\controller\user\invoice;
use app\common\controller\Backend;
+use think\Db;
+use think\exception\DbException;
+use think\exception\PDOException;
+use think\exception\ValidateException;
/**
* 个人发票抬头管理
@@ -73,4 +77,109 @@ class Header extends Backend
return $this->view->fetch();
}
+
+
+
+
+ /**
+ * 添加
+ *
+ * @return string
+ * @throws \think\Exception
+ */
+ public function add()
+ {
+ if (false === $this->request->isPost()) {
+ return $this->view->fetch();
+ }
+ $params = $this->request->post('row/a');
+ if (empty($params)) {
+ $this->error(__('Parameter %s can not be empty', ''));
+ }
+ $params = $this->preExcludeFields($params);
+
+ if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
+ $params[$this->dataLimitField] = $this->auth->id;
+ }
+ $result = false;
+ Db::startTrans();
+ try {
+ //是否采用模型验证
+ if ($this->modelValidate) {
+ $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+ $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
+ $this->model->validateFailException()->validate($validate);
+ }
+
+ $params["is_default"] = $params["is_default"] ?? '0';
+ if($params["is_default"] == '1'){
+ $this->model::where('user_id',$params['user_id'])->update(['is_default'=>'0']);
+ }
+
+ $result = $this->model->allowField(true)->save($params);
+ Db::commit();
+ } catch (ValidateException|PDOException|Exception $e) {
+ Db::rollback();
+ $this->error($e->getMessage());
+ }
+ if ($result === false) {
+ $this->error(__('No rows were inserted'));
+ }
+ $this->success();
+ }
+
+ /**
+ * 编辑
+ *
+ * @param $ids
+ * @return string
+ * @throws DbException
+ * @throws \think\Exception
+ */
+ public function edit($ids = null)
+ {
+ $row = $this->model->get($ids);
+ if (!$row) {
+ $this->error(__('No Results were found'));
+ }
+ $adminIds = $this->getDataLimitAdminIds();
+ if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
+ $this->error(__('You have no permission'));
+ }
+ if (false === $this->request->isPost()) {
+ $this->view->assign('row', $row);
+ return $this->view->fetch();
+ }
+ $params = $this->request->post('row/a');
+ if (empty($params)) {
+ $this->error(__('Parameter %s can not be empty', ''));
+ }
+ $params = $this->preExcludeFields($params);
+ $result = false;
+ Db::startTrans();
+ try {
+ //是否采用模型验证
+ if ($this->modelValidate) {
+ $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+ $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
+ $row->validateFailException()->validate($validate);
+ }
+
+ $params["is_default"] = $params["is_default"] ?? '0';
+ if($params["is_default"] == '1'){
+ $this->model::where('user_id',$params['user_id'])->update(['is_default'=>'0']);
+ }
+
+ $result = $row->allowField(true)->save($params);
+ Db::commit();
+ } catch (ValidateException|PDOException|Exception $e) {
+ Db::rollback();
+ $this->error($e->getMessage());
+ }
+ if (false === $result) {
+ $this->error(__('No rows were updated'));
+ }
+ $this->success();
+ }
+
}
diff --git a/application/admin/lang/zh-cn.php b/application/admin/lang/zh-cn.php
index f7420df..6c87471 100644
--- a/application/admin/lang/zh-cn.php
+++ b/application/admin/lang/zh-cn.php
@@ -203,7 +203,7 @@ return [
'Third group' => '三级管理组',
'Second group 2' => '二级管理组2',
'Third group 2' => '三级管理组2',
- 'Dashboard tips' => '用于展示当前系统中的统计数据、统计报表及重要实时数据',
+ 'Dashboard tips' => '',
'Config tips' => '可以在此增改系统的变量和分组,也可以自定义分组和变量',
'Category tips' => '分类类型请在常规管理->系统配置->字典配置中添加',
'Attachment tips' => '主要用于管理上传到服务器或第三方存储的数据',
diff --git a/application/admin/view/manystore/index/add.html b/application/admin/view/manystore/index/add.html
index 1dab7ab..c3bf5f5 100644
--- a/application/admin/view/manystore/index/add.html
+++ b/application/admin/view/manystore/index/add.html
@@ -102,7 +102,7 @@
diff --git a/application/manystore/view/user/invoice/apply/edit.html b/application/manystore/view/user/invoice/apply/edit.html
index a529909..bab2ebd 100644
--- a/application/manystore/view/user/invoice/apply/edit.html
+++ b/application/manystore/view/user/invoice/apply/edit.html
@@ -77,6 +77,9 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/assets/js/backend/manystore/index.js b/public/assets/js/backend/manystore/index.js
index 5569bb7..1f01da3 100644
--- a/public/assets/js/backend/manystore/index.js
+++ b/public/assets/js/backend/manystore/index.js
@@ -25,7 +25,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
fixedColumns: true,
- fixedRightNumber: 2,
+ fixedRightNumber: 1,
columns: [
[
{checkbox: true},
@@ -84,7 +84,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'logintime', title: __('Login time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
- {field: 'miniqrcode_link', title: __('微信小程序端展示'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+ // {field: 'miniqrcode_link', title: __('微信小程序端展示'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'operate', title: __('Operate'),width:180, table: table , buttons: [
{name: 'url',
text: '查看小程序链接',
diff --git a/public/assets/js/backend/manystore/shop_apply.js b/public/assets/js/backend/manystore/shop_apply.js
index 63427ec..0468b19 100644
--- a/public/assets/js/backend/manystore/shop_apply.js
+++ b/public/assets/js/backend/manystore/shop_apply.js
@@ -112,7 +112,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
return 'manystore/index/add?user_id='+row.user_id
+ '&type='+row.type
- + '&name=' + (row.name || row.realname)
+ + '&logo='+encodeURIComponent( row.user.avatar ? row.user.avatar : default_data_json.logo)
+ + '&image='+ encodeURIComponent(default_data_json.image)
+ + '&images='+ encodeURIComponent(default_data_json.images)
+ + '&name=' + encodeURIComponent(row.name || row.realname)
+ '&tel='+row.mobile
+ '&shop_apply_id='+row.id
+ '&address_detail='+row.address + '&legal_entity='+row.realname;
diff --git a/public/assets/js/backend/user/invoice/header.js b/public/assets/js/backend/user/invoice/header.js
index 9867a10..b83e5ed 100644
--- a/public/assets/js/backend/user/invoice/header.js
+++ b/public/assets/js/backend/user/invoice/header.js
@@ -61,9 +61,50 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
},
api: {
bindevent: function () {
+ shop_apply.listen();
Form.api.bindevent($("form[role=form]"));
}
}
};
+
+
+
+ var shop_apply = {
+ listen:function () {
+
+ this.setOfflineType($("select[name='row[head_type]']").val());
+ this.offlineListen();
+ },
+ offlineListen:function () {
+ var that = this;
+ // console.log($("input:radio[name='row[address_type]']").val())
+ // this.setOfflineType($("input:radio[name='row[address_type]']").val());
+ // $("input:radio[name='row[head_type]']").change(function (){
+ //
+ // console.log(1111111);
+ // that.setOfflineType($(this).val());
+ // });
+ //改成下拉
+ $("select[name='row[head_type]']").change(function (){
+ that.setOfflineType($(this).val());
+ });
+
+ },
+ setOfflineType:function (val) {
+ switch (val) {
+ case 'personal': //个人
+ $('#enterprise_data').hide();
+
+ break;
+ case 'corporate': //企业
+ $('#enterprise_data').show();
+
+ break;
+ }
+ },
+
+ }
+
+
return Controller;
});
diff --git a/public/assets/js/manystore/user/invoice/apply.js b/public/assets/js/manystore/user/invoice/apply.js
index 642607a..2d087ea 100644
--- a/public/assets/js/manystore/user/invoice/apply.js
+++ b/public/assets/js/manystore/user/invoice/apply.js
@@ -77,9 +77,50 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
},
api: {
bindevent: function () {
+ shop_apply.listen();
Form.api.bindevent($("form[role=form]"));
}
}
};
+
+
+
+ var shop_apply = {
+ listen:function () {
+
+ this.setOfflineType($("select[name='row[head_type]']").val());
+ this.offlineListen();
+ },
+ offlineListen:function () {
+ var that = this;
+ // console.log($("input:radio[name='row[address_type]']").val())
+ // this.setOfflineType($("input:radio[name='row[address_type]']").val());
+ // $("input:radio[name='row[head_type]']").change(function (){
+ //
+ // console.log(1111111);
+ // that.setOfflineType($(this).val());
+ // });
+ //改成下拉
+ $("select[name='row[head_type]']").change(function (){
+ that.setOfflineType($(this).val());
+ });
+
+ },
+ setOfflineType:function (val) {
+ switch (val) {
+ case 'personal': //个人
+ $('#enterprise_data').hide();
+
+ break;
+ case 'corporate': //企业
+ $('#enterprise_data').show();
+
+ break;
+ }
+ },
+
+ }
+
+
return Controller;
});
\ No newline at end of file
diff --git a/public/assets/js/manystore/user/invoice/header.js b/public/assets/js/manystore/user/invoice/header.js
index 5b165c1..89e09d4 100644
--- a/public/assets/js/manystore/user/invoice/header.js
+++ b/public/assets/js/manystore/user/invoice/header.js
@@ -59,9 +59,52 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
},
api: {
bindevent: function () {
+ shop_apply.listen();
Form.api.bindevent($("form[role=form]"));
}
}
};
+
+
+
+
+ var shop_apply = {
+ listen:function () {
+
+ this.setOfflineType($("select[name='row[head_type]']").val());
+ this.offlineListen();
+ },
+ offlineListen:function () {
+ var that = this;
+ // console.log($("input:radio[name='row[address_type]']").val())
+ // this.setOfflineType($("input:radio[name='row[address_type]']").val());
+ // $("input:radio[name='row[head_type]']").change(function (){
+ //
+ // console.log(1111111);
+ // that.setOfflineType($(this).val());
+ // });
+ //改成下拉
+ $("select[name='row[head_type]']").change(function (){
+ that.setOfflineType($(this).val());
+ });
+
+ },
+ setOfflineType:function (val) {
+ switch (val) {
+ case 'personal': //个人
+ $('#enterprise_data').hide();
+
+ break;
+ case 'corporate': //企业
+ $('#enterprise_data').show();
+
+ break;
+ }
+ },
+
+ }
+
+
+
return Controller;
});
\ No newline at end of file