戴艳蓉 3 years ago
parent
commit
0a58604b66

+ 9 - 4
src/components/search-good-modal/columns.js

@@ -31,11 +31,16 @@ export default [
     width: "70px",
   },
   {
-    prop: "status",
-    label: "状态",
-    _slot_: "status",
-    width: "118px",
+    prop: "good_unit",
+    label: "单位",
+    width: "45px",
+  },
+  {
+    prop: "tax",
+    label: "税率",
+    width: "45px",
   },
+  
   {
     prop: "supplierNo",
     label: "供应商编号",

+ 176 - 95
src/components/search-good-modal/main.vue

@@ -37,109 +37,186 @@
       >
         <template #table-header="{ selection }">
           <div style="width: 100%">
-            <el-row style="margin-top: -15px">
-              <el-col :span="24">
-                <el-col :span="4" style="width: 280px; padding: 0">
-                  <el-select
-                    v-model="supplierCode"
-                    multiple
-                    filterable
-                    remote
-                    :multiple-limit="1"
-                    reserve-keyword
-                    :size="searchSize"
-                    clearable
-                    style="width: 100%"
-                    :placeholder="'供应商名称'"
-                    :remote-method="remoteMethod"
-                    :loading="selectLoading"
-                    @change="supplierChange"
-                  >
-                    <el-option
-                      v-for="(item, index) in options"
-                      :key="item.id + index"
-                      :label="item.name"
-                      :value="item.code + ''"
-                      :disabled="item.status !== '1'"
-                    >
-                    </el-option>
-                  </el-select>
-                </el-col>
-                <el-col :span="4" style="width: 190px; padding: 0 0 0 10px">
-                  <el-input
-                    :size="searchSize"
-                    v-model="parmValue.good_code"
-                    :maxlength="40"
-                    clearable
-                    placeholder="商品编号"
+            <el-row style="padding: 0 0 10px 0;margin:-5px 0 0 0">
+              <el-col :span="6" style="width: 363px">
+                <good-class
+                  :value="parmValue.cat_id"
+                  @handleChange="goods_class_change"
+                  :disabled="false"
+                  :size="searchSize"
+                  :isDetail="false"
+                  :placeholder="'分类'"
+                />
+              </el-col>
+              <el-col :span="4" style="width: 145px; padding: 0 0 0 10px">
+                <search-brand
+                  :value="brandid"
+                  :disabled="type === 'view' || type === 'editCoin'"
+                  :size="'mini'"
+                  :isDetail="type !== 'add'"
+                  :names="brand_name"
+                  :placeholder="'商品品牌'"
+                  @searchChange="brandidsearchChange"
+                />
+              </el-col>
+              <el-col :span="4" style="width: 145px; padding: 0 0 0 10px">
+                <el-select
+                  v-model="parmValue.good_type"
+                  filterable
+                  clearable
+                  :size="searchSize"
+                  placeholder="是否定制"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in options1"
+                    :key="'good_type' + item.id"
+                    :label="item.name"
+                    :value="item.id"
                   />
-                </el-col>
-                <el-col :span="4" style="width: 180px; padding: 0 0 0 10px">
-                  <el-input
-                    :size="searchSize"
-                    v-model="parmValue.good_name"
-                    :maxlength="40"
-                    clearable
-                    placeholder="商品名称"
+                </el-select>
+              </el-col>
+               <el-col :span="4" style="width: 210px; padding: 0 0 0 10px">
+                <el-select
+                  v-model="parmValue.status"
+                  filterable
+                  clearable
+                  :size="searchSize"
+                  placeholder="状态"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in statusList"
+                    :key="'status' + item.code"
+                    :label="item.name"
+                    :value="item.code"
                   />
-                </el-col>
+                </el-select>
+              </el-col>
+              <el-col
+                :span="3"
+                class="fr"
+                style="width: 66px; padding: 0 0 0 10px"
+              >
+                <el-button
+                  type="primary"
+                  :size="searchSize"
+                  @click="searchList"
+                >
+                  刷新
+                </el-button>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="4" style="width: 363px">
+                <search-supplier
+                  :value="supplierNo"
+                  :placeholder="'供应商'"
+                  :disabled="false"
+                  :size="searchSize"
+                  :isDetail="false"
+                  @searchChange="supplierNosearchChange"
+                />
+              </el-col>
 
-                <el-col :span="4" style="width: 54px">
-                  <el-button
-                    :size="searchSize"
-                    type="primary"
-                    class="fr"
-                    icon="el-icon-search"
-                    @click="searchList"
-                /></el-col>
-                <el-col :span="4" style="width: 66px">
-                  <el-button
-                    type="warning"
-                    class="fr"
-                    :size="searchSize"
-                    @click="restSearch"
-                  >
-                    重置
-                  </el-button>
-                </el-col>
-                <el-col :span="3" style="width: 66px">
-                  <el-button
-                    :size="searchSize"
-                    type="primary"
-                    style="float: right; margin-left: 5px"
-                    @click="searchList"
-                  >
-                    刷新
-                  </el-button>
-                </el-col>
-                <el-col :span="3" style="width: 66px; float: right">
-                  <el-button
-                    :size="searchSize"
-                    type="success"
-                    style="float: right; margin-left: 5px"
-                    @click="resultList(selection)"
+              <el-col :span="4" style="width: 373px; padding: 0 0 0 10px">
+                <search-work-company
+                  :value="parmValue.company_id"
+                  :placeholder="'业务公司'"
+                  :disabled="false"
+                  :size="searchSize"
+                  :isDetail="false"
+                  @searchChange="company_idsearchChange"
+                />
+              </el-col>
+              <el-col
+                :span="3"
+                class="fr"
+                style="width: 66px; padding: 0 0 0 10px"
+              >
+                <el-button
+                  type="warning"
+                  :size="searchSize"
+                  @click="restSearch"
+                >
+                  重置
+                </el-button>
+              </el-col>
+            </el-row>
+            <el-row style="padding: 10px 0 0 0">
+              <el-col :span="4" style="width: 518px">
+                <el-input
+                  :size="searchSize"
+                  v-model="parmValue.name"
+                  :maxlength="40"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                  placeholder="关键字"
+                  ><el-select
+                    v-model="select"
+                    slot="prepend"
+                    style="width: 135px"
+                    placeholder="关键字类型"
                   >
-                    保存
-                  </el-button>
-                </el-col>
+                    <el-option label="商品编号" value="1" />
+                    <el-option label="商品名称" value="2" /> </el-select
+                ></el-input>
               </el-col>
+                <el-col
+                :span="3"
+                class="fr"
+                style="width: 66px; padding: 0 0 0 10px"
+              >
+                <el-button
+                  type="success"
+                  :size="searchSize"
+                  @click="resultList(selection)"
+                >
+                  保存
+                </el-button>
+              </el-col>
+             
             </el-row>
+            
+          </div>
+        </template>
+        <template #good_thumb_img="{ scope }">
+          <div
+            v-if="scope.row.good_thumb_img"
+            style="width: 20px; height: 20px"
+            class="hover"
+            v-viewer
+          >
+            <img
+              :src="scope.row.good_thumb_img"
+              style="display: inline-block; width: 100%; height: 100%"
+              alt=""
+            />
           </div>
         </template>
-           <template #good_thumb_img="{ scope }">
-        <div
-          v-if="scope.row.good_thumb_img"
-          style="width: 20px; height: 20px"
-          class="hover"
-          v-viewer
-        >
-          <img
-            :src="scope.row.good_thumb_img" 
-            style="display: inline-block; width: 100%; height: 100%"
-            alt=""
-          />
-        </div>
-      </template>
+        <template #good_type="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.good_type == '0' ? 'warning' : ''"
+            v-text="
+              (options1.find((item) => item.id == scope.row.good_type) || {})
+                .name || '--'
+            "
+          ></el-tag>
+        </template>
       </ex-table>
     </el-card>
   </el-dialog>
@@ -170,6 +247,10 @@ export default {
    */
   data() {
     return {
+      options1: [
+        { id: "0", name: "否" },
+        { id: "1", name: "是" },
+      ],
       options: [],
       selectLoading: false,
       searchName: "",

+ 1 - 1
src/views/goodStore/goodsCost/index.vue

@@ -130,7 +130,7 @@
                   parmValue.page = 1;
                   searchList();
                 "
-                placeholder="单位名称"
+                placeholder="关键字"
                 ><el-select
                   v-model="select"
                   slot="prepend"

+ 19 - 3
src/views/goodStore/goodsOnline/components/baseForm.vue

@@ -90,7 +90,12 @@
             </el-table-column>
           </el-table>
         </el-form-item>
-        <search-good-modal :showModel="showModel" :once="false"/> 
+        <!--添加商品-->
+        <search-good-modal
+          :showModel="showModel"
+          :once="false"
+          @resultList="resultList"
+        />
       </el-col>
       <el-col
         :span="24"
@@ -108,7 +113,7 @@
 import asyncRequest from "@/apis/service/goodStore/goodsCost";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
-import searchGoodModal from "@/components/search-good-modal"
+import searchGoodModal from "@/components/search-good-modal";
 // import baseFormAddEdit from "./baseFormAddEdit";
 // import costFormAddEdit from "./costFormAddEdit";
 import {
@@ -126,7 +131,7 @@ export default {
   mixins: [resToken],
   props: ["showModel", "id", "type", "sitem"],
   components: {
-    searchGoodModal 
+    searchGoodModal,
     // baseFormAddEdit,
     // costFormAddEdit,
   },
@@ -198,6 +203,17 @@ export default {
       this.costsitem = sitem;
       this.costshowModel = true;
     },
+    resultList(e) {
+      let list = JSON.parse(JSON.stringify(e));
+      let oldList = JSON.parse(JSON.stringify(this.tableData));
+      list.forEach((e, ei) => {
+        let index = oldList.findIndex((a) => e.spucode === a.spucode);
+        if (index === -1) {
+          let item = JSON.parse(JSON.stringify(list[ei]));
+          this.tableData.push(item);
+        }
+      });
+    },
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {