Преглед изворни кода

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

csx пре 3 година
родитељ
комит
03f1e76923

+ 5 - 4
src/api/supply.js Прегледај датотеку

@@ -275,11 +275,12 @@ export function updatesupply(data) {
275 275
   })
276 276
 }
277 277
 
278
-// export function updatesupply(data) {
278
+
279
+// export function getsupplytype(params) {
279 280
 //   return request({
280
-//     url: '/api/supply/updatesupply' ,
281
-//     method: 'post',
282
-//     data: data
281
+//     url: '/api/supply/getsupplytype' ,
282
+//     method: 'get',
283
+//     params: params
283 284
 //   })
284 285
 // }
285 286
 

+ 35 - 15
src/xt_pages/supply/components/addSupply.vue Прегледај датотеку

@@ -60,12 +60,7 @@
60 60
         </el-row>
61 61
       </el-form>
62 62
 
63
-      <el-form
64
-        :rules="tableRules"
65
-        :model="recordInfo"
66
-        ref="recordInfo"
67
-        class="tableclass"
68
-      >
63
+      <el-form :model="recordInfo" ref="recordInfo" class="tableclass">
69 64
         <el-table
70 65
           :row-style="{ color: '#303133' }"
71 66
           :header-cell-style="{
@@ -83,10 +78,21 @@
83 78
             <template slot="header" slot-scope="scope">
84 79
               <span>联系人<span style="color: red">*</span></span>
85 80
             </template>
81
+            <!-- tableRules.name -->
86 82
             <template slot-scope="scope">
87 83
               <el-form-item
88 84
                 :prop="'contacts.' + scope.$index + '.name'"
89
-                :rules="tableRules.name"
85
+                :rules="
86
+                  scope.row.name != ''
87
+                    ? [
88
+                        {
89
+                          required: 'true',
90
+                          message: '请输入主要联系人',
91
+                          trigger: ['blur', 'change'],
92
+                        },
93
+                      ]
94
+                    : null
95
+                "
90 96
               >
91 97
                 <el-input
92 98
                   v-model="scope.row.name"
@@ -362,8 +368,17 @@ export default {
362 368
             this.$refs[formName].validate((valid) => {
363 369
               if (valid) {
364 370
                 let params = {
365
-                  ...this.supplier,
366
-                  ...this.recordInfo,
371
+                  suppliercode: this.supplier.supplierCode,
372
+                  suppliername: this.supplier.supplierName,
373
+                  // ...this.recordInfo
374
+                  id: parseInt(this.supplier_ids),
375
+                  // id:JSON.parse(this.supplier_ids),
376
+                  suppliertype: "",
377
+                  vatrate: "",
378
+                  number: "",
379
+                  bank: "",
380
+                  bankaccount: "",
381
+                  contacts: [...this.recordInfo.contacts],
367 382
                 };
368 383
                 console.log(params, "dhas");
369 384
                 savesupply(params).then((res) => {});
@@ -383,15 +398,20 @@ export default {
383 398
             this.$refs[formName].validate((valid) => {
384 399
               if (valid) {
385 400
                 let params = {
386
-                  suppliercode:this.supplier.supplierCode,
387
-                  suppliername:this.supplier.supplierName,
388
-                  tmp:"测试",
401
+                  suppliercode: this.supplier.supplierCode,
402
+                  suppliername: this.supplier.supplierName,
389 403
                   // ...this.recordInfo
390
-                  id:this.supplier_ids,
391
-                  contacts:[...this.recordInfo.contacts]
404
+                  id: parseInt(this.supplier_ids),
405
+                  // id:JSON.parse(this.supplier_ids),
406
+                  suppliertype: "",
407
+                  vatrate: "",
408
+                  number: "",
409
+                  bank: "",
410
+                  bankaccount: "",
411
+                  contacts: [...this.recordInfo.contacts],
392 412
                 };
393 413
                 console.log(this.recordInfo, "dhas");
394
-                console.log(typeof(this.supplier_ids),'oo')
414
+                console.log(typeof this.supplier_ids, "oo");
395 415
                 updatesupply(params).then((res) => {
396 416
                   console.log(res, "oo");
397 417
                 });

+ 0 - 3
src/xt_pages/supply/goodOrderQuery.vue Прегледај датотеку

@@ -267,11 +267,9 @@ export default {
267 267
           page:this.page,
268 268
           limit:this.limit,
269 269
         }
270
-       console.log("param2323322332",params)
271 270
        getAllGoodOrderList(params).then(response=>{
272 271
           if(response.data.state == 1){
273 272
             var list = response.data.data.list 
274
-            console.log("购货单列表",list)
275 273
             this.tableList = list
276 274
             var total = response.data.data.total
277 275
             this.total = total
@@ -341,7 +339,6 @@ export default {
341 339
        this.$router.push({path:"/good/order/edit?id="+val.id+"&warehousing_id="+val.warehousing_id})
342 340
      },
343 341
      toDelete(val,index){
344
-       console.log("val323223233223",val)
345 342
        if(val.is_check == 1){
346 343
          this.$message.error("已审核单据,不能删除!")
347 344
          return false

+ 25 - 48
src/xt_pages/supply/supplyQuery.vue Прегледај датотеку

@@ -15,52 +15,19 @@
15 15
         <div>
16 16
           <el-select
17 17
             v-model="type_name"
18
-            style="width: 140px; margin-right: 10px"
19
-            placeholder="请选择"
18
+            style="width: 170px; margin-right: 10px"
19
+            placeholder="请选择供应商类别"
20 20
             @change="changeTypeName"
21 21
           >
22 22
             <el-option
23
-              v-for="item in types"
23
+              v-for="item in sType"
24 24
               :key="item.id"
25
-              :label="item.type_name"
26
-              :value="item.id"
25
+              :label="item.name"
26
+              :value="item.value"
27 27
             >
28 28
             </el-option>
29 29
           </el-select>
30
-          <el-date-picker
31
-            size="small"
32
-            v-model="start_time"
33
-            prefix-icon="el-icon-date"
34
-            :editable="false"
35
-            style="width: 196px"
36
-            type="date"
37
-            placeholder="选择日期时间"
38
-            align="right"
39
-            format="yyyy-MM-dd"
40
-            value-format="yyyy-MM-dd"
41
-            @change="startTimeChange"
42
-          ></el-date-picker
43
-          >-
44
-          <el-date-picker
45
-            size="small"
46
-            v-model="end_time"
47
-            prefix-icon="el-icon-date"
48
-            :editable="false"
49
-            style="width: 196px"
50
-            type="date"
51
-            placeholder="选择日期时间"
52
-            align="right"
53
-            format="yyyy-MM-dd"
54
-            value-format="yyyy-MM-dd"
55
-            @change="endTimeChange"
56
-          ></el-date-picker>
57
-          <el-input
58
-            size="small"
59
-            style="width: 200px; margin-left: 10px"
60
-            class="filter-item"
61
-            v-model.trim="keywords"
62
-            placeholder="耗材名称"
63
-          />
30
+
64 31
           <el-button
65 32
             size="small"
66 33
             class="filter-item"
@@ -90,7 +57,7 @@
90 57
       >
91 58
         <el-table-column prop="SupplierType" label="供应商类别" align="center">
92 59
           <template slot-scope="scope">
93
-            <span>{{ scope.row.SupplierType }}</span>
60
+            <span>{{ scope.row.TypeName }}</span>
94 61
           </template>
95 62
         </el-table-column>
96 63
         <el-table-column prop="SupplierCode" label="供应商编码" align="center">
@@ -175,13 +142,11 @@
175 142
 <script>
176 143
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
177 144
 import addSupply from "./components/addSupply.vue";
178
-import {
179
-  getexporthistory,
180
-  delsupplys
181
-} from "@/api/supply";
145
+import { getexporthistory, delsupplys, getsupplytype } from "@/api/supply";
182 146
 export default {
183 147
   name: "stockIn",
184 148
   created() {
149
+    this.getsupplytype();
185 150
     // this.initSupplierData()
186 151
     this.org_id = this.$store.getters.xt_user.org_id;
187 152
 
@@ -207,7 +172,7 @@ export default {
207 172
       page: 1,
208 173
       limit: 10,
209 174
 
210
-      type_name: "",
175
+      type_name: 0,
211 176
       crumbs: [
212 177
         { path: false, name: "采购管理" },
213 178
         { path: "/supply/good/order/query", name: "供应商管理" },
@@ -226,13 +191,16 @@ export default {
226 191
       types: [],
227 192
       tableList: [],
228 193
       tyep_name: "",
194
+      sType: [],
229 195
     };
230 196
   },
197
+
231 198
   methods: {
232 199
     initData() {
233 200
       let params = {
234 201
         limit: this.limit,
235 202
         page: this.page,
203
+        ctype: this.type_name,
236 204
       };
237 205
       getexporthistory(params).then((res) => {
238 206
         if (res.data.state == 1) {
@@ -242,6 +210,15 @@ export default {
242 210
       });
243 211
     },
244 212
 
213
+    getsupplytype() {
214
+      getsupplytype().then((res) => {
215
+        if (res.data.state == 1) {
216
+          this.sType = res.data.data.list;
217
+        }
218
+        console.log(res, "oo");
219
+      });
220
+    },
221
+
245 222
     toDelete(val, index) {
246 223
       delsupplys(val.ID)
247 224
         .then((res) => {
@@ -257,15 +234,15 @@ export default {
257 234
         });
258 235
     },
259 236
 
260
-   
261
-
262 237
     toAdd(val) {
263 238
       this.$refs.addSupply.show(1, val);
264 239
     },
265 240
     toClick(data, val) {
266 241
       this.$refs.addSupply.show(data, val);
267 242
     },
268
-    changeTypeName() {},
243
+    changeTypeName() {
244
+      this.initData();
245
+    },
269 246
     startTimeChange() {},
270 247
     endTimeChange() {},
271 248
     search() {},