Browse Source

订单系统

zhangjinxing 3 years ago
parent
commit
3d7d1fac8f
2 changed files with 58 additions and 78 deletions
  1. 20 3
      src/views/interest/handover/addEdit.vue
  2. 38 75
      src/views/purchaseIn/storeGoods/index.vue

+ 20 - 3
src/views/interest/handover/addEdit.vue

@@ -33,7 +33,13 @@
               />
             </el-form-item>
             <el-form-item label="离职人" prop="resign_name">
-              <el-input v-model="ruleForm.resign_name" :disabled="isDetail" />
+              <search-account
+                :value="ruleForm.resign_name"
+                :size="searchSize"
+                :disabled="isDetail"
+                :placeholder="'请输入用户名账号'"
+                @searchChange="handleD"
+              />
             </el-form-item>
             <el-form-item label="接受人部门" prop="Handover_part">
               <all-organize
@@ -44,7 +50,12 @@
               />
             </el-form-item>
             <el-form-item label="接受人" prop="hand_name">
-              <el-input v-model="ruleForm.hand_name" :disabled="isDetail" />
+              <search-account
+                :value="ruleForm.hand_name"
+                :size="searchSize"
+                :disabled="isDetail"
+                :placeholder="'请输入用户名账号'"
+              />
             </el-form-item>
           </el-form>
         </el-col>
@@ -136,6 +147,7 @@ export default {
     },
     async initForm() {
       this.loading = true;
+      // console.log(this.id);add
       if (this.id === "add") {
         this.title = "添加离职交接";
         this.rulesThis = this.rules;
@@ -187,7 +199,10 @@ export default {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           this.ruleForm = {
-            name: "", // 离职交接名称
+            resign_name: "", //离职人
+            leaves_part: [], //离职人部门
+            hand_name: "", //交接人
+            Handover_part: [], //交接人部门
           };
         }
       });
@@ -210,9 +225,11 @@ export default {
             Handover_part: this.ruleForm.Handover_part,
           };
           let res = {};
+          console.log(this.id);
           if (this.id === "add") {
             delete model["id"];
             res = await asyncRequest.add(model);
+            console.log(res);
           } else {
             res = await asyncRequest.update(model);
           }

+ 38 - 75
src/views/purchaseIn/storeGoods/index.vue

@@ -10,7 +10,6 @@
         :columns="columns"
         :page="pageInfo"
         :size="size"
-        :min-width="100"
         @page-curr-change="handlePageChange"
         @page-size-change="handleSizeChange"
         @screen-reset="
@@ -32,6 +31,8 @@
                   <search-supplier
                     :placeholder="'请输入供应商'"
                     :size="searchSize"
+                    :value="parmValue.gys_code"
+                    @searchChange="handleValue"
                   ></search-supplier>
                 </el-col>
                 <el-col :span="4" style="width: 200px; padding-left: 10px">
@@ -40,25 +41,6 @@
                     :size="searchSize"
                   ></search-stock>
                 </el-col>
-                <!-- <el-col :span="4" style="width: 200px; padding-left: 10px">
-                  <el-input
-                    :size="searchSize"
-                    placeholder="请输入商品名称"
-                    v-model="product_name"
-                    clearable
-                  >
-                  </el-input>
-                </el-col>
-
-                <el-col :span="4" style="width: 200px; padding-left: 10px">
-                  <el-input
-                    :size="searchSize"
-                    placeholder="请输入商品编码"
-                    v-model="product_code"
-                    clearable
-                  >
-                  </el-input>
-                </el-col> -->
                 <el-col :span="4" style="width: 54px">
                   <el-button
                     :size="searchSize"
@@ -93,7 +75,7 @@
                   <el-input
                     :size="searchSize"
                     placeholder="请输入商品名称"
-                    v-model="product_name"
+                    v-model="parmValue.good_name"
                     clearable
                   >
                   </el-input>
@@ -103,7 +85,7 @@
                   <el-input
                     :size="searchSize"
                     placeholder="请输入商品编码"
-                    v-model="product_code"
+                    v-model="parmValue.good_code"
                     clearable
                   >
                   </el-input>
@@ -115,7 +97,7 @@
         <template #status="{ scope }">
           <el-tag
             :size="tablebtnSize"
-            :type="scope.row.status == '0' ? 'warning' : ''"
+            :type="scope.row.bstatus == '0' ? 'warning' : ''"
             v-text="
               (statusOptions.find((item) => item.id == scope.row.bstatus) || {})
                 .label || '--'
@@ -131,7 +113,10 @@
             content="下架"
             placement="top"
           >
-            <p @click="statusConfirm(scope.row.id, scope.row.bstatus)">上架</p>
+            <i
+              class="el-icon-upload2 tb-icon"
+              @click="statusConfirm(scope.row.id, scope.row.bstatus)"
+            ></i>
           </el-tooltip>
           <el-tooltip
             v-if="
@@ -141,7 +126,10 @@
             content="上架"
             placement="top"
           >
-            <p @click="statusConfirm(scope.row.id, scope.row.bstatus)">下架</p>
+            <i
+              class="el-icon-download tb-icon"
+              @click="statusConfirm(scope.row.id, scope.row.bstatus)"
+            ></i>
           </el-tooltip>
         </template>
       </ex-table>
@@ -197,11 +185,9 @@ export default {
   },
   data() {
     return {
+      gys_code: "", //供应商编码
       product_code: "", //商品编码
       product_name: "", //商品名称
-      // product_options: [],
-      // code_options: [],
-      // 饿了么
       product: "", //商品名称绑定的数据
       sitem: null,
       // 渲染当前状态
@@ -216,7 +202,7 @@ export default {
       modelId: 0,
       parmValue: {
         page: 1, // 页码
-        size: 100, // 每页显示条数
+        size: 15, // 每页显示条数
         good_code: "", //商品编码
         good_name: "", //商品名称
         gys_code: "", //供应商编码
@@ -241,18 +227,24 @@ export default {
       },
       columns: [
         {
-          prop: "id",
-          label: "商品ID",
-          width: "60px",
+          prop: "good_code",
+          label: "商品编码",
+          width: "150",
+        },
+        {
+          prop: "gys_code",
+          label: "供应商编码",
+          width: "150",
         },
         {
           prop: "brand",
           label: "品牌",
+          "min-width": "80",
         },
         {
           prop: "good_name",
           label: "商品名称",
-          // min-width: "200",
+          "min-width": "120",
         },
 
         {
@@ -267,13 +259,14 @@ export default {
           prop: "material",
           label: "商品材质",
         },
-        {
-          prop: "specs",
-          label: "商品规格",
-        },
+        // {后端有接口但是没有值。
+        //   prop: "specs",
+        //   label: "商品规格",
+        // },
         {
           prop: "unit",
           label: "单位",
+          width: "50",
         },
         {
           prop: "good_type",
@@ -282,6 +275,7 @@ export default {
         {
           prop: "cg_saler",
           label: "采购员",
+          width: "60",
         },
         {
           prop: "usable_stock",
@@ -297,19 +291,7 @@ export default {
         {
           prop: "supplier_name",
           label: "供货商",
-        },
-
-        {
-          prop: "type_code",
-          label: "商品属性编码",
-        },
-        {
-          prop: "good_code",
-          label: "商品编码",
-        },
-        {
-          prop: "gys_code",
-          label: "供应商编码",
+          "min-width": "160",
         },
         {
           prop: "",
@@ -333,7 +315,7 @@ export default {
         good_name: "", //商品名称
         gys_code: "", //供应商编码
         page: 1, // 页码
-        size: 100, // 每页显示条数
+        size: 15, // 每页显示条数
       };
       this.searchList();
     },
@@ -376,14 +358,9 @@ export default {
     // 获取商品列表功能函数
     async searchList() {
       this.loading = true;
-      // console.log(this.product_name);
-      // console.log(this.product_code);
-      console.log(this.parmValue);
 
+      console.log(this.parmValue);
       const res = await asyncRequest.list(this.parmValue);
-      console.log(this.product_name);
-      this.parmValue.good_name = this.product_name;
-      this.parmValue.good_code = this.product_code;
       if (res && res.code === 0 && res.data) {
         res.data.list.forEach((element) => {
           element.classArr = `${element.sort_f}/${element.sort_s}${element.sort_t}`;
@@ -438,24 +415,10 @@ export default {
           console.log("取消");
         });
     },
-    // // 饿了么
-    // async remoteMethod(query) {
-    //   if (query !== "") {
-    //     // let parmValue = {
-    //     //   page: 1,
-    //     //   size: 100,
-    //     // };
-    //     this.product_options = this.tableData.filter((item) => {
-    //       return item.good_name.toLowerCase().indexOf(query.toLowerCase()) > -1;
-    //     });
-    //   } else {
-    //     this.product_options = [];
-    //   }
-    // },
-    // selectProduct(val) {
-    //   // console.log(val);
-    //   console.log(this.product_name);
-    // },
+    handleValue(e) {
+      console.log(e);
+      this.parmValue.gys_code = e.code;
+    },
   },
 };
 </script>