Browse Source

设置规格

afa 5 months ago
parent
commit
43086d40cb

+ 165 - 0
app/admin/controller/shop/CustomerSpec.php

@@ -0,0 +1,165 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\controller\shop;
+
+use app\common\controller\Backend;
+use app\admin\traits\Actions;
+use think\annotation\route\Group;
+use think\annotation\route\Route;
+use app\common\model\Customer;
+use app\common\model\StockConfig;
+use think\facade\Db;
+use app\common\model\ProductConfig;
+use app\common\model\CustomerSpec as CustomerSpecModel;
+
+#[Group("shop/customer_spec")]
+class CustomerSpec extends Backend
+{
+    use Actions{
+        index as private _index;
+        add as private _add;
+        edit as private _edit;
+        del as private _del;
+        multi as private _multi;
+    }
+
+    protected function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new CustomerSpecModel();
+        $this->assign('customerList', Customer::where('status', 1)->column('name','id'));
+        $this->assign('fieldList', StockConfig::where('type_id', 'variety_name')->order('sort desc')->column('title','id'));
+    }
+
+    //查看
+    #[Route("GET,JSON","index")]
+    public function index()
+    {
+        return $this->_index();
+    }
+  /**
+     * 添加
+     */
+    #[Route('GET,POST','add')]
+    public function add()
+    {
+        if (false === $this->request->isPost()) {
+            return $this->fetch();
+        }
+       
+        $customer_id =$this->request->post('customer_id/d', 0);
+        $type_box    =$this->request->post('type_box');
+        $type_list   =$this->request->post('type_list');
+        if(empty($customer_id) || empty($type_box) || empty($type_list)) return resp_json(0,'请填写完整信息');
+        $specsList = [];
+        foreach ($type_box as $item) {
+           if(empty($item['price'])) return resp_json(0, '请填写发货价格');
+           $specsList[] = ['type_id'=> $item['type_id'], 'type_name'=> $item['type_name'],'specs_id'=>$item['value'],'specs_name'=>$item['name'], 'price'=> $item['price']];
+        }
+        if($this->model->where('customer_id', $customer_id)->count()>0) return resp_json(0,'客户信息已存在');
+        $result = false;
+        Db::startTrans();
+        try {
+
+            $result = $this->model->save([
+                'customer_id'=> $customer_id,
+                'variety'    => json_encode($type_list, JSON_UNESCAPED_UNICODE),
+                'specs'      => json_encode($type_box, JSON_UNESCAPED_UNICODE),
+            ]);
+            if($this->callback){
+                $callback=$this->callback;
+                $callback($this->model);
+            }
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if ($result === false) {
+            $this->error(__('没有新增任何数据'));
+        }
+        return resp_json(200,'操作成功');
+    }
+
+    /**
+     * 编辑
+     */
+    #[Route('GET,POST','edit')]
+    public function edit(mixed $row=null)
+    {   
+        if (false === $this->request->isPost()) {
+            $ids = $this->request->get('ids');
+            if(!$row || is_array($row)){
+                $row = $this->model->find($ids);
+            }
+            if (!$row) {
+                $this->error(__('没有找到记录'));
+            }
+            $row->customer_id = (string)$row->customer_id;
+            $row->specs = json_decode($row->specs, true);
+            $row->variety = json_decode($row->variety, true);
+            $this->assign('row', $row);
+            return $this->fetch();
+        }
+        $params = $this->request->post("");
+        if(empty($params['ids']) || empty($params['type_box']) || empty($params['type_list'])) return resp_json(0,'请填写完整信息');
+        $specsList = [];
+        foreach ($params['type_box'] as $item) {
+           if(empty($item['price'])) return resp_json(0, '请填写发货价格');
+           $specsList[] = ['type_id'=> $item['type_id'], 'type_name'=> $item['type_name'],'specs_id'=>$item['value'],'specs_name'=>$item['name'], 'price'=> $item['price']];
+        }
+       
+        $result = false;
+        Db::startTrans();
+        try {
+         
+            $result = $this->model->where('id', $params['ids'])->save([
+                'variety'    => json_encode($params['type_list'], JSON_UNESCAPED_UNICODE),
+                'specs'      => json_encode($params['type_box'], JSON_UNESCAPED_UNICODE),
+            ]);
+            if($this->callback){
+                $callback=$this->callback;
+                $callback($row);
+            }
+            Db::commit();
+        } catch (\Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('没有数据被更新'));
+        }
+        return resp_json(200,'操作成功');
+    }
+
+    //删除
+    #[Route("GET,POST","del")]
+    public function del()
+    {
+        //通过定义callback回调函数来执行删除后的操作
+        $this->callback=function ($ids){};
+        return $this->_del();
+    }
+
+    //更新
+    #[Route("GET,POST","multi")]
+    public function multi()
+    {
+        //通过定义callback回调函数来执行更新后的操作
+        $this->callback=function ($ids,$field,$value){};
+        return $this->_multi();
+    }
+
+    #[Route('GET','get_box')]
+    public function get_box()
+    {
+        if($this->request->isAjax()){
+            $type_id = $this->request->get('type_id/d', 0);
+            if(empty($type_id)) return resp_json(0, '参数错误');
+            $list = ProductConfig::where('type_id', $type_id)->order('sort desc')->field('id, title')->select();
+            return json($list, 200);
+        }
+    }
+
+}

+ 20 - 9
app/admin/controller/shop/ShopList.php

@@ -27,10 +27,10 @@ class ShopList extends Backend
         parent::_initialize();
         $this->model = new ShopListModel();
 
-        $this->assign('customerList', Customer::where('status',Customer::STATUS_NORMAL)->column('name','id'));
-        $this->assign('platformList', config("app.platform_list"));
+        $this->assign('customerList', Customer::where('status', 1)->column('name','id'));
+        $this->assign('platformList', site_config('addonsd.platform_list'));
         $this->assign('userList', User::where('status',Customer::STATUS_NORMAL)->column('nickname','id'));
-        
+        $this->assign('fieldList', StockConfig::where('type_id', 'variety_name')->order('sort desc')->column('title','id'));
         $this->relationField=['customer','staff'];
     }   
 
@@ -44,6 +44,7 @@ class ShopList extends Backend
             $type_id = $this->request->post('type_id');
             $specs   = $this->request->post('type_box');
             $specsList = [];
+          
             foreach ($specs as $item) {
                if(empty($item['price'])) return resp_json(0, '请填写发货价格');
                $specsList[] = ['name'=>$item['name'], 'price'=> $item['price']];
@@ -58,9 +59,7 @@ class ShopList extends Backend
           
             $ids = $this->request->get('ids/d', 0);
             $rows = $this->model::find($ids);
-            $fieldList= StockConfig::where('type_id', 'variety_name')->column('field_name','id');
-            $this->assign('rows', $rows);
-            $this->assign('fieldList',$fieldList);
+            $this->assign('row', $rows);
             return $this->fetch();
         }
     }
@@ -70,10 +69,22 @@ class ShopList extends Backend
     public function get_box()
     {
         if($this->request->isAjax()){
+         
+            $customer_id = $this->request->get('customer_id/d', 0);
             $type_id = $this->request->get('type_id/d', 0);
-            if(empty($type_id)) return resp_json(0, '参数错误');
-            $list = ProductConfig::where('type_id', $type_id)->order('sort desc')->field('another_name, title')->select();
-            return json($list, 200);
+            if(empty($type_id) || empty($customer_id)) return resp_json(0, '参数错误');
+            $rows = $this->model::where('customer_id', $customer_id)->order('sort desc')->find();
+            if($rows->specs){
+
+                $specs = json_decode($rows->specs, true);
+
+                dump($specs);die;
+                foreach ($specs['specs'] as $item) {
+
+                }
+            }
+
+            return json($rows, 200);
         }
     }
  

+ 137 - 0
app/admin/view/shop/customer_spec/add.html

@@ -0,0 +1,137 @@
+<template>
+    <el-card shadow="never" style="border: 0;">
+
+        <el-form ref="form" :model="form" label-width="80px" border stripe>
+
+            <el-form-item label="客户名称">
+                <el-select v-model="value" placeholder="请选择" @change="changeCustomer">
+                    <el-option
+                      v-for="item in customerList"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+            </el-form-item>
+
+            <el-form-item label="品种">
+                <el-checkbox-group v-model="form.nameValue">
+                    <el-checkbox :label="item.label" :value="JSON.stringify(item)" v-for="(item, index) in options"
+                        :key="index" @change="changeType">
+                    </el-checkbox>
+                </el-checkbox-group>
+            </el-form-item>
+            <el-form-item label="规格">
+                <el-table :data="tableData" style="border: 1px solid rgb(235, 235, 235); border-radius: 6px">
+                    <el-table-column prop="name" label="规格" width="200">
+                    </el-table-column>
+
+                    <el-table-column prop="price" label="发货价格" align="center">
+                        <template #default="{row}">
+                            <el-input v-model="row.price" placeholder="发货价格"></el-input>
+                        </template>
+                    </el-table-column>
+                    <el-table-column  label="操作" width="120" header-align="right">
+                        <template  #default="scope">
+                            <el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text"
+                                size="small">
+                                移除
+                            </el-button>
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" @click="onSubmit">立即创建</el-button>
+                <el-button>取消</el-button>
+            </el-form-item>
+        </el-form>
+    </el-card>
+</template>
+<script>
+    import form from "@components/Form.js";
+    var typeList = [], boxList = [], customerList = [], customer = 0;
+    export default {
+        components: { 'YunForm': form },
+        data() {
+            return {
+                row: Yunqi.data.row,
+                tableData: [],
+                value: "",
+                form: {
+                    nameValue: [],
+                },
+                options: typeList,
+                customerList: customerList,
+            }
+        },
+        methods: {
+            //获取客户
+            changeCustomer: function (data) {
+                customer =data
+            },
+            //获取规格
+            changeType: function (data, row) {
+                let obj = JSON.parse(row.target.value);
+
+                //品种去重
+                let idx = boxList.findIndex(item => item.value == obj.value);
+                if (idx != -1) {
+                    boxList.splice(idx, 1)
+                }else{
+                    boxList.push({ label: obj.label, value: obj.value });
+                }
+                Yunqi.ajax.get('shop/customer_spec/get_box', { type_id: obj.value }, false, false, true).then(res => {
+                    //编辑数据
+                    if (res.length > 0) {
+                        for (var key in Object(res)) {
+                            let index = this.tableData.findIndex(item => item.value == res[key]['id']);
+                            if (index != -1) {
+                            
+                                this.tableData.splice(index, 1)
+                            } else {
+                           
+                                this.tableData.push({ name: res[key]['title'], value: res[key]['id'], price: res[key]['price'], type_id:obj.value, type_name: obj.label });
+                            }
+                        }
+                    }
+                });
+            },
+            onSubmit() {
+                //获取规格
+                if (this.tableData == "" || boxList.length == 0 || customer=="") return;
+                Yunqi.ajax.post('shop/customer_spec/add', {customer_id: customer, type_list: boxList, type_box: this.tableData }, false, false, true).then(res => {
+                    if (res.code == 200) {
+                        this.$message.success(__('设置成功'));
+                        Yunqi.api.closelayer(Yunqi.app.window.id, true);
+                    } else {
+                        this.$message.error(res.msg);
+                        return false;
+                    }
+                });
+
+            },
+
+            deleteRow(index, rows) {
+                rows.splice(index, 1);
+            }
+        },
+        onLoad: function () {
+            
+            let type = Yunqi.data.fieldList;
+            //全部品种
+            for (var key in Object(type)) {
+                typeList.push({ label: type[key], value: key });
+            }
+            //全部客户
+            let customer = Yunqi.data.customerList;
+            for (var key in Object(customer)) {
+                customerList.push({ label: customer[key], value: key });
+            }
+            
+        },
+    }
+</script>
+<style>
+
+</style>

+ 138 - 0
app/admin/view/shop/customer_spec/edit.html

@@ -0,0 +1,138 @@
+<template>
+      <el-card shadow="never" style="border: 0;">
+            
+            <el-form-item label="客户名称">
+                  <el-select v-model="value" placeholder="请选择" @change="changeCustomer" disabled >
+                      <el-option
+                        v-for="item in customerList"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value">
+                      </el-option>
+                    </el-select>
+            </el-form-item>
+
+          <el-form ref="form" :model="form" label-width="80px" border stripe>
+              <el-form-item label="品种">
+                  <el-checkbox-group v-model="form.nameValue">
+                      <el-checkbox :label="item.label" :value="JSON.stringify(item)" v-for="(item, index) in options"
+                          :key="index" @change="changeType">
+                      </el-checkbox>
+                  </el-checkbox-group>
+  
+              </el-form-item>
+              <el-form-item label="规格">
+                  <el-table :data="tableData" style="border: 1px solid rgb(235, 235, 235); border-radius: 6px">
+                      <el-table-column prop="name" label="规格" width="200">
+                      </el-table-column>
+                      <el-table-column prop="price" label="发货价格" align="center">
+                        <template #default="{row}">
+                            <el-input v-model="row.price" placeholder="发货价格"></el-input>
+                        </template>
+                    </el-table-column>
+                      <el-table-column  label="操作" width="120" header-align="right">
+                          <template  #default="scope">
+                              <el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text"
+                                  size="small">
+                                  移除
+                              </el-button>
+                          </template>
+                      </el-table-column>
+                  </el-table>
+              </el-form-item>
+              <el-form-item>
+                  <el-button type="primary" @click="onSubmit">立即创建</el-button>
+                  <el-button>取消</el-button>
+              </el-form-item>
+          </el-form>
+      </el-card>
+  </template>
+  <script>
+      import form from "@components/Form.js";
+      var typeList = [], boxList = [], customerList = [], customer = 0;
+      export default {
+          components: { 'YunForm': form },
+          data() {
+              return {
+                  row: Yunqi.data.row,
+                  tableData: Yunqi.data.row.specs,
+                  value: Yunqi.data.row.customer_id,
+                  form: {
+                      nameValue: Yunqi.data.row.variety,
+                  },
+                  options: typeList,//品种
+                  customerList: customerList, //客户列表
+              }
+          },
+          methods: {
+         
+            changeType: function (data, row) {
+                  //获取规格
+                  let obj = JSON.parse(row.target.value);
+                  //品种去除
+                  let idx = boxList.findIndex(item => item.value == obj.value);
+                  if (idx != -1) {
+                        boxList.splice(idx, 1)
+                  }else{
+                        boxList.push({ label: obj.label, value: obj.value });
+                  }
+                  Yunqi.ajax.get('shop/customer_spec/get_box', { type_id: obj.value }, false, false, true).then(res => {
+  
+                      //编辑数据
+                      if (res.length > 0) {
+                          for (var key in Object(res)) {
+                              let index = this.tableData.findIndex(item => item.value == res[key]['id']);
+                              if (index != -1 ) {
+                                  this.tableData.splice(index, 1)
+                              }else {
+                                this.tableData.push({ name: res[key]['title'], value: res[key]['id'], price: res[key]['price'], type_id:obj.value, type_name: obj.label });
+                              }
+                          }
+                      }
+                  });
+              },
+              onSubmit() {
+                  //获取规格
+                  if (this.tableData == "" || boxList.length == 0 ) return;
+            
+                  Yunqi.ajax.post('shop/customer_spec/edit', {ids: Yunqi.data.row.id, type_list: boxList, type_box: this.tableData }, false, false, true).then(res => {
+                      if (res.code == 200) {
+                          this.$message.success(__('设置成功'));
+                          Yunqi.api.closelayer(Yunqi.app.window.id, true);
+                      } else {
+                          Yunqi.alert(__('请填写发货价格'), __('温馨提示'), { type: 'error' });
+                      }
+                  });
+  
+              },
+  
+              deleteRow(index, rows) {
+                  rows.splice(index, 1);
+              }
+          },
+          onLoad: function () {
+                       
+            for (let index = 0; index < this.form.nameValue.length; index++) {
+                this.form.nameValue[index] = JSON.stringify(this.form.nameValue[index]);
+            }
+            let type = Yunqi.data.fieldList;
+            //全部品种
+            for (var key in Object(type)) {
+                typeList.push({ label: type[key], value: key });
+            }
+            //全部客户
+            let customer = Yunqi.data.customerList;
+            for (var key in Object(customer)) {
+                customerList.push({ label: customer[key], value: key });
+            }
+            
+            //品种
+            for (var key in Object(Yunqi.data.row.variety)) {
+                boxList[key] = JSON.parse(Yunqi.data.row.variety[key]);
+            }
+          },
+      }
+  </script>
+  <style>
+  
+  </style>

+ 89 - 0
app/admin/view/shop/customer_spec/index.html

@@ -0,0 +1,89 @@
+<template>
+    <el-card shadow="never">
+        <yun-table
+                :columns="columns"
+                ref="yuntable"
+                @render="onTableRender"
+                toolbar="refresh,add,edit,del"
+                :auth="{
+                    add:{:$auth->check('app\\admin\\controller\\shop\\CustomerSpec','add')},
+                    edit:{:$auth->check('app\\admin\\controller\\shop\\CustomerSpec','edit')},
+                    del:{:$auth->check('app\\admin\\controller\\shop\\CustomerSpec','del')},
+                    multi:{:$auth->check('app\\admin\\controller\\shop\\CustomerSpec','multi')},
+                }"
+                :extend="extend">
+        </yun-table>
+    </el-card>
+</template>
+<script>
+import table from "@components/Table.js";
+export default{
+    components:{
+        'YunTable':table
+    },
+    data:{
+        extend:{
+            index_url: 'shop/customer_spec/index',
+            add_url: 'shop/customer_spec/add',
+            edit_url: 'shop/customer_spec/edit',
+            del_url: 'shop/customer_spec/del',
+            multi_url: 'shop/customer_spec/multi',
+        },
+        columns:[
+            {checkbox: true,selectable:function (row,index){
+                //可以根据业务需求返回false让某些行不可选中
+                return true;
+            }},
+            {field:"id",title:"主键",operate:false},
+            {field:"customer_id",title:"客户ID"},
+            {field:"variety",title:"品种",operate:false},
+            {field:"specs",title:"品种规格",operate:false},
+            {field:"create_time",title:"创建时间",operate:"daterange",formatter:Yunqi.formatter.datetime},
+            {field:"update_time",title:"修改时间",operate: false,formatter:Yunqi.formatter.datetime},
+            {
+                field: 'operate',
+                title: __('操作'),
+                width:130,
+                action:{
+                    edit:function(row){
+                        //可以根据业务需求返回false让按钮不显示
+                        return true
+                    },
+                    del:true,
+                }
+            }
+        ]
+    },
+    //页面加载完成时执行
+    onLoad:function(query){
+        console.log(query);
+    },
+    //页面初始显示或在框架内显示时执行
+    onShow:function(){
+
+    },
+    //页面在框架内隐藏时执行
+    onHide:function(){
+
+    },
+    //页面在框架内关闭时执行
+    onUnload:function(){
+
+    },
+    methods: {
+        onTableRender:function(list){
+            //表格渲染完成后执行
+            /**
+             * table常用方法
+             * this.$refs.yuntable.reset();//重新渲染整个组件,当columns修改时,需要重新渲染表格才能生效,可以执行该方法。
+             * this.$refs.yuntable.reload();//保持当前的page,重新获取数据
+             * this.$refs.yuntable.submit();//返回第一页,重新获取数据
+             * this.$refs.yuntable.expandAllTree();//树形表格展开所有节点
+             * this.$refs.yuntable.expandTree(topid);//树形表格展开指定节点
+             */
+        }
+    }
+}
+</script>
+<style>
+</style>

+ 51 - 54
app/admin/view/shop/shop_list/specs.html

@@ -1,23 +1,29 @@
 <template>
     <el-card shadow="never" style="border: 0;">
-  
+
         <el-form ref="form" :model="form" label-width="80px" border stripe>
             <el-form-item label="品种">
-                <el-radio-group v-model="form.nameValue">
-                    <el-radio :label="item.label" :value= "JSON.stringify(item)" v-for="(item, index) in options"
-                        :key="index" @change="changeType"></el-radio>
-                </el-radio-group>
+                <el-checkbox-group v-model="form.nameValue">
+                    <el-checkbox :label="item.label" :value="JSON.stringify(item)" v-for="(item, index) in options"
+                        :key="index" @change="changeType">
+                    </el-checkbox>
+                </el-checkbox-group>
             </el-form-item>
+
             <el-form-item label="规格">
                 <el-table :data="tableData" style="border: 1px solid rgb(235, 235, 235); border-radius: 6px">
                     <el-table-column prop="name" label="规格" width="200">
                     </el-table-column>
-                    
-                    <el-table-column prop="price" label="发货价格" align="center">
-                        <template #default="{row}">
-                            <el-input v-model="row.price" placeholder="发货价格"></el-input>
+
+                    <el-table-column  label="操作" header-align="right">
+                        <template  #default="scope">
+                            <el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text"
+                                size="small">
+                                移除
+                            </el-button>
                         </template>
                     </el-table-column>
+
                 </el-table>
             </el-form-item>
             <el-form-item>
@@ -29,74 +35,65 @@
 </template>
 <script>
     import form from "@components/Form.js";
-    var typeList = [], boxList=[], field_name = '';
+    var typeList = [], boxList = [], field_name = '';
     export default {
         components: { 'YunForm': form },
         data() {
             return {
                 row: Yunqi.data.row,
-                tableData: boxList,
-                value:0,
+                tableData: Yunqi.data.row.type_spec,
+                value: 0,
                 form: {
-                    nameValue: "",
+                    nameValue: Yunqi.data.row.variety,
                 },
-                options: typeList,
+                options: typeList,//品种
             }
         },
         methods: {
             changeType: function (data, row) {
-                this.tableData = []
+        
                 //获取规格
-                data = JSON.parse(data);    
-                field_name = data.label
+                let obj = JSON.parse(row.target.value);
+                Yunqi.ajax.get('shop/shop_list/get_box', {customer_id:Yunqi.data.row.customer_id, type_id: obj.value }, false, false, true).then(res => {
 
-                    Yunqi.ajax.get('shop/shop_list/get_box',{type_id: data.value},false,false,true).then(res=>{
-
-                        //编辑数据
-                        let type_spec = Yunqi.data.rows.type_spec;
-                        let type_arr = JSON.parse(type_spec);
-                        if(type_arr != null && type_arr['field_name']['type_id'] == data.value){
-                            this.tableData = type_arr['specs']
-                        }else{
-                            if(res.length > 0){
-                                for (var key in Object(res)) {
-                                    this.tableData.push({name: res[key]['title'], value: ""});
-                                }
-                            }
-                        }
-                    });
+                    //编辑数据
+                    if (res.length > 0) {
+                          for (var key in Object(res)) {
+                              let index = this.tableData.findIndex(item => item.value == res[key]['id']);
+                              if (index != -1 ) {
+                                  this.tableData.splice(index, 1)
+                              }else {
+                                this.tableData.push({ name: res[key]['title'], value: res[key]['id'], price: res[key]['price'], type_id:obj.value, type_name: obj.label });
+                              }
+                          }
+                    }
+                });
             },
             onSubmit() {
                 //获取规格
-                if(this.tableData == "")  return
-                Yunqi.ajax.post('shop/shop_list/specs',{ids:Yunqi.data.rows.id,type_id:JSON.parse(this.form.nameValue).value,field_name:field_name, type_box: this.tableData},false,false,true).then(res=>{    
-                    if(res.code == 200){
+                if (this.tableData == "") return
+                Yunqi.ajax.post('shop/shop_list/specs', { ids: Yunqi.data.rows.id, type_id: JSON.parse(this.form.nameValue).value, field_name: field_name, type_box: this.tableData }, false, false, true).then(res => {
+                    if (res.code == 200) {
                         this.$message.success(__('设置成功'));
-                        Yunqi.api.closelayer(Yunqi.app.window.id,true);
-                    }else{
-                        Yunqi.alert(__('请填写发货价格'),__('温馨提示'),{type: 'error'});
+                        Yunqi.api.closelayer(Yunqi.app.window.id, true);
+                    } else {
+                        Yunqi.alert(__('请填写发货价格'), __('温馨提示'), { type: 'error' });
                     }
                 });
-                
+
             },
-        },
-        onLoad:function (){
-      
-            let type_spec = Yunqi.data.rows.type_spec; //编辑数据
-            let type = Yunqi.data.fieldList;
-            if(type_spec != null){
-                let spec_arr = JSON.parse(type_spec)
-                let obj = {
-                    label : spec_arr.field_name.field_name,
-                    value : spec_arr.field_name.type_id,
-                }
-                this.form.nameValue = JSON.stringify(obj)
-                this.tableData = spec_arr.specs
-             
+
+            deleteRow(index, rows) {
+                rows.splice(index, 1);
             }
+        },
+        onLoad: function () {
+
+         
             //全部品种
+            let type = Yunqi.data.fieldList;
             for (var key in Object(type)) {
-                typeList.push({label: type[key], value: key});
+                typeList.push({ label: type[key], value: key });
             }
         },
     }

+ 11 - 0
app/common/model/CustomerSpec.php

@@ -0,0 +1,11 @@
+<?php
+declare(strict_types=1);
+
+namespace app\common\model;
+
+use think\Model;
+
+class CustomerSpec Extends Model
+{
+
+}

File diff suppressed because it is too large
+ 0 - 0
runtime/cache/7a/b2b683b6c3e8e0985917962d853b9c.php


Some files were not shown because too many files changed in this diff