Selaa lähdekoodia

修改库存相关功能

csx 6 vuotta sitten
vanhempi
commit
687712c623

+ 1 - 1
config/dev.env.js Näytä tiedosto

@@ -6,5 +6,5 @@
6 6
 module.exports = {
7 7
   NODE_ENV: '"development"',
8 8
   ENV_CONFIG: '"dev"',
9
-  BASE_API: '"http://112.74.16.180:9527"',//'"http://localhost:9529"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527
9
+  BASE_API: '"http://localhost:9529"',//'"http://localhost:9529"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527
10 10
 }

+ 8 - 8
src/api/stock.js Näytä tiedosto

@@ -385,9 +385,9 @@ export function DeleteWarehouseInfoItem(params) {
385 385
   })
386 386
 }
387 387
 
388
-export function EditWarehouse(params, warehousing_time, id,type,manufacturer_id) {
388
+export function EditWarehouse(params, warehousing_time, id,type,manufacturer_id,dealer_id) {
389 389
   return request({
390
-    url: '/api/warehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id,
390
+    url: '/api/warehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
391 391
     method: 'post',
392 392
     data: params
393 393
   })
@@ -433,9 +433,9 @@ export function deleteSalesReturnInfo(params) {
433 433
   })
434 434
 }
435 435
 
436
-export function editSalesReturnInfo(params, return_time, id,type,manufacturer_id) {
436
+export function editSalesReturnInfo(params, return_time, id,type,manufacturer_id,dealer_id) {
437 437
   return request({
438
-    url: '/api/salesreturn/edit?return_time=' + return_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id,
438
+    url: '/api/salesreturn/edit?return_time=' + return_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
439 439
     method: 'post',
440 440
     data: params
441 441
   })
@@ -473,9 +473,9 @@ export function getWarehouseOutInfo(params) {
473 473
   })
474 474
 }
475 475
 
476
-export function editWarehouseoutInfo(params, warehouse_out_time, id,type,manufacturer_id) {
476
+export function editWarehouseoutInfo(params, warehouse_out_time, id,type,manufacturer_id,dealer_id) {
477 477
   return request({
478
-    url: '/api/warehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id,
478
+    url: '/api/warehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
479 479
     method: 'post',
480 480
     data: params
481 481
   })
@@ -489,9 +489,9 @@ export function getCancelStockList(params) {
489 489
   })
490 490
 }
491 491
 
492
-export function editCancelStockInfo(params, cancel_stock_time, id,type,manufacturer_id) {
492
+export function editCancelStockInfo(params, cancel_stock_time, id,type,manufacturer_id,dealer_id) {
493 493
   return request({
494
-    url: '/api/cancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id,
494
+    url: '/api/cancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id=" + dealer_id,
495 495
     method: 'post',
496 496
     data: params
497 497
   })

+ 101 - 77
src/xt_pages/stock/Dialog/goodInfoDailog.vue Näytä tiedosto

@@ -2,94 +2,118 @@
2 2
   <el-dialog width="854px" :title="titles" :visible.sync="visibility" :close-on-click-modal="isClose"
3 3
              :close-on-press-escape="isClose">
4 4
 
5
-    <el-form class="demo-form-inline"
5
+    <el-form class="demo-form-inline" style="height: 300px"
6 6
              :rules="rules" :model="form" ref="form"
7
-             label-width="116px">
8
-      <el-row>
9
-        <el-col :span="8">
10
-          <el-form-item label="商品类型" prop="good_id">
11
-            <el-select v-model="form.good_id" placeholder="请选择" size="small" >
12
-              <el-option
13
-                v-for="item in form.goodType"
14
-                :key="item.id"
15
-                :label="item.type_name"
16
-                :value="item.id">
17
-              </el-option>
18
-            </el-select>
19
-          </el-form-item>
20
-        </el-col>
21
-
22
-        <el-col :span="8">
23
-          <el-form-item label="规格名称" prop="specification_name">
24
-            <el-input  v-model="form.specification_name"></el-input>
25
-          </el-form-item>
26
-        </el-col>
27
-
28
-        <el-col :span="8">
29
-          <el-form-item label="单位" prop="good_unit">
30
-            <el-select  v-model="good_unit" @change="changeSelected" placeholder="请选择">
31
-              <el-option
32
-                v-for="item in form.goodUnit"
33
-                :key="item.id"
34
-                :label="item.name"
35
-                :value="item.id">
36
-              </el-option>
37
-            </el-select>
38
-
39
-          </el-form-item>
40
-        </el-col>
41
-      </el-row>
42
-
43
-      <el-row>
44
-
45
-        <el-col :span="8">
46
-          <el-form-item label="进货价" prop="buy_price">
47
-            <el-input  type="number" v-model="form.buy_price"></el-input>
48
-          </el-form-item>
49
-        </el-col>
50
-
51
-        <el-col :span="8">
52
-          <el-form-item label="出货价" prop="sell_price">
53
-            <el-input  type="number" v-model="form.sell_price"></el-input>
54
-          </el-form-item>
55
-        </el-col>
56
-        <el-col :span="8">
57
-          <el-form-item label="有效期预警天数" prop="expiry_date_warn_day_count">
58
-            <el-input type="number" v-model="form.expiry_date_warn_day_count"></el-input>
59
-          </el-form-item>
60
-        </el-col>
61
-
62
-
63
-      </el-row>
64
-
65
-
66
-      <el-row>
67
-
68
-        <el-col :span="8">
69
-          <el-form-item label="库存预警数量" prop="stock_warn_count">
70
-            <el-input  type="number" v-model="form.stock_warn_count"></el-input>
71
-          </el-form-item>
72
-        </el-col>
73
-
74
-
75
-        <el-col :span="16">
76
-        <el-form-item label="是否可复用" prop="is_reuse">
77
-            <el-radio v-model="form.is_reuse" label="1">可以</el-radio>
78
-            <el-radio v-model="form.is_reuse" label="2">不可以</el-radio>
79
-          </el-form-item>
80
-        </el-col>
81
-      </el-row>
7
+             label-width="140px">
8
+      <el-col :span="size">
9
+        <el-form-item label="物品类型:" prop="good_id">
10
+          <el-select v-model="form.good_id" placeholder="请选择"
11
+          >
12
+            <el-option
13
+              v-for="item in form.goodType"
14
+              :key="item.id"
15
+              :label="item.type_name"
16
+              :value="item.id">
17
+            </el-option>
18
+          </el-select>
19
+        </el-form-item>
20
+      </el-col>
21
+
22
+      <el-col :span="size">
23
+        <el-form-item label="规格名称:" prop="specification_name">
24
+          <el-input v-model="form.specification_name"></el-input>
25
+        </el-form-item>
26
+      </el-col>
27
+
28
+
29
+      <el-col :span="size">
30
+        <el-form-item label="单位:" prop="good_unit">
31
+
32
+          <el-select v-model="good_unit" @change="changeSelected" placeholder="请选择">
33
+            <el-option
34
+              v-for="item in form.goodUnit"
35
+              :key="item.id"
36
+              :label="item.name"
37
+              :value="item.id">
38
+            </el-option>
39
+          </el-select>
40
+
41
+        </el-form-item>
42
+      </el-col>
43
+
44
+      <el-col :span="size">
45
+        <el-form-item label="生产厂家:" prop="dealer">
46
+          <el-select v-model="form.manufacturer" placeholder="请选择">
47
+            <el-option
48
+              v-for="item in form.manufacturers"
49
+              :key="item.id"
50
+              :label="item.manufacturer_name"
51
+              :value="item.id">
52
+            </el-option>
53
+          </el-select>
54
+        </el-form-item>
55
+      </el-col>
56
+
57
+      <el-col :span="size">
58
+        <el-form-item label="经销商:" prop="manufacturer">
59
+          <el-select v-model="form.dealer" placeholder="请选择">
60
+            <el-option
61
+              v-for="item in form.dealers"
62
+              :key="item.id"
63
+              :label="item.dealer_name"
64
+              :value="item.id">
65
+            </el-option>
66
+          </el-select>
67
+        </el-form-item>
68
+      </el-col>
69
+
70
+
71
+      <el-col :span="size">
72
+        <el-form-item label="进货价:" prop="buy_price">
73
+          <el-input type="number" v-model="form.buy_price"></el-input>
74
+        </el-form-item>
75
+      </el-col>
76
+
77
+      <el-col :span="size">
78
+        <el-form-item label="出货价:" prop="sell_price">
79
+          <el-input type="number" v-model="form.sell_price"></el-input>
80
+        </el-form-item>
81
+      </el-col>
82
+
83
+      <el-col :span="size">
84
+        <el-form-item label="有效期预警天数:" prop="expiry_date_warn_day_count">
85
+          <el-input type="number" v-model="form.expiry_date_warn_day_count"></el-input>
86
+        </el-form-item>
87
+      </el-col>
88
+
89
+      <el-col :span="size">
90
+        <el-form-item label="库存预警数量:" prop="stock_warn_count">
91
+          <el-input type="number" v-model="form.stock_warn_count"></el-input>
92
+        </el-form-item>
93
+      </el-col>
94
+
95
+
96
+      <el-col :span="size">
97
+        <el-form-item label="是否可复用:" prop="is_reuse">
98
+          <el-radio v-model="form.is_reuse" label="1">可以</el-radio>
99
+          <el-radio v-model="form.is_reuse" label="2">不可以</el-radio>
100
+        </el-form-item>
101
+      </el-col>
102
+
82 103
 
83 104
       <el-col>
84
-        <el-form-item label="备注" prop="remark">
105
+        <el-form-item label="备注 : " prop="remark">
85 106
           <el-input type="textarea" :row="5" v-model="form.remark"
86 107
                     placeholder="请输入内容">
87 108
           </el-input>
88 109
         </el-form-item>
89 110
       </el-col>
111
+
90 112
     </el-form>
91 113
 
92 114
 
115
+
116
+
93 117
     <span slot="footer" class="dialog-footer">
94 118
     <el-button v-if="isCreated == 3" @click="cancle('form')">取 消</el-button>
95 119
     <el-button v-if="isCreated != 3 " @click="cancle('form')">取 消</el-button>

+ 41 - 9
src/xt_pages/stock/Dialog/salesReturnDialog.vue Näytä tiedosto

@@ -16,7 +16,6 @@
16 16
           highlight-current-row
17 17
           max-height="250"
18 18
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
19
-
20 19
           @current-change="goodTypeTableChange"
21 20
           style="width: 100%">
22 21
           <el-table-column
@@ -93,29 +92,63 @@
93 92
     methods: {
94 93
       hide:function(){
95 94
         this.visibility = false
95
+        this.goodInfoTableData = []
96
+
96 97
       },
97 98
       show:function(){
98 99
         this.visibility = true
99 100
       },
100 101
       goodTypeTableChange: function(currentRow, oldCurrentRow) {
101 102
         this.currentGoodTypeId = currentRow.id
102
-
103 103
         this.goodInfoTableData = []
104 104
         this.goodInfo = []
105
+        console.log(this.propForm.manufacturer)
106
+        console.log(this.propForm.dealer)
107
+        console.log(this.propForm.goodInfo)
108
+
109
+
105 110
         for (let i = 0; i < this.propForm.goodInfo.length; i++) {
106 111
           if (this.currentGoodTypeId == this.propForm.goodInfo[i].good_type_id) {
107
-            this.goodInfo.push(this.propForm.goodInfo[i])
108
-            this.goodInfoTableData.push(this.propForm.goodInfo[i])
112
+            if(this.propForm.dealer == 0 && this.propForm.manufacturer == 0){
113
+              this.goodInfo.push(this.propForm.goodInfo[i])
114
+              this.goodInfoTableData.push(this.propForm.goodInfo[i])
115
+
116
+            }else{
117
+              if(this.propForm.manufacturer == 0 && this.propForm.dealer != 0){
118
+                if(this.propForm.goodInfo[i].dealers.id == this.propForm.dealer){
119
+                  this.goodInfo.push(this.propForm.goodInfo[i])
120
+                  this.goodInfoTableData.push(this.propForm.goodInfo[i])
121
+                }
122
+              }
123
+              if(this.propForm.manufacturer != 0 && this.propForm.dealer == 0){
124
+                if(this.propForm.goodInfo[i].manufacturers.id == this.propForm.manufacturer){
125
+                  this.goodInfo.push(this.propForm.goodInfo[i])
126
+                  this.goodInfoTableData.push(this.propForm.goodInfo[i])
127
+                }
128
+              }
129
+              if(this.propForm.manufacturer != 0 && this.propForm.dealer != 0){
130
+                if(this.propForm.goodInfo[i].manufacturers.id == this.propForm.manufacturer && this.propForm.goodInfo[i].dealers.id == this.propForm.dealer){
131
+                  this.goodInfo.push(this.propForm.goodInfo[i])
132
+                  this.goodInfoTableData.push(this.propForm.goodInfo[i])
133
+                }
134
+              }
135
+            }
109 136
           }
110 137
         }
111 138
       },
112 139
       cancle: function() {
113 140
         this.$emit('dialog-cancle', this.getValue())
114 141
         this.$refs.multipleTable.clearSelection()
142
+        this.$refs.templatetable.setCurrentRow(null);
143
+        this.goodInfoTableData = []
144
+
115 145
       },
116 146
       comfirm: function() {
117 147
         this.$emit('dialog-comfirm', this.getValue())
118 148
         this.$refs.multipleTable.clearSelection()
149
+        this.$refs.templatetable.setCurrentRow(null);
150
+        this.goodInfoTableData = []
151
+
119 152
       },
120 153
       getValue: function() {
121 154
         const obj = {
@@ -126,11 +159,10 @@
126 159
       }, goodTypeSelect: function(id) {
127 160
         this.tempGoodInfo = []
128 161
         this.goodInfo = []
129
-        for (let i = 0; i < this.propForm.goodInfo.length; i++) {
130
-          if (this.propForm.goodInfo[i].good_type_id == id) {
131
-            this.tempGoodInfo.push(this.propForm.goodInfo[i])
132
-          }
133
-        }
162
+        console.log(this.propForm.manufacturer )
163
+        console.log(this.propForm.dealers )
164
+
165
+
134 166
       }, goodInfoSelect: function(id) {
135 167
         let index = 0
136 168
         for (let i = 0; i < this.propForm.goodInfo.length; i++) {

+ 10 - 0
src/xt_pages/stock/Dialog/stockInDialog.vue Näytä tiedosto

@@ -59,6 +59,16 @@
59 59
             </template>
60 60
           </el-table-column>
61 61
 
62
+          <el-table-column
63
+            align="center"
64
+            label="单价"
65
+            property="buy_price"
66
+          >
67
+            <template slot-scope="scope">
68
+              <span>{{scope.row.buy_price}}</span>
69
+            </template>
70
+          </el-table-column>
71
+
62 72
         </el-table>
63 73
       </el-col>
64 74
     </el-row>

+ 120 - 39
src/xt_pages/stock/cancelStockOrderAdd.vue Näytä tiedosto

@@ -1,7 +1,9 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+
5 7
       <div style="float:right;">
6 8
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
7 9
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
@@ -25,9 +27,22 @@
25 27
                           type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
26 28
                           value-format="yyyy-MM-dd"></el-date-picker>
27 29
         </div>
28
-        <div class="cell clearfix">
29
-          <label class="title"><span class="name">厂商<span style="color: red;margin-left: -15px">*</span></span> : </label>
30
-          <el-select  size="small"   v-model="form.manufacturer" clearable  placeholder="请选择厂商" @change="changeManufacturer()">
30
+
31
+      <div class="cell clearfix">
32
+        <label class="title"><span class="name">经销商</span> : </label>
33
+        <el-select   size="small"  v-model="form.dealer" clearable  placeholder="请选择经销商"  @change="changeDealer">
34
+          <el-option
35
+            v-for="(option, index) in dealer"
36
+            :key="index"
37
+            :label="option.dealer_name"
38
+            :value="option.id">
39
+          </el-option>
40
+        </el-select>
41
+      </div>
42
+
43
+      <div class="cell clearfix">
44
+          <label class="title"><span class="name">厂商</span> : </label>
45
+          <el-select  size="small"   v-model="form.manufacturer" clearable  placeholder="请选择厂商" @change="changeManufacturer">
31 46
             <el-option
32 47
               v-for="(option, index) in manufacturer"
33 48
               :key="index"
@@ -37,17 +52,6 @@
37 52
           </el-select>
38 53
         </div>
39 54
 
40
-        <div class="cell clearfix">
41
-          <label class="title"><span class="name">经销商</span> : </label>
42
-          <el-select   size="small"  v-model="form.dealer" clearable  placeholder="请选择经销商" >
43
-            <el-option
44
-              v-for="(option, index) in dealer"
45
-              :key="index"
46
-              :label="option.dealer_name"
47
-              :value="option.id">
48
-            </el-option>
49
-          </el-select>
50
-        </div>
51 55
 
52 56
 
53 57
     </div>
@@ -142,7 +146,12 @@
142 146
       return {
143 147
         crumbs: [
144 148
           { path: false, name: '库存管理' },
145
-          { path: false, name: '退库单' },
149
+          { path: false, name: '耗材退库单' },
150
+          { path: false, name: '新增退库单' }
151
+        ],
152
+        crumbs2: [
153
+          { path: false, name: '库存管理' },
154
+          { path: false, name: '其他退库单' },
146 155
           { path: false, name: '新增退库单' }
147 156
         ],
148 157
 
@@ -169,11 +178,13 @@
169 178
         propForm: {
170 179
           goodType: [],
171 180
           goodInfo: [],
172
-          goodUnit: []
181
+          goodUnit: [],
182
+          manufacturer: 0,
183
+          dealer: 0
173 184
         },
174 185
         form: {
175
-          manufacturer: '',
176
-          dealer: ''
186
+          manufacturer: 0,
187
+          dealer: 0
177 188
         },
178 189
         warehouseOutInfoList:[],
179 190
         manufacturer: [],
@@ -199,37 +210,53 @@
199 210
           }
200 211
         }
201 212
 
213
+        this.propForm.goodType = []
214
+
202 215
         this.currentIndex = -1
203 216
       }, cancle: function() {
204 217
         this.$refs.dialog.hide()
218
+        this.propForm.goodType = []
219
+
205 220
       }, GetConfigInfo: function() {
221
+        const loading = this.$loading({
222
+          lock: true,
223
+          text: 'Loading',
224
+          spinner: 'el-icon-loading',
225
+          background: 'rgba(0, 0, 0, 0.7)'
226
+        })
227
+
206 228
         const params = {
207 229
           type: this.$route.query.type
208 230
         }
209 231
         getCancelStockConfig(params).then(response => {
210 232
           if (response.data.state == 0) {
233
+            loading.close()
211 234
             this.$message.error(response.data.msg)
212 235
             return false
213 236
           } else {
214
-            var warehouseOutList = response.data.data.warehouseOutList
237
+            loading.close()
215 238
             var warehouseOutInfoList = response.data.data.warehouseOutInfoList
216 239
             this.warehouseOutInfoList = response.data.data.warehouseOutInfoList
217
-
218
-            for (let i = 0; i < warehouseOutList.length; i++) {
219
-              if (warehouseOutList[i].Manufacturer.id > 0) {
220
-                this.manufacturer.push(warehouseOutList[i].Manufacturer)
240
+            for (let i = 0; i < warehouseOutInfoList.length; i++) {
241
+              if (warehouseOutInfoList[i].info.manufacturers.id > 0) {
242
+                this.manufacturer.push(warehouseOutInfoList[i].info.manufacturers)
221 243
               }
222
-              if (warehouseOutList[i].Dealer.id > 0) {
223
-                this.dealer.push(warehouseOutList[i].Dealer)
244
+              if (warehouseOutInfoList[i].info.dealers.id > 0) {
245
+                this.dealer.push(warehouseOutInfoList[i].info.dealers)
224 246
               }
225 247
             }
248
+            for (let i = 0; i < warehouseOutInfoList.length; i++) {
249
+              this.goodType.push(warehouseOutInfoList[i].info.type)
250
+            }
251
+
226 252
 
227 253
             for (let i = 0; i < warehouseOutInfoList.length; i++) {
228
-              this.propForm.goodInfo.push(warehouseOutInfoList[i].GoodInfo)
254
+              this.propForm.goodInfo.push(warehouseOutInfoList[i].info)
229 255
             }
230 256
 
231 257
             const obj = {}
232 258
             const obj2 = {}
259
+            const obj3 = {}
233 260
             const obj4 = {}
234 261
             // 去重复
235 262
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
@@ -241,17 +268,27 @@
241 268
               obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
242 269
               return cur
243 270
             }, [])
271
+            this.goodType = this.goodType.reduce((cur, next) => {
272
+              obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
273
+              return cur
274
+            }, [])
244 275
             this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
245 276
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
246 277
               return cur
247 278
             }, [])
279
+
280
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
281
+            this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
282
+            this.form.manufacturer =0
283
+            this.form.dealer = 0
284
+
248 285
           }
249 286
         })
250 287
       }, typeName: function(good_type_id) {
251 288
         let name = ''
252
-        for (let i = 0; i < this.propForm.goodType.length; i++) {
253
-          if (this.propForm.goodType[i].id == good_type_id) {
254
-            name = this.propForm.goodType[i].type_name
289
+        for (let i = 0; i < this.goodType.length; i++) {
290
+          if (this.goodType[i].id == good_type_id) {
291
+            name = this.goodType[i].type_name
255 292
           }
256 293
         }
257 294
         return name
@@ -289,10 +326,57 @@
289 326
           return ''
290 327
         }
291 328
       }, showDialog(index, row) {
329
+        this.currentIndex = index
330
+        this.propForm.goodType = []
331
+
332
+
333
+        if (this.form.manufacturer == 0 && this.form.dealer == 0) {
334
+          for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
335
+            this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
336
+          }
337
+          const obj3 = {}
338
+          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
339
+            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
340
+            return cur
341
+          }, [])
342
+
343
+        } else {
344
+          if(this.form.manufacturer == 0 && this.form.dealer != 0){
345
+            for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
346
+              if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer){
347
+                this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
348
+              }
349
+            }
350
+          }
351
+          if(this.form.manufacturer != 0 && this.form.dealer == 0){
352
+            for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
353
+              if(this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
354
+                this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
355
+              }
356
+            }
357
+          }
358
+          if(this.form.manufacturer != 0 && this.form.dealer != 0){
359
+            for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
360
+              if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer && this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
361
+                this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
362
+              }
363
+            }
364
+          }
365
+          const obj3 = {}
366
+          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
367
+            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
368
+            return cur
369
+          }, [])
370
+        }
371
+
372
+
373
+
374
+        this.$refs.dialog.show()
375
+
376
+
292 377
         this.currentIndex = index
293 378
         if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
294
-          this.$message.error('请先选择厂商')
295
-          return
379
+
296 380
         } else {
297 381
           this.$refs.dialog.show()
298 382
 
@@ -351,13 +435,10 @@
351 435
             return false
352 436
           }
353 437
         })
354
-      }, changeManufacturer() {
355
-        this.recordInfo.recordData = []
356
-        const tempObj = {}
357
-        tempObj['good_type_id'] = 0
358
-        tempObj['good_id'] = 0
359
-        tempObj['return_count'] = ''
360
-        this.recordInfo.recordData.push(tempObj)
438
+      }, changeManufacturer(val) {
439
+        this.propForm.manufacturer = val
440
+      },changeDealer(val){
441
+        this.propForm.dealer = val
361 442
       }
362 443
     },
363 444
     created() {

+ 10 - 2
src/xt_pages/stock/cancelStockOrderDetail.vue Näytä tiedosto

@@ -1,7 +1,10 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
4
+
5
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
6
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
7
+
5 8
     </div>
6 9
   <div class="app-container">
7 10
 
@@ -82,7 +85,12 @@
82 85
       return {
83 86
         crumbs: [
84 87
           { path: false, name: '库存管理' },
85
-          { path: false, name: '退库单' },
88
+          { path: false, name: '耗材退库单' },
89
+          { path: false, name: '退库单详情' }
90
+        ],
91
+        crumbs2: [
92
+          { path: false, name: '库存管理' },
93
+          { path: false, name: '其他退库单' },
86 94
           { path: false, name: '退库单详情' }
87 95
         ],
88 96
         isEdit: 0,

+ 93 - 11
src/xt_pages/stock/cancelStockOrderEdit.vue Näytä tiedosto

@@ -1,7 +1,8 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
5 6
       <div style="float:right;">
6 7
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
7 8
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
@@ -21,6 +22,35 @@
21 22
                         value-format="yyyy-MM-dd"></el-date-picker>
22 23
       </div>
23 24
 
25
+      <div class="cell clearfix">
26
+        <label class="title"><span class="name">经销商</span> : </label>
27
+        <el-select   size="small"  v-model="form.dealer" clearable  placeholder="请选择经销商"  @change="changeDealer">
28
+          <el-option
29
+            v-for="(option, index) in dealer"
30
+            :key="index"
31
+            :label="option.dealer_name"
32
+            :value="option.id">
33
+          </el-option>
34
+        </el-select>
35
+      </div>
36
+
37
+      <div class="cell clearfix">
38
+        <label class="title"><span class="name">厂商</span> : </label>
39
+        <el-select  size="small"   v-model="form.manufacturer" clearable  placeholder="请选择厂商" @change="changeManufacturer">
40
+          <el-option
41
+            v-for="(option, index) in manufacturer"
42
+            :key="index"
43
+            :label="option.manufacturer_name"
44
+            :value="option.id">
45
+          </el-option>
46
+        </el-select>
47
+      </div>
48
+
49
+
50
+
51
+
52
+
53
+
24 54
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
25 55
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
26 56
                   max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
@@ -117,9 +147,17 @@
117 147
       return {
118 148
         crumbs: [
119 149
           { path: false, name: '库存管理' },
120
-          { path: false, name: '退库单' },
150
+          { path: false, name: '耗材退库单' },
151
+          { path: false, name: '编辑退库单' }
152
+        ],
153
+
154
+        crumbs2: [
155
+          { path: false, name: '库存管理' },
156
+          { path: false, name: '其他退库单' },
121 157
           { path: false, name: '编辑退库单' }
122 158
         ],
159
+
160
+
123 161
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
124 162
         warehousing_time: '',
125 163
         adminUserOptions: null,
@@ -191,35 +229,75 @@
191 229
         const params = {
192 230
           type: this.$route.query.type
193 231
         }
232
+        const loading = this.$loading({
233
+          lock: true,
234
+          text: 'Loading',
235
+          spinner: 'el-icon-loading',
236
+          background: 'rgba(0, 0, 0, 0.7)'
237
+        })
194 238
         getCancelStockConfig(params).then(response => {
239
+
195 240
           if (response.data.state == 0) {
241
+            loading.close()
196 242
             this.$message.error(response.data.msg)
197 243
             return false
198 244
           } else {
245
+            loading.close()
199 246
             var warehouseOutInfoList = response.data.data.warehouseOutInfoList
200 247
             this.warehouseOutInfoList = response.data.data.warehouseOutInfoList
248
+            for (let i = 0; i < warehouseOutInfoList.length; i++) {
249
+              if (warehouseOutInfoList[i].info.manufacturers.id > 0) {
250
+                this.manufacturer.push(warehouseOutInfoList[i].info.manufacturers)
251
+              }
252
+              if (warehouseOutInfoList[i].info.dealers.id > 0) {
253
+                this.dealer.push(warehouseOutInfoList[i].info.dealers)
254
+              }
255
+            }
256
+            for (let i = 0; i < warehouseOutInfoList.length; i++) {
257
+              this.goodType.push(warehouseOutInfoList[i].info.type)
258
+            }
259
+
201 260
 
202 261
             for (let i = 0; i < warehouseOutInfoList.length; i++) {
203
-              this.propForm.goodInfo.push(warehouseOutInfoList[i].GoodInfo)
204
-              this.propForm.goodType.push(warehouseOutInfoList[i].GoodInfo.GoodsType)
262
+              this.propForm.goodInfo.push(warehouseOutInfoList[i].info)
205 263
             }
264
+
265
+            const obj = {}
266
+            const obj2 = {}
206 267
             const obj3 = {}
207 268
             const obj4 = {}
208
-            this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
209
-              obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
269
+            // 去重复
270
+            this.manufacturer = this.manufacturer.reduce((cur, next) => {
271
+              obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
210 272
               return cur
211 273
             }, [])
212
-            this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
274
+            // 去重复
275
+            this.dealer = this.dealer.reduce((cur, next) => {
276
+              obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
277
+              return cur
278
+            }, [])
279
+            this.goodType = this.goodType.reduce((cur, next) => {
213 280
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
214 281
               return cur
215 282
             }, [])
283
+            this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
284
+              obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
285
+              return cur
286
+            }, [])
287
+
288
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
289
+            this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
290
+
291
+
292
+            console.log(this.goodType)
293
+
216 294
           }
217 295
         })
218 296
       }, typeName: function(good_type_id) {
219 297
         let name = ''
220
-        for (let i = 0; i < this.propForm.goodType.length; i++) {
221
-          if (this.propForm.goodType[i].id == good_type_id) {
222
-            name = this.propForm.goodType[i].type_name
298
+        for (let i = 0; i < this.goodType.length; i++) {
299
+          if (this.goodType[i].id == good_type_id) {
300
+            name = this.goodType[i].type_name
223 301
           }
224 302
         }
225 303
         return name
@@ -301,7 +379,7 @@
301 379
             const params = {
302 380
               'cancelStock': this.recordInfo.recordData
303 381
             }
304
-            editCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer).then(response => {
382
+            editCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
305 383
               if (response.data.state == 0) {
306 384
                 this.$message.error(response.data.msg)
307 385
                 return false
@@ -342,6 +420,10 @@
342 420
             this.recordInfo.recordData.push(tempObj)
343 421
           }
344 422
         })
423
+      },changeManufacturer(val) {
424
+        this.propForm.manufacturer = val
425
+      },changeDealer(val){
426
+        this.propForm.dealer = val
345 427
       }
346 428
     },
347 429
     created() {

+ 19 - 15
src/xt_pages/stock/config/goodInfo.vue Näytä tiedosto

@@ -32,27 +32,28 @@
32 32
             </template>
33 33
           </el-table-column>
34 34
 
35
-          <el-table-column label="进价"  align="center">
36
-            <template slot-scope="scope">
35
+
36
+          <el-table-column label="进价"  align="center" >
37
+            <template slot-scope="scope" v-if="scope.row.buy_price">
37 38
               {{scope.row.buy_price}}
38 39
 
39 40
             </template>
40 41
           </el-table-column>
41
-          <el-table-column label="出货价"  align="center">
42
-            <template slot-scope="scope">
42
+          <el-table-column label="出货价"  align="center" >
43
+            <template slot-scope="scope" v-if="scope.row.sell_price">
43 44
               {{scope.row.sell_price}}
44 45
             </template>
45 46
           </el-table-column>
46
-          <el-table-column label="有效期预警"  align="center">
47
-            <template slot-scope="scope">
48
-              {{scope.row.expiry_date_warn_day_count}}
49
-            </template>
50
-          </el-table-column>
51
-          <el-table-column label="库存预警" align="center">
52
-            <template slot-scope="scope">
53
-              {{scope.row.stock_warn_count}}
54
-            </template>
55
-          </el-table-column>
47
+          <!--<el-table-column label="有效期预警"  align="center">-->
48
+            <!--<template slot-scope="scope" v-if="scope.row.expiry_date_warn_day_count">-->
49
+              <!--{{scope.row.expiry_date_warn_day_count}}-->
50
+            <!--</template>-->
51
+          <!--</el-table-column>-->
52
+          <!--<el-table-column label="库存预警" align="center">-->
53
+            <!--<template slot-scope="scope" v-if="scope.row.stock_warn_count">-->
54
+              <!--{{scope.row.stock_warn_count}}-->
55
+            <!--</template>-->
56
+          <!--</el-table-column>-->
56 57
           <el-table-column label="操作" align="center" >
57 58
             <template slot-scope="scope">
58 59
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
@@ -318,7 +319,6 @@
318 319
         });
319 320
 
320 321
       }, goodInfoDialogComfirm: function (val) {
321
-        this.$refs.dialog.hide()
322 322
 
323 323
         if (val.isCreated == 2) { //修改
324 324
           val['id'] = this.goodInfo.editGoodId
@@ -329,6 +329,8 @@
329 329
               this.$message.error(response.data.msg);
330 330
               return false;
331 331
             } else {
332
+              this.$refs.dialog.hide()
333
+
332 334
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].specification_name = response.data.data.goodInfo.specification_name
333 335
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit = response.data.data.goodInfo.good_unit
334 336
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].buy_price = response.data.data.goodInfo.buy_price.toString()
@@ -348,6 +350,8 @@
348 350
               this.$message.error(response.data.msg);
349 351
               return false;
350 352
             } else {
353
+              this.$refs.dialog.hide()
354
+
351 355
               this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
352 356
 
353 357
               this.$message.success("新增成功")

+ 4 - 2
src/xt_pages/stock/config/goodType.vue Näytä tiedosto

@@ -259,7 +259,6 @@ export default {
259 259
     },
260 260
 
261 261
     goodTypeDialogComfirm: function(val) {
262
-      this.$refs.dialog.hide();
263 262
 
264 263
       if (val.isCreated == 2) {
265 264
         //修改
@@ -275,6 +274,8 @@ export default {
275 274
             this.$message.error(response.data.msg);
276 275
             return false;
277 276
           } else {
277
+            this.$refs.dialog.hide();
278
+
278 279
             this.goodType.goodTypeData[this.goodType.editTypeIndex].type_name =
279 280
               response.data.data.goodTypes.type_name;
280 281
             this.goodType.goodTypeData[this.goodType.editTypeIndex].remark =
@@ -290,8 +291,8 @@ export default {
290 291
             this.$message.error(response.data.msg);
291 292
             return false;
292 293
           } else {
294
+            this.$refs.dialog.hide();
293 295
             this.goodType.goodTypeData.unshift(response.data.data.goodTypes);
294
-
295 296
             this.$message.success("新增成功");
296 297
           }
297 298
         });
@@ -301,6 +302,7 @@ export default {
301 302
       this.$refs.dialog.hide();
302 303
     },
303 304
     showDialog: function() {
305
+      this.goodType.goodTypeDialog.isCreated = 1;
304 306
       this.$refs.dialog.show();
305 307
     },
306 308
     getList() {

+ 19 - 2
src/xt_pages/stock/detail/cancelStockDetail.vue Näytä tiedosto

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
     <div>
3 3
       <div class="cell clearfix" >
4
-        <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/商品"/>
4
+        <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
5 5
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
6 6
       </div>
7 7
 
@@ -58,13 +58,20 @@
58 58
             </template>
59 59
           </el-table-column>
60 60
 
61
-          <el-table-column label="商品" align="center">
61
+          <el-table-column label="商品类型" align="center">
62
+            <template slot-scope="scope">
63
+              {{typeName(scope.row.good_type_id)}}
64
+            </template>
65
+          </el-table-column>
66
+
67
+          <el-table-column label="规格名称" align="center">
62 68
             <template slot-scope="scope">
63 69
               {{specificationName(scope.row.good_id)}}
64 70
             </template>
65 71
           </el-table-column>
66 72
 
67 73
 
74
+
68 75
           <el-table-column label="单据类型" align="center">
69 76
             <template slot-scope="scope">
70 77
               {{getTypeName(scope.row)}}
@@ -187,6 +194,14 @@
187 194
           name = '其他退库单'
188 195
         }
189 196
 
197
+        return name
198
+      },   typeName: function(good_type_id) {
199
+        let name = ''
200
+        for (let i = 0; i < this.goodType.length; i++) {
201
+          if (this.goodType[i].id == good_type_id) {
202
+            name = this.goodType[i].type_name
203
+          }
204
+        }
190 205
         return name
191 206
       },
192 207
       specificationName: function(good_info_id) {
@@ -301,6 +316,8 @@
301 316
             this.manufacturer = response.data.data.manufacturer
302 317
             this.dealer = response.data.data.dealer
303 318
             this.goodInfo = response.data.data.goodInfo
319
+            this.goodType = response.data.data.goodType
320
+
304 321
           }
305 322
         })
306 323
       }, getManufactuerName: function(manufacturer_id) {

+ 18 - 2
src/xt_pages/stock/detail/salesReturnDetail.vue Näytä tiedosto

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
     <div>
3 3
       <div class="cell clearfix" >
4
-        <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/商品"/>
4
+        <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
5 5
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
6 6
       </div>
7 7
 
@@ -61,7 +61,13 @@
61 61
             </template>
62 62
           </el-table-column>
63 63
 
64
-          <el-table-column label="商品" align="center">
64
+          <el-table-column label="商品类型" align="center">
65
+            <template slot-scope="scope">
66
+              {{typeName(scope.row.good_type_id)}}
67
+            </template>
68
+          </el-table-column>
69
+
70
+          <el-table-column label="规格名称" align="center">
65 71
             <template slot-scope="scope">
66 72
               {{specificationName(scope.row.good_id)}}
67 73
             </template>
@@ -189,6 +195,14 @@
189 195
           name = '其他退货单'
190 196
         }
191 197
 
198
+        return name
199
+      },   typeName: function(good_type_id) {
200
+        let name = ''
201
+        for (let i = 0; i < this.goodType.length; i++) {
202
+          if (this.goodType[i].id == good_type_id) {
203
+            name = this.goodType[i].type_name
204
+          }
205
+        }
192 206
         return name
193 207
       },
194 208
       specificationName: function(good_info_id) {
@@ -303,6 +317,8 @@
303 317
             this.manufacturer = response.data.data.manufacturer
304 318
             this.dealer = response.data.data.dealer
305 319
             this.goodInfo = response.data.data.goodInfo
320
+            this.goodType = response.data.data.goodType
321
+
306 322
           }
307 323
         })
308 324
       }, getManufactuerName: function(manufacturer_id) {

+ 18 - 2
src/xt_pages/stock/detail/stockInDetail.vue Näytä tiedosto

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
     <div>
3 3
       <div class="cell clearfix">
4
-        <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/商品"/>
4
+        <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
5 5
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
6 6
       </div>
7 7
 
@@ -58,7 +58,13 @@
58 58
             </template>
59 59
           </el-table-column>
60 60
 
61
-          <el-table-column label="商品" align="center">
61
+          <el-table-column label="商品类型" align="center">
62
+            <template slot-scope="scope">
63
+              {{typeName(scope.row.good_type_id)}}
64
+            </template>
65
+          </el-table-column>
66
+
67
+          <el-table-column label="规格名称" align="center">
62 68
             <template slot-scope="scope">
63 69
               {{specificationName(scope.row.good_id)}}
64 70
             </template>
@@ -198,6 +204,14 @@
198 204
           name = '其他入库单'
199 205
         }
200 206
 
207
+        return name
208
+      },   typeName: function(good_type_id) {
209
+        let name = ''
210
+        for (let i = 0; i < this.goodType.length; i++) {
211
+          if (this.goodType[i].id == good_type_id) {
212
+            name = this.goodType[i].type_name
213
+          }
214
+        }
201 215
         return name
202 216
       },
203 217
       specificationName: function(good_info_id) {
@@ -312,6 +326,8 @@
312 326
             this.manufacturer = response.data.data.manufacturer
313 327
             this.dealer = response.data.data.dealer
314 328
             this.goodInfo = response.data.data.goodInfo
329
+            this.goodType = response.data.data.goodType
330
+
315 331
           }
316 332
         })
317 333
       }, getManufactuerName: function(manufacturer_id) {

+ 19 - 2
src/xt_pages/stock/detail/stockOutDetail.vue Näytä tiedosto

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
     <div>
3 3
       <div class="cell clearfix" >
4
-        <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/商品"/>
4
+        <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
5 5
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
6 6
       </div>
7 7
 
@@ -62,7 +62,13 @@
62 62
             </template>
63 63
           </el-table-column>
64 64
 
65
-          <el-table-column label="商品" align="center">
65
+          <el-table-column label="商品类型" align="center">
66
+            <template slot-scope="scope">
67
+              {{typeName(scope.row.good_type_id)}}
68
+            </template>
69
+          </el-table-column>
70
+
71
+          <el-table-column label="规格名称" align="center">
66 72
             <template slot-scope="scope">
67 73
               {{specificationName(scope.row.good_id)}}
68 74
             </template>
@@ -212,6 +218,15 @@
212 218
         }
213 219
         return name
214 220
       },
221
+      typeName: function(good_type_id) {
222
+        let name = ''
223
+        for (let i = 0; i < this.goodType.length; i++) {
224
+          if (this.goodType[i].id == good_type_id) {
225
+            name = this.goodType[i].type_name
226
+          }
227
+        }
228
+        return name
229
+      },
215 230
       search: function() {
216 231
         const Params = {
217 232
           page: this.page,
@@ -315,6 +330,8 @@
315 330
             this.manufacturer = response.data.data.manufacturer
316 331
             this.dealer = response.data.data.dealer
317 332
             this.goodInfo = response.data.data.goodInfo
333
+            this.goodType = response.data.data.goodType
334
+
318 335
           }
319 336
         })
320 337
       }, getManufactuerName: function(manufacturer_id) {

+ 150 - 30
src/xt_pages/stock/salesReturnEdit.vue Näytä tiedosto

@@ -22,7 +22,37 @@
22 22
                             value-format="yyyy-MM-dd"></el-date-picker>
23 23
     </div>
24 24
 
25
-        <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
25
+
26
+    <div class="cell clearfix">
27
+      <label class="title"><span class="name">经销商</span> : </label>
28
+      <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
29
+        <el-option
30
+          v-for="(option, index) in dealer"
31
+          :key="index"
32
+          :label="option.dealer_name"
33
+          :value="option.id">
34
+        </el-option>
35
+      </el-select>
36
+    </div>
37
+
38
+
39
+    <div class="cell clearfix">
40
+      <label class="title"><span class="name">厂商</span> : </label>
41
+
42
+      <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer">
43
+        <el-option
44
+          v-for="(option, index) in manufacturer"
45
+          :key="index"
46
+          :label="option.manufacturer_name"
47
+          :value="option.id">
48
+        </el-option>
49
+      </el-select>
50
+    </div>
51
+
52
+
53
+
54
+
55
+    <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
26 56
           <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
27 57
                     max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
28 58
           >
@@ -143,12 +173,7 @@
143 173
           ]
144 174
 
145 175
         },
146
-        ruleForm: {
147
-          manufacturer: [
148
-            { required: true, message: '请选择厂商', trigger: 'change' }
149
-          ]
150 176
 
151
-        },
152 177
 
153 178
         // prop
154 179
         isVisibility: false,
@@ -156,12 +181,14 @@
156 181
           goodType: [],
157 182
           goodInfo: [],
158 183
           goodUnit: [],
159
-          title: '入库'
184
+          title: '入库',
185
+          manufacturer:0,
186
+          dealer:0,
160 187
         },
161 188
 
162 189
         form: {
163
-          manufacturer: '',
164
-          dealer: ''
190
+          manufacturer: 0,
191
+          dealer: 0,
165 192
         },
166 193
         warehouseInfoList:[],
167 194
         salesReturn: {},
@@ -189,45 +216,91 @@
189 216
             }
190 217
           }
191 218
         }
192
-
219
+        this.propForm.goodType = []
193 220
         this.currentIndex = -1
194 221
       }, cancle: function() {
195 222
         this.$refs.dialog.hide()
223
+        this.propForm.goodType = []
224
+
196 225
       }, GetConfigInfo: function() {
197 226
         const params = {
198 227
           type: this.$route.query.type
199 228
 
200 229
         }
230
+        const loading = this.$loading({
231
+          lock: true,
232
+          text: 'Loading',
233
+          spinner: 'el-icon-loading',
234
+          background: 'rgba(0, 0, 0, 0.7)'
235
+        })
201 236
         getSalesReturnConfig(params).then(response => {
202 237
           if (response.data.state == 0) {
238
+            loading.close()
239
+
203 240
             this.$message.error(response.data.msg)
204 241
             return false
205 242
           } else {
243
+            loading.close()
244
+
206 245
             var warehouseInfoList = response.data.data.warehouseInfoList
207 246
             this.warehouseInfoList = response.data.data.warehouseInfoList
208 247
             for (let i = 0; i < warehouseInfoList.length; i++) {
209
-              this.propForm.goodInfo.push(warehouseInfoList[i].GoodInfo)
210
-              this.propForm.goodType.push(warehouseInfoList[i].GoodInfo.GoodsType)
248
+              if (warehouseInfoList[i].info.manufacturers.id > 0) {
249
+                this.manufacturer.push(warehouseInfoList[i].info.manufacturers)
250
+              }
251
+              if (warehouseInfoList[i].info.dealers.id > 0) {
252
+                this.dealer.push(warehouseInfoList[i].info.dealers)
253
+              }
254
+            }
255
+
256
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
257
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
258
+            }
259
+
260
+
261
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
262
+              this.goodType.push(this.warehouseInfoList[i].info.type)
211 263
             }
264
+
265
+
266
+            const obj = {}
267
+            const obj2 = {}
212 268
             const obj3 = {}
269
+
213 270
             const obj4 = {}
214
-            this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
215
-              obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
271
+
272
+            // 去重复
273
+            this.manufacturer = this.manufacturer.reduce((cur, next) => {
274
+              obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
275
+              return cur
276
+            }, [])
277
+            // 去重复
278
+            this.dealer = this.dealer.reduce((cur, next) => {
279
+              obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
216 280
               return cur
217 281
             }, [])
218
-            this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
282
+
283
+            this.goodType = this.goodType.reduce((cur, next) => {
219 284
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
220 285
               return cur
221 286
             }, [])
222
-            console.log(this.propForm.goodInfo)
223
-            console.log(this.propForm.goodType)
287
+
288
+
289
+            this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
290
+              obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
291
+              return cur
292
+            }, [])
293
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
294
+            this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
295
+
296
+
224 297
           }
225 298
         })
226 299
       }, typeName: function(good_type_id) {
227 300
         let name = ''
228
-        for (let i = 0; i < this.propForm.goodType.length; i++) {
229
-          if (this.propForm.goodType[i].id == good_type_id) {
230
-            name = this.propForm.goodType[i].type_name
301
+        for (let i = 0; i < this.goodType.length; i++) {
302
+          if (this.goodType[i].id == good_type_id) {
303
+            name = this.goodType[i].type_name
231 304
           }
232 305
         }
233 306
         return name
@@ -278,17 +351,58 @@
278 351
         }
279 352
       }, showDialog(index, row) {
280 353
         this.currentIndex = index
281
-        this.$refs.dialog.show()
282
-        for (let i = 0; i < this.warehouseInfoList.length; i++) {
283
-          if (this.warehouseInfoList[i].manufacturer == this.form.manufacturer) {
284
-            this.propForm.goodType.push(this.warehouseInfoList[i].GoodInfo.GoodsType)
354
+        this.propForm.goodType = []
355
+
356
+
357
+        if (this.form.manufacturer == 0 && this.form.dealer == 0) {
358
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
359
+            this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
285 360
           }
361
+          const obj3 = {}
362
+          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
363
+            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
364
+            return cur
365
+          }, [])
366
+        } else {
367
+
368
+
369
+          if(this.form.manufacturer == 0 && this.form.dealer != 0){
370
+
371
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
372
+              if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer){
373
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
374
+              }
375
+            }
376
+          }
377
+          if(this.form.manufacturer != 0 && this.form.dealer == 0){
378
+            console.log(this.warehouseInfoList)
379
+
380
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
381
+              if(this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
382
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
383
+              }
384
+            }
385
+
386
+          }
387
+          if(this.form.manufacturer != 0 && this.form.dealer != 0){
388
+
389
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
390
+              if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
391
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
392
+              }
393
+            }
394
+
395
+          }
396
+          const obj3 = {}
397
+          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
398
+            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
399
+            return cur
400
+          }, [])
286 401
         }
287
-        const obj3 = {}
288
-        this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
289
-          obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
290
-          return cur
291
-        }, [])
402
+        this.$refs.dialog.show()
403
+
404
+
405
+
292 406
       }, back() {
293 407
         this.$router.go(-1)
294 408
       }, submit() {
@@ -309,7 +423,7 @@
309 423
             const params = {
310 424
               'salesReturn': this.recordInfo.recordData
311 425
             }
312
-            editSalesReturnInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer).then(response => {
426
+            editSalesReturnInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
313 427
               if (response.data.state == 0) {
314 428
                 this.$message.error(response.data.msg)
315 429
                 return false
@@ -351,6 +465,12 @@
351 465
             this.recordInfo.recordData.push(tempObj)
352 466
           }
353 467
         })
468
+      },changeManufacturer(val) {
469
+        this.propForm.manufacturer = val
470
+        console.log(val)
471
+      },changeDealer(val){
472
+        this.propForm.dealer = val
473
+        console.log(val)
354 474
       }
355 475
     },
356 476
     created() {

+ 110 - 58
src/xt_pages/stock/salesReturnOrderAdd.vue Näytä tiedosto

@@ -1,7 +1,10 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+
7
+
5 8
       <div style="float:right;">
6 9
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
7 10
         <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
@@ -20,32 +23,33 @@
20 23
                         value-format="yyyy-MM-dd"></el-date-picker>
21 24
       </div>
22 25
 
23
-
24 26
       <div class="cell clearfix">
25
-        <label class="title"><span class="name">厂商<span style="color: red;margin-left: -15px">*</span></span> : </label>
26
-
27
-        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer()">
27
+        <label class="title"><span class="name">经销商</span> : </label>
28
+        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
28 29
           <el-option
29
-            v-for="(option, index) in manufacturer"
30
+            v-for="(option, index) in dealer"
30 31
             :key="index"
31
-            :label="option.manufacturer_name"
32
+            :label="option.dealer_name"
32 33
             :value="option.id">
33 34
           </el-option>
34 35
         </el-select>
35 36
       </div>
36 37
 
37 38
       <div class="cell clearfix">
38
-        <label class="title"><span class="name">经销商</span> : </label>
39
-        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商">
39
+        <label class="title"><span class="name">厂商</span> : </label>
40
+
41
+        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer">
40 42
           <el-option
41
-            v-for="(option, index) in dealer"
43
+            v-for="(option, index) in manufacturer"
42 44
             :key="index"
43
-            :label="option.dealer_name"
45
+            :label="option.manufacturer_name"
44 46
             :value="option.id">
45 47
           </el-option>
46 48
         </el-select>
47 49
       </div>
48 50
 
51
+
52
+
49 53
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
50 54
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
51 55
                   max-height="450"  :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
@@ -91,9 +95,6 @@
91 95
               <span>退货数量<span style="color: red">*</span></span>
92 96
             </template>
93 97
             <template slot-scope="scope">
94
-              <!--{{scope.row.warehousing_count}}-->
95
-              <!--<el-input type="number" v-model="scope.row.warehousing_count"   @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
96
-
97 98
               <el-form-item :prop="'recordData.' + scope.$index + '.return_count'" :rules='tableRules.return_count'
98 99
                             style="padding-top: 17px">
99 100
                 <el-input  placeholder="请输入退货数量" type="number" v-model="scope.row.return_count"></el-input>
@@ -148,10 +149,16 @@
148 149
       return {
149 150
         crumbs: [
150 151
           { path: false, name: '库存管理' },
151
-          { path: false, name: '退回单' },
152
+          { path: false, name: '耗材退货单' },
153
+          { path: false, name: '新增退货单' }
154
+        ],
155
+        crumbs2: [
156
+          { path: false, name: '库存管理' },
157
+          { path: false, name: '其他退货单' },
152 158
           { path: false, name: '新增退货单' }
153 159
         ],
154 160
 
161
+
155 162
         type: this.$route.query.type,
156 163
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
157 164
         return_time: '',
@@ -167,22 +174,21 @@
167 174
             { required: true, message: '数量不能为空', trigge: 'blur' }
168 175
           ]
169 176
         },
170
-        ruleForm: {
171
-          manufacturer: [
172
-            { required: true, message: '请选择厂商', trigger: 'change' }
173
-          ]
174 177
 
175
-        },
178
+
179
+
176 180
         // prop
177 181
         isVisibility: false,
178 182
         propForm: {
179 183
           goodType: [],
180 184
           goodInfo: [],
181
-          goodUnit: []
185
+          goodUnit: [],
186
+          manufacturer:0,
187
+          dealer:0,
182 188
         },
183 189
         form: {
184
-          manufacturer: '',
185
-          dealer: ''
190
+          manufacturer: 0,
191
+          dealer: 0,
186 192
         },
187 193
         warehouseInfoList:[],
188 194
         manufacturer: [],
@@ -193,7 +199,6 @@
193 199
     methods: {
194 200
       comfirm: function(val) {
195 201
         this.$refs.dialog.hide()
196
-
197 202
         if (val.selectedGoodInfo.length > 0) {
198 203
           for (let i = val.selectedGoodInfo.length - 1; ; i--) {
199 204
             if (i == 0) {
@@ -209,38 +214,51 @@
209 214
             }
210 215
           }
211 216
         }
212
-
217
+        this.propForm.goodType = []
213 218
         this.currentIndex = -1
214 219
       }, cancle: function() {
215 220
         this.$refs.dialog.hide()
221
+        this.propForm.goodType = []
222
+
216 223
       }, GetConfigInfo: function() {
217 224
         const params = {
218 225
           type: this.type
219 226
         }
227
+        const loading = this.$loading({
228
+          lock: true,
229
+          text: 'Loading',
230
+          spinner: 'el-icon-loading',
231
+          background: 'rgba(0, 0, 0, 0.7)'
232
+        })
233
+
220 234
         getSalesReturnConfig(params).then(response => {
221 235
           if (response.data.state == 0) {
236
+            loading.close()
237
+
222 238
             this.$message.error(response.data.msg)
223 239
             return false
224 240
           } else {
225
-            var warehouseList = response.data.data.warehouseList
241
+            loading.close()
226 242
             var warehouseInfoList = response.data.data.warehouseInfoList
227
-            this.warehouseInfoList =  response.data.data.warehouseInfoList
228
-
229
-            for (let i = 0; i < warehouseList.length; i++) {
230
-              if (warehouseList[i].Manufacturer.id > 0) {
231
-                this.manufacturer.push(warehouseList[i].Manufacturer)
243
+            this.warehouseInfoList = response.data.data.warehouseInfoList
244
+            for (let i = 0; i < warehouseInfoList.length; i++) {
245
+              if (warehouseInfoList[i].info.manufacturers.id > 0) {
246
+                this.manufacturer.push(warehouseInfoList[i].info.manufacturers)
232 247
               }
233
-              if (warehouseList[i].Dealer.id > 0) {
234
-                this.dealer.push(warehouseList[i].Dealer)
248
+              if (warehouseInfoList[i].info.dealers.id > 0) {
249
+                this.dealer.push(warehouseInfoList[i].info.dealers)
235 250
               }
236 251
             }
237 252
 
238
-            for (let i = 0; i < warehouseInfoList.length; i++) {
239
-              this.propForm.goodInfo.push(warehouseInfoList[i].GoodInfo)
253
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
254
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
255
+            }
256
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
257
+              this.goodType.push(this.warehouseInfoList[i].info.type)
240 258
             }
241
-
242 259
             const obj = {}
243 260
             const obj2 = {}
261
+            const obj3 = {}
244 262
             const obj4 = {}
245 263
             // 去重复
246 264
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
@@ -252,18 +270,27 @@
252 270
               obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
253 271
               return cur
254 272
             }, [])
273
+
274
+            this.goodType = this.goodType.reduce((cur, next) => {
275
+              obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
276
+              return cur
277
+            }, [])
278
+
255 279
             this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
256 280
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
257 281
               return cur
258 282
             }, [])
283
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
284
+            this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
285
+
259 286
 
260 287
           }
261 288
         })
262 289
       }, typeName: function(good_type_id) {
263 290
         let name = ''
264
-        for (let i = 0; i < this.propForm.goodType.length; i++) {
265
-          if (this.propForm.goodType[i].id == good_type_id) {
266
-            name = this.propForm.goodType[i].type_name
291
+        for (let i = 0; i < this.goodType.length; i++) {
292
+          if (this.goodType[i].id == good_type_id) {
293
+            name = this.goodType[i].type_name
267 294
           }
268 295
         }
269 296
         return name
@@ -303,16 +330,46 @@
303 330
         }
304 331
       }, showDialog(index, row) {
305 332
         this.currentIndex = index
306
-        if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
307
-          this.$message.error('请先选择厂商')
308
-          return
309
-        } else {
310
-          this.$refs.dialog.show()
333
+        this.propForm.goodType = []
311 334
 
335
+        if (this.form.manufacturer == 0 && this.form.dealer == 0) {
312 336
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
313
-            if (this.warehouseInfoList[i].manufacturer == this.form.manufacturer) {
314
-              this.propForm.goodType.push(this.warehouseInfoList[i].GoodInfo.GoodsType)
337
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
338
+          }
339
+          const obj3 = {}
340
+          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
341
+            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
342
+            return cur
343
+          }, [])
344
+        } else {
345
+
346
+
347
+          if(this.form.manufacturer == 0 && this.form.dealer != 0){
348
+
349
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
350
+              if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer){
351
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
352
+              }
353
+            }
354
+          }
355
+          if(this.form.manufacturer != 0 && this.form.dealer == 0){
356
+            console.log(this.warehouseInfoList)
357
+
358
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
359
+              if(this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
360
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
361
+              }
362
+            }
363
+
364
+          }
365
+          if(this.form.manufacturer != 0 && this.form.dealer != 0){
366
+
367
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
368
+              if(this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer){
369
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
370
+              }
315 371
             }
372
+
316 373
           }
317 374
           const obj3 = {}
318 375
           this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
@@ -320,15 +377,12 @@
320 377
             return cur
321 378
           }, [])
322 379
         }
380
+        this.$refs.dialog.show()
323 381
       }, back() {
324 382
         this.$router.go(-1)
325 383
       }, submit() {
326 384
         this.$refs['tableForm'].validate((valid) => {
327 385
           if (valid) {
328
-            if (this.form.manufacturer == 0) {
329
-              this.$message.error('厂商不能为空')
330
-              return
331
-            }
332 386
             const array = this.recordInfo.recordData
333 387
             let total = 0
334 388
             for (let i = 0; i < array.length; i++) {
@@ -360,14 +414,12 @@
360 414
             return false
361 415
           }
362 416
         })
363
-      }, changeManufacturer() {
364
-        this.recordInfo.recordData = []
365
-        const tempObj = {}
366
-        tempObj['good_type_id'] = 0
367
-        tempObj['good_id'] = 0
368
-        tempObj['return_count'] = ''
369
-        tempObj['price'] = ''
370
-        this.recordInfo.recordData.push(tempObj)
417
+      }, changeManufacturer(val) {
418
+        this.propForm.manufacturer = val
419
+        console.log(val)
420
+      },changeDealer(val){
421
+        this.propForm.dealer = val
422
+        console.log(val)
371 423
       }
372 424
     },
373 425
     created() {

+ 8 - 2
src/xt_pages/stock/salesReturnOrderDetail.vue Näytä tiedosto

@@ -1,7 +1,8 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
5 6
     </div>
6 7
 
7 8
     <div class="app-container">
@@ -82,7 +83,12 @@
82 83
       return {
83 84
         crumbs: [
84 85
           { path: false, name: '库存管理' },
85
-          { path: false, name: '退货单' },
86
+          { path: false, name: '耗材退货单' },
87
+          { path: false, name: '退货单详情' }
88
+        ],
89
+        crumbs2: [
90
+          { path: false, name: '库存管理' },
91
+          { path: false, name: '其他退货单' },
86 92
           { path: false, name: '退货单详情' }
87 93
         ],
88 94
         isEdit: 0,

+ 226 - 209
src/xt_pages/stock/stockInOrderAdd.vue Näytä tiedosto

@@ -2,10 +2,12 @@
2 2
 
3 3
   <div class="main-contain">
4 4
     <div class="position">
5
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="type == 1" :crumbs='crumbs'></bread-crumb>
6
+      <bread-crumb v-if="type == 2" :crumbs='crumbs2'></bread-crumb>
7
+
6 8
       <div style="float:right;">
7
-      <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
8
-      <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
9
+        <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
+        <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
9 11
       </div>
10 12
     </div>
11 13
     <div class="app-container">
@@ -18,13 +20,16 @@
18 20
 
19 21
       <div class="cell clearfix">
20 22
         <label class="title"><span class="name">入库时间</span> : </label>
21
-        <el-date-picker size="small" v-model="warehousing_time"  prefix-icon="el-icon-date"  :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right"  format="yyyy-MM-dd" value-format="yyyy-MM-dd" > </el-date-picker>
23
+        <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
24
+                        style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
25
+                        value-format="yyyy-MM-dd"></el-date-picker>
22 26
       </div>
23 27
 
24 28
       <div class="cell clearfix">
25
-        <label class="title"><span class="name">厂商<span style="color: red;margin-left: -15px">*</span></span> : </label>
29
+        <label class="title"><span class="name">厂商</span> : </label>
26 30
 
27
-        <el-select size="small"  v-model="form.manufacturer" clearable  placeholder="请选择厂商" @change="changeManufacturer()" >
31
+        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商"
32
+                   @change="changeManufacturer">
28 33
           <el-option
29 34
             v-for="(option, index) in manufacturer"
30 35
             :key="index"
@@ -36,7 +41,7 @@
36 41
 
37 42
       <div class="cell clearfix">
38 43
         <label class="title"><span class="name">经销商</span> : </label>
39
-        <el-select  size="small" v-model="form.dealer" clearable  placeholder="请选择经销商" >
44
+        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
40 45
           <el-option
41 46
             v-for="(option, index) in dealer"
42 47
             :key="index"
@@ -47,141 +52,139 @@
47 52
       </div>
48 53
 
49 54
 
50
-            <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
51
-              <el-table   id="oictable" :data="recordInfo.recordData" :class="signAndWeighBoxPatients" border style="width: 100%"
52
-                        max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
53
-              >
54
-
55
-                <el-table-column  align="center" width="200">
56
-
57
-                  <template slot="header" slot-scope="scope">
58
-                    <span>商品类型<span style="color: red">*</span></span>
59
-                  </template>
60
-
61
-                  <template slot-scope="scope">
62
-                    <el-form-item style="padding-top: 15px;margin-left: 10px;margin-right: 10px">
63
-                      <el-input placeholder="请输入商品类型" v-model="scope.row.good_type_id"
64
-                                :value="typeName(scope.row.good_type_id)"
65
-                                @focus="showDialog(scope.$index, scope.row)"></el-input>
66
-                    </el-form-item>
67
-                  </template>
68
-                </el-table-column>
69
-                <el-table-column align="center" width="200">
70
-                  <template slot="header" slot-scope="scope">
71
-                    <span>规格名称<span style="color: red">*</span></span>
72
-                  </template>
73
-                  <template slot-scope="scope">
74
-
75
-                    <el-form-item style="padding-top: 15px">
76
-                      <el-input placeholder="请输入规格名称" v-model="scope.row.good_id"
77
-                                :value="specificationName(scope.row.good_id)"
78
-                                @focus="showDialog(scope.$index, scope.row)"></el-input>
79
-                    </el-form-item>
80
-
81
-                  </template>
82
-                </el-table-column>
83
-
84
-
85
-                <el-table-column  align="center" width="150">
86
-                  <template slot="header" slot-scope="scope">
87
-                    <span>单价<span style="color: red">*</span></span>
88
-                  </template>
89
-                  <template slot-scope="scope">
90
-                    <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
91
-                    <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
92
-                                  style="padding-top: 17px">
93
-                      <el-input placeholder="请输入单价"  type="number" v-model="scope.row.price"></el-input>
94
-                    </el-form-item>
95
-
96
-
97
-                  </template>
98
-                </el-table-column>
99
-
100
-                <el-table-column  align="center"  width="180">
101
-                  <template slot="header" slot-scope="scope">
102
-                    <span>入库数量<span style="color: red">*</span></span>
103
-                  </template>
104
-                  <template slot-scope="scope">
105
-                    <!--{{scope.row.warehousing_count}}-->
106
-                    <!--<el-input type="number" v-model="scope.row.warehousing_count"   @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
107
-
108
-                    <el-form-item :prop="'recordData.' + scope.$index + '.warehousing_count'"
109
-                                  :rules='tableRules.warehousing_count' style="padding-top: 17px">
110
-                      <el-input placeholder="请输入入库数量"  type="number" v-model="scope.row.warehousing_count"></el-input>
111
-                    </el-form-item>
112
-                  </template>
113
-                </el-table-column>
114
-
115
-                <el-table-column label="总价" align="center" width="150">
116
-                  <template slot-scope="scope">
117
-                    {{calculate(scope.row.price*scope.row.warehousing_count)}}
118
-                  </template>
119
-                </el-table-column>
120
-
121
-                <el-table-column align="center"  width="150">
122
-                  <template slot="header" slot-scope="scope">
123
-                    <span>批号<span style="color: red">*</span></span>
124
-                  </template>
125
-                  <template slot-scope="scope">
126
-                    <!--<el-input  v-model="scope.row.numbers"></el-input>-->
127
-
128
-                    <el-form-item :prop="'recordData.' + scope.$index + '.number'" :rules='tableRules.number'
129
-                                  style="padding-top: 17px">
130
-                      <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
131
-                    </el-form-item>
132
-
133
-                  </template>
134
-                </el-table-column>
135
-                <el-table-column label="生产日期"  align="center" width="250">
136
-                  <template slot-scope="scope">
137
-                    <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
138
-                    <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.product_date"
139
-                                    type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
140
-                                    value-format="yyyy-MM-dd"></el-date-picker>
141
-
142
-                  </template>
143
-                </el-table-column>
144
-                <el-table-column label="有效日期"  align="center" width="250">
145
-                  <template slot-scope="scope">
146
-                    <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
147
-                    <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.expiry_date"
148
-                                    type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
149
-                                    value-format="yyyy-MM-dd"></el-date-picker>
150
-
151
-                  </template>
152
-                </el-table-column>
153
-                <el-table-column label="备注"  align="center" width="150">
154
-                  <template slot-scope="scope">
155
-                    <el-input placeholder="请输入备注"   v-model="scope.row.remark"></el-input>
156
-                  </template>
157
-                </el-table-column>
158
-
159
-                <el-table-column label="操作" align="center" fixed="right"  width="150">
160
-                  <template slot-scope="scope" >
161
-                    <el-tooltip class="item" effect="dark" content="新增" placement="top">
162
-
163
-                    <el-button
164
-                      size="mini"
165
-                      type="primary"
166
-                      icon="el-icon-circle-plus-outline"
167
-                      @click="handleEdit(scope.$index, scope.row)">
168
-                    </el-button>
169
-                    </el-tooltip>
170
-                    <el-tooltip class="item" effect="dark" content="删除" placement="top">
171
-
172
-                    <el-button
173
-                      size="mini"
174
-                      type="danger"
175
-                      icon="el-icon-delete"
176
-                      @click="handleDelete(scope.$index, scope.row)">
177
-                    </el-button>
178
-                    </el-tooltip>
179
-
180
-                  </template>
181
-                </el-table-column>
182
-
183
-              </el-table>
184
-            </el-form>
55
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
56
+        <el-table id="oictable" :data="recordInfo.recordData" :class="signAndWeighBoxPatients" border
57
+                  style="width: 100%"
58
+                  max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
59
+        >
60
+
61
+          <el-table-column align="center" width="200">
62
+
63
+            <template slot="header" slot-scope="scope">
64
+              <span>商品类型<span style="color: red">*</span></span>
65
+            </template>
66
+
67
+            <template slot-scope="scope">
68
+              <el-form-item style="padding-top: 15px;margin-left: 10px;margin-right: 10px">
69
+                <el-input placeholder="请输入商品类型" v-model="scope.row.good_type_id"
70
+                          :value="typeName(scope.row.good_type_id)"
71
+                          @focus="showDialog(scope.$index, scope.row)"></el-input>
72
+              </el-form-item>
73
+            </template>
74
+          </el-table-column>
75
+          <el-table-column align="center" width="200">
76
+            <template slot="header" slot-scope="scope">
77
+              <span>规格名称<span style="color: red">*</span></span>
78
+            </template>
79
+            <template slot-scope="scope">
80
+
81
+              <el-form-item style="padding-top: 15px">
82
+                <el-input placeholder="请输入规格名称" v-model="scope.row.good_id"
83
+                          :value="specificationName(scope.row.good_id)"
84
+                          @focus="showDialog(scope.$index, scope.row)"></el-input>
85
+              </el-form-item>
86
+
87
+            </template>
88
+          </el-table-column>
89
+
90
+
91
+          <el-table-column align="center" width="150">
92
+            <template slot="header" slot-scope="scope">
93
+              <span>单价<span style="color: red">*</span></span>
94
+            </template>
95
+            <template slot-scope="scope">
96
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
97
+              <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
98
+                            style="padding-top: 17px">
99
+                <el-input placeholder="请输入单价" type="number" v-model="scope.row.price"></el-input>
100
+              </el-form-item>
101
+
102
+
103
+            </template>
104
+          </el-table-column>
105
+
106
+          <el-table-column align="center" width="180">
107
+            <template slot="header" slot-scope="scope">
108
+              <span>入库数量<span style="color: red">*</span></span>
109
+            </template>
110
+            <template slot-scope="scope">
111
+              <!--{{scope.row.warehousing_count}}-->
112
+              <!--<el-input type="number" v-model="scope.row.warehousing_count"   @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
113
+
114
+              <el-form-item :prop="'recordData.' + scope.$index + '.warehousing_count'"
115
+                            :rules='tableRules.warehousing_count' style="padding-top: 17px">
116
+                <el-input placeholder="请输入入库数量" type="number" v-model="scope.row.warehousing_count"></el-input>
117
+              </el-form-item>
118
+            </template>
119
+          </el-table-column>
120
+
121
+          <el-table-column label="总价" align="center" width="150">
122
+            <template slot-scope="scope">
123
+              {{calculate(scope.row.price*scope.row.warehousing_count)}}
124
+            </template>
125
+          </el-table-column>
126
+
127
+          <el-table-column align="center" width="150">
128
+            <template slot="header" slot-scope="scope">
129
+              <span>批号</span>
130
+            </template>
131
+            <template slot-scope="scope">
132
+              <el-form-item style="padding-top: 17px">
133
+                <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
134
+              </el-form-item>
135
+
136
+            </template>
137
+          </el-table-column>
138
+          <el-table-column label="生产日期" align="center" width="250">
139
+            <template slot-scope="scope">
140
+              <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
141
+              <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.product_date"
142
+                              type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
143
+                              value-format="yyyy-MM-dd"></el-date-picker>
144
+
145
+            </template>
146
+          </el-table-column>
147
+          <el-table-column label="有效日期" align="center" width="250">
148
+            <template slot-scope="scope">
149
+              <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
150
+              <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.expiry_date"
151
+                              type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
152
+                              value-format="yyyy-MM-dd"></el-date-picker>
153
+
154
+            </template>
155
+          </el-table-column>
156
+          <el-table-column label="备注" align="center" width="150">
157
+            <template slot-scope="scope">
158
+              <el-input placeholder="请输入备注" v-model="scope.row.remark"></el-input>
159
+            </template>
160
+          </el-table-column>
161
+
162
+          <el-table-column label="操作" align="center" fixed="right" width="150">
163
+            <template slot-scope="scope">
164
+              <el-tooltip class="item" effect="dark" content="新增" placement="top">
165
+
166
+                <el-button
167
+                  size="mini"
168
+                  type="primary"
169
+                  icon="el-icon-circle-plus-outline"
170
+                  @click="handleEdit(scope.$index, scope.row)">
171
+                </el-button>
172
+              </el-tooltip>
173
+              <el-tooltip class="item" effect="dark" content="删除" placement="top">
174
+
175
+                <el-button
176
+                  size="mini"
177
+                  type="danger"
178
+                  icon="el-icon-delete"
179
+                  @click="handleDelete(scope.$index, scope.row)">
180
+                </el-button>
181
+              </el-tooltip>
182
+
183
+            </template>
184
+          </el-table-column>
185
+
186
+        </el-table>
187
+      </el-form>
185 188
 
186 189
 
187 190
     </div>
@@ -221,7 +224,12 @@
221 224
       return {
222 225
         crumbs: [
223 226
           { path: false, name: '库存管理' },
224
-          { path: false, name: '入库单' },
227
+          { path: false, name: '耗材入库单' },
228
+          { path: false, name: '新增入库单' }
229
+        ],
230
+        crumbs2: [
231
+          { path: false, name: '库存管理' },
232
+          { path: false, name: '其他入库单' },
225 233
           { path: false, name: '新增入库单' }
226 234
         ],
227 235
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
@@ -242,19 +250,11 @@
242 250
           warehousing_count: [
243 251
             { required: true, message: '数量不能为空', trigge: 'blur' }
244 252
           ],
245
-          number: [
246
-            { required: true, message: '批号不能为空', trigge: 'blur' }
247
-          ],
253
+
248 254
           good_id: [
249 255
             { validator: checkGoodId, trigger: 'blur' }
250 256
           ]
251 257
 
252
-        },
253
-        ruleForm: {
254
-          manufacturer: [
255
-            { required: true, message: '请选择厂商', trigger: 'change' }
256
-          ]
257
-
258 258
         },
259 259
         type: this.$route.query.type,
260 260
         total: '',
@@ -335,16 +335,21 @@
335 335
 
336 336
         })
337 337
       }, handleCreate: function() {
338
+
338 339
         this.propForm.formValue = {}
339 340
         this.propForm.isCreated = 1
340 341
         this.isVisibility = true
341 342
       }, comfirm: function(val) {
343
+        this.propForm.goodType = []
342 344
         this.$refs.dialog.hide()
345
+        console.log(val)
343 346
         if (val.selectedGoodInfo.length > 0) {
344 347
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
345 348
             if (i == 0) {
346 349
               this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
347 350
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
351
+              this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
352
+
348 353
             } else {
349 354
               const tempForm = {}
350 355
               tempForm['good_type_id'] = val.goodTypeId
@@ -353,7 +358,7 @@
353 358
               tempForm['product_date'] = ''
354 359
               tempForm['expiry_date'] = ''
355 360
               tempForm['warehousing_count'] = ''
356
-              tempForm['price'] = ''
361
+              tempForm['price'] = val.selectedGoodInfo[i].buy_price.toString()
357 362
               tempForm['remark'] = ''
358 363
               tempForm['dealer'] = ''
359 364
               tempForm['manufacturer'] = ''
@@ -366,6 +371,7 @@
366 371
 
367 372
         this.currentIndex = -1
368 373
       }, cancle: function() {
374
+        this.propForm.goodType = []
369 375
         this.$refs.dialog.hide()
370 376
       }, GetAllGoodType: function() {
371 377
         GetAllGoodType().then(response => {
@@ -390,6 +396,13 @@
390 396
           }
391 397
         })
392 398
       }, GetConfigInfo: function() {
399
+        const loading = this.$loading({
400
+          lock: true,
401
+          text: 'Loading',
402
+          spinner: 'el-icon-loading',
403
+          background: 'rgba(0, 0, 0, 0.7)'
404
+        })
405
+
393 406
         GetAllConfig().then(response => {
394 407
           if (response.data.state == 0) {
395 408
             this.$message.error(response.data.msg)
@@ -399,7 +412,13 @@
399 412
             this.dealer = response.data.data.dealer
400 413
             this.goodType = response.data.data.goodType
401 414
             this.goodInfo = response.data.data.goodInfo
415
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
416
+            this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
417
+            this.form.manufacturer = 0
418
+            this.form.dealer = 0
402 419
           }
420
+          loading.close()
421
+
403 422
         })
404 423
       }, typeName: function(good_type_id) {
405 424
         let name = ''
@@ -461,43 +480,47 @@
461 480
           return ''
462 481
         }
463 482
       }, showDialog(index, row) {
483
+        const loading = this.$loading({
484
+          lock: true,
485
+          text: 'Loading',
486
+          spinner: 'el-icon-loading',
487
+          background: 'rgba(0, 0, 0, 0.7)'
488
+        })
464 489
         this.currentIndex = index
465
-        if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
466
-          this.$message.error('请先选择厂商')
467
-          return
468
-        } else {
469
-          this.$refs.dialog.show()
470
-
471
-          // this.isVisibility = true
472
-          // const params = {
473
-          //   id: this.form.manufacturer
474
-          // }
475
-          this.propForm.goodType = this.goodType
476
-          //
477
-
478
-          // GetAllGoodInfoByID(params).then(response => {
479
-          //   if (response.data.state == 0) {
480
-          //     this.$message.error(response.data.msg)
481
-          //     return false
482
-          //   } else {
483
-          //     if (response.data.data.goodInfo.length == 0) {
484
-          //       this.$message.error('该厂商没商品,请添加商品')
485
-          //     } else {
486
-          //       for (let i = 0; i < response.data.data.goodInfo.length; i++) {
487
-          //         this.propForm.goodType.push(response.data.data.goodInfo[i].GoodsType)
488
-          //       }
489
-          //
490
-          //       const obj = {}
491
-          //       this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
492
-          //         obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
493
-          //         return cur
494
-          //       }, []) // 设置cur默认类型为数组,并且初始值为空的数组
495
-          //
496
-          //     }
497
-          //   }
498
-          // })
490
+        this.isVisibility = true
491
+        const params = {
492
+          manufacturer_id: this.form.manufacturer,
493
+          dealer_id: this.form.dealer
499 494
         }
500
-      }, getSummaries(param) {
495
+        GetAllGoodInfoByID(params).then(response => {
496
+            if (response.data.state == 0) {
497
+              this.$message.error(response.data.msg)
498
+              return false
499
+              loading.close()
500
+
501
+            } else {
502
+              loading.close()
503
+
504
+              if (response.data.data.goodInfo.length <= 0) {
505
+                this.$message.error('该厂商或经销商没有物品信息')
506
+                return
507
+              }
508
+              this.$refs.dialog.show()
509
+              for (let i = 0; i < response.data.data.goodInfo.length; i++) {
510
+                this.propForm.goodType.push(response.data.data.goodInfo[i].GoodsType)
511
+              }
512
+              const obj = {}
513
+              this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
514
+                obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
515
+                return cur
516
+              }, []) // 设置cur默认类型为数组,并且初始值为空的数组
517
+            }
518
+
519
+
520
+          }
521
+        )
522
+      },
523
+      getSummaries(param) {
501 524
         const { columns, data } = param
502 525
         const sums = []
503 526
         columns.forEach((column, index) => {
@@ -522,15 +545,15 @@
522 545
         })
523 546
 
524 547
         return sums
525
-      }, back() {
548
+      }
549
+      ,
550
+      back() {
526 551
         this.$router.go(-1)
527
-      }, submit() {
552
+      }
553
+      ,
554
+      submit() {
528 555
         this.$refs['tableForm'].validate((valid) => {
529 556
           if (valid) {
530
-            if (this.form.manufacturer == 0) {
531
-              this.$message.error('厂商不能为空')
532
-              return
533
-            }
534 557
             const array = this.recordInfo.recordData
535 558
             for (let i = 0; i < array.length; i++) {
536 559
               if (array[i].good_type_id == 0) {
@@ -560,22 +583,16 @@
560 583
             return false
561 584
           }
562 585
         })
563
-      }, changeManufacturer() {
564
-        this.recordInfo.recordData = []
565
-        const tempObj = {}
566
-        tempObj['good_type_id'] = 0
567
-        tempObj['good_id'] = 0
568
-        tempObj['number'] = ''
569
-        tempObj['product_date'] = ''
570
-        tempObj['expiry_date'] = ''
571
-        tempObj['warehousing_count'] = ''
572
-        tempObj['price'] = ''
573
-        tempObj['remark'] = ''
574
-        tempObj['dealer'] = ''
575
-        tempObj['manufacturer'] = ''
576
-        this.recordInfo.recordData.push(tempObj)
577 586
       }
578
-    },
587
+      ,
588
+      changeManufacturer(val) {
589
+
590
+
591
+      }, changeDealer(val) {
592
+
593
+      }
594
+    }
595
+    ,
579 596
     created() {
580 597
       var nowDate = new Date()
581 598
       var nowYear = nowDate.getFullYear()

+ 9 - 2
src/xt_pages/stock/stockInOrderDetail.vue Näytä tiedosto

@@ -1,7 +1,9 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+
5 7
     </div>
6 8
   <div class="app-container">
7 9
     <div class="filter-container">
@@ -122,7 +124,12 @@
122 124
       return {
123 125
         crumbs: [
124 126
           { path: false, name: '库存管理' },
125
-          { path: false, name: '入库单' },
127
+          { path: false, name: '耗材入库单' },
128
+          { path: false, name: '入库单详情' }
129
+        ],
130
+        crumbs2: [
131
+          { path: false, name: '库存管理' },
132
+          { path: false, name: '其他入库单' },
126 133
           { path: false, name: '入库单详情' }
127 134
         ],
128 135
         isEdit: 0,

+ 87 - 29
src/xt_pages/stock/stockInOrderEdit.vue Näytä tiedosto

@@ -1,7 +1,9 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2"  :crumbs='crumbs2'></bread-crumb>
6
+
5 7
       <div style="float:right;">
6 8
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
7 9
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
@@ -22,6 +24,35 @@
22 24
       <el-date-picker size="small" v-model="warehousing_time"  prefix-icon="el-icon-date"  :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right"  format="yyyy-MM-dd" value-format="yyyy-MM-dd" > </el-date-picker>
23 25
     </div>
24 26
 
27
+    <div class="cell clearfix">
28
+      <label class="title"><span class="name">经销商</span> : </label>
29
+      <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商">
30
+        <el-option
31
+          v-for="(option, index) in dealer"
32
+          :key="index"
33
+          :label="option.dealer_name"
34
+          :value="option.id">
35
+        </el-option>
36
+      </el-select>
37
+    </div>
38
+
39
+
40
+
41
+    <div class="cell clearfix">
42
+      <label class="title"><span class="name">厂商</span> : </label>
43
+
44
+      <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商"
45
+                >
46
+        <el-option
47
+          v-for="(option, index) in manufacturer"
48
+          :key="index"
49
+          :label="option.manufacturer_name"
50
+          :value="option.id">
51
+        </el-option>
52
+      </el-select>
53
+    </div>
54
+
55
+
25 56
 
26 57
         <el-form  :rules="tableRules" :model="recordInfo" ref="tableForm">
27 58
           <el-table id="oictable" :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
@@ -96,12 +127,10 @@
96 127
 
97 128
             <el-table-column align="center"  width="150">
98 129
               <template slot="header" slot-scope="scope">
99
-                <span>批号<span style="color: red">*</span></span>
130
+                <span>批号</span>
100 131
               </template>
101 132
               <template slot-scope="scope">
102
-                <!--<el-input  v-model="scope.row.numbers"></el-input>-->
103
-                <el-form-item :prop="'recordData.' + scope.$index + '.number'" :rules='tableRules.number'
104
-                              style="padding-top: 17px">
133
+                <el-form-item>
105 134
                   <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
106 135
                 </el-form-item>
107 136
               </template>
@@ -195,7 +224,12 @@ export default {
195 224
       return {
196 225
         crumbs: [
197 226
           { path: false, name: '库存管理' },
198
-          { path: false, name: '入库单' },
227
+          { path: false, name: '耗材入库单' },
228
+          { path: false, name: '编辑入库单' }
229
+        ],
230
+        crumbs2: [
231
+          { path: false, name: '库存管理' },
232
+          { path: false, name: '其他入库单' },
199 233
           { path: false, name: '编辑入库单' }
200 234
         ],
201 235
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
@@ -216,20 +250,13 @@ export default {
216 250
           warehousing_count: [
217 251
             { required: true, message: '数量不能为空', trigge: 'blur' }
218 252
           ],
219
-          number: [
220
-            { required: true, message: '批号不能为空', trigge: 'blur' }
221
-          ],
253
+
222 254
           good_id: [
223 255
             { validator: checkGoodId, trigger: 'blur' }
224 256
           ]
225 257
 
226 258
         },
227
-        ruleForm: {
228
-          manufacturer: [
229
-            { required: true, message: '请选择厂商', trigger: 'change' }
230
-          ]
231 259
 
232
-        },
233 260
 
234 261
         total: '',
235 262
         product_date: '',
@@ -260,12 +287,15 @@ export default {
260 287
 
261 288
       comfirm: function(val) {
262 289
         this.$refs.dialog.hide()
290
+        this.propForm.goodType = []
263 291
 
264 292
         if (val.selectedGoodInfo.length > 0) {
265 293
           for (let i = val.selectedGoodInfo.length - 1; ;i--) {
266 294
             if (i == 0) {
267 295
               this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
268 296
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
297
+              this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
298
+
269 299
             } else {
270 300
               const tempForm = {}
271 301
               tempForm['id'] = 0
@@ -275,7 +305,7 @@ export default {
275 305
               tempForm['product_date'] = ''
276 306
               tempForm['expiry_date'] = ''
277 307
               tempForm['warehousing_count'] = ''
278
-              tempForm['price'] = ''
308
+              tempForm['price'] = val.selectedGoodInfo[i].buy_price.toString()
279 309
               tempForm['remark'] = ''
280 310
               tempForm['dealer'] = ''
281 311
               tempForm['manufacturer'] = ''
@@ -287,7 +317,15 @@ export default {
287 317
         this.currentIndex = -1
288 318
       }, cancle: function() {
289 319
         this.$refs.dialog.hide()
320
+        this.propForm.goodType = []
321
+
290 322
       }, GetConfigInfo: function() {
323
+        const loading = this.$loading({
324
+          lock: true,
325
+          text: 'Loading',
326
+          spinner: 'el-icon-loading',
327
+          background: 'rgba(0, 0, 0, 0.7)'
328
+        })
291 329
         GetAllConfig().then(response => {
292 330
           if (response.data.state == 0) {
293 331
             this.$message.error(response.data.msg)
@@ -297,7 +335,11 @@ export default {
297 335
             this.dealer = response.data.data.dealer
298 336
             this.goodType = response.data.data.goodType
299 337
             this.goodInfo = response.data.data.goodInfo
338
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
339
+            this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
300 340
           }
341
+          loading.close()
342
+
301 343
         })
302 344
       }, typeName: function(good_type_id) {
303 345
         let name = ''
@@ -367,25 +409,40 @@ export default {
367 409
         }
368 410
       }, showDialog(index, row) {
369 411
         this.currentIndex = index
370
-        if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
371
-          this.$message.error('请先选择厂商')
372
-          return
373
-        } else {
374
-          this.isVisibility = true
375
-          const params = {
376
-            id: this.form.manufacturer
377
-          }
378
-          this.propForm.goodType = []
379
-          GetAllGoodInfoByID(params).then(response => {
412
+        const loading = this.$loading({
413
+          lock: true,
414
+          text: 'Loading',
415
+          spinner: 'el-icon-loading',
416
+          background: 'rgba(0, 0, 0, 0.7)'
417
+        })
418
+
419
+        const params = {
420
+          manufacturer_id: this.form.manufacturer,
421
+          dealer_id: this.form.dealer
422
+        }
423
+        GetAllGoodInfoByID(params).then(response => {
380 424
             if (response.data.state == 0) {
381 425
               this.$message.error(response.data.msg)
382 426
               return false
383 427
             } else {
384
-              this.propForm.goodType = this.goodType
428
+              if(response.data.data.goodInfo.length <= 0){
429
+                this.$message.error("该厂商或经销商没有物品信息")
430
+                return
431
+              }
385 432
               this.$refs.dialog.show()
433
+              for (let i = 0; i < response.data.data.goodInfo.length; i++) {
434
+                this.propForm.goodType.push(response.data.data.goodInfo[i].GoodsType)
435
+              }
436
+              const obj = {}
437
+              this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
438
+                obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
439
+                return cur
440
+              }, []) // 设置cur默认类型为数组,并且初始值为空的数组
386 441
             }
387
-          })
388
-        }
442
+            loading.close()
443
+
444
+          }
445
+        )
389 446
       }, back() {
390 447
         this.$router.go(-1)
391 448
       }, submit() {
@@ -406,7 +463,7 @@ export default {
406 463
             const params = {
407 464
               'stockIn': this.recordInfo.recordData
408 465
             }
409
-            EditWarehouse(params, this.warehousing_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer).then(response => {
466
+            EditWarehouse(params, this.warehousing_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
410 467
               if (response.data.state == 0) {
411 468
                 this.$message.error(response.data.msg)
412 469
                 return false
@@ -441,6 +498,7 @@ export default {
441 498
             this.warehouse = response.data.data.warehousing
442 499
             this.form.manufacturer = this.warehouse.manufacturer
443 500
             this.form.dealer = this.warehouse.dealer
501
+
444 502
             this.warehousing_time = this.getTime(this.warehouse.warehousing_time, '{y}-{m}-{d}')
445 503
 
446 504
             if (this.recordInfo.recordData.length == 0) {

+ 233 - 179
src/xt_pages/stock/stockOutOrderAdd.vue Näytä tiedosto

@@ -2,161 +2,168 @@
2 2
 
3 3
   <div class="main-contain">
4 4
     <div class="position">
5
-    <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
6
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
7
+
8
+
6 9
       <div style="float:right;">
7
-        <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
8
-        <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
10
+        <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
11
+        <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
9 12
       </div>
10
-  </div>
13
+    </div>
11 14
 
12
-  <div class="app-container">
15
+    <div class="app-container">
13 16
 
14
-    <sales-return-dialog ref="dialog" :propForm="propForm"
15
-                         :visibility="isVisibility"
16
-                         v-on:dialog-comfirm="comfirm"
17
-                         v-on:dialog-cancle="cancle"></sales-return-dialog>
17
+      <sales-return-dialog ref="dialog" :propForm="propForm"
18
+                           :visibility="isVisibility"
19
+                           v-on:dialog-comfirm="comfirm"
20
+                           v-on:dialog-cancle="cancle"></sales-return-dialog>
18 21
 
19
-    <div class="cell clearfix">
22
+      <div class="cell clearfix">
20 23
         <label class="title"><span class="name">出库时间</span> : </label>
21
-          <el-date-picker size="small" v-model="warehouse_out_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
22
-                          type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
23
-                          value-format="yyyy-MM-dd"></el-date-picker>
24
-        </div>
25
-
26
-
27
-    <div class="cell clearfix">
28
-      <label class="title"><span class="name">厂商<span style="color: red;margin-left: -15px">*</span></span> : </label>
29
-
30
-      <el-select size="small"  v-model="form.manufacturer" clearable  placeholder="请选择厂商"  @change="changeManufacturer()">
31
-        <el-option
32
-          v-for="(option, index) in manufacturer"
33
-          :key="index"
34
-          :label="option.manufacturer_name"
35
-          :value="option.id">
36
-        </el-option>
37
-      </el-select>
38
-    </div>
24
+        <el-date-picker size="small" v-model="warehouse_out_time" prefix-icon="el-icon-date" :editable="false"
25
+                        style="width: 196px;"
26
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
27
+                        value-format="yyyy-MM-dd"></el-date-picker>
28
+      </div>
39 29
 
40
-    <div class="cell clearfix">
41
-      <label class="title"><span class="name">经销商</span> : </label>
42
-      <el-select size="small"  v-model="form.dealer" clearable  placeholder="请选择经销商" >
43
-        <el-option
44
-          v-for="(option, index) in dealer"
45
-          :key="index"
46
-          :label="option.dealer_name"
47
-          :value="option.id">
48
-        </el-option>
49
-      </el-select>
50
-    </div>
51 30
 
31
+      <div class="cell clearfix">
32
+        <label class="title"><span class="name">经销商</span> : </label>
33
+        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
34
+          <el-option
35
+            v-for="(option, index) in dealer"
36
+            :key="index"
37
+            :label="option.dealer_name"
38
+            :value="option.id">
39
+          </el-option>
40
+        </el-select>
41
+      </div>
52 42
 
53
-        <el-form  :rules="tableRules" :model="recordInfo" ref="tableForm">
54
-          <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
55
-                    max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
56
-          >
57
-
58
-            <el-table-column min-width="35" align="center">
59
-
60
-              <template slot="header" slot-scope="scope">
61
-                <span>商品类型<span style="color: red">*</span></span>
62
-              </template>
63
-
64
-              <template slot-scope="scope" >
65
-                <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id == 0" style="color:#c5c8cf">请输入类型</span>-->
66
-                <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id != 0">{{typeName(scope.row.good_type_id)}}</span>-->
67
-
68
-                <el-form-item  style="padding-top: 15px">
69
-                  <el-input placeholder="请输入商品类型"  v-model="scope.row.good_type_id" :value="typeName(scope.row.good_type_id)" @focus="showDialog(scope.$index, scope.row)" ></el-input>
70
-                </el-form-item>
71
-
72
-              </template>
73
-            </el-table-column>
74
-            <el-table-column min-width="35" align="center">
75
-              <template slot="header" slot-scope="scope">
76
-                <span>规格名称<span style="color: red">*</span></span>
77
-              </template>
78
-              <template slot-scope="scope">
79
-
80
-                <el-form-item  style="padding-top: 15px">
81
-                  <el-input placeholder="请输入规格名称"  v-model="scope.row.good_id" :value="specificationName(scope.row.good_id)" @focus="showDialog(scope.$index, scope.row)" ></el-input>
82
-                </el-form-item>
83
-
84
-              </template>
85
-            </el-table-column>
86
-
87
-
88
-            <el-table-column  min-width="23" align="center">
89
-              <template slot="header" slot-scope="scope">
90
-                <span>单价<span style="color: red">*</span></span>
91
-              </template>
92
-              <template slot-scope="scope">
93
-                <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
94
-                <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price' style="padding-top: 17px">
95
-                  <el-input placeholder="请输入单价" type="number"  v-model="scope.row.price" ></el-input>
96
-                </el-form-item>
97
-
98
-
99
-              </template>
100
-            </el-table-column>
101
-
102
-            <el-table-column  min-width="23" align="center">
103
-              <template slot="header" slot-scope="scope">
104
-                <span>出库数量<span style="color: red">*</span></span>
105
-              </template>
106
-              <template slot-scope="scope">
107
-                <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count' style="padding-top: 17px">
108
-                  <el-input placeholder="请输入出库数量" type="number"  v-model="scope.row.count" ></el-input>
109
-                </el-form-item>
110
-              </template>
111
-            </el-table-column>
112
-
113
-            <el-table-column label="总价" min-width="20" align="center">
114
-              <template slot-scope="scope">
115
-                {{calculate(scope.row.price*scope.row.count)}}
116
-              </template>
117
-            </el-table-column>
118
-            <el-table-column label="备注" min-width="20" align="center">
119
-              <template slot-scope="scope">
120
-                <el-input  v-model="scope.row.remark"></el-input>
121
-              </template>
122
-            </el-table-column>
123
-
124
-            <el-table-column label="操作" align="center" min-width="20">
125
-              <template slot-scope="scope">
126
-                <el-tooltip class="item" effect="dark" content="新增" placement="top">
127
-
128
-                  <el-button
129
-                    size="mini"
130
-                    type="primary"
131
-                    icon="el-icon-circle-plus-outline"
132
-                    @click="handleEdit(scope.$index, scope.row)">
133
-                  </el-button>
134
-                </el-tooltip>
135
-                <el-tooltip class="item" effect="dark" content="删除" placement="top">
136
-
137
-                  <el-button
138
-                    size="mini"
139
-                    type="danger"
140
-                    icon="el-icon-delete"
141
-                    @click="handleDelete(scope.$index, scope.row)">
142
-                  </el-button>
143
-                </el-tooltip>
144
-
145
-              </template>
146
-            </el-table-column>
147
-          </el-table>
148
-        </el-form>
149
-  </div>
43
+
44
+      <div class="cell clearfix">
45
+        <label class="title"><span class="name">厂商</span> : </label>
46
+        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer">
47
+          <el-option
48
+            v-for="(option, index) in manufacturer"
49
+            :key="index"
50
+            :label="option.manufacturer_name"
51
+            :value="option.id">
52
+          </el-option>
53
+        </el-select>
54
+      </div>
55
+
56
+
57
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
58
+        <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
59
+                  max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
60
+        >
61
+
62
+          <el-table-column min-width="35" align="center">
63
+
64
+            <template slot="header" slot-scope="scope">
65
+              <span>商品类型</span>
66
+            </template>
67
+
68
+            <template slot-scope="scope">
69
+              <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id == 0" style="color:#c5c8cf">请输入类型</span>-->
70
+              <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id != 0">{{typeName(scope.row.good_type_id)}}</span>-->
71
+
72
+              <el-form-item style="padding-top: 15px">
73
+                <el-input placeholder="请输入商品类型" v-model="scope.row.good_type_id"
74
+                          :value="typeName(scope.row.good_type_id)"
75
+                          @focus="showDialog(scope.$index, scope.row)"></el-input>
76
+              </el-form-item>
77
+
78
+            </template>
79
+          </el-table-column>
80
+          <el-table-column min-width="35" align="center">
81
+            <template slot="header" slot-scope="scope">
82
+              <span>规格名称<span style="color: red">*</span></span>
83
+            </template>
84
+            <template slot-scope="scope">
85
+
86
+              <el-form-item style="padding-top: 15px">
87
+                <el-input placeholder="请输入规格名称" v-model="scope.row.good_id"
88
+                          :value="specificationName(scope.row.good_id)"
89
+                          @focus="showDialog(scope.$index, scope.row)"></el-input>
90
+              </el-form-item>
91
+
92
+            </template>
93
+          </el-table-column>
94
+
95
+
96
+          <el-table-column min-width="23" align="center">
97
+            <template slot="header" slot-scope="scope">
98
+              <span>单价<span style="color: red">*</span></span>
99
+            </template>
100
+            <template slot-scope="scope">
101
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
102
+              <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
103
+                            style="padding-top: 17px">
104
+                <el-input placeholder="请输入单价" type="number" v-model="scope.row.price"></el-input>
105
+              </el-form-item>
106
+
107
+
108
+            </template>
109
+          </el-table-column>
110
+
111
+          <el-table-column min-width="23" align="center">
112
+            <template slot="header" slot-scope="scope">
113
+              <span>出库数量<span style="color: red">*</span></span>
114
+            </template>
115
+            <template slot-scope="scope">
116
+              <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
117
+                            style="padding-top: 17px">
118
+                <el-input placeholder="请输入出库数量" type="number" v-model="scope.row.count"></el-input>
119
+              </el-form-item>
120
+            </template>
121
+          </el-table-column>
122
+
123
+          <el-table-column label="总价" min-width="20" align="center">
124
+            <template slot-scope="scope">
125
+              {{calculate(scope.row.price*scope.row.count)}}
126
+            </template>
127
+          </el-table-column>
128
+          <el-table-column label="备注" min-width="20" align="center">
129
+            <template slot-scope="scope">
130
+              <el-input v-model="scope.row.remark"></el-input>
131
+            </template>
132
+          </el-table-column>
133
+
134
+          <el-table-column label="操作" align="center" min-width="20">
135
+            <template slot-scope="scope">
136
+              <el-tooltip class="item" effect="dark" content="新增" placement="top">
137
+
138
+                <el-button
139
+                  size="mini"
140
+                  type="primary"
141
+                  icon="el-icon-circle-plus-outline"
142
+                  @click="handleEdit(scope.$index, scope.row)">
143
+                </el-button>
144
+              </el-tooltip>
145
+              <el-tooltip class="item" effect="dark" content="删除" placement="top">
146
+
147
+                <el-button
148
+                  size="mini"
149
+                  type="danger"
150
+                  icon="el-icon-delete"
151
+                  @click="handleDelete(scope.$index, scope.row)">
152
+                </el-button>
153
+              </el-tooltip>
154
+
155
+            </template>
156
+          </el-table-column>
157
+        </el-table>
158
+      </el-form>
159
+    </div>
150 160
   </div>
151 161
 
152 162
 </template>
153 163
 
154 164
 <script>
155 165
   import { uParseTime } from '@/utils/tools'
156
-  import {
157
-    getSalesReturnConfig,
158
-    postWarehouseOut
159
-  } from '@/api/stock'
166
+  import { getSalesReturnConfig, postWarehouseOut } from '@/api/stock'
160 167
   import SalesReturnDialog from './Dialog/salesReturnDialog'
161 168
   import BreadCrumb from '../components/bread-crumb'
162 169
 
@@ -168,7 +175,12 @@
168 175
       return {
169 176
         crumbs: [
170 177
           { path: false, name: '库存管理' },
171
-          { path: false, name: '出库单' },
178
+          { path: false, name: '耗材出库单' },
179
+          { path: false, name: '新增出库单' }
180
+        ],
181
+        crumbs2: [
182
+          { path: false, name: '库存管理' },
183
+          { path: false, name: '其他出库单' },
172 184
           { path: false, name: '新增出库单' }
173 185
         ],
174 186
         type: this.$route.query.type,
@@ -197,13 +209,15 @@
197 209
         propForm: {
198 210
           goodType: [],
199 211
           goodInfo: [],
200
-          goodUnit: []
212
+          goodUnit: [],
213
+          manufacturer: 0,
214
+          dealer: 0
201 215
         },
202 216
         form: {
203
-          manufacturer: '',
204
-          dealer: ''
217
+          manufacturer: 0,
218
+          dealer: 0
205 219
         },
206
-        warehouseInfoList:[],
220
+        warehouseInfoList: [],
207 221
         manufacturer: [],
208 222
         dealer: [],
209 223
         goodType: []
@@ -212,9 +226,9 @@
212 226
     methods: {
213 227
       comfirm: function(val) {
214 228
         this.$refs.dialog.hide()
215
-
229
+        this.propForm.goodType = []
216 230
         if (val.selectedGoodInfo.length > 0) {
217
-          for (let i = val.selectedGoodInfo.length - 1; ;i--) {
231
+          for (let i = val.selectedGoodInfo.length - 1; ; i--) {
218 232
             if (i == 0) {
219 233
               this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
220 234
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
@@ -233,32 +247,48 @@
233 247
         this.currentIndex = -1
234 248
       }, cancle: function() {
235 249
         this.$refs.dialog.hide()
250
+        this.propForm.goodType = []
251
+
236 252
       }, GetConfigInfo: function() {
237 253
         const params = {
238 254
           type: this.$route.query.type
239 255
 
240 256
         }
241 257
         getSalesReturnConfig(params).then(response => {
258
+          const loading = this.$loading({
259
+            lock: true,
260
+            text: 'Loading',
261
+            spinner: 'el-icon-loading',
262
+            background: 'rgba(0, 0, 0, 0.7)'
263
+          })
264
+
242 265
           if (response.data.state == 0) {
243 266
             this.$message.error(response.data.msg)
244 267
             return false
245 268
           } else {
246
-            var warehouseList = response.data.data.warehouseList
269
+            loading.close()
247 270
             var warehouseInfoList = response.data.data.warehouseInfoList
248 271
             this.warehouseInfoList = response.data.data.warehouseInfoList
249
-            for (let i = 0; i < warehouseList.length; i++) {
250
-              if (warehouseList[i].Manufacturer.id > 0) {
251
-                this.manufacturer.push(warehouseList[i].Manufacturer)
272
+            for (let i = 0; i < warehouseInfoList.length; i++) {
273
+              if (warehouseInfoList[i].info.manufacturers.id > 0) {
274
+                this.manufacturer.push(warehouseInfoList[i].info.manufacturers)
252 275
               }
253
-              if (warehouseList[i].Dealer.id > 0) {
254
-                this.dealer.push(warehouseList[i].Dealer)
276
+              if (warehouseInfoList[i].info.dealers.id > 0) {
277
+                this.dealer.push(warehouseInfoList[i].info.dealers)
255 278
               }
256 279
             }
257
-            for (let i = 0; i < warehouseInfoList.length; i++) {
258
-              this.propForm.goodInfo.push(warehouseInfoList[i].GoodInfo)
280
+
281
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
282
+              this.goodType.push(this.warehouseInfoList[i].info.type)
283
+            }
284
+
285
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
286
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
259 287
             }
260 288
             const obj = {}
261 289
             const obj2 = {}
290
+            const obj3 = {}
291
+
262 292
             const obj4 = {}
263 293
             // 去重复
264 294
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
@@ -274,13 +304,22 @@
274 304
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
275 305
               return cur
276 306
             }, [])
307
+
308
+            this.goodType = this.goodType.reduce((cur, next) => {
309
+              obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
310
+              return cur
311
+            }, [])
312
+
313
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
314
+            this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
315
+
277 316
           }
278 317
         })
279 318
       }, typeName: function(good_type_id) {
280 319
         let name = ''
281
-        for (let i = 0; i < this.propForm.goodType.length; i++) {
282
-          if (this.propForm.goodType[i].id == good_type_id) {
283
-            name = this.propForm.goodType[i].type_name
320
+        for (let i = 0; i < this.goodType.length; i++) {
321
+          if (this.goodType[i].id == good_type_id) {
322
+            name = this.goodType[i].type_name
284 323
           }
285 324
         }
286 325
         return name
@@ -324,15 +363,36 @@
324 363
         }
325 364
       }, showDialog(index, row) {
326 365
         this.currentIndex = index
327
-        if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
328
-          this.$message.error('请先选择厂商')
329
-          return
330
-        } else {
331
-          this.$refs.dialog.show()
332
-
366
+        this.propForm.goodType = []
367
+        if (this.form.manufacturer == 0 && this.form.dealer == 0) {
333 368
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
334
-            if (this.warehouseInfoList[i].manufacturer == this.form.manufacturer) {
335
-              this.propForm.goodType.push(this.warehouseInfoList[i].GoodInfo.GoodsType)
369
+            this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
370
+          }
371
+          const obj3 = {}
372
+          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
373
+            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
374
+            return cur
375
+          }, [])
376
+        } else {
377
+          if (this.form.manufacturer == 0 && this.form.dealer != 0) {
378
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
379
+              if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
380
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
381
+              }
382
+            }
383
+          }
384
+          if (this.form.manufacturer != 0 && this.form.dealer == 0) {
385
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
386
+              if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
387
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
388
+              }
389
+            }
390
+          }
391
+          if (this.form.manufacturer != 0 && this.form.dealer != 0) {
392
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
393
+              if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
394
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
395
+              }
336 396
             }
337 397
           }
338 398
           const obj3 = {}
@@ -341,15 +401,13 @@
341 401
             return cur
342 402
           }, [])
343 403
         }
404
+        this.$refs.dialog.show()
405
+
344 406
       }, back() {
345 407
         this.$router.go(-1)
346 408
       }, submit() {
347 409
         this.$refs['tableForm'].validate((valid) => {
348 410
           if (valid) {
349
-            if (this.form.manufacturer == 0) {
350
-              this.$message.error('厂商不能为空')
351
-              return
352
-            }
353 411
             const array = this.recordInfo.recordData
354 412
             let total = 0
355 413
             for (let i = 0; i < array.length; i++) {
@@ -382,15 +440,10 @@
382 440
             return false
383 441
           }
384 442
         })
385
-      }, changeManufacturer() {
386
-        this.recordInfo.recordData = []
387
-        const tempObj = {}
388
-        tempObj['good_type_id'] = 0
389
-        tempObj['good_id'] = 0
390
-        tempObj['return_count'] = 0
391
-        tempObj['price'] = ''
392
-        tempObj['remark'] = ''
393
-        this.recordInfo.recordData.push(tempObj)
443
+      }, changeManufacturer(val) {
444
+        this.propForm.manufacturer = val
445
+      }, changeDealer(val) {
446
+        this.propForm.dealer = val
394 447
       }
395 448
     },
396 449
     created() {
@@ -428,6 +481,7 @@
428 481
     border-bottom: 1px #dcdfe6 solid;
429 482
     margin: 0px 0 20px 0;
430 483
   }
484
+
431 485
   }
432 486
 
433 487
 

+ 9 - 2
src/xt_pages/stock/stockOutOrderDetail.vue Näytä tiedosto

@@ -1,7 +1,9 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+
5 7
     </div>
6 8
 
7 9
     <div class="app-container">
@@ -108,7 +110,12 @@
108 110
       return {
109 111
         crumbs: [
110 112
           { path: false, name: '库存管理' },
111
-          { path: false, name: '出库单' },
113
+          { path: false, name: '耗材出库单' },
114
+          { path: false, name: '出库单详情' }
115
+        ],
116
+        crumbs2: [
117
+          { path: false, name: '库存管理' },
118
+          { path: false, name: '其他出库单' },
112 119
           { path: false, name: '出库单详情' }
113 120
         ],
114 121
         isEdit: 0,

+ 243 - 137
src/xt_pages/stock/stockOutOrderEdit.vue Näytä tiedosto

@@ -1,124 +1,157 @@
1 1
 <template>
2 2
   <div class="main-contain">
3 3
     <div class="position">
4
-      <bread-crumb :crumbs='crumbs'></bread-crumb>
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+
7
+
5 8
       <div style="float:right;">
6
-        <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
7
-        <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
9
+        <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
+        <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
8 11
       </div>
9 12
     </div>
10 13
 
11
-  <div class="app-container">
14
+    <div class="app-container">
12 15
 
13
-    <sales-return-dialog  ref="dialog"  :propForm="propForm"
14
-                     :visibility="isVisibility"
15
-                     v-on:dialog-comfirm="comfirm"
16
-                     v-on:dialog-cancle="cancle"></sales-return-dialog>
16
+      <sales-return-dialog ref="dialog" :propForm="propForm"
17
+                           :visibility="isVisibility"
18
+                           v-on:dialog-comfirm="comfirm"
19
+                           v-on:dialog-cancle="cancle"></sales-return-dialog>
17 20
 
18
-    <div class="cell clearfix">
19
-      <label class="title"><span class="name">出库时间</span> : </label>
20
-      <el-date-picker size="small" v-model="warehouse_out_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
21
-                            type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
22
-                            value-format="yyyy-MM-dd"></el-date-picker>
23
-    </div>
21
+      <div class="cell clearfix">
22
+        <label class="title"><span class="name">出库时间</span> : </label>
23
+        <el-date-picker size="small" v-model="warehouse_out_time" prefix-icon="el-icon-date" :editable="false"
24
+                        style="width: 196px;"
25
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
26
+                        value-format="yyyy-MM-dd"></el-date-picker>
27
+      </div>
24 28
 
25
-        <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
26
-          <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
27
-                    max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
28
-          >
29
-
30
-            <el-table-column min-width="35" align="center">
31
-
32
-              <template slot="header" slot-scope="scope">
33
-                <span>商品类型<span style="color: red">*</span></span>
34
-              </template>
35
-
36
-              <template slot-scope="scope">
37
-                <el-form-item style="padding-top: 15px">
38
-                  <el-input placeholder="请输入商品类型" v-model="scope.row.good_type_id"
39
-                            :value="typeName(scope.row.good_type_id)"
40
-                            @focus="showDialog(scope.$index, scope.row)"></el-input>
41
-                </el-form-item>
42
-              </template>
43
-            </el-table-column>
44
-            <el-table-column min-width="35" align="center">
45
-              <template slot="header" slot-scope="scope">
46
-                <span>规格名称<span style="color: red">*</span></span>
47
-              </template>
48
-              <template slot-scope="scope">
49
-
50
-                <el-form-item style="padding-top: 15px">
51
-                  <el-input placeholder="请输入规格名称" v-model="scope.row.good_id"
52
-                            :value="specificationName(scope.row.good_id)"
53
-                            @focus="showDialog(scope.$index, scope.row)"></el-input>
54
-                </el-form-item>
55
-
56
-              </template>
57
-            </el-table-column>
58
-
59
-
60
-            <el-table-column  min-width="23" align="center">
61
-              <template slot="header" slot-scope="scope">
62
-                <span>单价<span style="color: red">*</span></span>
63
-              </template>
64
-              <template slot-scope="scope">
65
-                <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
66
-                <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price' style="padding-top: 17px">
67
-                  <el-input type="number"  v-model="scope.row.price" ></el-input>
68
-                </el-form-item>
69
-
70
-
71
-              </template>
72
-            </el-table-column>
73
-
74
-            <el-table-column  min-width="23" align="center">
75
-              <template slot="header" slot-scope="scope">
76
-                <span>出库数量<span style="color: red">*</span></span>
77
-              </template>
78
-              <template slot-scope="scope">
79
-                <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count' style="padding-top: 17px">
80
-                  <el-input type="number"  v-model="scope.row.count" ></el-input>
81
-                </el-form-item>
82
-              </template>
83
-            </el-table-column>
84
-
85
-            <el-table-column label="总价" min-width="20" align="center">
86
-              <template slot-scope="scope">
87
-                {{calculate(scope.row.price*scope.row.count)}}
88
-              </template>
89
-            </el-table-column>
90
-            <el-table-column label="备注" min-width="20" align="center">
91
-              <template slot-scope="scope">
92
-                <el-input  v-model="scope.row.remark"></el-input>
93
-              </template>
94
-            </el-table-column>
95
-            <el-table-column label="操作" align="center" min-width="20">
96
-              <template slot-scope="scope">
97
-                <el-tooltip class="item" effect="dark" content="新增" placement="top">
98
-
99
-                  <el-button
100
-                    size="mini"
101
-                    type="primary"
102
-                    icon="el-icon-circle-plus-outline"
103
-                    @click="handleEdit(scope.$index, scope.row)">
104
-                  </el-button>
105
-                </el-tooltip>
106
-                <el-tooltip class="item" effect="dark" content="删除" placement="top">
107
-
108
-                  <el-button
109
-                    size="mini"
110
-                    type="danger"
111
-                    icon="el-icon-delete"
112
-                    @click="handleDelete(scope.$index, scope.row)">
113
-                  </el-button>
114
-                </el-tooltip>
115
-
116
-              </template>
117
-            </el-table-column>
118
-          </el-table>
119
-        </el-form>
120 29
 
121
-  </div>
30
+      <div class="cell clearfix">
31
+        <label class="title"><span class="name">经销商</span> : </label>
32
+        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
33
+          <el-option
34
+            v-for="(option, index) in dealer"
35
+            :key="index"
36
+            :label="option.dealer_name"
37
+            :value="option.id">
38
+          </el-option>
39
+        </el-select>
40
+      </div>
41
+
42
+
43
+      <div class="cell clearfix">
44
+        <label class="title"><span class="name">厂商</span> : </label>
45
+
46
+        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer">
47
+          <el-option
48
+            v-for="(option, index) in manufacturer"
49
+            :key="index"
50
+            :label="option.manufacturer_name"
51
+            :value="option.id">
52
+          </el-option>
53
+        </el-select>
54
+      </div>
55
+
56
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
57
+        <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
58
+                  max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
59
+        >
60
+
61
+          <el-table-column min-width="35" align="center">
62
+
63
+            <template slot="header" slot-scope="scope">
64
+              <span>商品类型<span style="color: red">*</span></span>
65
+            </template>
66
+
67
+            <template slot-scope="scope">
68
+              <el-form-item style="padding-top: 15px">
69
+                <el-input placeholder="请输入商品类型" v-model="scope.row.good_type_id"
70
+                          :value="typeName(scope.row.good_type_id)"
71
+                          @focus="showDialog(scope.$index, scope.row)"></el-input>
72
+              </el-form-item>
73
+            </template>
74
+          </el-table-column>
75
+          <el-table-column min-width="35" align="center">
76
+            <template slot="header" slot-scope="scope">
77
+              <span>规格名称<span style="color: red">*</span></span>
78
+            </template>
79
+            <template slot-scope="scope">
80
+
81
+              <el-form-item style="padding-top: 15px">
82
+                <el-input placeholder="请输入规格名称" v-model="scope.row.good_id"
83
+                          :value="specificationName(scope.row.good_id)"
84
+                          @focus="showDialog(scope.$index, scope.row)"></el-input>
85
+              </el-form-item>
86
+
87
+            </template>
88
+          </el-table-column>
89
+
90
+
91
+          <el-table-column min-width="23" align="center">
92
+            <template slot="header" slot-scope="scope">
93
+              <span>单价<span style="color: red">*</span></span>
94
+            </template>
95
+            <template slot-scope="scope">
96
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
97
+              <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
98
+                            style="padding-top: 17px">
99
+                <el-input type="number" v-model="scope.row.price"></el-input>
100
+              </el-form-item>
101
+
102
+
103
+            </template>
104
+          </el-table-column>
105
+
106
+          <el-table-column min-width="23" align="center">
107
+            <template slot="header" slot-scope="scope">
108
+              <span>出库数量<span style="color: red">*</span></span>
109
+            </template>
110
+            <template slot-scope="scope">
111
+              <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
112
+                            style="padding-top: 17px">
113
+                <el-input type="number" v-model="scope.row.count"></el-input>
114
+              </el-form-item>
115
+            </template>
116
+          </el-table-column>
117
+
118
+          <el-table-column label="总价" min-width="20" align="center">
119
+            <template slot-scope="scope">
120
+              {{calculate(scope.row.price*scope.row.count)}}
121
+            </template>
122
+          </el-table-column>
123
+          <el-table-column label="备注" min-width="20" align="center">
124
+            <template slot-scope="scope">
125
+              <el-input v-model="scope.row.remark"></el-input>
126
+            </template>
127
+          </el-table-column>
128
+          <el-table-column label="操作" align="center" min-width="20">
129
+            <template slot-scope="scope">
130
+              <el-tooltip class="item" effect="dark" content="新增" placement="top">
131
+
132
+                <el-button
133
+                  size="mini"
134
+                  type="primary"
135
+                  icon="el-icon-circle-plus-outline"
136
+                  @click="handleEdit(scope.$index, scope.row)">
137
+                </el-button>
138
+              </el-tooltip>
139
+              <el-tooltip class="item" effect="dark" content="删除" placement="top">
140
+
141
+                <el-button
142
+                  size="mini"
143
+                  type="danger"
144
+                  icon="el-icon-delete"
145
+                  @click="handleDelete(scope.$index, scope.row)">
146
+                </el-button>
147
+              </el-tooltip>
148
+
149
+            </template>
150
+          </el-table-column>
151
+        </el-table>
152
+      </el-form>
153
+
154
+    </div>
122 155
   </div>
123 156
 
124 157
 </template>
@@ -126,12 +159,7 @@
126 159
 <script>
127 160
   import { uParseTime } from '@/utils/tools'
128 161
 
129
-  import {
130
-    deleteWarehouseOutInfo,
131
-    getWarehouseOutInfo,
132
-    getSalesReturnConfig,
133
-    editWarehouseoutInfo
134
-  } from '@/api/stock'
162
+  import { deleteWarehouseOutInfo, editWarehouseoutInfo, getSalesReturnConfig, getWarehouseOutInfo } from '@/api/stock'
135 163
   import SalesReturnDialog from './Dialog/salesReturnDialog'
136 164
   import BreadCrumb from '../components/bread-crumb'
137 165
 
@@ -143,7 +171,12 @@
143 171
       return {
144 172
         crumbs: [
145 173
           { path: false, name: '库存管理' },
146
-          { path: false, name: '出库单' },
174
+          { path: false, name: '耗材出库单' },
175
+          { path: false, name: '编辑出库单' }
176
+        ],
177
+        crumbs2: [
178
+          { path: false, name: '库存管理' },
179
+          { path: false, name: '其他出库单' },
147 180
           { path: false, name: '编辑出库单' }
148 181
         ],
149 182
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
@@ -177,14 +210,16 @@
177 210
           goodType: [],
178 211
           goodInfo: [],
179 212
           goodUnit: [],
180
-          title: '入库'
213
+          title: '入库',
214
+          manufacturer: 0,
215
+          dealer: 0
181 216
         },
182 217
 
183 218
         form: {
184
-          manufacturer: '',
185
-          dealer: ''
219
+          manufacturer: 0,
220
+          dealer: 0
186 221
         },
187
-        warehouseInfoList:[],
222
+        warehouseInfoList: [],
188 223
         warehouseOut: {},
189 224
         manufacturer: [],
190 225
         dealer: [],
@@ -221,34 +256,71 @@
221 256
           type: this.$route.query.type
222 257
         }
223 258
         getSalesReturnConfig(params).then(response => {
259
+          const loading = this.$loading({
260
+            lock: true,
261
+            text: 'Loading',
262
+            spinner: 'el-icon-loading',
263
+            background: 'rgba(0, 0, 0, 0.7)'
264
+          })
265
+
224 266
           if (response.data.state == 0) {
225 267
             this.$message.error(response.data.msg)
226 268
             return false
227 269
           } else {
270
+            loading.close()
228 271
             var warehouseInfoList = response.data.data.warehouseInfoList
229 272
             this.warehouseInfoList = response.data.data.warehouseInfoList
230
-
231 273
             for (let i = 0; i < warehouseInfoList.length; i++) {
232
-              this.propForm.goodInfo.push(warehouseInfoList[i].GoodInfo)
233
-              this.propForm.goodType.push(warehouseInfoList[i].GoodInfo.GoodsType)
274
+              if (warehouseInfoList[i].info.manufacturers.id > 0) {
275
+                this.manufacturer.push(warehouseInfoList[i].info.manufacturers)
276
+              }
277
+              if (warehouseInfoList[i].info.dealers.id > 0) {
278
+                this.dealer.push(warehouseInfoList[i].info.dealers)
279
+              }
280
+            }
281
+
282
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
283
+              this.goodType.push(this.warehouseInfoList[i].info.type)
284
+            }
285
+
286
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
287
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
234 288
             }
289
+            const obj = {}
290
+            const obj2 = {}
235 291
             const obj3 = {}
292
+
236 293
             const obj4 = {}
294
+            // 去重复
295
+            this.manufacturer = this.manufacturer.reduce((cur, next) => {
296
+              obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
297
+              return cur
298
+            }, [])
299
+            // 去重复
300
+            this.dealer = this.dealer.reduce((cur, next) => {
301
+              obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
302
+              return cur
303
+            }, [])
237 304
             this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
238 305
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
239 306
               return cur
240 307
             }, [])
241
-            this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
308
+
309
+            this.goodType = this.goodType.reduce((cur, next) => {
242 310
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
243 311
               return cur
244 312
             }, [])
313
+
314
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
315
+            this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
316
+
245 317
           }
246 318
         })
247 319
       }, typeName: function(good_type_id) {
248 320
         let name = ''
249
-        for (let i = 0; i < this.propForm.goodType.length; i++) {
250
-          if (this.propForm.goodType[i].id == good_type_id) {
251
-            name = this.propForm.goodType[i].type_name
321
+        for (let i = 0; i < this.goodType.length; i++) {
322
+          if (this.goodType[i].id == good_type_id) {
323
+            name = this.goodType[i].type_name
252 324
           }
253 325
         }
254 326
         return name
@@ -302,17 +374,46 @@
302 374
         }
303 375
       }, showDialog(index, row) {
304 376
         this.currentIndex = index
305
-        for (let i = 0; i < this.warehouseInfoList.length; i++) {
306
-          if (this.warehouseInfoList[i].manufacturer == this.form.manufacturer) {
307
-            this.propForm.goodType.push(this.warehouseInfoList[i].GoodInfo.GoodsType)
377
+        this.propForm.goodType = []
378
+        if (this.form.manufacturer == 0 && this.form.dealer == 0) {
379
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
380
+            this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
308 381
           }
382
+          const obj3 = {}
383
+          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
384
+            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
385
+            return cur
386
+          }, [])
387
+        } else {
388
+          if (this.form.manufacturer == 0 && this.form.dealer != 0) {
389
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
390
+              if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
391
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
392
+              }
393
+            }
394
+          }
395
+          if (this.form.manufacturer != 0 && this.form.dealer == 0) {
396
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
397
+              if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
398
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
399
+              }
400
+            }
401
+          }
402
+          if (this.form.manufacturer != 0 && this.form.dealer != 0) {
403
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
404
+              if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
405
+                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
406
+              }
407
+            }
408
+          }
409
+          const obj3 = {}
410
+          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
411
+            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
412
+            return cur
413
+          }, [])
309 414
         }
310
-        const obj3 = {}
311
-        this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
312
-          obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
313
-          return cur
314
-        }, [])
315 415
         this.$refs.dialog.show()
416
+
316 417
       }, back() {
317 418
         this.$router.go(-1)
318 419
       }, submit() {
@@ -333,7 +434,7 @@
333 434
             const params = {
334 435
               'stockOut': this.recordInfo.recordData
335 436
             }
336
-            editWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer).then(response => {
437
+            editWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
337 438
               if (response.data.state == 0) {
338 439
                 this.$message.error(response.data.msg)
339 440
                 return false
@@ -363,6 +464,7 @@
363 464
             this.warehouseOut = response.data.data.info
364 465
             this.warehouse_out_time = this.getTime(this.warehouseOut.warehouse_out_time, '{y}-{m}-{d}')
365 466
             this.form.manufacturer = this.warehouseOut.manufacturer
467
+            this.form.dealer = this.warehouseOut.dealer
366 468
 
367 469
           }
368 470
 
@@ -382,6 +484,10 @@
382 484
           return ''
383 485
         }
384 486
         return Math.round(parseFloat(val) * 100) / 100
487
+      }, changeManufacturer(val) {
488
+        this.propForm.manufacturer = val
489
+      }, changeDealer(val) {
490
+        this.propForm.dealer = val
385 491
       }
386 492
     },
387 493
     created() {

+ 5 - 2
src/xt_pages/stock/stockQuery.vue Näytä tiedosto

@@ -14,11 +14,14 @@
14 14
             {{scope.row.good_code}}
15 15
           </template>
16 16
         </el-table-column>
17
+        <el-table-column label="商品类型" align="center">
18
+          <template slot-scope="scope">
19
+            <span>{{scope.row.type.type_name}}</span>
20
+          </template>
21
+        </el-table-column>
17 22
         <el-table-column label="规格名称" align="center">
18 23
           <template slot-scope="scope">
19
-
20 24
             <span>{{scope.row.specification_name}}</span>
21
-
22 25
           </template>
23 26
         </el-table-column>
24 27
         <el-table-column label="入库数量" align="center" >

+ 1 - 2
src/xt_pages/user/components/PatientForm.vue Näytä tiedosto

@@ -232,7 +232,7 @@
232 232
               :before-upload="beforeAvatarUpload">
233 233
               <el-button :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false" class="uploadHeadBtn" type="primary" >上传头像</el-button>
234 234
             </el-upload>
235
-            <el-form-item prop="avatar">
235
+            <el-form-item >
236 236
               <el-input v-model="form.avatar"  type="hidden" placeholder=""></el-input>
237 237
             </el-form-item>
238 238
           </el-col>
@@ -543,7 +543,6 @@
543 543
 
544 544
         subscibe: {},
545 545
         rules: {
546
-          avatar: [{ required: true, message: '请上传头像', trigger: 'blur' }],
547 546
           patientType: [{ required: true, message: '请选择患者类型', trigger: 'blur' }],
548 547
           dialysisNo: [{ required: true, message: '请填写透析号', trigger: 'blur' }],
549 548
           phone: [{ validator: checkPhone, trigger: 'blur' }],