wupengfei 2 年之前
父节点
当前提交
fa8f81b587

+ 3 - 2
.idea/workspace.xml

@@ -3,7 +3,8 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/supplier_goods/index_search.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/supplier_goods/index_search.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/SupplierGoods.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/SupplierGoods.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/supplier_goods/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/supplier_goods/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -289,7 +290,7 @@
       <workItem from="1681174490906" duration="23334000" />
       <workItem from="1681260946292" duration="27381000" />
       <workItem from="1681348081818" duration="22448000" />
-      <workItem from="1681434523223" duration="18793000" />
+      <workItem from="1681434523223" duration="19098000" />
     </task>
     <servers />
   </component>

+ 17 - 0
application/operate/controller/SupplierGoods.php

@@ -112,6 +112,23 @@ class SupplierGoods extends Controller
     public function enable()
     {
         $this->_save($this->table, ['status' => 1]);
+        $this->success('已上架!');
+    }
+
+    /**
+     * 禁用
+     * @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 forbidden()
+    {
+        $this->_save($this->table, ['status' => 0]);
+        $this->success('已下架!');
     }
 
     /**

+ 5 - 0
application/operate/view/supplier_goods/index.html

@@ -28,6 +28,11 @@
             <td class='text-left' style="width: 20%">
 
                 <a data-title="编 辑" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}&supplier_id={$vo.supplier_id}&source={$Think.get.source}'>编 辑</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"  onclick="btn_confirm('启用','enable','{$vo.id}');">启 用</span>
+                {/if}
                 <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
             </td>
         </tr>