wupengfei %!s(int64=2) %!d(string=hai) anos
pai
achega
5bdea2e17f

+ 22 - 14
.idea/workspace.xml

@@ -2,6 +2,10 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/application/api/controller/Bill.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/synth/controller/BillType.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/synth/view/bill_type/form.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/synth/view/bill_type/index.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -120,7 +124,7 @@
   <component name="PropertiesComponent">
     <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
     <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/common/model" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/synth/view/bill_type" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -131,16 +135,16 @@
     <property name="two.files.diff.last.used.folder" value="$PROJECT_DIR$" />
   </component>
   <component name="RecentsManager">
+    <key name="MoveFile.RECENT_KEYS">
+      <recent name="D:\zs\gaoyixia\public\wx_cert" />
+      <recent name="D:\zs\gaoyixia\application\api\controller" />
+    </key>
     <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\zs\gaoyixia\application\synth\view\bill_type" />
+      <recent name="D:\zs\gaoyixia\application\api\controller" />
       <recent name="D:\zs\gaoyixia\application\common\model" />
       <recent name="D:\zs\gaoyixia\application\operate\view\recruit" />
       <recent name="D:\zs\gaoyixia\application\operate\view\forum" />
-      <recent name="D:\zs\gaoyixia\application\common\service" />
-      <recent name="D:\zs\gaoyixia\application\user\view\tag" />
-    </key>
-    <key name="MoveFile.RECENT_KEYS">
-      <recent name="D:\zs\gaoyixia\public\wx_cert" />
-      <recent name="D:\zs\gaoyixia\application\api\controller" />
     </key>
   </component>
   <component name="SvnConfiguration">
@@ -209,7 +213,7 @@
       <workItem from="1672793409629" duration="408000" />
       <workItem from="1672793834653" duration="24306000" />
       <workItem from="1672880479757" duration="22897000" />
-      <workItem from="1672966192005" duration="1516000" />
+      <workItem from="1672966192005" duration="8572000" />
     </task>
     <servers />
   </component>
@@ -339,14 +343,18 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="283" y="145" width="1942" height="1088" key="DiffContextDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1672820850032" />
-    <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1672902080136">
+    <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1672985053345">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1418" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1672902080136" />
+    <state x="1418" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1672985053345" />
     <state x="1051" y="472" key="MultipleFileMergeDialog" timestamp="1671416392056">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="1051" y="472" key="MultipleFileMergeDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1671416392056" />
+    <state x="1423" y="617" key="NewPhpClassDialog" timestamp="1672986116087">
+      <screen x="0" y="0" width="2560" height="1400" />
+    </state>
+    <state x="1423" y="617" key="NewPhpClassDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1672986116087" />
     <state x="737" y="480" key="RollbackChangesDialog" timestamp="1671171122897">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
@@ -363,15 +371,15 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="533" y="290" key="com.intellij.ide.util.TipDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1672793838147" />
-    <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1672810353408">
+    <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1672985282244">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="875" y="449" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.1920.1040@0.0.1920.1040" timestamp="1665835639346" />
-    <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.2560.1400@0.0.2560.1400" timestamp="1672810353408" />
-    <state x="1057" y="460" width="746" height="548" key="find.popup" timestamp="1672902106701">
+    <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.2560.1400@0.0.2560.1400" timestamp="1672985282244" />
+    <state x="1057" y="460" width="746" height="548" key="find.popup" timestamp="1672985240209">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1057" y="460" width="746" height="548" key="find.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1672902106701" />
+    <state x="1057" y="460" width="746" height="548" key="find.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1672985240209" />
     <state x="1291" y="317" key="run.anything.popup" timestamp="1672903043103">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

+ 42 - 0
application/api/controller/Bill.php

@@ -0,0 +1,42 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ThinkAdmin
+// +----------------------------------------------------------------------
+// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// +----------------------------------------------------------------------
+// | 官方网站: http://demo.thinkadmin.top
+// +----------------------------------------------------------------------
+// | 开源协议 ( https://mit-license.org )
+// +----------------------------------------------------------------------
+// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
+// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
+// +----------------------------------------------------------------------
+
+namespace app\api\controller;
+use app\common\model\ChinaArea;
+use think\Db;
+/**
+ * @title 发票模块【二期】
+ * @controller Bill
+ */
+class Bill extends Base
+{
+
+    protected $need_login = [
+        ''
+    ];
+
+    public function initialize()
+    {
+        parent::initialize();
+        parent::setUid();
+    }
+
+
+
+
+
+
+
+}

+ 71 - 0
application/synth/controller/BillType.php

@@ -0,0 +1,71 @@
+<?php
+namespace app\synth\controller;
+use think\Controller;
+use think\Db;
+
+class BillType extends Controller
+{
+    protected $table = 'BillType';
+
+
+    /**
+     * 列表
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function index()
+    {
+        $this->title = '分类管理';
+        $query = $this->_query($this->table)->where('is_deleted',0)->page(false);
+    }
+
+
+    /**
+     * 删除
+     * @auth true
+     * @menu true
+     * @param array $data
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function remove()
+    {
+        $this->_save($this->table, ['is_deleted' => '1']);
+    }
+
+    /**
+     * 禁用
+     * @auth true
+     * @menu true
+     * @param array $data
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function forbidden()
+    {
+        $this->_save($this->table, ['status' => '0']);
+    }
+    /**
+     * 启用
+     * @auth true
+     * @menu true
+     * @param array $data
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function enable()
+    {
+        $this->_save($this->table, ['status' => '1']);
+    }
+
+
+
+}

+ 31 - 0
application/synth/view/bill_type/form.html

@@ -0,0 +1,31 @@
+<style>
+
+</style>
+<div class="think-box-shadow">
+    <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
+        <div class="layui-card-body">
+
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">类型名称</label>
+                <div class="layui-input-block">
+                    <input name="title" maxlength="20"  value='{$vo.title|default=""}' placeholder="请输入类型名称" class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">排序</label>
+                <div class="layui-input-block">
+                    <input type="number" name="sort"  value='{$vo.sort|default=""}' placeholder="请输入排序号" class="layui-input">
+                </div>
+            </div>
+            {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
+            <div class="layui-form-item text-center">
+                <button class="layui-btn" type='submit'>保 存</button>
+                <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定取消编辑吗?" data-close>取消编辑</button>
+            </div>
+        </div>
+    </form>
+    <script>
+        window.form.render();
+    </script>
+</div>

+ 63 - 0
application/synth/view/bill_type/index.html

@@ -0,0 +1,63 @@
+{extend name='admin@main'}
+
+{block name="button"}
+<button data-modal='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
+{/block}
+
+{block name="content"}
+<div class="think-box-shadow">
+    <table class="layui-table margin-top-20" lay-skin="line">
+        <thead>
+        <tr>
+            <th class='text-left nowrap' style="width: 75%">类型名称</th>
+            <th class='text-left nowrap' >状态</th>
+            <th class="text-left nowrap" >操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='text-left nowrap'>{$vo.title|default=''}</td>
+            <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
+            <td class='text-left' >
+                <a data-title="编辑" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
+                {if $vo.status == 1}
+                <span class="layui-btn layui-btn-sm layui-btn-warm"  onclick="btn_confirm('禁用','forbidden','{$vo.id}');" >禁 用</span>
+                {else}
+                <span class="layui-btn layui-btn-sm layui-btn-sm"  onclick="btn_confirm('启用','enable','{$vo.id}');">启 用</span>
+                {/if}
+                <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','remove','{$vo.id}');">删 除</span>
+            </td>
+        </tr>
+        {/foreach}
+        </tbody>
+    </table>
+
+    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
+</div>
+<script>
+    function btn_confirm(msg,fun,id) {
+        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
+            var url = "/synth/bill_type/"+fun;
+            layer.closeAll();
+            $.ajax({
+                type: "post",
+                url: url,
+                data: {id:id},
+                dataType: "json",
+                async: false,
+                success: function (data) {
+                    layer.msg(data.info);
+                    setTimeout(function () {
+                        window.location.reload();
+                    },1000)
+                }
+            });
+        });
+    }
+
+</script>
+{/block}
+
+
+