WIN-2308041133\Administrator 5 days ago
parent
commit
c10d154f13

+ 2 - 1
app/admin/controller/store/StoreProduct.php

@@ -22,7 +22,7 @@ use crmeb\services\{
 };
 use crmeb\traits\CurdControllerTrait;
 use think\facade\Route as Url;
-use app\admin\model\system\{SystemAdmin, SystemAttachment, ShippingTemplates};
+use app\admin\model\system\{SystemAdmin, SystemAttachment, ShippingTemplates, SystemStore};
 
 
 /**
@@ -201,6 +201,7 @@ class StoreProduct extends AuthController
             $menus[] = ['value' => $menu['id'], 'label' => $menu['html'] . $menu['cate_name'], 'disabled' => $menu['pid'] == 0 ? 0 : 1];//,'disabled'=>$menu['pid']== 0];
         }
         $data['tempList'] = ShippingTemplates::order('sort', 'desc')->field(['id', 'name'])->select()->toArray();
+        $data['merList'] = SystemStore::where('is_show',1)->where('is_del',0)->order('id', 'desc')->field(['id', 'name as store_name'])->select()->toArray();
         $data['cateList'] = $menus;
         $data['productInfo'] = [];
         if ($id) {

+ 25 - 0
app/admin/view/store/store_product/create.php

@@ -630,6 +630,21 @@
                                         </div>
                                     </div>
                                 </div>
+                                <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
+                                    <div class="grid-demo grid-demo-bg1">
+                                        <div class="layui-form-item">
+                                            <label class="layui-form-label">门店选择<i class="red">*</i></label>
+                                            <div class="layui-input-block">
+                                                <select name="mer_id" lay-filter="mer_id">
+                                                    <option value="0">请选择</option>
+                                                    <option :value="item.id" v-for="item in merList"
+                                                            :selected=" item.id == formData.mer_id ? true : false ">{{item.store_name}}</option>
+                                                </select>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+
                                 <div class="layui-row layui-col-space15">
                                     <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
                                         <div class="grid-demo grid-demo-bg1">
@@ -1015,12 +1030,15 @@
             cateList: [],
             //运费模板
             tempList: [],
+            //门店
+            merList: [],
             upload: {
                 videoIng: false
             },
             formData: {
                 cate_id: [],
                 temp_id: 0,
+                mer_id: 0,
                 commission: 0,
                 store_name: '',
                 keyword: '',
@@ -1245,6 +1263,7 @@
                 })).then(function (res) {
                     that.$set(that, 'cateList', res.data.cateList);
                     that.$set(that, 'tempList', res.data.tempList);
+                    that.$set(that, 'merList', res.data.merList);
                     var productInfo = res.data.productInfo || {};
                     if (productInfo.id && that.id) {
                         that.$set(that, 'formData', productInfo);
@@ -1510,6 +1529,9 @@
                         that.form.on('select(temp_id)', function (data) {
                             that.$set(that.formData, 'temp_id', data.value);
                         });
+                        that.form.on('select(mer_id)', function (data) {
+                            that.$set(that.formData, 'mer_id', data.value);
+                        });
                         that.form.on('select(rule_index)', function (data) {
                             that.ruleIndex = data.value;
                         });
@@ -1598,6 +1620,9 @@
                 if (!that.formData.temp_id) {
                     return that.showMsg('请选择运费模板');
                 }
+                if (!that.formData.mer_id) {
+                    return that.showMsg('请选择门店');
+                }
                 if (!that.formData.store_name) {
                     return that.showMsg('请填写商品名称');
                 }