Browse Source

Merge branch 'superman' of http://git.shengws.com/zhangbj/xt_vue into superman

柳香萍 6 years ago
parent
commit
e9159b5c73

+ 8 - 8
src/api/stock.js View File

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
   return request({
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
     method: 'post',
391
     method: 'post',
392
     data: params
392
     data: params
393
   })
393
   })
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
   return request({
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
     method: 'post',
439
     method: 'post',
440
     data: params
440
     data: params
441
   })
441
   })
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
   return request({
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
     method: 'post',
479
     method: 'post',
480
     data: params
480
     data: params
481
   })
481
   })
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
   return request({
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
     method: 'post',
495
     method: 'post',
496
     data: params
496
     data: params
497
   })
497
   })

+ 101 - 77
src/xt_pages/stock/Dialog/goodInfoDailog.vue View File

2
   <el-dialog width="854px" :title="titles" :visible.sync="visibility" :close-on-click-modal="isClose"
2
   <el-dialog width="854px" :title="titles" :visible.sync="visibility" :close-on-click-modal="isClose"
3
              :close-on-press-escape="isClose">
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
              :rules="rules" :model="form" ref="form"
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
       <el-col>
104
       <el-col>
84
-        <el-form-item label="备注" prop="remark">
105
+        <el-form-item label="备注 : " prop="remark">
85
           <el-input type="textarea" :row="5" v-model="form.remark"
106
           <el-input type="textarea" :row="5" v-model="form.remark"
86
                     placeholder="请输入内容">
107
                     placeholder="请输入内容">
87
           </el-input>
108
           </el-input>
88
         </el-form-item>
109
         </el-form-item>
89
       </el-col>
110
       </el-col>
111
+
90
     </el-form>
112
     </el-form>
91
 
113
 
92
 
114
 
115
+
116
+
93
     <span slot="footer" class="dialog-footer">
117
     <span slot="footer" class="dialog-footer">
94
     <el-button v-if="isCreated == 3" @click="cancle('form')">取 消</el-button>
118
     <el-button v-if="isCreated == 3" @click="cancle('form')">取 消</el-button>
95
     <el-button v-if="isCreated != 3 " @click="cancle('form')">取 消</el-button>
119
     <el-button v-if="isCreated != 3 " @click="cancle('form')">取 消</el-button>

+ 41 - 9
src/xt_pages/stock/Dialog/salesReturnDialog.vue View File

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

+ 10 - 0
src/xt_pages/stock/Dialog/stockInDialog.vue View File

59
             </template>
59
             </template>
60
           </el-table-column>
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
         </el-table>
72
         </el-table>
63
       </el-col>
73
       </el-col>
64
     </el-row>
74
     </el-row>

+ 120 - 39
src/xt_pages/stock/cancelStockOrderAdd.vue View File

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
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
       <div style="float:right;">
7
       <div style="float:right;">
6
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
8
         <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"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
25
                           type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
27
                           type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
26
                           value-format="yyyy-MM-dd"></el-date-picker>
28
                           value-format="yyyy-MM-dd"></el-date-picker>
27
         </div>
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
             <el-option
46
             <el-option
32
               v-for="(option, index) in manufacturer"
47
               v-for="(option, index) in manufacturer"
33
               :key="index"
48
               :key="index"
37
           </el-select>
52
           </el-select>
38
         </div>
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
     </div>
57
     </div>
142
       return {
146
       return {
143
         crumbs: [
147
         crumbs: [
144
           { path: false, name: '库存管理' },
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
           { path: false, name: '新增退库单' }
155
           { path: false, name: '新增退库单' }
147
         ],
156
         ],
148
 
157
 
169
         propForm: {
178
         propForm: {
170
           goodType: [],
179
           goodType: [],
171
           goodInfo: [],
180
           goodInfo: [],
172
-          goodUnit: []
181
+          goodUnit: [],
182
+          manufacturer: 0,
183
+          dealer: 0
173
         },
184
         },
174
         form: {
185
         form: {
175
-          manufacturer: '',
176
-          dealer: ''
186
+          manufacturer: 0,
187
+          dealer: 0
177
         },
188
         },
178
         warehouseOutInfoList:[],
189
         warehouseOutInfoList:[],
179
         manufacturer: [],
190
         manufacturer: [],
199
           }
210
           }
200
         }
211
         }
201
 
212
 
213
+        this.propForm.goodType = []
214
+
202
         this.currentIndex = -1
215
         this.currentIndex = -1
203
       }, cancle: function() {
216
       }, cancle: function() {
204
         this.$refs.dialog.hide()
217
         this.$refs.dialog.hide()
218
+        this.propForm.goodType = []
219
+
205
       }, GetConfigInfo: function() {
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
         const params = {
228
         const params = {
207
           type: this.$route.query.type
229
           type: this.$route.query.type
208
         }
230
         }
209
         getCancelStockConfig(params).then(response => {
231
         getCancelStockConfig(params).then(response => {
210
           if (response.data.state == 0) {
232
           if (response.data.state == 0) {
233
+            loading.close()
211
             this.$message.error(response.data.msg)
234
             this.$message.error(response.data.msg)
212
             return false
235
             return false
213
           } else {
236
           } else {
214
-            var warehouseOutList = response.data.data.warehouseOutList
237
+            loading.close()
215
             var warehouseOutInfoList = response.data.data.warehouseOutInfoList
238
             var warehouseOutInfoList = response.data.data.warehouseOutInfoList
216
             this.warehouseOutInfoList = response.data.data.warehouseOutInfoList
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
             for (let i = 0; i < warehouseOutInfoList.length; i++) {
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
             const obj = {}
257
             const obj = {}
232
             const obj2 = {}
258
             const obj2 = {}
259
+            const obj3 = {}
233
             const obj4 = {}
260
             const obj4 = {}
234
             // 去重复
261
             // 去重复
235
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
262
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
241
               obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
268
               obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
242
               return cur
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
             this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
275
             this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
245
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
276
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
246
               return cur
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
       }, typeName: function(good_type_id) {
287
       }, typeName: function(good_type_id) {
251
         let name = ''
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
         return name
294
         return name
289
           return ''
326
           return ''
290
         }
327
         }
291
       }, showDialog(index, row) {
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
         this.currentIndex = index
377
         this.currentIndex = index
293
         if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
378
         if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
294
-          this.$message.error('请先选择厂商')
295
-          return
379
+
296
         } else {
380
         } else {
297
           this.$refs.dialog.show()
381
           this.$refs.dialog.show()
298
 
382
 
351
             return false
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
     created() {
444
     created() {

+ 10 - 2
src/xt_pages/stock/cancelStockOrderDetail.vue View File

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
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
     </div>
8
     </div>
6
   <div class="app-container">
9
   <div class="app-container">
7
 
10
 
82
       return {
85
       return {
83
         crumbs: [
86
         crumbs: [
84
           { path: false, name: '库存管理' },
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
           { path: false, name: '退库单详情' }
94
           { path: false, name: '退库单详情' }
87
         ],
95
         ],
88
         isEdit: 0,
96
         isEdit: 0,

+ 93 - 11
src/xt_pages/stock/cancelStockOrderEdit.vue View File

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
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
       <div style="float:right;">
6
       <div style="float:right;">
6
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
7
         <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>
8
         <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
21
                         value-format="yyyy-MM-dd"></el-date-picker>
22
                         value-format="yyyy-MM-dd"></el-date-picker>
22
       </div>
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
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
54
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
25
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
55
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
26
                   max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
56
                   max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
117
       return {
147
       return {
118
         crumbs: [
148
         crumbs: [
119
           { path: false, name: '库存管理' },
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
           { path: false, name: '编辑退库单' }
157
           { path: false, name: '编辑退库单' }
122
         ],
158
         ],
159
+
160
+
123
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
161
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
124
         warehousing_time: '',
162
         warehousing_time: '',
125
         adminUserOptions: null,
163
         adminUserOptions: null,
191
         const params = {
229
         const params = {
192
           type: this.$route.query.type
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
         getCancelStockConfig(params).then(response => {
238
         getCancelStockConfig(params).then(response => {
239
+
195
           if (response.data.state == 0) {
240
           if (response.data.state == 0) {
241
+            loading.close()
196
             this.$message.error(response.data.msg)
242
             this.$message.error(response.data.msg)
197
             return false
243
             return false
198
           } else {
244
           } else {
245
+            loading.close()
199
             var warehouseOutInfoList = response.data.data.warehouseOutInfoList
246
             var warehouseOutInfoList = response.data.data.warehouseOutInfoList
200
             this.warehouseOutInfoList = response.data.data.warehouseOutInfoList
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
             for (let i = 0; i < warehouseOutInfoList.length; i++) {
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
             const obj3 = {}
267
             const obj3 = {}
207
             const obj4 = {}
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
               return cur
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
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
280
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
214
               return cur
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
       }, typeName: function(good_type_id) {
296
       }, typeName: function(good_type_id) {
219
         let name = ''
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
         return name
303
         return name
301
             const params = {
379
             const params = {
302
               'cancelStock': this.recordInfo.recordData
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
               if (response.data.state == 0) {
383
               if (response.data.state == 0) {
306
                 this.$message.error(response.data.msg)
384
                 this.$message.error(response.data.msg)
307
                 return false
385
                 return false
342
             this.recordInfo.recordData.push(tempObj)
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
     created() {
429
     created() {

+ 19 - 15
src/xt_pages/stock/config/goodInfo.vue View File

32
             </template>
32
             </template>
33
           </el-table-column>
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
               {{scope.row.buy_price}}
38
               {{scope.row.buy_price}}
38
 
39
 
39
             </template>
40
             </template>
40
           </el-table-column>
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
               {{scope.row.sell_price}}
44
               {{scope.row.sell_price}}
44
             </template>
45
             </template>
45
           </el-table-column>
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
           <el-table-column label="操作" align="center" >
57
           <el-table-column label="操作" align="center" >
57
             <template slot-scope="scope">
58
             <template slot-scope="scope">
58
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
59
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
318
         });
319
         });
319
 
320
 
320
       }, goodInfoDialogComfirm: function (val) {
321
       }, goodInfoDialogComfirm: function (val) {
321
-        this.$refs.dialog.hide()
322
 
322
 
323
         if (val.isCreated == 2) { //修改
323
         if (val.isCreated == 2) { //修改
324
           val['id'] = this.goodInfo.editGoodId
324
           val['id'] = this.goodInfo.editGoodId
329
               this.$message.error(response.data.msg);
329
               this.$message.error(response.data.msg);
330
               return false;
330
               return false;
331
             } else {
331
             } else {
332
+              this.$refs.dialog.hide()
333
+
332
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].specification_name = response.data.data.goodInfo.specification_name
334
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].specification_name = response.data.data.goodInfo.specification_name
333
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit = response.data.data.goodInfo.good_unit
335
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit = response.data.data.goodInfo.good_unit
334
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].buy_price = response.data.data.goodInfo.buy_price.toString()
336
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].buy_price = response.data.data.goodInfo.buy_price.toString()
348
               this.$message.error(response.data.msg);
350
               this.$message.error(response.data.msg);
349
               return false;
351
               return false;
350
             } else {
352
             } else {
353
+              this.$refs.dialog.hide()
354
+
351
               this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
355
               this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
352
 
356
 
353
               this.$message.success("新增成功")
357
               this.$message.success("新增成功")

+ 4 - 2
src/xt_pages/stock/config/goodType.vue View File

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

+ 19 - 2
src/xt_pages/stock/detail/cancelStockDetail.vue View File

1
 <template>
1
 <template>
2
     <div>
2
     <div>
3
       <div class="cell clearfix" >
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
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
5
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
6
       </div>
6
       </div>
7
 
7
 
58
             </template>
58
             </template>
59
           </el-table-column>
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
             <template slot-scope="scope">
68
             <template slot-scope="scope">
63
               {{specificationName(scope.row.good_id)}}
69
               {{specificationName(scope.row.good_id)}}
64
             </template>
70
             </template>
65
           </el-table-column>
71
           </el-table-column>
66
 
72
 
67
 
73
 
74
+
68
           <el-table-column label="单据类型" align="center">
75
           <el-table-column label="单据类型" align="center">
69
             <template slot-scope="scope">
76
             <template slot-scope="scope">
70
               {{getTypeName(scope.row)}}
77
               {{getTypeName(scope.row)}}
187
           name = '其他退库单'
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
         return name
205
         return name
191
       },
206
       },
192
       specificationName: function(good_info_id) {
207
       specificationName: function(good_info_id) {
301
             this.manufacturer = response.data.data.manufacturer
316
             this.manufacturer = response.data.data.manufacturer
302
             this.dealer = response.data.data.dealer
317
             this.dealer = response.data.data.dealer
303
             this.goodInfo = response.data.data.goodInfo
318
             this.goodInfo = response.data.data.goodInfo
319
+            this.goodType = response.data.data.goodType
320
+
304
           }
321
           }
305
         })
322
         })
306
       }, getManufactuerName: function(manufacturer_id) {
323
       }, getManufactuerName: function(manufacturer_id) {

+ 18 - 2
src/xt_pages/stock/detail/salesReturnDetail.vue View File

1
 <template>
1
 <template>
2
     <div>
2
     <div>
3
       <div class="cell clearfix" >
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
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
5
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
6
       </div>
6
       </div>
7
 
7
 
61
             </template>
61
             </template>
62
           </el-table-column>
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
             <template slot-scope="scope">
71
             <template slot-scope="scope">
66
               {{specificationName(scope.row.good_id)}}
72
               {{specificationName(scope.row.good_id)}}
67
             </template>
73
             </template>
189
           name = '其他退货单'
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
         return name
206
         return name
193
       },
207
       },
194
       specificationName: function(good_info_id) {
208
       specificationName: function(good_info_id) {
303
             this.manufacturer = response.data.data.manufacturer
317
             this.manufacturer = response.data.data.manufacturer
304
             this.dealer = response.data.data.dealer
318
             this.dealer = response.data.data.dealer
305
             this.goodInfo = response.data.data.goodInfo
319
             this.goodInfo = response.data.data.goodInfo
320
+            this.goodType = response.data.data.goodType
321
+
306
           }
322
           }
307
         })
323
         })
308
       }, getManufactuerName: function(manufacturer_id) {
324
       }, getManufactuerName: function(manufacturer_id) {

+ 18 - 2
src/xt_pages/stock/detail/stockInDetail.vue View File

1
 <template>
1
 <template>
2
     <div>
2
     <div>
3
       <div class="cell clearfix">
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
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
5
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
6
       </div>
6
       </div>
7
 
7
 
58
             </template>
58
             </template>
59
           </el-table-column>
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
             <template slot-scope="scope">
68
             <template slot-scope="scope">
63
               {{specificationName(scope.row.good_id)}}
69
               {{specificationName(scope.row.good_id)}}
64
             </template>
70
             </template>
198
           name = '其他入库单'
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
         return name
215
         return name
202
       },
216
       },
203
       specificationName: function(good_info_id) {
217
       specificationName: function(good_info_id) {
312
             this.manufacturer = response.data.data.manufacturer
326
             this.manufacturer = response.data.data.manufacturer
313
             this.dealer = response.data.data.dealer
327
             this.dealer = response.data.data.dealer
314
             this.goodInfo = response.data.data.goodInfo
328
             this.goodInfo = response.data.data.goodInfo
329
+            this.goodType = response.data.data.goodType
330
+
315
           }
331
           }
316
         })
332
         })
317
       }, getManufactuerName: function(manufacturer_id) {
333
       }, getManufactuerName: function(manufacturer_id) {

+ 19 - 2
src/xt_pages/stock/detail/stockOutDetail.vue View File

1
 <template>
1
 <template>
2
     <div>
2
     <div>
3
       <div class="cell clearfix" >
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
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
5
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
6
       </div>
6
       </div>
7
 
7
 
62
             </template>
62
             </template>
63
           </el-table-column>
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
             <template slot-scope="scope">
72
             <template slot-scope="scope">
67
               {{specificationName(scope.row.good_id)}}
73
               {{specificationName(scope.row.good_id)}}
68
             </template>
74
             </template>
212
         }
218
         }
213
         return name
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
       search: function() {
230
       search: function() {
216
         const Params = {
231
         const Params = {
217
           page: this.page,
232
           page: this.page,
315
             this.manufacturer = response.data.data.manufacturer
330
             this.manufacturer = response.data.data.manufacturer
316
             this.dealer = response.data.data.dealer
331
             this.dealer = response.data.data.dealer
317
             this.goodInfo = response.data.data.goodInfo
332
             this.goodInfo = response.data.data.goodInfo
333
+            this.goodType = response.data.data.goodType
334
+
318
           }
335
           }
319
         })
336
         })
320
       }, getManufactuerName: function(manufacturer_id) {
337
       }, getManufactuerName: function(manufacturer_id) {

+ 150 - 30
src/xt_pages/stock/salesReturnEdit.vue View File

22
                             value-format="yyyy-MM-dd"></el-date-picker>
22
                             value-format="yyyy-MM-dd"></el-date-picker>
23
     </div>
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
           <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
56
           <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
27
                     max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
57
                     max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
28
           >
58
           >
143
           ]
173
           ]
144
 
174
 
145
         },
175
         },
146
-        ruleForm: {
147
-          manufacturer: [
148
-            { required: true, message: '请选择厂商', trigger: 'change' }
149
-          ]
150
 
176
 
151
-        },
152
 
177
 
153
         // prop
178
         // prop
154
         isVisibility: false,
179
         isVisibility: false,
156
           goodType: [],
181
           goodType: [],
157
           goodInfo: [],
182
           goodInfo: [],
158
           goodUnit: [],
183
           goodUnit: [],
159
-          title: '入库'
184
+          title: '入库',
185
+          manufacturer:0,
186
+          dealer:0,
160
         },
187
         },
161
 
188
 
162
         form: {
189
         form: {
163
-          manufacturer: '',
164
-          dealer: ''
190
+          manufacturer: 0,
191
+          dealer: 0,
165
         },
192
         },
166
         warehouseInfoList:[],
193
         warehouseInfoList:[],
167
         salesReturn: {},
194
         salesReturn: {},
189
             }
216
             }
190
           }
217
           }
191
         }
218
         }
192
-
219
+        this.propForm.goodType = []
193
         this.currentIndex = -1
220
         this.currentIndex = -1
194
       }, cancle: function() {
221
       }, cancle: function() {
195
         this.$refs.dialog.hide()
222
         this.$refs.dialog.hide()
223
+        this.propForm.goodType = []
224
+
196
       }, GetConfigInfo: function() {
225
       }, GetConfigInfo: function() {
197
         const params = {
226
         const params = {
198
           type: this.$route.query.type
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
         getSalesReturnConfig(params).then(response => {
236
         getSalesReturnConfig(params).then(response => {
202
           if (response.data.state == 0) {
237
           if (response.data.state == 0) {
238
+            loading.close()
239
+
203
             this.$message.error(response.data.msg)
240
             this.$message.error(response.data.msg)
204
             return false
241
             return false
205
           } else {
242
           } else {
243
+            loading.close()
244
+
206
             var warehouseInfoList = response.data.data.warehouseInfoList
245
             var warehouseInfoList = response.data.data.warehouseInfoList
207
             this.warehouseInfoList = response.data.data.warehouseInfoList
246
             this.warehouseInfoList = response.data.data.warehouseInfoList
208
             for (let i = 0; i < warehouseInfoList.length; i++) {
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
             const obj3 = {}
268
             const obj3 = {}
269
+
213
             const obj4 = {}
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
               return cur
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
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
284
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
220
               return cur
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
       }, typeName: function(good_type_id) {
299
       }, typeName: function(good_type_id) {
227
         let name = ''
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
         return name
306
         return name
278
         }
351
         }
279
       }, showDialog(index, row) {
352
       }, showDialog(index, row) {
280
         this.currentIndex = index
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
       }, back() {
406
       }, back() {
293
         this.$router.go(-1)
407
         this.$router.go(-1)
294
       }, submit() {
408
       }, submit() {
309
             const params = {
423
             const params = {
310
               'salesReturn': this.recordInfo.recordData
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
               if (response.data.state == 0) {
427
               if (response.data.state == 0) {
314
                 this.$message.error(response.data.msg)
428
                 this.$message.error(response.data.msg)
315
                 return false
429
                 return false
351
             this.recordInfo.recordData.push(tempObj)
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
     created() {
476
     created() {

+ 110 - 58
src/xt_pages/stock/salesReturnOrderAdd.vue View File

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
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
       <div style="float:right;">
8
       <div style="float:right;">
6
         <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
9
         <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>
10
         <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
20
                         value-format="yyyy-MM-dd"></el-date-picker>
23
                         value-format="yyyy-MM-dd"></el-date-picker>
21
       </div>
24
       </div>
22
 
25
 
23
-
24
       <div class="cell clearfix">
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
           <el-option
29
           <el-option
29
-            v-for="(option, index) in manufacturer"
30
+            v-for="(option, index) in dealer"
30
             :key="index"
31
             :key="index"
31
-            :label="option.manufacturer_name"
32
+            :label="option.dealer_name"
32
             :value="option.id">
33
             :value="option.id">
33
           </el-option>
34
           </el-option>
34
         </el-select>
35
         </el-select>
35
       </div>
36
       </div>
36
 
37
 
37
       <div class="cell clearfix">
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
           <el-option
42
           <el-option
41
-            v-for="(option, index) in dealer"
43
+            v-for="(option, index) in manufacturer"
42
             :key="index"
44
             :key="index"
43
-            :label="option.dealer_name"
45
+            :label="option.manufacturer_name"
44
             :value="option.id">
46
             :value="option.id">
45
           </el-option>
47
           </el-option>
46
         </el-select>
48
         </el-select>
47
       </div>
49
       </div>
48
 
50
 
51
+
52
+
49
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
53
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
50
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
54
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
51
                   max-height="450"  :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
55
                   max-height="450"  :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
91
               <span>退货数量<span style="color: red">*</span></span>
95
               <span>退货数量<span style="color: red">*</span></span>
92
             </template>
96
             </template>
93
             <template slot-scope="scope">
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
               <el-form-item :prop="'recordData.' + scope.$index + '.return_count'" :rules='tableRules.return_count'
98
               <el-form-item :prop="'recordData.' + scope.$index + '.return_count'" :rules='tableRules.return_count'
98
                             style="padding-top: 17px">
99
                             style="padding-top: 17px">
99
                 <el-input  placeholder="请输入退货数量" type="number" v-model="scope.row.return_count"></el-input>
100
                 <el-input  placeholder="请输入退货数量" type="number" v-model="scope.row.return_count"></el-input>
148
       return {
149
       return {
149
         crumbs: [
150
         crumbs: [
150
           { path: false, name: '库存管理' },
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
           { path: false, name: '新增退货单' }
158
           { path: false, name: '新增退货单' }
153
         ],
159
         ],
154
 
160
 
161
+
155
         type: this.$route.query.type,
162
         type: this.$route.query.type,
156
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
163
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
157
         return_time: '',
164
         return_time: '',
167
             { required: true, message: '数量不能为空', trigge: 'blur' }
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
         // prop
180
         // prop
177
         isVisibility: false,
181
         isVisibility: false,
178
         propForm: {
182
         propForm: {
179
           goodType: [],
183
           goodType: [],
180
           goodInfo: [],
184
           goodInfo: [],
181
-          goodUnit: []
185
+          goodUnit: [],
186
+          manufacturer:0,
187
+          dealer:0,
182
         },
188
         },
183
         form: {
189
         form: {
184
-          manufacturer: '',
185
-          dealer: ''
190
+          manufacturer: 0,
191
+          dealer: 0,
186
         },
192
         },
187
         warehouseInfoList:[],
193
         warehouseInfoList:[],
188
         manufacturer: [],
194
         manufacturer: [],
193
     methods: {
199
     methods: {
194
       comfirm: function(val) {
200
       comfirm: function(val) {
195
         this.$refs.dialog.hide()
201
         this.$refs.dialog.hide()
196
-
197
         if (val.selectedGoodInfo.length > 0) {
202
         if (val.selectedGoodInfo.length > 0) {
198
           for (let i = val.selectedGoodInfo.length - 1; ; i--) {
203
           for (let i = val.selectedGoodInfo.length - 1; ; i--) {
199
             if (i == 0) {
204
             if (i == 0) {
209
             }
214
             }
210
           }
215
           }
211
         }
216
         }
212
-
217
+        this.propForm.goodType = []
213
         this.currentIndex = -1
218
         this.currentIndex = -1
214
       }, cancle: function() {
219
       }, cancle: function() {
215
         this.$refs.dialog.hide()
220
         this.$refs.dialog.hide()
221
+        this.propForm.goodType = []
222
+
216
       }, GetConfigInfo: function() {
223
       }, GetConfigInfo: function() {
217
         const params = {
224
         const params = {
218
           type: this.type
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
         getSalesReturnConfig(params).then(response => {
234
         getSalesReturnConfig(params).then(response => {
221
           if (response.data.state == 0) {
235
           if (response.data.state == 0) {
236
+            loading.close()
237
+
222
             this.$message.error(response.data.msg)
238
             this.$message.error(response.data.msg)
223
             return false
239
             return false
224
           } else {
240
           } else {
225
-            var warehouseList = response.data.data.warehouseList
241
+            loading.close()
226
             var warehouseInfoList = response.data.data.warehouseInfoList
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
             const obj = {}
259
             const obj = {}
243
             const obj2 = {}
260
             const obj2 = {}
261
+            const obj3 = {}
244
             const obj4 = {}
262
             const obj4 = {}
245
             // 去重复
263
             // 去重复
246
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
264
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
252
               obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
270
               obj2[next.id] ? '' : obj2[next.id] = true && cur.push(next)
253
               return cur
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
             this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
279
             this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
256
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
280
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
257
               return cur
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
       }, typeName: function(good_type_id) {
289
       }, typeName: function(good_type_id) {
263
         let name = ''
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
         return name
296
         return name
303
         }
330
         }
304
       }, showDialog(index, row) {
331
       }, showDialog(index, row) {
305
         this.currentIndex = index
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
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
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
           const obj3 = {}
374
           const obj3 = {}
318
           this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
375
           this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
320
             return cur
377
             return cur
321
           }, [])
378
           }, [])
322
         }
379
         }
380
+        this.$refs.dialog.show()
323
       }, back() {
381
       }, back() {
324
         this.$router.go(-1)
382
         this.$router.go(-1)
325
       }, submit() {
383
       }, submit() {
326
         this.$refs['tableForm'].validate((valid) => {
384
         this.$refs['tableForm'].validate((valid) => {
327
           if (valid) {
385
           if (valid) {
328
-            if (this.form.manufacturer == 0) {
329
-              this.$message.error('厂商不能为空')
330
-              return
331
-            }
332
             const array = this.recordInfo.recordData
386
             const array = this.recordInfo.recordData
333
             let total = 0
387
             let total = 0
334
             for (let i = 0; i < array.length; i++) {
388
             for (let i = 0; i < array.length; i++) {
360
             return false
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
     created() {
425
     created() {

+ 8 - 2
src/xt_pages/stock/salesReturnOrderDetail.vue View File

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
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
     </div>
6
     </div>
6
 
7
 
7
     <div class="app-container">
8
     <div class="app-container">
82
       return {
83
       return {
83
         crumbs: [
84
         crumbs: [
84
           { path: false, name: '库存管理' },
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
           { path: false, name: '退货单详情' }
92
           { path: false, name: '退货单详情' }
87
         ],
93
         ],
88
         isEdit: 0,
94
         isEdit: 0,

+ 226 - 209
src/xt_pages/stock/stockInOrderAdd.vue View File

2
 
2
 
3
   <div class="main-contain">
3
   <div class="main-contain">
4
     <div class="position">
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
       <div style="float:right;">
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
       </div>
11
       </div>
10
     </div>
12
     </div>
11
     <div class="app-container">
13
     <div class="app-container">
18
 
20
 
19
       <div class="cell clearfix">
21
       <div class="cell clearfix">
20
         <label class="title"><span class="name">入库时间</span> : </label>
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
       </div>
26
       </div>
23
 
27
 
24
       <div class="cell clearfix">
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
           <el-option
33
           <el-option
29
             v-for="(option, index) in manufacturer"
34
             v-for="(option, index) in manufacturer"
30
             :key="index"
35
             :key="index"
36
 
41
 
37
       <div class="cell clearfix">
42
       <div class="cell clearfix">
38
         <label class="title"><span class="name">经销商</span> : </label>
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
           <el-option
45
           <el-option
41
             v-for="(option, index) in dealer"
46
             v-for="(option, index) in dealer"
42
             :key="index"
47
             :key="index"
47
       </div>
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
     </div>
190
     </div>
221
       return {
224
       return {
222
         crumbs: [
225
         crumbs: [
223
           { path: false, name: '库存管理' },
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
           { path: false, name: '新增入库单' }
233
           { path: false, name: '新增入库单' }
226
         ],
234
         ],
227
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
235
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
242
           warehousing_count: [
250
           warehousing_count: [
243
             { required: true, message: '数量不能为空', trigge: 'blur' }
251
             { required: true, message: '数量不能为空', trigge: 'blur' }
244
           ],
252
           ],
245
-          number: [
246
-            { required: true, message: '批号不能为空', trigge: 'blur' }
247
-          ],
253
+
248
           good_id: [
254
           good_id: [
249
             { validator: checkGoodId, trigger: 'blur' }
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
         type: this.$route.query.type,
259
         type: this.$route.query.type,
260
         total: '',
260
         total: '',
335
 
335
 
336
         })
336
         })
337
       }, handleCreate: function() {
337
       }, handleCreate: function() {
338
+
338
         this.propForm.formValue = {}
339
         this.propForm.formValue = {}
339
         this.propForm.isCreated = 1
340
         this.propForm.isCreated = 1
340
         this.isVisibility = true
341
         this.isVisibility = true
341
       }, comfirm: function(val) {
342
       }, comfirm: function(val) {
343
+        this.propForm.goodType = []
342
         this.$refs.dialog.hide()
344
         this.$refs.dialog.hide()
345
+        console.log(val)
343
         if (val.selectedGoodInfo.length > 0) {
346
         if (val.selectedGoodInfo.length > 0) {
344
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
347
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
345
             if (i == 0) {
348
             if (i == 0) {
346
               this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
349
               this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
347
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
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
             } else {
353
             } else {
349
               const tempForm = {}
354
               const tempForm = {}
350
               tempForm['good_type_id'] = val.goodTypeId
355
               tempForm['good_type_id'] = val.goodTypeId
353
               tempForm['product_date'] = ''
358
               tempForm['product_date'] = ''
354
               tempForm['expiry_date'] = ''
359
               tempForm['expiry_date'] = ''
355
               tempForm['warehousing_count'] = ''
360
               tempForm['warehousing_count'] = ''
356
-              tempForm['price'] = ''
361
+              tempForm['price'] = val.selectedGoodInfo[i].buy_price.toString()
357
               tempForm['remark'] = ''
362
               tempForm['remark'] = ''
358
               tempForm['dealer'] = ''
363
               tempForm['dealer'] = ''
359
               tempForm['manufacturer'] = ''
364
               tempForm['manufacturer'] = ''
366
 
371
 
367
         this.currentIndex = -1
372
         this.currentIndex = -1
368
       }, cancle: function() {
373
       }, cancle: function() {
374
+        this.propForm.goodType = []
369
         this.$refs.dialog.hide()
375
         this.$refs.dialog.hide()
370
       }, GetAllGoodType: function() {
376
       }, GetAllGoodType: function() {
371
         GetAllGoodType().then(response => {
377
         GetAllGoodType().then(response => {
390
           }
396
           }
391
         })
397
         })
392
       }, GetConfigInfo: function() {
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
         GetAllConfig().then(response => {
406
         GetAllConfig().then(response => {
394
           if (response.data.state == 0) {
407
           if (response.data.state == 0) {
395
             this.$message.error(response.data.msg)
408
             this.$message.error(response.data.msg)
399
             this.dealer = response.data.data.dealer
412
             this.dealer = response.data.data.dealer
400
             this.goodType = response.data.data.goodType
413
             this.goodType = response.data.data.goodType
401
             this.goodInfo = response.data.data.goodInfo
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
       }, typeName: function(good_type_id) {
423
       }, typeName: function(good_type_id) {
405
         let name = ''
424
         let name = ''
461
           return ''
480
           return ''
462
         }
481
         }
463
       }, showDialog(index, row) {
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
         this.currentIndex = index
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
         const { columns, data } = param
524
         const { columns, data } = param
502
         const sums = []
525
         const sums = []
503
         columns.forEach((column, index) => {
526
         columns.forEach((column, index) => {
522
         })
545
         })
523
 
546
 
524
         return sums
547
         return sums
525
-      }, back() {
548
+      }
549
+      ,
550
+      back() {
526
         this.$router.go(-1)
551
         this.$router.go(-1)
527
-      }, submit() {
552
+      }
553
+      ,
554
+      submit() {
528
         this.$refs['tableForm'].validate((valid) => {
555
         this.$refs['tableForm'].validate((valid) => {
529
           if (valid) {
556
           if (valid) {
530
-            if (this.form.manufacturer == 0) {
531
-              this.$message.error('厂商不能为空')
532
-              return
533
-            }
534
             const array = this.recordInfo.recordData
557
             const array = this.recordInfo.recordData
535
             for (let i = 0; i < array.length; i++) {
558
             for (let i = 0; i < array.length; i++) {
536
               if (array[i].good_type_id == 0) {
559
               if (array[i].good_type_id == 0) {
560
             return false
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
     created() {
596
     created() {
580
       var nowDate = new Date()
597
       var nowDate = new Date()
581
       var nowYear = nowDate.getFullYear()
598
       var nowYear = nowDate.getFullYear()

+ 9 - 2
src/xt_pages/stock/stockInOrderDetail.vue View File

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
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
     </div>
7
     </div>
6
   <div class="app-container">
8
   <div class="app-container">
7
     <div class="filter-container">
9
     <div class="filter-container">
122
       return {
124
       return {
123
         crumbs: [
125
         crumbs: [
124
           { path: false, name: '库存管理' },
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
           { path: false, name: '入库单详情' }
133
           { path: false, name: '入库单详情' }
127
         ],
134
         ],
128
         isEdit: 0,
135
         isEdit: 0,

+ 87 - 29
src/xt_pages/stock/stockInOrderEdit.vue View File

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
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
       <div style="float:right;">
7
       <div style="float:right;">
6
         <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
8
         <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"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
22
       <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>
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
     </div>
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
         <el-form  :rules="tableRules" :model="recordInfo" ref="tableForm">
57
         <el-form  :rules="tableRules" :model="recordInfo" ref="tableForm">
27
           <el-table id="oictable" :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
58
           <el-table id="oictable" :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
96
 
127
 
97
             <el-table-column align="center"  width="150">
128
             <el-table-column align="center"  width="150">
98
               <template slot="header" slot-scope="scope">
129
               <template slot="header" slot-scope="scope">
99
-                <span>批号<span style="color: red">*</span></span>
130
+                <span>批号</span>
100
               </template>
131
               </template>
101
               <template slot-scope="scope">
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
                   <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
134
                   <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
106
                 </el-form-item>
135
                 </el-form-item>
107
               </template>
136
               </template>
195
       return {
224
       return {
196
         crumbs: [
225
         crumbs: [
197
           { path: false, name: '库存管理' },
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
           { path: false, name: '编辑入库单' }
233
           { path: false, name: '编辑入库单' }
200
         ],
234
         ],
201
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
235
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
216
           warehousing_count: [
250
           warehousing_count: [
217
             { required: true, message: '数量不能为空', trigge: 'blur' }
251
             { required: true, message: '数量不能为空', trigge: 'blur' }
218
           ],
252
           ],
219
-          number: [
220
-            { required: true, message: '批号不能为空', trigge: 'blur' }
221
-          ],
253
+
222
           good_id: [
254
           good_id: [
223
             { validator: checkGoodId, trigger: 'blur' }
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
         total: '',
261
         total: '',
235
         product_date: '',
262
         product_date: '',
260
 
287
 
261
       comfirm: function(val) {
288
       comfirm: function(val) {
262
         this.$refs.dialog.hide()
289
         this.$refs.dialog.hide()
290
+        this.propForm.goodType = []
263
 
291
 
264
         if (val.selectedGoodInfo.length > 0) {
292
         if (val.selectedGoodInfo.length > 0) {
265
           for (let i = val.selectedGoodInfo.length - 1; ;i--) {
293
           for (let i = val.selectedGoodInfo.length - 1; ;i--) {
266
             if (i == 0) {
294
             if (i == 0) {
267
               this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
295
               this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
268
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
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
             } else {
299
             } else {
270
               const tempForm = {}
300
               const tempForm = {}
271
               tempForm['id'] = 0
301
               tempForm['id'] = 0
275
               tempForm['product_date'] = ''
305
               tempForm['product_date'] = ''
276
               tempForm['expiry_date'] = ''
306
               tempForm['expiry_date'] = ''
277
               tempForm['warehousing_count'] = ''
307
               tempForm['warehousing_count'] = ''
278
-              tempForm['price'] = ''
308
+              tempForm['price'] = val.selectedGoodInfo[i].buy_price.toString()
279
               tempForm['remark'] = ''
309
               tempForm['remark'] = ''
280
               tempForm['dealer'] = ''
310
               tempForm['dealer'] = ''
281
               tempForm['manufacturer'] = ''
311
               tempForm['manufacturer'] = ''
287
         this.currentIndex = -1
317
         this.currentIndex = -1
288
       }, cancle: function() {
318
       }, cancle: function() {
289
         this.$refs.dialog.hide()
319
         this.$refs.dialog.hide()
320
+        this.propForm.goodType = []
321
+
290
       }, GetConfigInfo: function() {
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
         GetAllConfig().then(response => {
329
         GetAllConfig().then(response => {
292
           if (response.data.state == 0) {
330
           if (response.data.state == 0) {
293
             this.$message.error(response.data.msg)
331
             this.$message.error(response.data.msg)
297
             this.dealer = response.data.data.dealer
335
             this.dealer = response.data.data.dealer
298
             this.goodType = response.data.data.goodType
336
             this.goodType = response.data.data.goodType
299
             this.goodInfo = response.data.data.goodInfo
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
       }, typeName: function(good_type_id) {
344
       }, typeName: function(good_type_id) {
303
         let name = ''
345
         let name = ''
367
         }
409
         }
368
       }, showDialog(index, row) {
410
       }, showDialog(index, row) {
369
         this.currentIndex = index
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
             if (response.data.state == 0) {
424
             if (response.data.state == 0) {
381
               this.$message.error(response.data.msg)
425
               this.$message.error(response.data.msg)
382
               return false
426
               return false
383
             } else {
427
             } else {
384
-              this.propForm.goodType = this.goodType
428
+              if(response.data.data.goodInfo.length <= 0){
429
+                this.$message.error("该厂商或经销商没有物品信息")
430
+                return
431
+              }
385
               this.$refs.dialog.show()
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
       }, back() {
446
       }, back() {
390
         this.$router.go(-1)
447
         this.$router.go(-1)
391
       }, submit() {
448
       }, submit() {
406
             const params = {
463
             const params = {
407
               'stockIn': this.recordInfo.recordData
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
               if (response.data.state == 0) {
467
               if (response.data.state == 0) {
411
                 this.$message.error(response.data.msg)
468
                 this.$message.error(response.data.msg)
412
                 return false
469
                 return false
441
             this.warehouse = response.data.data.warehousing
498
             this.warehouse = response.data.data.warehousing
442
             this.form.manufacturer = this.warehouse.manufacturer
499
             this.form.manufacturer = this.warehouse.manufacturer
443
             this.form.dealer = this.warehouse.dealer
500
             this.form.dealer = this.warehouse.dealer
501
+
444
             this.warehousing_time = this.getTime(this.warehouse.warehousing_time, '{y}-{m}-{d}')
502
             this.warehousing_time = this.getTime(this.warehouse.warehousing_time, '{y}-{m}-{d}')
445
 
503
 
446
             if (this.recordInfo.recordData.length == 0) {
504
             if (this.recordInfo.recordData.length == 0) {

+ 233 - 179
src/xt_pages/stock/stockOutOrderAdd.vue View File

2
 
2
 
3
   <div class="main-contain">
3
   <div class="main-contain">
4
     <div class="position">
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
       <div style="float:right;">
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
       </div>
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
         <label class="title"><span class="name">出库时间</span> : </label>
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
   </div>
160
   </div>
151
 
161
 
152
 </template>
162
 </template>
153
 
163
 
154
 <script>
164
 <script>
155
   import { uParseTime } from '@/utils/tools'
165
   import { uParseTime } from '@/utils/tools'
156
-  import {
157
-    getSalesReturnConfig,
158
-    postWarehouseOut
159
-  } from '@/api/stock'
166
+  import { getSalesReturnConfig, postWarehouseOut } from '@/api/stock'
160
   import SalesReturnDialog from './Dialog/salesReturnDialog'
167
   import SalesReturnDialog from './Dialog/salesReturnDialog'
161
   import BreadCrumb from '../components/bread-crumb'
168
   import BreadCrumb from '../components/bread-crumb'
162
 
169
 
168
       return {
175
       return {
169
         crumbs: [
176
         crumbs: [
170
           { path: false, name: '库存管理' },
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
           { path: false, name: '新增出库单' }
184
           { path: false, name: '新增出库单' }
173
         ],
185
         ],
174
         type: this.$route.query.type,
186
         type: this.$route.query.type,
197
         propForm: {
209
         propForm: {
198
           goodType: [],
210
           goodType: [],
199
           goodInfo: [],
211
           goodInfo: [],
200
-          goodUnit: []
212
+          goodUnit: [],
213
+          manufacturer: 0,
214
+          dealer: 0
201
         },
215
         },
202
         form: {
216
         form: {
203
-          manufacturer: '',
204
-          dealer: ''
217
+          manufacturer: 0,
218
+          dealer: 0
205
         },
219
         },
206
-        warehouseInfoList:[],
220
+        warehouseInfoList: [],
207
         manufacturer: [],
221
         manufacturer: [],
208
         dealer: [],
222
         dealer: [],
209
         goodType: []
223
         goodType: []
212
     methods: {
226
     methods: {
213
       comfirm: function(val) {
227
       comfirm: function(val) {
214
         this.$refs.dialog.hide()
228
         this.$refs.dialog.hide()
215
-
229
+        this.propForm.goodType = []
216
         if (val.selectedGoodInfo.length > 0) {
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
             if (i == 0) {
232
             if (i == 0) {
219
               this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
233
               this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
220
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
234
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
233
         this.currentIndex = -1
247
         this.currentIndex = -1
234
       }, cancle: function() {
248
       }, cancle: function() {
235
         this.$refs.dialog.hide()
249
         this.$refs.dialog.hide()
250
+        this.propForm.goodType = []
251
+
236
       }, GetConfigInfo: function() {
252
       }, GetConfigInfo: function() {
237
         const params = {
253
         const params = {
238
           type: this.$route.query.type
254
           type: this.$route.query.type
239
 
255
 
240
         }
256
         }
241
         getSalesReturnConfig(params).then(response => {
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
           if (response.data.state == 0) {
265
           if (response.data.state == 0) {
243
             this.$message.error(response.data.msg)
266
             this.$message.error(response.data.msg)
244
             return false
267
             return false
245
           } else {
268
           } else {
246
-            var warehouseList = response.data.data.warehouseList
269
+            loading.close()
247
             var warehouseInfoList = response.data.data.warehouseInfoList
270
             var warehouseInfoList = response.data.data.warehouseInfoList
248
             this.warehouseInfoList = response.data.data.warehouseInfoList
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
             const obj = {}
288
             const obj = {}
261
             const obj2 = {}
289
             const obj2 = {}
290
+            const obj3 = {}
291
+
262
             const obj4 = {}
292
             const obj4 = {}
263
             // 去重复
293
             // 去重复
264
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
294
             this.manufacturer = this.manufacturer.reduce((cur, next) => {
274
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
304
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
275
               return cur
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
       }, typeName: function(good_type_id) {
318
       }, typeName: function(good_type_id) {
280
         let name = ''
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
         return name
325
         return name
324
         }
363
         }
325
       }, showDialog(index, row) {
364
       }, showDialog(index, row) {
326
         this.currentIndex = index
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
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
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
           const obj3 = {}
398
           const obj3 = {}
341
             return cur
401
             return cur
342
           }, [])
402
           }, [])
343
         }
403
         }
404
+        this.$refs.dialog.show()
405
+
344
       }, back() {
406
       }, back() {
345
         this.$router.go(-1)
407
         this.$router.go(-1)
346
       }, submit() {
408
       }, submit() {
347
         this.$refs['tableForm'].validate((valid) => {
409
         this.$refs['tableForm'].validate((valid) => {
348
           if (valid) {
410
           if (valid) {
349
-            if (this.form.manufacturer == 0) {
350
-              this.$message.error('厂商不能为空')
351
-              return
352
-            }
353
             const array = this.recordInfo.recordData
411
             const array = this.recordInfo.recordData
354
             let total = 0
412
             let total = 0
355
             for (let i = 0; i < array.length; i++) {
413
             for (let i = 0; i < array.length; i++) {
382
             return false
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
     created() {
449
     created() {
428
     border-bottom: 1px #dcdfe6 solid;
481
     border-bottom: 1px #dcdfe6 solid;
429
     margin: 0px 0 20px 0;
482
     margin: 0px 0 20px 0;
430
   }
483
   }
484
+
431
   }
485
   }
432
 
486
 
433
 
487
 

+ 9 - 2
src/xt_pages/stock/stockOutOrderDetail.vue View File

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
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
     </div>
7
     </div>
6
 
8
 
7
     <div class="app-container">
9
     <div class="app-container">
108
       return {
110
       return {
109
         crumbs: [
111
         crumbs: [
110
           { path: false, name: '库存管理' },
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
           { path: false, name: '出库单详情' }
119
           { path: false, name: '出库单详情' }
113
         ],
120
         ],
114
         isEdit: 0,
121
         isEdit: 0,

+ 243 - 137
src/xt_pages/stock/stockOutOrderEdit.vue View File

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
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
       <div style="float:right;">
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
       </div>
11
       </div>
9
     </div>
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
   </div>
155
   </div>
123
 
156
 
124
 </template>
157
 </template>
126
 <script>
159
 <script>
127
   import { uParseTime } from '@/utils/tools'
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
   import SalesReturnDialog from './Dialog/salesReturnDialog'
163
   import SalesReturnDialog from './Dialog/salesReturnDialog'
136
   import BreadCrumb from '../components/bread-crumb'
164
   import BreadCrumb from '../components/bread-crumb'
137
 
165
 
143
       return {
171
       return {
144
         crumbs: [
172
         crumbs: [
145
           { path: false, name: '库存管理' },
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
           { path: false, name: '编辑出库单' }
180
           { path: false, name: '编辑出库单' }
148
         ],
181
         ],
149
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
182
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
177
           goodType: [],
210
           goodType: [],
178
           goodInfo: [],
211
           goodInfo: [],
179
           goodUnit: [],
212
           goodUnit: [],
180
-          title: '入库'
213
+          title: '入库',
214
+          manufacturer: 0,
215
+          dealer: 0
181
         },
216
         },
182
 
217
 
183
         form: {
218
         form: {
184
-          manufacturer: '',
185
-          dealer: ''
219
+          manufacturer: 0,
220
+          dealer: 0
186
         },
221
         },
187
-        warehouseInfoList:[],
222
+        warehouseInfoList: [],
188
         warehouseOut: {},
223
         warehouseOut: {},
189
         manufacturer: [],
224
         manufacturer: [],
190
         dealer: [],
225
         dealer: [],
221
           type: this.$route.query.type
256
           type: this.$route.query.type
222
         }
257
         }
223
         getSalesReturnConfig(params).then(response => {
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
           if (response.data.state == 0) {
266
           if (response.data.state == 0) {
225
             this.$message.error(response.data.msg)
267
             this.$message.error(response.data.msg)
226
             return false
268
             return false
227
           } else {
269
           } else {
270
+            loading.close()
228
             var warehouseInfoList = response.data.data.warehouseInfoList
271
             var warehouseInfoList = response.data.data.warehouseInfoList
229
             this.warehouseInfoList = response.data.data.warehouseInfoList
272
             this.warehouseInfoList = response.data.data.warehouseInfoList
230
-
231
             for (let i = 0; i < warehouseInfoList.length; i++) {
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
             const obj3 = {}
291
             const obj3 = {}
292
+
236
             const obj4 = {}
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
             this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
304
             this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
238
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
305
               obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
239
               return cur
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
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
310
               obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
243
               return cur
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
       }, typeName: function(good_type_id) {
319
       }, typeName: function(good_type_id) {
248
         let name = ''
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
         return name
326
         return name
302
         }
374
         }
303
       }, showDialog(index, row) {
375
       }, showDialog(index, row) {
304
         this.currentIndex = index
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
         this.$refs.dialog.show()
415
         this.$refs.dialog.show()
416
+
316
       }, back() {
417
       }, back() {
317
         this.$router.go(-1)
418
         this.$router.go(-1)
318
       }, submit() {
419
       }, submit() {
333
             const params = {
434
             const params = {
334
               'stockOut': this.recordInfo.recordData
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
               if (response.data.state == 0) {
438
               if (response.data.state == 0) {
338
                 this.$message.error(response.data.msg)
439
                 this.$message.error(response.data.msg)
339
                 return false
440
                 return false
363
             this.warehouseOut = response.data.data.info
464
             this.warehouseOut = response.data.data.info
364
             this.warehouse_out_time = this.getTime(this.warehouseOut.warehouse_out_time, '{y}-{m}-{d}')
465
             this.warehouse_out_time = this.getTime(this.warehouseOut.warehouse_out_time, '{y}-{m}-{d}')
365
             this.form.manufacturer = this.warehouseOut.manufacturer
466
             this.form.manufacturer = this.warehouseOut.manufacturer
467
+            this.form.dealer = this.warehouseOut.dealer
366
 
468
 
367
           }
469
           }
368
 
470
 
382
           return ''
484
           return ''
383
         }
485
         }
384
         return Math.round(parseFloat(val) * 100) / 100
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
     created() {
493
     created() {

+ 5 - 2
src/xt_pages/stock/stockQuery.vue View File

14
             {{scope.row.good_code}}
14
             {{scope.row.good_code}}
15
           </template>
15
           </template>
16
         </el-table-column>
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
         <el-table-column label="规格名称" align="center">
22
         <el-table-column label="规格名称" align="center">
18
           <template slot-scope="scope">
23
           <template slot-scope="scope">
19
-
20
             <span>{{scope.row.specification_name}}</span>
24
             <span>{{scope.row.specification_name}}</span>
21
-
22
           </template>
25
           </template>
23
         </el-table-column>
26
         </el-table-column>
24
         <el-table-column label="入库数量" align="center" >
27
         <el-table-column label="入库数量" align="center" >

+ 1 - 2
src/xt_pages/user/components/PatientForm.vue View File

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