瀏覽代碼

修改库存

csx 6 年之前
父節點
當前提交
a9dcf12bd6

+ 8 - 0
src/api/stock.js 查看文件

@@ -536,3 +536,11 @@ export function getCancelStockConfig(params) {
536 536
   })
537 537
 }
538 538
 
539
+export function getStockDetail(params) {
540
+  return request({
541
+    url: '/api/stock/detail',
542
+    method: 'get',
543
+    params: params
544
+  })
545
+}
546
+

+ 2 - 1
src/lang/zh.js 查看文件

@@ -151,7 +151,8 @@ export default {
151 151
     stockInDetail: '入库单详情',
152 152
     salesReturnDetail: '退货单详情',
153 153
     stockOutDetail: '出库单详情',
154
-    cancelStockDetail: '出库退库单详情'
154
+    cancelStockDetail: '出库退库单详情',
155
+    stockDetail:'出入库明细查询',
155 156
 
156 157
   },
157 158
   navbar: {

文件差異過大導致無法顯示
+ 474 - 469
src/router/index.js


+ 28 - 5
src/xt_pages/stock/cancelStockOrder.vue 查看文件

@@ -12,7 +12,7 @@
12 12
 
13 13
 
14 14
       <div class="cell clearfix" >
15
-        <el-input style="width: 300px;" class="filter-item" placeholder="单据日期/单据编码/制单人/供应商"/>
15
+        <el-input style="width: 300px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/厂商"/>
16 16
         <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
17 17
       </div>
18 18
 
@@ -164,6 +164,7 @@
164 164
           { path: false, name: '库存管理' },
165 165
           { path: '/stock/cancel', name: '出库退库单' }
166 166
         ],
167
+        searchKey:'',
167 168
         type: 1,
168 169
         page: 1,
169 170
         limit: 7,
@@ -186,6 +187,28 @@
186 187
       }
187 188
     },
188 189
     methods: {
190
+      search:function(){
191
+        const Params = {
192
+          page: this.page,
193
+          limit: this.limit,
194
+          start_time: this.start_time,
195
+          end_time: this.end_time,
196
+          type: this.type,
197
+          keywords:this.searchKey,
198
+        }
199
+        this.cancelStockDate = []
200
+        getCancelStockList(Params).then(response => {
201
+          if (response.data.state == 0) {
202
+            this.$message.error(response.data.msg)
203
+            return false
204
+          } else {
205
+            this.total = response.data.data.total
206
+            for (let i = 0; i < response.data.data.list.length; i++) {
207
+              this.cancelStockDate.push(response.data.data.list[i])
208
+            }
209
+          }
210
+        })
211
+      },
189 212
       AddNewOrder: function() {
190 213
         this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type }})
191 214
       },
@@ -245,14 +268,14 @@
245 268
         this.multipleSelection = val
246 269
       }, handleSizeChange(val) {
247 270
         this.limit = val
248
-        this.GetWarehouse()
271
+        this.GetCancelStock()
249 272
       }, handleCurrentChange(val) {
250 273
         this.page = val
251
-        this.GetWarehouse()
274
+        this.GetCancelStock()
252 275
       }, startTimeChange(val) {
253
-        this.GetWarehouse()
276
+        this.GetCancelStock()
254 277
       }, endTimeChange(val) {
255
-        this.GetWarehouse()
278
+        this.GetCancelStock()
256 279
       }, calculate: function(val) {
257 280
         return Math.round(parseFloat(val) * 100) / 100
258 281
       }, GetConfigInfo: function() {

+ 6 - 1
src/xt_pages/stock/cancelStockOrderAdd.vue 查看文件

@@ -268,7 +268,12 @@
268 268
         tempObj['return_count'] = ''
269 269
         this.recordInfo.recordData.push(tempObj)
270 270
       }, handleDelete: function(index, row) {
271
-        this.recordInfo.recordData.splice(index, 1)
271
+        if( this.recordInfo.recordData.length <= 1){
272
+          this.$message.error('只有一条记录的时候无法删除')
273
+          return
274
+        }else{
275
+          this.recordInfo.recordData.splice(index, 1)
276
+        }
272 277
       }, calculate: function(val) {
273 278
         if (val == 0) {
274 279
           return ''

+ 13 - 0
src/xt_pages/stock/cancelStockOrderEdit.vue 查看文件

@@ -341,6 +341,19 @@
341 341
             this.form.manufacturer = this.cancelStock.manufacturer
342 342
             this.form.dealer = this.cancelStock.dealer
343 343
           }
344
+          if( this.recordInfo.recordData.length == 0){
345
+            const tempObj = {}
346
+            tempObj['id'] = 0
347
+            tempObj['good_type_id'] = 0
348
+            tempObj['good_id'] = 0
349
+            tempObj['count'] = ''
350
+            this.recordInfo.recordData.push(tempObj)
351
+
352
+
353
+
354
+          }
355
+
356
+
344 357
         })
345 358
       }
346 359
     },

+ 2 - 2
src/xt_pages/stock/config/dealer.vue 查看文件

@@ -12,7 +12,7 @@
12 12
       <el-col>
13 13
         <!--<el-button type="primary" style="float:right;"  @click="showDialog">新增经销商</el-button>-->
14 14
 
15
-        <div>经销商
15
+        <div>
16 16
           <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px" type="primary" @click="showDialog">新增</el-button>
17 17
         </div>
18 18
 
@@ -71,7 +71,7 @@
71 71
                   @click="handleDelete(scope.$index, scope.row)">
72 72
                 </el-button>
73 73
               </el-tooltip>
74
-              
74
+
75 75
               <!--<el-button-->
76 76
                 <!--size="mini"-->
77 77
                 <!--type="primary"-->

+ 3 - 3
src/xt_pages/stock/config/goodInfo.vue 查看文件

@@ -13,7 +13,7 @@
13 13
       <el-col>
14 14
 
15 15
 
16
-        <div>物品信息
16
+        <div>
17 17
           <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px" type="primary" @click="showInfoDialog">新增</el-button>
18 18
         </div>
19 19
 
@@ -63,7 +63,7 @@
63 63
                   @click="handleGoodInfoEdit(scope.$index, scope.row)">
64 64
                 </el-button>
65 65
               </el-tooltip>
66
-              <el-tooltip class="item" effect="dark" content="删除" placement="top">              
66
+              <el-tooltip class="item" effect="dark" content="删除" placement="top">
67 67
                 <el-button
68 68
                   size="small"
69 69
                   type="danger"
@@ -71,7 +71,7 @@
71 71
                   @click="handleGoodInfoDelete(scope.$index, scope.row)">
72 72
                 </el-button>
73 73
               </el-tooltip>
74
-              
74
+
75 75
               <!--<el-button-->
76 76
                 <!--size="mini"-->
77 77
                 <!--type="primary"-->

+ 1 - 1
src/xt_pages/stock/config/goodType.vue 查看文件

@@ -10,7 +10,7 @@
10 10
     <el-row :gutter="15">
11 11
       <el-col>
12 12
 
13
-        <div>物品类型
13
+        <div>
14 14
           <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px" type="primary" @click="showDialog">新增</el-button>
15 15
         </div>
16 16
 

+ 2 - 2
src/xt_pages/stock/config/manufacturer.vue 查看文件

@@ -11,7 +11,7 @@
11 11
     <el-row>
12 12
       <el-col>
13 13
 
14
-        <div>厂家
14
+        <div>
15 15
           <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px" type="primary" @click="showDialog">新增</el-button>
16 16
         </div>
17 17
 
@@ -59,7 +59,7 @@
59 59
                   @click="handleEdit(scope.$index, scope.row)">
60 60
                 </el-button>
61 61
               </el-tooltip>
62
-              <el-tooltip class="item" effect="dark" content="删除" placement="top">              
62
+              <el-tooltip class="item" effect="dark" content="删除" placement="top">
63 63
                 <el-button
64 64
                   size="small"
65 65
                   type="danger"

+ 453 - 0
src/xt_pages/stock/detail/cancelStockDetail.vue 查看文件

@@ -0,0 +1,453 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="cell clearfix" >
5
+        <el-input style="width: 300px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/商品类型"/>
6
+        <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
7
+      </div>
8
+
9
+      <div class="cell clearfix">
10
+        <label class="title"><span class="name">日期查询</span> : </label>
11
+        <el-date-picker v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
12
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
13
+                        value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
14
+        <span class="">-</span>
15
+        <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
16
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
17
+                        value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
18
+      </div>
19
+
20
+
21
+      <div class="cell clearfix">
22
+        <label class="title"><span class="name">单据类型</span> : </label>
23
+        <el-select v-model="order_type" clearable placeholder="单据类型" @change="changeType">
24
+          <el-option
25
+            v-for="item in orderTypeArr"
26
+            :key="item.value"
27
+            :label="item.label"
28
+            :value="item.value">
29
+          </el-option>
30
+        </el-select>
31
+      </div>
32
+
33
+      <div class="cell clearfix">
34
+        <label class="title"><span class="name">其它</span> : </label>
35
+        <el-select v-model="manufacturer_id" clearable placeholder="厂商" @change="changeManufacturer">
36
+          <el-option
37
+            v-for="item in manufacturer"
38
+            :key="item.id"
39
+            :label="item.manufacturer_name"
40
+            :value="item.id">
41
+          </el-option>
42
+        </el-select>
43
+      </div>
44
+
45
+      <el-row :gutter="12" style="margin-top: 10px">
46
+        <el-table
47
+          :data="cancelStockDate"
48
+          :class="signAndWeighBoxPatients"
49
+          border
50
+          highlight-current-row
51
+          ref="multipleTable"
52
+          @selection-change="select"
53
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
54
+        >
55
+
56
+          <el-table-column label="单据编号" align="center">
57
+            <template slot-scope="scope">
58
+              {{scope.row.order_number}}
59
+            </template>
60
+          </el-table-column>
61
+
62
+          <el-table-column label="商品类型" align="center">
63
+            <template slot-scope="scope">
64
+              {{specificationName(scope.row.good_id)}}
65
+            </template>
66
+          </el-table-column>
67
+
68
+
69
+          <el-table-column label="单据类型" align="center">
70
+            <template slot-scope="scope">
71
+              {{getTypeName(scope.row)}}
72
+            </template>
73
+          </el-table-column>
74
+
75
+          <el-table-column label="操作时间" align="center">
76
+            <template slot-scope="scope">
77
+              {{ scope.row.CancelStock.return_time | parseTime('{y}-{m}-{d}')}}
78
+            </template>
79
+          </el-table-column>
80
+          <el-table-column label="制单人" align="center">
81
+            <template slot-scope="scope">
82
+              {{getXuserName(scope.row.CancelStock.creater)}}
83
+
84
+            </template>
85
+          </el-table-column>
86
+
87
+          <el-table-column label="数量" align="center">
88
+            <template slot-scope="scope">
89
+              {{scope.row.count}}
90
+            </template>
91
+          </el-table-column>
92
+
93
+        </el-table>
94
+
95
+        <el-pagination
96
+          @size-change="handleSizeChange"
97
+          @current-change="handleCurrentChange"
98
+          :page-sizes="[7]"
99
+          :page-size="7"
100
+          background
101
+          style="margin-top:20px;float: right"
102
+          layout="total, sizes, prev, pager, next, jumper"
103
+          :total="total">
104
+        </el-pagination>
105
+
106
+      </el-row>
107
+    </div>
108
+  </div>
109
+</template>
110
+
111
+<script>
112
+  import { uParseTime } from '@/utils/tools'
113
+  import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
114
+  import { deleteCancelStock, GetAllConfig, getStockDetail } from '@/api/stock'
115
+
116
+
117
+  export default {
118
+    name: 'cancelStockDetail',
119
+
120
+    created() {
121
+      var year = new Date().getFullYear()
122
+      var month = new Date().getMonth() + 1
123
+      var day = new Date().getDate()
124
+      if (parseInt(month) < 10) {
125
+        month = '0' + month
126
+      }
127
+      if (parseInt(day) < 10) {
128
+        day = '0' + day
129
+      }
130
+      const endTime = year + '-' + month + '-' + day
131
+      this.end_time = endTime
132
+
133
+      var year = new Date().getFullYear()
134
+      var month = new Date().getMonth()
135
+      var day = new Date().getDate()
136
+      if (parseInt(month) < 10) {
137
+        month = '0' + month
138
+      }
139
+      if (parseInt(day) < 10) {
140
+        day = '0' + day
141
+      }
142
+      const startTime = year + '-' + month + '-' + day
143
+      this.start_time = startTime
144
+      this.GetCancelStock()
145
+      this.GetConfigInfo()
146
+      this.fetchAllAdminUsers()
147
+    },
148
+    data() {
149
+      return {
150
+        orderTypeArr: [
151
+          { value: 1, label: '耗材入库单' },
152
+          { value: 2, label: '其他入库单' }
153
+        ],
154
+        manufacturer_id: '',
155
+        dealer_id: '',
156
+        order_type: '',
157
+        searchKey:'',
158
+        type: 4,
159
+        page: 1,
160
+        limit: 7,
161
+        checked: false,
162
+        total: 0,
163
+        pageTotal: 0,
164
+        pageSelect: 0,
165
+        adminUserOptions: [],
166
+        multipleSelection: [],
167
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
168
+        start_time: '',
169
+        cancelStockDate: [],
170
+        end_time: '',
171
+        goodType: [],
172
+        goodInfo: [],
173
+        manufacturer: [],
174
+        selectedTableData: [],
175
+        dealer: []
176
+
177
+      }
178
+    },
179
+    methods: {
180
+      changeType: function(val) {
181
+        this.order_type  = val
182
+        this.GetCancelStock()
183
+      }, changeManufacturer: function(val) {
184
+        this.manufacturer_id  = val
185
+        this.GetCancelStock()
186
+      },
187
+      getTypeName:function(row){
188
+        let name = ""
189
+        let name2 = ""
190
+        if (row.type == 1){
191
+          name = "耗材退库单"
192
+
193
+        }else if(row.type == 2){
194
+          name = "其他退库单"
195
+        }
196
+
197
+        return name
198
+      },
199
+      specificationName: function(good_info_id) {
200
+        let name = ''
201
+        for (let i = 0; i < this.goodInfo.length; i++) {
202
+          if (this.goodInfo[i].id == good_info_id) {
203
+            name = this.goodInfo[i].specification_name
204
+          }
205
+        }
206
+        return name
207
+      },
208
+      search:function(){
209
+        const Params = {
210
+          page: this.page,
211
+          limit: this.limit,
212
+          start_time: this.start_time,
213
+          end_time: this.end_time,
214
+          type: this.type,
215
+          keywords:this.searchKey,
216
+        }
217
+        this.cancelStockDate = []
218
+        getStockDetail(Params).then(response => {
219
+          if (response.data.state == 0) {
220
+            this.$message.error(response.data.msg)
221
+            return false
222
+          } else {
223
+            this.total = response.data.data.total
224
+            for (let i = 0; i < response.data.data.list.length; i++) {
225
+              this.cancelStockDate.push(response.data.data.list[i])
226
+            }
227
+          }
228
+        })
229
+      },
230
+      AddNewOrder: function() {
231
+        this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type }})
232
+      },
233
+      GetCancelStock: function() {
234
+        const Params = {
235
+          page: this.page,
236
+          limit: this.limit,
237
+          start_time: this.start_time,
238
+          end_time: this.end_time,
239
+          type: this.type,
240
+          manufacturer: this.manufacturer_id,
241
+          order_type: this.order_type,
242
+          dealer: this.dealer_id
243
+        }
244
+        this.cancelStockDate = []
245
+        getStockDetail(Params).then(response => {
246
+          if (response.data.state == 0) {
247
+            this.$message.error(response.data.msg)
248
+            return false
249
+          } else {
250
+            this.total = response.data.data.total
251
+            for (let i = 0; i < response.data.data.list.length; i++) {
252
+              this.cancelStockDate.push(response.data.data.list[i])
253
+            }
254
+          }
255
+        })
256
+      }, getXuserName(id) {
257
+        if (id <= 0) {
258
+          return ''
259
+        }
260
+        var name = ''
261
+        if (this.adminUserOptions == null || typeof (this.adminUserOptions.length) === 'undefined') {
262
+          return name
263
+        }
264
+        var leng = this.adminUserOptions.length
265
+        if (leng == 0) {
266
+          return name
267
+        }
268
+        for (let index = 0; index < leng; index++) {
269
+          if (this.adminUserOptions[index].id == id) {
270
+            name = this.adminUserOptions[index].name
271
+            break
272
+          }
273
+        }
274
+        return name
275
+      }, fetchAllAdminUsers() {
276
+        fetchAllAdminUsers().then(response => {
277
+          console.log(response)
278
+          if (response.data.state == 1) {
279
+            this.adminUserOptions = response.data.data.users
280
+            var alen = this.adminUserOptions.length
281
+            for (let index = 0; index < alen; index++) {
282
+              if (this.adminUserOptions[index].user_type == 2) {
283
+                // this.doctorOptions.push(this.adminUserOptions[index]);
284
+              }
285
+            }
286
+          }
287
+        })
288
+      }, handleSelectionChange: function(val) {
289
+        this.multipleSelection = val
290
+      }, handleSizeChange(val) {
291
+        this.limit = val
292
+        this.GetCancelStock()
293
+      }, handleCurrentChange(val) {
294
+        this.page = val
295
+        this.GetCancelStock()
296
+      }, startTimeChange(val) {
297
+        this.GetCancelStock()
298
+      }, endTimeChange(val) {
299
+        this.GetCancelStock()
300
+      }, calculate: function(val) {
301
+        return Math.round(parseFloat(val) * 100) / 100
302
+      }, GetConfigInfo: function() {
303
+        GetAllConfig().then(response => {
304
+          if (response.data.state == 0) {
305
+            this.$message.error(response.data.msg)
306
+            return false
307
+          } else {
308
+            this.manufacturer = response.data.data.manufacturer
309
+            this.dealer = response.data.data.dealer
310
+            this.goodInfo = response.data.data.goodInfo
311
+
312
+          }
313
+        })
314
+      }, getManufactuerName: function(manufacturer_id) {
315
+        for (let i = 0; i < this.manufacturer.length; i++) {
316
+          if (this.manufacturer[i].id == manufacturer_id) {
317
+            return this.manufacturer[i].manufacturer_name
318
+          }
319
+        }
320
+      }, getDealerName: function(dealer_id) {
321
+        for (let i = 0; i < this.dealer.length; i++) {
322
+          if (this.dealer[i].id == dealer_id) {
323
+            return this.dealer[i].dealer_name
324
+          }
325
+        }
326
+      }, handleEdit: function(index, row) {
327
+        this.$router.push({ name: 'cancelStockDetail', query: { id: row.id,type: this.type }})
328
+      }, handleDelete: function(index, row) {
329
+        const ids = []
330
+        ids.push(row.id)
331
+        const idStr = ids.join(',')
332
+
333
+        const params = {
334
+          ids: idStr
335
+        }
336
+
337
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
338
+          confirmButtonText: '确定',
339
+          cancelButtonText: '取消',
340
+          type: 'warning'
341
+        }).then(() => {
342
+          deleteCancelStock(params).then(response => {
343
+            if (response.data.state == 0) {
344
+              this.$message.error(response.data.msg)
345
+              return false
346
+            } else {
347
+              this.$notify({
348
+                title: '成功',
349
+                message: '删除成功',
350
+                type: 'success',
351
+                duration: 2000
352
+              })
353
+              for (let i = 0; i < ids.length; i++) {
354
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
355
+                  if (ids[i] == this.cancelStockDate[y].id) {
356
+                    this.cancelStockDate.splice(y, 1)
357
+                  }
358
+                }
359
+              }
360
+            }
361
+          })
362
+        }).catch(() => {
363
+        })
364
+      }, changeAllSelected: function(val) {
365
+        if (val) {
366
+          this.$refs.multipleTable.toggleAllSelection()
367
+        } else {
368
+          this.$refs.multipleTable.clearSelection()
369
+        }
370
+      }, select(selection) {
371
+        this.selectedTableData = selection
372
+      }, batchDelete() {
373
+        if (this.selectedTableData.length <= 0) {
374
+          this.$message.error('请选择要删除的记录')
375
+          return
376
+        }
377
+        const ids = []
378
+        for (let i = 0; i < this.selectedTableData.length; i++) {
379
+          ids.push(this.selectedTableData[i].id)
380
+        }
381
+        const idStr = ids.join(',')
382
+        const params = {
383
+          ids: idStr
384
+        }
385
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
386
+          confirmButtonText: '确定',
387
+          cancelButtonText: '取消',
388
+          type: 'warning'
389
+        }).then(() => {
390
+          deleteCancelStock(params).then(response => {
391
+            if (response.data.state == 0) {
392
+              this.$message.error(response.data.msg)
393
+              return false
394
+            } else {
395
+              this.$notify({
396
+                title: '成功',
397
+                message: '删除成功',
398
+                type: 'success',
399
+                duration: 2000
400
+              })
401
+
402
+              for (let i = 0; i < ids.length; i++) {
403
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
404
+                  if (ids[i] == this.cancelStockDate[y].id) {
405
+                    this.cancelStockDate.splice(y, 1)
406
+                  }
407
+                }
408
+              }
409
+            }
410
+          })
411
+        }).catch(() => {
412
+        })
413
+      }
414
+    }
415
+  }
416
+</script>
417
+
418
+<style rel="stylesheet/css" lang="scss" scoped>
419
+  .information {
420
+    border: 1px #dcdfe6 solid;
421
+    padding: 30px 20px 30px 20px;
422
+
423
+  .border {
424
+    border-bottom: 1px #dcdfe6 solid;
425
+    margin: 0px 0 20px 0;
426
+  }
427
+
428
+  }
429
+
430
+
431
+  .edit_separater {
432
+    border-top: 1px solid rgb(233, 233, 233);
433
+    margin-top: 15px;
434
+    margin-bottom: 15px;
435
+  }
436
+
437
+</style>
438
+
439
+<style>
440
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
441
+    font-size: 12px;
442
+  }
443
+
444
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
445
+    background: #6fb5fa;
446
+  }
447
+
448
+  .count {
449
+    color: #bd2c00;
450
+
451
+  }
452
+
453
+</style>

+ 456 - 0
src/xt_pages/stock/detail/salesReturnDetail.vue 查看文件

@@ -0,0 +1,456 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="cell clearfix" >
5
+        <el-input style="width: 300px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/商品类型"/>
6
+        <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
7
+      </div>
8
+
9
+      <div class="cell clearfix">
10
+        <label class="title"><span class="name">日期查询</span> : </label>
11
+        <el-date-picker v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
12
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
13
+                        value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
14
+        <span class="">-</span>
15
+        <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
16
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
17
+                        value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
18
+      </div>
19
+
20
+
21
+      <div class="cell clearfix">
22
+        <label class="title"><span class="name">单据类型</span> : </label>
23
+        <el-select v-model="order_type" clearable placeholder="单据类型" @change="changeType">
24
+          <el-option
25
+            v-for="item in orderTypeArr"
26
+            :key="item.value"
27
+            :label="item.label"
28
+            :value="item.value">
29
+          </el-option>
30
+        </el-select>
31
+      </div>
32
+
33
+      <div class="cell clearfix">
34
+        <label class="title"><span class="name">其它</span> : </label>
35
+        <el-select v-model="manufacturer_id" clearable placeholder="厂商" @change="changeManufacturer">
36
+          <el-option
37
+            v-for="item in manufacturer"
38
+            :key="item.id"
39
+            :label="item.manufacturer_name"
40
+            :value="item.id">
41
+          </el-option>
42
+        </el-select>
43
+      </div>
44
+
45
+      <el-row :gutter="12" style="margin-top: 10px">
46
+        <el-table
47
+          :data="cancelStockDate"
48
+          :class="signAndWeighBoxPatients"
49
+          border
50
+          highlight-current-row
51
+          ref="multipleTable"
52
+          @selection-change="select"
53
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
54
+
55
+        >
56
+
57
+
58
+
59
+          <el-table-column label="单据编号" align="center">
60
+            <template slot-scope="scope">
61
+              {{scope.row.order_number}}
62
+            </template>
63
+          </el-table-column>
64
+
65
+          <el-table-column label="商品类型" align="center">
66
+            <template slot-scope="scope">
67
+              {{specificationName(scope.row.good_id)}}
68
+            </template>
69
+          </el-table-column>
70
+
71
+
72
+          <el-table-column label="单据类型" align="center">
73
+            <template slot-scope="scope">
74
+              {{getTypeName(scope.row)}}
75
+            </template>
76
+          </el-table-column>
77
+
78
+          <el-table-column label="操作时间" align="center">
79
+            <template slot-scope="scope">
80
+              {{ scope.row.SalesReturn.return_time | parseTime('{y}-{m}-{d}')}}
81
+            </template>
82
+          </el-table-column>
83
+          <el-table-column label="制单人" align="center">
84
+            <template slot-scope="scope">
85
+              {{getXuserName(scope.row.SalesReturn.creater)}}
86
+
87
+            </template>
88
+          </el-table-column>
89
+
90
+          <el-table-column label="数量" align="center">
91
+            <template slot-scope="scope">
92
+              {{scope.row.count}}
93
+            </template>
94
+          </el-table-column>
95
+
96
+        </el-table>
97
+
98
+        <el-pagination
99
+          @size-change="handleSizeChange"
100
+          @current-change="handleCurrentChange"
101
+          :page-sizes="[7]"
102
+          :page-size="7"
103
+          background
104
+          style="margin-top:20px;float: right"
105
+          layout="total, sizes, prev, pager, next, jumper"
106
+          :total="total">
107
+        </el-pagination>
108
+
109
+      </el-row>
110
+    </div>
111
+  </div>
112
+</template>
113
+
114
+<script>
115
+  import { uParseTime } from '@/utils/tools'
116
+  import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
117
+  import { deleteCancelStock, GetAllConfig, getStockDetail } from '@/api/stock'
118
+
119
+
120
+  export default {
121
+    name: 'salesReturnDetail',
122
+
123
+    created() {
124
+      var year = new Date().getFullYear()
125
+      var month = new Date().getMonth() + 1
126
+      var day = new Date().getDate()
127
+      if (parseInt(month) < 10) {
128
+        month = '0' + month
129
+      }
130
+      if (parseInt(day) < 10) {
131
+        day = '0' + day
132
+      }
133
+      const endTime = year + '-' + month + '-' + day
134
+      this.end_time = endTime
135
+
136
+      var year = new Date().getFullYear()
137
+      var month = new Date().getMonth()
138
+      var day = new Date().getDate()
139
+      if (parseInt(month) < 10) {
140
+        month = '0' + month
141
+      }
142
+      if (parseInt(day) < 10) {
143
+        day = '0' + day
144
+      }
145
+      const startTime = year + '-' + month + '-' + day
146
+      this.start_time = startTime
147
+      this.GetCancelStock()
148
+      this.GetConfigInfo()
149
+      this.fetchAllAdminUsers()
150
+    },
151
+    data() {
152
+      return {
153
+        orderTypeArr: [
154
+          { value: 1, label: '耗材入库单' },
155
+          { value: 2, label: '其他入库单' }
156
+        ],
157
+        manufacturer_id: '',
158
+        dealer_id: '',
159
+        order_type: '',
160
+        searchKey:'',
161
+        type: 3,
162
+        page: 1,
163
+        limit: 7,
164
+        checked: false,
165
+        total: 0,
166
+        pageTotal: 0,
167
+        pageSelect: 0,
168
+        adminUserOptions: [],
169
+        multipleSelection: [],
170
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
171
+        start_time: '',
172
+        cancelStockDate: [],
173
+        end_time: '',
174
+        goodType: [],
175
+        goodInfo: [],
176
+        manufacturer: [],
177
+        selectedTableData: [],
178
+        dealer: []
179
+
180
+      }
181
+    },
182
+    methods: {
183
+      changeType: function(val) {
184
+        this.order_type  = val
185
+        this.GetCancelStock()
186
+      }, changeManufacturer: function(val) {
187
+        this.manufacturer_id  = val
188
+        this.GetCancelStock()
189
+
190
+      },
191
+      getTypeName:function(row){
192
+        let name = ""
193
+        if (row.type == 1){
194
+          name = "耗材退货单"
195
+
196
+        }else if(row.type == 2){
197
+          name = "其他退货单"
198
+        }
199
+
200
+        return name
201
+      },
202
+      specificationName: function(good_info_id) {
203
+        let name = ''
204
+        for (let i = 0; i < this.goodInfo.length; i++) {
205
+          if (this.goodInfo[i].id == good_info_id) {
206
+            name = this.goodInfo[i].specification_name
207
+          }
208
+        }
209
+        return name
210
+      },
211
+      search:function(){
212
+        const Params = {
213
+          page: this.page,
214
+          limit: this.limit,
215
+          start_time: this.start_time,
216
+          end_time: this.end_time,
217
+          type: this.type,
218
+          keywords:this.searchKey,
219
+        }
220
+        this.cancelStockDate = []
221
+        getStockDetail(Params).then(response => {
222
+          if (response.data.state == 0) {
223
+            this.$message.error(response.data.msg)
224
+            return false
225
+          } else {
226
+            this.total = response.data.data.total
227
+            for (let i = 0; i < response.data.data.list.length; i++) {
228
+              this.cancelStockDate.push(response.data.data.list[i])
229
+            }
230
+          }
231
+        })
232
+      },
233
+      AddNewOrder: function() {
234
+        this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type }})
235
+      },
236
+      GetCancelStock: function() {
237
+        const Params = {
238
+          page: this.page,
239
+          limit: this.limit,
240
+          start_time: this.start_time,
241
+          end_time: this.end_time,
242
+          type: this.type,
243
+          manufacturer: this.manufacturer_id,
244
+          order_type: this.order_type,
245
+          dealer: this.dealer_id
246
+        }
247
+        this.cancelStockDate = []
248
+        getStockDetail(Params).then(response => {
249
+          if (response.data.state == 0) {
250
+            this.$message.error(response.data.msg)
251
+            return false
252
+          } else {
253
+            this.total = response.data.data.total
254
+            for (let i = 0; i < response.data.data.list.length; i++) {
255
+              this.cancelStockDate.push(response.data.data.list[i])
256
+            }
257
+          }
258
+        })
259
+      }, getXuserName(id) {
260
+        if (id <= 0) {
261
+          return ''
262
+        }
263
+        var name = ''
264
+        if (this.adminUserOptions == null || typeof (this.adminUserOptions.length) === 'undefined') {
265
+          return name
266
+        }
267
+        var leng = this.adminUserOptions.length
268
+        if (leng == 0) {
269
+          return name
270
+        }
271
+        for (let index = 0; index < leng; index++) {
272
+          if (this.adminUserOptions[index].id == id) {
273
+            name = this.adminUserOptions[index].name
274
+            break
275
+          }
276
+        }
277
+        return name
278
+      }, fetchAllAdminUsers() {
279
+        fetchAllAdminUsers().then(response => {
280
+          console.log(response)
281
+          if (response.data.state == 1) {
282
+            this.adminUserOptions = response.data.data.users
283
+            var alen = this.adminUserOptions.length
284
+            for (let index = 0; index < alen; index++) {
285
+              if (this.adminUserOptions[index].user_type == 2) {
286
+                // this.doctorOptions.push(this.adminUserOptions[index]);
287
+              }
288
+            }
289
+          }
290
+        })
291
+      }, handleSelectionChange: function(val) {
292
+        this.multipleSelection = val
293
+      }, handleSizeChange(val) {
294
+        this.limit = val
295
+        this.GetCancelStock()
296
+      }, handleCurrentChange(val) {
297
+        this.page = val
298
+        this.GetCancelStock()
299
+      }, startTimeChange(val) {
300
+        this.GetCancelStock()
301
+      }, endTimeChange(val) {
302
+        this.GetCancelStock()
303
+      }, calculate: function(val) {
304
+        return Math.round(parseFloat(val) * 100) / 100
305
+      }, GetConfigInfo: function() {
306
+        GetAllConfig().then(response => {
307
+          if (response.data.state == 0) {
308
+            this.$message.error(response.data.msg)
309
+            return false
310
+          } else {
311
+            this.manufacturer = response.data.data.manufacturer
312
+            this.dealer = response.data.data.dealer
313
+            this.goodInfo = response.data.data.goodInfo
314
+
315
+          }
316
+        })
317
+      }, getManufactuerName: function(manufacturer_id) {
318
+        for (let i = 0; i < this.manufacturer.length; i++) {
319
+          if (this.manufacturer[i].id == manufacturer_id) {
320
+            return this.manufacturer[i].manufacturer_name
321
+          }
322
+        }
323
+      }, getDealerName: function(dealer_id) {
324
+        for (let i = 0; i < this.dealer.length; i++) {
325
+          if (this.dealer[i].id == dealer_id) {
326
+            return this.dealer[i].dealer_name
327
+          }
328
+        }
329
+      }, handleEdit: function(index, row) {
330
+        this.$router.push({ name: 'cancelStockDetail', query: { id: row.id,type: this.type }})
331
+      }, handleDelete: function(index, row) {
332
+        const ids = []
333
+        ids.push(row.id)
334
+        const idStr = ids.join(',')
335
+
336
+        const params = {
337
+          ids: idStr
338
+        }
339
+
340
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
341
+          confirmButtonText: '确定',
342
+          cancelButtonText: '取消',
343
+          type: 'warning'
344
+        }).then(() => {
345
+          deleteCancelStock(params).then(response => {
346
+            if (response.data.state == 0) {
347
+              this.$message.error(response.data.msg)
348
+              return false
349
+            } else {
350
+              this.$notify({
351
+                title: '成功',
352
+                message: '删除成功',
353
+                type: 'success',
354
+                duration: 2000
355
+              })
356
+              for (let i = 0; i < ids.length; i++) {
357
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
358
+                  if (ids[i] == this.cancelStockDate[y].id) {
359
+                    this.cancelStockDate.splice(y, 1)
360
+                  }
361
+                }
362
+              }
363
+            }
364
+          })
365
+        }).catch(() => {
366
+        })
367
+      }, changeAllSelected: function(val) {
368
+        if (val) {
369
+          this.$refs.multipleTable.toggleAllSelection()
370
+        } else {
371
+          this.$refs.multipleTable.clearSelection()
372
+        }
373
+      }, select(selection) {
374
+        this.selectedTableData = selection
375
+      }, batchDelete() {
376
+        if (this.selectedTableData.length <= 0) {
377
+          this.$message.error('请选择要删除的记录')
378
+          return
379
+        }
380
+        const ids = []
381
+        for (let i = 0; i < this.selectedTableData.length; i++) {
382
+          ids.push(this.selectedTableData[i].id)
383
+        }
384
+        const idStr = ids.join(',')
385
+        const params = {
386
+          ids: idStr
387
+        }
388
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
389
+          confirmButtonText: '确定',
390
+          cancelButtonText: '取消',
391
+          type: 'warning'
392
+        }).then(() => {
393
+          deleteCancelStock(params).then(response => {
394
+            if (response.data.state == 0) {
395
+              this.$message.error(response.data.msg)
396
+              return false
397
+            } else {
398
+              this.$notify({
399
+                title: '成功',
400
+                message: '删除成功',
401
+                type: 'success',
402
+                duration: 2000
403
+              })
404
+
405
+              for (let i = 0; i < ids.length; i++) {
406
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
407
+                  if (ids[i] == this.cancelStockDate[y].id) {
408
+                    this.cancelStockDate.splice(y, 1)
409
+                  }
410
+                }
411
+              }
412
+            }
413
+          })
414
+        }).catch(() => {
415
+        })
416
+      }
417
+    }
418
+  }
419
+</script>
420
+
421
+<style rel="stylesheet/css" lang="scss" scoped>
422
+  .information {
423
+    border: 1px #dcdfe6 solid;
424
+    padding: 30px 20px 30px 20px;
425
+
426
+  .border {
427
+    border-bottom: 1px #dcdfe6 solid;
428
+    margin: 0px 0 20px 0;
429
+  }
430
+
431
+  }
432
+
433
+
434
+  .edit_separater {
435
+    border-top: 1px solid rgb(233, 233, 233);
436
+    margin-top: 15px;
437
+    margin-bottom: 15px;
438
+  }
439
+
440
+</style>
441
+
442
+<style>
443
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
444
+    font-size: 12px;
445
+  }
446
+
447
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
448
+    background: #6fb5fa;
449
+  }
450
+
451
+  .count {
452
+    color: #bd2c00;
453
+
454
+  }
455
+
456
+</style>

+ 465 - 0
src/xt_pages/stock/detail/stockInDetail.vue 查看文件

@@ -0,0 +1,465 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="cell clearfix">
5
+        <el-input style="width: 300px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/商品类型"/>
6
+        <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
7
+      </div>
8
+
9
+      <div class="cell clearfix">
10
+        <label class="title"><span class="name">日期查询</span> : </label>
11
+        <el-date-picker v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
12
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
13
+                        value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
14
+        <span class="">-</span>
15
+        <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
16
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
17
+                        value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
18
+      </div>
19
+
20
+      <div class="cell clearfix">
21
+        <label class="title"><span class="name">单据类型</span> : </label>
22
+        <el-select v-model="order_type" clearable placeholder="单据类型" @change="changeType">
23
+          <el-option
24
+            v-for="item in orderTypeArr"
25
+            :key="item.value"
26
+            :label="item.label"
27
+            :value="item.value">
28
+          </el-option>
29
+        </el-select>
30
+      </div>
31
+
32
+      <div class="cell clearfix">
33
+        <label class="title"><span class="name">其它</span> : </label>
34
+        <el-select v-model="manufacturer_id" clearable placeholder="厂商" @change="changeManufacturer">
35
+          <el-option
36
+            v-for="item in manufacturer"
37
+            :key="item.id"
38
+            :label="item.manufacturer_name"
39
+            :value="item.id">
40
+          </el-option>
41
+        </el-select>
42
+      </div>
43
+
44
+      <el-row :gutter="12" style="margin-top: 10px">
45
+        <el-table
46
+          :data="cancelStockDate"
47
+          :class="signAndWeighBoxPatients"
48
+          border
49
+          highlight-current-row
50
+          ref="multipleTable"
51
+          @selection-change="select"
52
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
53
+
54
+        >
55
+
56
+          <el-table-column label="单据编号" align="center">
57
+            <template slot-scope="scope">
58
+              {{scope.row.warehousing_order}}
59
+            </template>
60
+          </el-table-column>
61
+
62
+          <el-table-column label="商品类型" align="center">
63
+            <template slot-scope="scope">
64
+              {{specificationName(scope.row.good_id)}}
65
+            </template>
66
+          </el-table-column>
67
+
68
+
69
+          <el-table-column label="单据类型" align="center">
70
+            <template slot-scope="scope">
71
+              {{getTypeName(scope.row)}}
72
+            </template>
73
+          </el-table-column>
74
+
75
+          <el-table-column label="操作时间" align="center">
76
+            <template slot-scope="scope">
77
+              {{ scope.row.Warehousing.warehousing_time | parseTime('{y}-{m}-{d}')}}
78
+            </template>
79
+          </el-table-column>
80
+          <el-table-column label="制单人" align="center">
81
+            <template slot-scope="scope">
82
+              {{getXuserName(scope.row.Warehousing.creater)}}
83
+
84
+            </template>
85
+          </el-table-column>
86
+          <el-table-column label="单价" align="center">
87
+            <template slot-scope="scope">
88
+              {{scope.row.price}}
89
+            </template>
90
+          </el-table-column>
91
+          <el-table-column label="数量" align="center">
92
+            <template slot-scope="scope">
93
+              {{scope.row.warehousing_count}}
94
+            </template>
95
+          </el-table-column>
96
+          <el-table-column label="总价" align="center">
97
+            <template slot-scope="scope">
98
+              {{scope.row.price * scope.row.warehousing_count}}
99
+            </template>
100
+          </el-table-column>
101
+
102
+        </el-table>
103
+
104
+        <el-pagination
105
+          @size-change="handleSizeChange"
106
+          @current-change="handleCurrentChange"
107
+          :page-sizes="[7]"
108
+          :page-size="7"
109
+          background
110
+          style="margin-top:20px;float: right"
111
+          layout="total, sizes, prev, pager, next, jumper"
112
+          :total="total">
113
+        </el-pagination>
114
+
115
+      </el-row>
116
+    </div>
117
+  </div>
118
+</template>
119
+
120
+<script>
121
+  import { uParseTime } from '@/utils/tools'
122
+  import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
123
+  import { deleteCancelStock, GetAllConfig, getStockDetail } from '@/api/stock'
124
+
125
+  export default {
126
+    name: 'stockInDetail',
127
+
128
+    created() {
129
+      var year = new Date().getFullYear()
130
+      var month = new Date().getMonth() + 1
131
+      var day = new Date().getDate()
132
+      if (parseInt(month) < 10) {
133
+        month = '0' + month
134
+      }
135
+      if (parseInt(day) < 10) {
136
+        day = '0' + day
137
+      }
138
+      const endTime = year + '-' + month + '-' + day
139
+      this.end_time = endTime
140
+
141
+      var year = new Date().getFullYear()
142
+      var month = new Date().getMonth()
143
+      var day = new Date().getDate()
144
+      if (parseInt(month) < 10) {
145
+        month = '0' + month
146
+      }
147
+      if (parseInt(day) < 10) {
148
+        day = '0' + day
149
+      }
150
+      const startTime = year + '-' + month + '-' + day
151
+      this.start_time = startTime
152
+      this.GetCancelStock()
153
+      this.GetConfigInfo()
154
+      this.fetchAllAdminUsers()
155
+    },
156
+    data() {
157
+      return {
158
+        orderTypeArr: [
159
+          { value: 1, label: '耗材入库单' },
160
+          { value: 2, label: '其他入库单' }
161
+        ],
162
+
163
+        searchKey: '',
164
+        type: 1,
165
+        page: 1,
166
+        limit: 7,
167
+        manufacturer_id: '',
168
+        dealer_id: '',
169
+        order_type: '',
170
+        checked: false,
171
+        total: 0,
172
+        pageTotal: 0,
173
+        pageSelect: 0,
174
+        adminUserOptions: [],
175
+        multipleSelection: [],
176
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
177
+        start_time: '',
178
+        cancelStockDate: [],
179
+        end_time: '',
180
+        goodType: [],
181
+        goodInfo: [],
182
+        manufacturer: [],
183
+        selectedTableData: [],
184
+        dealer: []
185
+
186
+      }
187
+    },
188
+    methods: {
189
+      changeType: function(val) {
190
+        this.order_type  = val
191
+        this.GetCancelStock()
192
+      }, changeManufacturer: function(val) {
193
+        this.manufacturer_id  = val
194
+        this.GetCancelStock()
195
+
196
+      }, changeDealer: function(val) {
197
+        this.dealer_id  = val
198
+        this.GetCancelStock()
199
+
200
+      }, getTypeName: function(row) {
201
+        let name = ''
202
+        if (row.type == 1) {
203
+          name = '耗材入库单'
204
+
205
+        } else if (row.type == 2) {
206
+          name = '其他入库单'
207
+        }
208
+
209
+        return name
210
+      },
211
+      specificationName: function(good_info_id) {
212
+        let name = ''
213
+        for (let i = 0; i < this.goodInfo.length; i++) {
214
+          if (this.goodInfo[i].id == good_info_id) {
215
+            name = this.goodInfo[i].specification_name
216
+          }
217
+        }
218
+        return name
219
+      },
220
+      search: function() {
221
+        const Params = {
222
+          page: this.page,
223
+          limit: this.limit,
224
+          start_time: this.start_time,
225
+          end_time: this.end_time,
226
+          type: this.type,
227
+          keywords: this.searchKey,
228
+        }
229
+        this.cancelStockDate = []
230
+        getStockDetail(Params).then(response => {
231
+          if (response.data.state == 0) {
232
+            this.$message.error(response.data.msg)
233
+            return false
234
+          } else {
235
+            this.total = response.data.data.total
236
+            for (let i = 0; i < response.data.data.list.length; i++) {
237
+              this.cancelStockDate.push(response.data.data.list[i])
238
+            }
239
+          }
240
+        })
241
+      },
242
+      AddNewOrder: function() {
243
+        this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type } })
244
+      },
245
+      GetCancelStock: function() {
246
+        const Params = {
247
+          page: this.page,
248
+          limit: this.limit,
249
+          start_time: this.start_time,
250
+          end_time: this.end_time,
251
+          type: this.type,
252
+          manufacturer: this.manufacturer_id,
253
+          order_type: this.order_type,
254
+          dealer: this.dealer_id
255
+        }
256
+        this.cancelStockDate = []
257
+        getStockDetail(Params).then(response => {
258
+          if (response.data.state == 0) {
259
+            this.$message.error(response.data.msg)
260
+            return false
261
+          } else {
262
+            this.total = response.data.data.total
263
+            for (let i = 0; i < response.data.data.list.length; i++) {
264
+              this.cancelStockDate.push(response.data.data.list[i])
265
+            }
266
+          }
267
+        })
268
+      }, getXuserName(id) {
269
+        if (id <= 0) {
270
+          return ''
271
+        }
272
+        var name = ''
273
+        if (this.adminUserOptions == null || typeof (this.adminUserOptions.length) === 'undefined') {
274
+          return name
275
+        }
276
+        var leng = this.adminUserOptions.length
277
+        if (leng == 0) {
278
+          return name
279
+        }
280
+        for (let index = 0; index < leng; index++) {
281
+          if (this.adminUserOptions[index].id == id) {
282
+            name = this.adminUserOptions[index].name
283
+            break
284
+          }
285
+        }
286
+        return name
287
+      }, fetchAllAdminUsers() {
288
+        fetchAllAdminUsers().then(response => {
289
+          console.log(response)
290
+          if (response.data.state == 1) {
291
+            this.adminUserOptions = response.data.data.users
292
+            var alen = this.adminUserOptions.length
293
+            for (let index = 0; index < alen; index++) {
294
+              if (this.adminUserOptions[index].user_type == 2) {
295
+                // this.doctorOptions.push(this.adminUserOptions[index]);
296
+              }
297
+            }
298
+          }
299
+        })
300
+      }, handleSelectionChange: function(val) {
301
+        this.multipleSelection = val
302
+      }, handleSizeChange(val) {
303
+        this.limit = val
304
+        this.GetWarehouse()
305
+      }, handleCurrentChange(val) {
306
+        this.page = val
307
+        this.GetWarehouse()
308
+      }, startTimeChange(val) {
309
+        this.GetCancelStock()
310
+      }, endTimeChange(val) {
311
+        this.GetCancelStock()
312
+      }, calculate: function(val) {
313
+        return Math.round(parseFloat(val) * 100) / 100
314
+      }, GetConfigInfo: function() {
315
+        GetAllConfig().then(response => {
316
+          if (response.data.state == 0) {
317
+            this.$message.error(response.data.msg)
318
+            return false
319
+          } else {
320
+            this.manufacturer = response.data.data.manufacturer
321
+            this.dealer = response.data.data.dealer
322
+            this.goodInfo = response.data.data.goodInfo
323
+
324
+          }
325
+        })
326
+      }, getManufactuerName: function(manufacturer_id) {
327
+        for (let i = 0; i < this.manufacturer.length; i++) {
328
+          if (this.manufacturer[i].id == manufacturer_id) {
329
+            return this.manufacturer[i].manufacturer_name
330
+          }
331
+        }
332
+      }, getDealerName: function(dealer_id) {
333
+        for (let i = 0; i < this.dealer.length; i++) {
334
+          if (this.dealer[i].id == dealer_id) {
335
+            return this.dealer[i].dealer_name
336
+          }
337
+        }
338
+      }, handleEdit: function(index, row) {
339
+        this.$router.push({ name: 'cancelStockDetail', query: { id: row.id, type: this.type } })
340
+      }, handleDelete: function(index, row) {
341
+        const ids = []
342
+        ids.push(row.id)
343
+        const idStr = ids.join(',')
344
+
345
+        const params = {
346
+          ids: idStr
347
+        }
348
+
349
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
350
+          confirmButtonText: '确定',
351
+          cancelButtonText: '取消',
352
+          type: 'warning'
353
+        }).then(() => {
354
+          deleteCancelStock(params).then(response => {
355
+            if (response.data.state == 0) {
356
+              this.$message.error(response.data.msg)
357
+              return false
358
+            } else {
359
+              this.$notify({
360
+                title: '成功',
361
+                message: '删除成功',
362
+                type: 'success',
363
+                duration: 2000
364
+              })
365
+              for (let i = 0; i < ids.length; i++) {
366
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
367
+                  if (ids[i] == this.cancelStockDate[y].id) {
368
+                    this.cancelStockDate.splice(y, 1)
369
+                  }
370
+                }
371
+              }
372
+            }
373
+          })
374
+        }).catch(() => {
375
+        })
376
+      }, changeAllSelected: function(val) {
377
+        if (val) {
378
+          this.$refs.multipleTable.toggleAllSelection()
379
+        } else {
380
+          this.$refs.multipleTable.clearSelection()
381
+        }
382
+      }, select(selection) {
383
+        this.selectedTableData = selection
384
+      }, batchDelete() {
385
+        if (this.selectedTableData.length <= 0) {
386
+          this.$message.error('请选择要删除的记录')
387
+          return
388
+        }
389
+        const ids = []
390
+        for (let i = 0; i < this.selectedTableData.length; i++) {
391
+          ids.push(this.selectedTableData[i].id)
392
+        }
393
+        const idStr = ids.join(',')
394
+        const params = {
395
+          ids: idStr
396
+        }
397
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
398
+          confirmButtonText: '确定',
399
+          cancelButtonText: '取消',
400
+          type: 'warning'
401
+        }).then(() => {
402
+          deleteCancelStock(params).then(response => {
403
+            if (response.data.state == 0) {
404
+              this.$message.error(response.data.msg)
405
+              return false
406
+            } else {
407
+              this.$notify({
408
+                title: '成功',
409
+                message: '删除成功',
410
+                type: 'success',
411
+                duration: 2000
412
+              })
413
+
414
+              for (let i = 0; i < ids.length; i++) {
415
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
416
+                  if (ids[i] == this.cancelStockDate[y].id) {
417
+                    this.cancelStockDate.splice(y, 1)
418
+                  }
419
+                }
420
+              }
421
+            }
422
+          })
423
+        }).catch(() => {
424
+        })
425
+      }
426
+    }
427
+  }
428
+</script>
429
+
430
+<style rel="stylesheet/css" lang="scss" scoped>
431
+  .information {
432
+    border: 1px #dcdfe6 solid;
433
+    padding: 30px 20px 30px 20px;
434
+
435
+  .border {
436
+    border-bottom: 1px #dcdfe6 solid;
437
+    margin: 0px 0 20px 0;
438
+  }
439
+
440
+  }
441
+
442
+
443
+  .edit_separater {
444
+    border-top: 1px solid rgb(233, 233, 233);
445
+    margin-top: 15px;
446
+    margin-bottom: 15px;
447
+  }
448
+
449
+</style>
450
+
451
+<style>
452
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
453
+    font-size: 12px;
454
+  }
455
+
456
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
457
+    background: #6fb5fa;
458
+  }
459
+
460
+  .count {
461
+    color: #bd2c00;
462
+
463
+  }
464
+
465
+</style>

+ 468 - 0
src/xt_pages/stock/detail/stockOutDetail.vue 查看文件

@@ -0,0 +1,468 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="cell clearfix" >
5
+        <el-input style="width: 300px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/商品类型"/>
6
+        <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
7
+      </div>
8
+
9
+      <div class="cell clearfix">
10
+        <label class="title"><span class="name">日期查询</span> : </label>
11
+        <el-date-picker v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
12
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
13
+                        value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
14
+        <span class="">-</span>
15
+        <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
16
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
17
+                        value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
18
+      </div>
19
+
20
+
21
+      <div class="cell clearfix">
22
+        <label class="title"><span class="name">单据类型</span> : </label>
23
+        <el-select v-model="order_type" clearable placeholder="单据类型" @change="changeType">
24
+          <el-option
25
+            v-for="item in orderTypeArr"
26
+            :key="item.value"
27
+            :label="item.label"
28
+            :value="item.value">
29
+          </el-option>
30
+        </el-select>
31
+      </div>
32
+
33
+      <div class="cell clearfix">
34
+        <label class="title"><span class="name">其它</span> : </label>
35
+        <el-select v-model="manufacturer_id" clearable placeholder="厂商" @change="changeManufacturer">
36
+          <el-option
37
+            v-for="item in manufacturer"
38
+            :key="item.id"
39
+            :label="item.manufacturer_name"
40
+            :value="item.id">
41
+          </el-option>
42
+        </el-select>
43
+      </div>
44
+
45
+
46
+      <el-row :gutter="12" style="margin-top: 10px">
47
+        <el-table
48
+          :data="cancelStockDate"
49
+          :class="signAndWeighBoxPatients"
50
+          border
51
+          highlight-current-row
52
+          ref="multipleTable"
53
+          @selection-change="select"
54
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
55
+
56
+        >
57
+
58
+
59
+
60
+          <el-table-column label="单据编号" align="center">
61
+            <template slot-scope="scope">
62
+              {{scope.row.warehouse_out_order_number}}
63
+            </template>
64
+          </el-table-column>
65
+
66
+          <el-table-column label="商品类型" align="center">
67
+            <template slot-scope="scope">
68
+              {{specificationName(scope.row.good_id)}}
69
+            </template>
70
+          </el-table-column>
71
+
72
+
73
+          <el-table-column label="单据类型" align="center">
74
+            <template slot-scope="scope">
75
+              {{getTypeName(scope.row)}}
76
+            </template>
77
+          </el-table-column>
78
+
79
+          <el-table-column label="操作时间" align="center">
80
+            <template slot-scope="scope">
81
+              {{ scope.row.WarehouseOut.warehouse_out_time | parseTime('{y}-{m}-{d}')}}
82
+            </template>
83
+          </el-table-column>
84
+          <el-table-column label="制单人" align="center">
85
+            <template slot-scope="scope">
86
+              {{getXuserName(scope.row.WarehouseOut.creater)}}
87
+
88
+            </template>
89
+          </el-table-column>
90
+          <el-table-column label="单价" align="center">
91
+            <template slot-scope="scope">
92
+              {{scope.row.price}}
93
+            </template>
94
+          </el-table-column>
95
+          <el-table-column label="数量" align="center">
96
+            <template slot-scope="scope">
97
+              {{scope.row.count}}
98
+            </template>
99
+          </el-table-column>
100
+          <el-table-column label="总价" align="center">
101
+            <template slot-scope="scope">
102
+              {{scope.row.price *  scope.row.count}}
103
+            </template>
104
+          </el-table-column>
105
+
106
+        </el-table>
107
+
108
+        <el-pagination
109
+          @size-change="handleSizeChange"
110
+          @current-change="handleCurrentChange"
111
+          :page-sizes="[7]"
112
+          :page-size="7"
113
+          background
114
+          style="margin-top:20px;float: right"
115
+          layout="total, sizes, prev, pager, next, jumper"
116
+          :total="total">
117
+        </el-pagination>
118
+
119
+      </el-row>
120
+    </div>
121
+  </div>
122
+</template>
123
+
124
+<script>
125
+  import { uParseTime } from '@/utils/tools'
126
+  import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
127
+  import { deleteCancelStock, GetAllConfig, getStockDetail } from '@/api/stock'
128
+
129
+
130
+  export default {
131
+    name: 'stockOutDetail',
132
+
133
+    created() {
134
+      var year = new Date().getFullYear()
135
+      var month = new Date().getMonth() + 1
136
+      var day = new Date().getDate()
137
+      if (parseInt(month) < 10) {
138
+        month = '0' + month
139
+      }
140
+      if (parseInt(day) < 10) {
141
+        day = '0' + day
142
+      }
143
+      const endTime = year + '-' + month + '-' + day
144
+      this.end_time = endTime
145
+
146
+      var year = new Date().getFullYear()
147
+      var month = new Date().getMonth()
148
+      var day = new Date().getDate()
149
+      if (parseInt(month) < 10) {
150
+        month = '0' + month
151
+      }
152
+      if (parseInt(day) < 10) {
153
+        day = '0' + day
154
+      }
155
+      const startTime = year + '-' + month + '-' + day
156
+      this.start_time = startTime
157
+      this.GetCancelStock()
158
+      this.GetConfigInfo()
159
+      this.fetchAllAdminUsers()
160
+    },
161
+    data() {
162
+      return {
163
+        orderTypeArr: [
164
+          { value: 1, label: '耗材入库单' },
165
+          { value: 2, label: '其他入库单' }
166
+        ],
167
+        manufacturer_id: '',
168
+        dealer_id: '',
169
+        order_type: '',
170
+
171
+        searchKey:'',
172
+        type: 2,
173
+        page: 1,
174
+        limit: 7,
175
+        checked: false,
176
+        total: 0,
177
+        pageTotal: 0,
178
+        pageSelect: 0,
179
+        adminUserOptions: [],
180
+        multipleSelection: [],
181
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
182
+        start_time: '',
183
+        cancelStockDate: [],
184
+        end_time: '',
185
+        goodType: [],
186
+        goodInfo: [],
187
+        manufacturer: [],
188
+        selectedTableData: [],
189
+        dealer: []
190
+
191
+      }
192
+    },
193
+    methods: {
194
+      changeType: function(val) {
195
+        this.order_type  = val
196
+        this.GetCancelStock()
197
+      }, changeManufacturer: function(val) {
198
+        this.manufacturer_id  = val
199
+        this.GetCancelStock()
200
+
201
+      },
202
+      getTypeName:function(row){
203
+        let name = ""
204
+        let name2 = ""
205
+        if (row.type == 1){
206
+          name = "耗材出库单"
207
+
208
+        }else if(row.type == 2){
209
+          name = "其他出库单"
210
+        }
211
+
212
+        return name
213
+      },
214
+      specificationName: function(good_info_id) {
215
+        let name = ''
216
+        for (let i = 0; i < this.goodInfo.length; i++) {
217
+          if (this.goodInfo[i].id == good_info_id) {
218
+            name = this.goodInfo[i].specification_name
219
+          }
220
+        }
221
+        return name
222
+      },
223
+      search:function(){
224
+        const Params = {
225
+          page: this.page,
226
+          limit: this.limit,
227
+          start_time: this.start_time,
228
+          end_time: this.end_time,
229
+          type: this.type,
230
+          keywords:this.searchKey,
231
+        }
232
+        this.cancelStockDate = []
233
+        getStockDetail(Params).then(response => {
234
+          if (response.data.state == 0) {
235
+            this.$message.error(response.data.msg)
236
+            return false
237
+          } else {
238
+            this.total = response.data.data.total
239
+            for (let i = 0; i < response.data.data.list.length; i++) {
240
+              this.cancelStockDate.push(response.data.data.list[i])
241
+            }
242
+          }
243
+        })
244
+      },
245
+      AddNewOrder: function() {
246
+        this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type }})
247
+      },
248
+      GetCancelStock: function() {
249
+        const Params = {
250
+          page: this.page,
251
+          limit: this.limit,
252
+          start_time: this.start_time,
253
+          end_time: this.end_time,
254
+          type: this.type,
255
+          manufacturer: this.manufacturer_id,
256
+          order_type: this.order_type,
257
+          dealer: this.dealer_id
258
+        }
259
+        this.cancelStockDate = []
260
+        getStockDetail(Params).then(response => {
261
+          if (response.data.state == 0) {
262
+            this.$message.error(response.data.msg)
263
+            return false
264
+          } else {
265
+            this.total = response.data.data.total
266
+            for (let i = 0; i < response.data.data.list.length; i++) {
267
+              this.cancelStockDate.push(response.data.data.list[i])
268
+            }
269
+          }
270
+        })
271
+      }, getXuserName(id) {
272
+        if (id <= 0) {
273
+          return ''
274
+        }
275
+        var name = ''
276
+        if (this.adminUserOptions == null || typeof (this.adminUserOptions.length) === 'undefined') {
277
+          return name
278
+        }
279
+        var leng = this.adminUserOptions.length
280
+        if (leng == 0) {
281
+          return name
282
+        }
283
+        for (let index = 0; index < leng; index++) {
284
+          if (this.adminUserOptions[index].id == id) {
285
+            name = this.adminUserOptions[index].name
286
+            break
287
+          }
288
+        }
289
+        return name
290
+      }, fetchAllAdminUsers() {
291
+        fetchAllAdminUsers().then(response => {
292
+          console.log(response)
293
+          if (response.data.state == 1) {
294
+            this.adminUserOptions = response.data.data.users
295
+            var alen = this.adminUserOptions.length
296
+            for (let index = 0; index < alen; index++) {
297
+              if (this.adminUserOptions[index].user_type == 2) {
298
+                // this.doctorOptions.push(this.adminUserOptions[index]);
299
+              }
300
+            }
301
+          }
302
+        })
303
+      }, handleSelectionChange: function(val) {
304
+        this.multipleSelection = val
305
+      }, handleSizeChange(val) {
306
+        this.limit = val
307
+        this.GetCancelStock()
308
+      }, handleCurrentChange(val) {
309
+        this.page = val
310
+        this.GetCancelStock()
311
+      }, startTimeChange(val) {
312
+        this.GetCancelStock()
313
+      }, endTimeChange(val) {
314
+        this.GetCancelStock()
315
+      }, calculate: function(val) {
316
+        return Math.round(parseFloat(val) * 100) / 100
317
+      }, GetConfigInfo: function() {
318
+        GetAllConfig().then(response => {
319
+          if (response.data.state == 0) {
320
+            this.$message.error(response.data.msg)
321
+            return false
322
+          } else {
323
+            this.manufacturer = response.data.data.manufacturer
324
+            this.dealer = response.data.data.dealer
325
+            this.goodInfo = response.data.data.goodInfo
326
+
327
+          }
328
+        })
329
+      }, getManufactuerName: function(manufacturer_id) {
330
+        for (let i = 0; i < this.manufacturer.length; i++) {
331
+          if (this.manufacturer[i].id == manufacturer_id) {
332
+            return this.manufacturer[i].manufacturer_name
333
+          }
334
+        }
335
+      }, getDealerName: function(dealer_id) {
336
+        for (let i = 0; i < this.dealer.length; i++) {
337
+          if (this.dealer[i].id == dealer_id) {
338
+            return this.dealer[i].dealer_name
339
+          }
340
+        }
341
+      }, handleEdit: function(index, row) {
342
+        this.$router.push({ name: 'cancelStockDetail', query: { id: row.id,type: this.type }})
343
+      }, handleDelete: function(index, row) {
344
+        const ids = []
345
+        ids.push(row.id)
346
+        const idStr = ids.join(',')
347
+
348
+        const params = {
349
+          ids: idStr
350
+        }
351
+
352
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
353
+          confirmButtonText: '确定',
354
+          cancelButtonText: '取消',
355
+          type: 'warning'
356
+        }).then(() => {
357
+          deleteCancelStock(params).then(response => {
358
+            if (response.data.state == 0) {
359
+              this.$message.error(response.data.msg)
360
+              return false
361
+            } else {
362
+              this.$notify({
363
+                title: '成功',
364
+                message: '删除成功',
365
+                type: 'success',
366
+                duration: 2000
367
+              })
368
+              for (let i = 0; i < ids.length; i++) {
369
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
370
+                  if (ids[i] == this.cancelStockDate[y].id) {
371
+                    this.cancelStockDate.splice(y, 1)
372
+                  }
373
+                }
374
+              }
375
+            }
376
+          })
377
+        }).catch(() => {
378
+        })
379
+      }, changeAllSelected: function(val) {
380
+        if (val) {
381
+          this.$refs.multipleTable.toggleAllSelection()
382
+        } else {
383
+          this.$refs.multipleTable.clearSelection()
384
+        }
385
+      }, select(selection) {
386
+        this.selectedTableData = selection
387
+      }, batchDelete() {
388
+        if (this.selectedTableData.length <= 0) {
389
+          this.$message.error('请选择要删除的记录')
390
+          return
391
+        }
392
+        const ids = []
393
+        for (let i = 0; i < this.selectedTableData.length; i++) {
394
+          ids.push(this.selectedTableData[i].id)
395
+        }
396
+        const idStr = ids.join(',')
397
+        const params = {
398
+          ids: idStr
399
+        }
400
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
401
+          confirmButtonText: '确定',
402
+          cancelButtonText: '取消',
403
+          type: 'warning'
404
+        }).then(() => {
405
+          deleteCancelStock(params).then(response => {
406
+            if (response.data.state == 0) {
407
+              this.$message.error(response.data.msg)
408
+              return false
409
+            } else {
410
+              this.$notify({
411
+                title: '成功',
412
+                message: '删除成功',
413
+                type: 'success',
414
+                duration: 2000
415
+              })
416
+
417
+              for (let i = 0; i < ids.length; i++) {
418
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
419
+                  if (ids[i] == this.cancelStockDate[y].id) {
420
+                    this.cancelStockDate.splice(y, 1)
421
+                  }
422
+                }
423
+              }
424
+            }
425
+          })
426
+        }).catch(() => {
427
+        })
428
+      }
429
+    }
430
+  }
431
+</script>
432
+
433
+<style rel="stylesheet/css" lang="scss" scoped>
434
+  .information {
435
+    border: 1px #dcdfe6 solid;
436
+    padding: 30px 20px 30px 20px;
437
+
438
+  .border {
439
+    border-bottom: 1px #dcdfe6 solid;
440
+    margin: 0px 0 20px 0;
441
+  }
442
+
443
+  }
444
+
445
+
446
+  .edit_separater {
447
+    border-top: 1px solid rgb(233, 233, 233);
448
+    margin-top: 15px;
449
+    margin-bottom: 15px;
450
+  }
451
+
452
+</style>
453
+
454
+<style>
455
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
456
+    font-size: 12px;
457
+  }
458
+
459
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
460
+    background: #6fb5fa;
461
+  }
462
+
463
+  .count {
464
+    color: #bd2c00;
465
+
466
+  }
467
+
468
+</style>

+ 28 - 5
src/xt_pages/stock/otherCancelStockOrder.vue 查看文件

@@ -11,7 +11,7 @@
11 11
     <div class="app-container">
12 12
 
13 13
       <div class="cell clearfix">
14
-        <el-input style="width: 300px;" class="filter-item" placeholder="单据日期/单据编码/制单人/供应商"/>
14
+        <el-input style="width: 300px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/厂商"/>
15 15
         <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
16 16
       </div>
17 17
 
@@ -163,6 +163,7 @@
163 163
           { path: false, name: '库存管理' },
164 164
           { path: '/stock/cancel', name: '其他出库退库单' }
165 165
         ],
166
+        searchKey:'',
166 167
         type: 2,
167 168
         page: 1,
168 169
         limit: 7,
@@ -185,6 +186,28 @@
185 186
       }
186 187
     },
187 188
     methods: {
189
+      search:function(){
190
+        const Params = {
191
+          page: this.page,
192
+          limit: this.limit,
193
+          start_time: this.start_time,
194
+          end_time: this.end_time,
195
+          type: this.type,
196
+          keywords:this.searchKey,
197
+        }
198
+        this.cancelStockDate = []
199
+        getCancelStockList(Params).then(response => {
200
+          if (response.data.state == 0) {
201
+            this.$message.error(response.data.msg)
202
+            return false
203
+          } else {
204
+            this.total = response.data.data.total
205
+            for (let i = 0; i < response.data.data.list.length; i++) {
206
+              this.cancelStockDate.push(response.data.data.list[i])
207
+            }
208
+          }
209
+        })
210
+      },
188 211
       AddNewOrder: function() {
189 212
         this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type }})
190 213
       },
@@ -244,14 +267,14 @@
244 267
         this.multipleSelection = val
245 268
       }, handleSizeChange(val) {
246 269
         this.limit = val
247
-        this.GetWarehouse()
270
+        this.GetCancelStock()
248 271
       }, handleCurrentChange(val) {
249 272
         this.page = val
250
-        this.GetWarehouse()
273
+        this.GetCancelStock()
251 274
       }, startTimeChange(val) {
252
-        this.GetWarehouse()
275
+        this.GetCancelStock()
253 276
       }, endTimeChange(val) {
254
-        this.GetWarehouse()
277
+        this.GetCancelStock()
255 278
       }, calculate: function(val) {
256 279
         return Math.round(parseFloat(val) * 100) / 100
257 280
       }, GetConfigInfo: function() {

+ 28 - 5
src/xt_pages/stock/otherSalesReturnOrder.vue 查看文件

@@ -11,7 +11,7 @@
11 11
     <div class="app-container">
12 12
 
13 13
       <div class="cell clearfix">
14
-        <el-input style="width: 400px;" class="filter-item" placeholder="单据日期/单据编码/制单人/供应商"/>
14
+        <el-input style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/厂商"/>
15 15
         <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
16 16
       </div>
17 17
 
@@ -169,6 +169,7 @@
169 169
     },
170 170
     data() {
171 171
       return {
172
+        searchKey:'',
172 173
         crumbs: [
173 174
           { path: false, name: '库存管理' },
174 175
           { path: '/stock/return', name: '其他退货单' }
@@ -195,6 +196,28 @@
195 196
       }
196 197
     },
197 198
     methods: {
199
+      search:function() {
200
+        const Params = {
201
+          page: this.page,
202
+          limit: this.limit,
203
+          start_time: this.start_time,
204
+          end_time: this.end_time,
205
+          type: this.type,
206
+          keywords: this.searchKey,
207
+        }
208
+        this.saleReturnDate = []
209
+        getSalesReturnList(Params).then(response => {
210
+          if (response.data.state == 0) {
211
+            this.$message.error(response.data.msg)
212
+            return false
213
+          } else {
214
+            this.total = response.data.data.total
215
+            for (let i = 0; i < response.data.data.list.length; i++) {
216
+              this.saleReturnDate.push(response.data.data.list[i])
217
+            }
218
+          }
219
+        })
220
+      },
198 221
       AddNewOrder: function() {
199 222
         this.$router.push({ name: 'salesReturnOrderAdd', query: { type: this.type }})
200 223
       },
@@ -254,14 +277,14 @@
254 277
         this.multipleSelection = val
255 278
       }, handleSizeChange(val) {
256 279
         this.limit = val
257
-        this.GetWarehouse()
280
+        this.GetSalesReturn()
258 281
       }, handleCurrentChange(val) {
259 282
         this.page = val
260
-        this.GetWarehouse()
283
+        this.GetSalesReturn()
261 284
       }, startTimeChange(val) {
262
-        this.GetWarehouse()
285
+        this.GetSalesReturn()
263 286
       }, endTimeChange(val) {
264
-        this.GetWarehouse()
287
+        this.GetSalesReturn()
265 288
       }, calculate: function(val) {
266 289
         return Math.round(parseFloat(val) * 100) / 100
267 290
       }, GetConfigInfo: function() {

+ 29 - 3
src/xt_pages/stock/otherStockInOrder.vue 查看文件

@@ -10,8 +10,8 @@
10 10
     <div class="app-container">
11 11
 
12 12
       <div class="cell clearfix">
13
-        <el-input style="width: 400px;" class="filter-item" placeholder="单据日期/单据编码/制单人/供应商"/>
14
-        <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
13
+        <el-input style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/厂商"/>
14
+        <el-button class="filter-item"  type="primary" icon="el-icon-search" @click="search">搜索</el-button>
15 15
       </div>
16 16
 
17 17
       <div class="cell clearfix">
@@ -163,6 +163,7 @@
163 163
     },
164 164
     data() {
165 165
       return {
166
+        searchKey:'',
166 167
         crumbs: [
167 168
           { path: false, name: '库存管理' },
168 169
           { path: '/stock/in/other', name: '其他入库单' }
@@ -197,7 +198,32 @@
197 198
       }
198 199
     },
199 200
     methods: {
200
-      GetWarehouse: function() {
201
+      search:function() {
202
+        const Params = {
203
+          page: this.page,
204
+          limit: this.limit,
205
+          start_time: this.start_time,
206
+          end_time: this.end_time,
207
+          type: this.type,
208
+          keywords: this.searchKey,
209
+        }
210
+        this.Warehouse.warehouseDate = []
211
+        getWarehouseList(Params).then(response => {
212
+          if (response.data.state == 0) {
213
+            this.Warehouse.loading = false
214
+            this.$message.error(response.data.msg)
215
+            return false
216
+          } else {
217
+            this.Warehouse.loading = false
218
+            this.total = response.data.data.total
219
+            for (let i = 0; i < response.data.data.list.length; i++) {
220
+              this.Warehouse.warehouseDate.push(response.data.data.list[i])
221
+            }
222
+          }
223
+        })
224
+      },
225
+
226
+        GetWarehouse: function() {
201 227
         const Params = {
202 228
           page: this.page,
203 229
           limit: this.limit,

+ 29 - 5
src/xt_pages/stock/otherStockOutOrder.vue 查看文件

@@ -9,7 +9,7 @@
9 9
     </div>
10 10
     <div class="app-container">
11 11
       <div class="cell clearfix">
12
-        <el-input style="width: 400px;" class="filter-item" placeholder="单据日期/单据编码/制单人/供应商"/>
12
+        <el-input style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/厂商"/>
13 13
         <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
14 14
       </div>
15 15
 
@@ -165,6 +165,7 @@ export default {
165 165
         { path: false, name: "库存管理" },
166 166
         { path: "/stock/out", name: "其他出库单" }
167 167
       ],
168
+      searchKey:'',
168 169
       page: 1,
169 170
       limit: 7,
170 171
       checked: false,
@@ -186,6 +187,29 @@ export default {
186 187
     };
187 188
   },
188 189
   methods: {
190
+    search:function(){
191
+      const Params = {
192
+        page: this.page,
193
+        limit: this.limit,
194
+        start_time: this.start_time,
195
+        end_time: this.end_time,
196
+        type: this.type,
197
+        keywords:this.searchKey,
198
+      }
199
+      this.warehouseOutDate = [];
200
+      getWarehouseOutList(Params).then(response => {
201
+        if (response.data.state == 0) {
202
+          this.$message.error(response.data.msg);
203
+          return false;
204
+        } else {
205
+          this.total = response.data.data.total;
206
+          for (let i = 0; i < response.data.data.list.length; i++) {
207
+            this.warehouseOutDate.push(response.data.data.list[i]);
208
+          }
209
+        }
210
+      });
211
+
212
+    },
189 213
     AddNewOrder: function() {
190 214
       this.$router.push({
191 215
         name: "stockOutOrderAdd",
@@ -255,17 +279,17 @@ export default {
255 279
     },
256 280
     handleSizeChange(val) {
257 281
       this.limit = val;
258
-      this.GetWarehouse();
282
+      this.GetWarehouseOut();
259 283
     },
260 284
     handleCurrentChange(val) {
261 285
       this.page = val;
262
-      this.GetWarehouse();
286
+      this.GetWarehouseOut();
263 287
     },
264 288
     startTimeChange(val) {
265
-      this.GetWarehouse();
289
+      this.GetWarehouseOut();
266 290
     },
267 291
     endTimeChange(val) {
268
-      this.GetWarehouse();
292
+      this.GetWarehouseOut();
269 293
     },
270 294
     calculate: function(val) {
271 295
       return Math.round(parseFloat(val) * 100) / 100;

+ 11 - 0
src/xt_pages/stock/salesReturnEdit.vue 查看文件

@@ -353,6 +353,17 @@
353 353
             this.form.manufacturer = this.salesReturn.manufacturer
354 354
             this.form.dealer = this.salesReturn.dealer
355 355
           }
356
+
357
+
358
+          if( this.recordInfo.recordData.length == 0){
359
+            const tempObj = {}
360
+            tempObj['id'] = 0
361
+            tempObj['good_type_id'] = 0
362
+            tempObj['good_id'] = 0
363
+            tempObj['count'] = ''
364
+            this.recordInfo.recordData.push(tempObj)
365
+          }
366
+
356 367
         })
357 368
       }
358 369
     },

+ 28 - 5
src/xt_pages/stock/salesReturnOrder.vue 查看文件

@@ -11,7 +11,7 @@
11 11
     <div class="app-container">
12 12
 
13 13
       <div class="cell clearfix" >
14
-        <el-input style="width: 400px;" class="filter-item" placeholder="单据日期/单据编码/制单人/供应商"/>
14
+        <el-input style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/厂商"/>
15 15
         <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
16 16
       </div>
17 17
 
@@ -164,6 +164,7 @@
164 164
     },
165 165
     data() {
166 166
       return {
167
+        searchKey:'',
167 168
         crumbs: [
168 169
           { path: false, name: '库存管理' },
169 170
           { path: '/stock/return', name: '退货单' }
@@ -190,6 +191,28 @@
190 191
       }
191 192
     },
192 193
     methods: {
194
+      search:function() {
195
+        const Params = {
196
+          page: this.page,
197
+          limit: this.limit,
198
+          start_time: this.start_time,
199
+          end_time: this.end_time,
200
+          type: this.type,
201
+          keywords: this.searchKey,
202
+        }
203
+        this.saleReturnDate = []
204
+        getSalesReturnList(Params).then(response => {
205
+          if (response.data.state == 0) {
206
+            this.$message.error(response.data.msg)
207
+            return false
208
+          } else {
209
+            this.total = response.data.data.total
210
+            for (let i = 0; i < response.data.data.list.length; i++) {
211
+              this.saleReturnDate.push(response.data.data.list[i])
212
+            }
213
+          }
214
+        })
215
+      },
193 216
       AddNewOrder: function() {
194 217
         this.$router.push({ name: 'salesReturnOrderAdd', query: { type: this.type }})
195 218
       },
@@ -249,14 +272,14 @@
249 272
         this.multipleSelection = val
250 273
       }, handleSizeChange(val) {
251 274
         this.limit = val
252
-        this.GetWarehouse()
275
+        this.GetSalesReturn()
253 276
       }, handleCurrentChange(val) {
254 277
         this.page = val
255
-        this.GetWarehouse()
278
+        this.GetSalesReturn()
256 279
       }, startTimeChange(val) {
257
-        this.GetWarehouse()
280
+        this.GetSalesReturn()
258 281
       }, endTimeChange(val) {
259
-        this.GetWarehouse()
282
+        this.GetSalesReturn()
260 283
       }, calculate: function(val) {
261 284
         return Math.round(parseFloat(val) * 100) / 100
262 285
       }, GetConfigInfo: function() {

+ 7 - 1
src/xt_pages/stock/salesReturnOrderAdd.vue 查看文件

@@ -278,7 +278,13 @@
278 278
         tempObj['price'] = ''
279 279
         this.recordInfo.recordData.push(tempObj)
280 280
       }, handleDelete: function(index, row) {
281
-        this.recordInfo.recordData.splice(index, 1)
281
+        if( this.recordInfo.recordData.length <= 1){
282
+          this.$message.error('只有一条记录的时候无法删除')
283
+          return
284
+        }else{
285
+          this.recordInfo.recordData.splice(index, 1)
286
+        }
287
+
282 288
       }, calculate: function(val) {
283 289
         if (val == 0) {
284 290
           return ''

+ 451 - 0
src/xt_pages/stock/stockDetail.vue 查看文件

@@ -0,0 +1,451 @@
1
+<template>
2
+
3
+  <div class="main-contain">
4
+    <div class="position">
5
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
6
+      <el-button size="small" @click="AddNewOrder" class="filter-item" style="float:right;" type="primary"
7
+                 icon="el-icon-circle-plus-outline">新增
8
+      </el-button>
9
+    </div>
10
+
11
+    <div class="app-container">
12
+
13
+
14
+      <div class="cell clearfix" >
15
+        <el-input style="width: 300px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/厂商"/>
16
+        <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
17
+      </div>
18
+
19
+      <div class="cell clearfix">
20
+        <label class="title"><span class="name">日期查询</span> : </label>
21
+        <el-date-picker v-model="start_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" @change="startTimeChange"></el-date-picker>
24
+        <span class="">-</span>
25
+        <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
26
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
27
+                        value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
28
+      </div>
29
+
30
+      <div class="filter-container" style="margin-top: 10px">
31
+        <el-checkbox style="width: 30px" v-model="checked" @change="changeAllSelected">全选</el-checkbox>
32
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
33
+
34
+      </div>
35
+
36
+      <el-row :gutter="12" style="margin-top: 10px">
37
+        <el-table
38
+          :data="cancelStockDate"
39
+          :class="signAndWeighBoxPatients"
40
+          border
41
+          highlight-current-row
42
+          ref="multipleTable"
43
+          @selection-change="select"
44
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
45
+
46
+        >
47
+
48
+
49
+
50
+          <el-table-column label="单据编号" align="center">
51
+            <template slot-scope="scope">
52
+              {{scope.row.warehousing_order}}
53
+            </template>
54
+          </el-table-column>
55
+
56
+          <el-table-column label="商品类型" align="center">
57
+            <template slot-scope="scope">
58
+              {{specificationName(scope.row.good_id)}}
59
+            </template>
60
+          </el-table-column>
61
+
62
+
63
+          <el-table-column label="单据类型" align="center">
64
+            <template slot-scope="scope">
65
+              {{getTypeName(scope.row)}}
66
+            </template>
67
+          </el-table-column>
68
+
69
+          <el-table-column label="操作时间" align="center">
70
+            <template slot-scope="scope">
71
+              {{ scope.row.warehousing_time | parseTime('{y}-{m}-{d}')}}
72
+            </template>
73
+          </el-table-column>
74
+          <el-table-column label="制单人" align="center">
75
+            <template slot-scope="scope">
76
+              {{getXuserName(scope.row.creater)}}
77
+
78
+            </template>
79
+          </el-table-column>
80
+          <el-table-column label="单价" align="center">
81
+            <template slot-scope="scope">
82
+              {{scope.row.price}}
83
+            </template>
84
+          </el-table-column>
85
+          <el-table-column label="数量" align="center">
86
+            <template slot-scope="scope">
87
+              {{scope.row.warehousing_count}}
88
+            </template>
89
+          </el-table-column>
90
+          <el-table-column label="总价" align="center">
91
+            <template slot-scope="scope">
92
+              {{scope.row.price *  scope.row.warehousing_count}}
93
+            </template>
94
+          </el-table-column>
95
+
96
+        </el-table>
97
+
98
+        <el-pagination
99
+          @size-change="handleSizeChange"
100
+          @current-change="handleCurrentChange"
101
+          :page-sizes="[7]"
102
+          :page-size="7"
103
+          background
104
+          style="margin-top:20px;float: right"
105
+          layout="total, sizes, prev, pager, next, jumper"
106
+          :total="total">
107
+        </el-pagination>
108
+
109
+      </el-row>
110
+    </div>
111
+  </div>
112
+</template>
113
+
114
+<script>
115
+  import { uParseTime } from '@/utils/tools'
116
+  import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
117
+  import { deleteCancelStock, GetAllConfig, getStockDetail } from '@/api/stock'
118
+  import BreadCrumb from '../components/bread-crumb'
119
+
120
+  export default {
121
+    name: 'salesReturnOrder',
122
+    components: { BreadCrumb },
123
+    created() {
124
+      var year = new Date().getFullYear()
125
+      var month = new Date().getMonth() + 1
126
+      var day = new Date().getDate()
127
+      if (parseInt(month) < 10) {
128
+        month = '0' + month
129
+      }
130
+      if (parseInt(day) < 10) {
131
+        day = '0' + day
132
+      }
133
+      const endTime = year + '-' + month + '-' + day
134
+      this.end_time = endTime
135
+
136
+      var year = new Date().getFullYear()
137
+      var month = new Date().getMonth()
138
+      var day = new Date().getDate()
139
+      if (parseInt(month) < 10) {
140
+        month = '0' + month
141
+      }
142
+      if (parseInt(day) < 10) {
143
+        day = '0' + day
144
+      }
145
+      const startTime = year + '-' + month + '-' + day
146
+      this.start_time = startTime
147
+      this.GetCancelStock()
148
+      this.GetConfigInfo()
149
+      this.fetchAllAdminUsers()
150
+    },
151
+    data() {
152
+      return {
153
+        crumbs: [
154
+          { path: false, name: '库存管理' },
155
+          { path: '/stock/detail', name: '出入库明细查询' }
156
+        ],
157
+        searchKey:'',
158
+        type: 1,
159
+        page: 1,
160
+        limit: 7,
161
+        checked: false,
162
+        total: 0,
163
+        pageTotal: 0,
164
+        pageSelect: 0,
165
+        adminUserOptions: [],
166
+        multipleSelection: [],
167
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
168
+        start_time: '',
169
+        cancelStockDate: [],
170
+        end_time: '',
171
+        goodType: [],
172
+        goodInfo: [],
173
+        manufacturer: [],
174
+        selectedTableData: [],
175
+        dealer: []
176
+
177
+      }
178
+    },
179
+    methods: {
180
+      getTypeName:function(row){
181
+        let name = ""
182
+        let name2 = ""
183
+        if (row.type == 1){
184
+          name = "耗材"
185
+
186
+        }else if(row.type == 2){
187
+          name = "其他"
188
+        }
189
+        if (row.types == 1){
190
+          name2 = "入库单"
191
+        }else if(row.types == 2){
192
+          name2 = "出库单"
193
+        }else if(row.types == 3){
194
+          name2 = "退货单"
195
+        }else if(row.types == 4){
196
+          name2 = "退库单"
197
+        }
198
+        return name + name2
199
+      },
200
+      specificationName: function(good_info_id) {
201
+        let name = ''
202
+        for (let i = 0; i < this.goodInfo.length; i++) {
203
+          if (this.goodInfo[i].id == good_info_id) {
204
+            name = this.goodInfo[i].specification_name
205
+          }
206
+        }
207
+        return name
208
+      },
209
+      search:function(){
210
+        const Params = {
211
+          page: this.page,
212
+          limit: this.limit,
213
+          start_time: this.start_time,
214
+          end_time: this.end_time,
215
+          type: this.type,
216
+          keywords:this.searchKey,
217
+        }
218
+        this.cancelStockDate = []
219
+        getStockDetail(Params).then(response => {
220
+          if (response.data.state == 0) {
221
+            this.$message.error(response.data.msg)
222
+            return false
223
+          } else {
224
+            this.total = response.data.data.total
225
+            for (let i = 0; i < response.data.data.list.length; i++) {
226
+              this.cancelStockDate.push(response.data.data.list[i])
227
+            }
228
+          }
229
+        })
230
+      },
231
+      AddNewOrder: function() {
232
+        this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type }})
233
+      },
234
+      GetCancelStock: function() {
235
+        const Params = {
236
+          page: this.page,
237
+          limit: this.limit,
238
+          start_time: this.start_time,
239
+          end_time: this.end_time,
240
+          type: this.type
241
+        }
242
+        this.cancelStockDate = []
243
+        getStockDetail(Params).then(response => {
244
+          if (response.data.state == 0) {
245
+            this.$message.error(response.data.msg)
246
+            return false
247
+          } else {
248
+            this.total = response.data.data.total
249
+            for (let i = 0; i < response.data.data.list.length; i++) {
250
+              this.cancelStockDate.push(response.data.data.list[i])
251
+            }
252
+          }
253
+        })
254
+      }, getXuserName(id) {
255
+        if (id <= 0) {
256
+          return ''
257
+        }
258
+        var name = ''
259
+        if (this.adminUserOptions == null || typeof (this.adminUserOptions.length) === 'undefined') {
260
+          return name
261
+        }
262
+        var leng = this.adminUserOptions.length
263
+        if (leng == 0) {
264
+          return name
265
+        }
266
+        for (let index = 0; index < leng; index++) {
267
+          if (this.adminUserOptions[index].id == id) {
268
+            name = this.adminUserOptions[index].name
269
+            break
270
+          }
271
+        }
272
+        return name
273
+      }, fetchAllAdminUsers() {
274
+        fetchAllAdminUsers().then(response => {
275
+          console.log(response)
276
+          if (response.data.state == 1) {
277
+            this.adminUserOptions = response.data.data.users
278
+            var alen = this.adminUserOptions.length
279
+            for (let index = 0; index < alen; index++) {
280
+              if (this.adminUserOptions[index].user_type == 2) {
281
+                // this.doctorOptions.push(this.adminUserOptions[index]);
282
+              }
283
+            }
284
+          }
285
+        })
286
+      }, handleSelectionChange: function(val) {
287
+        this.multipleSelection = val
288
+      }, handleSizeChange(val) {
289
+        this.limit = val
290
+        this.GetWarehouse()
291
+      }, handleCurrentChange(val) {
292
+        this.page = val
293
+        this.GetWarehouse()
294
+      }, startTimeChange(val) {
295
+        this.GetWarehouse()
296
+      }, endTimeChange(val) {
297
+        this.GetWarehouse()
298
+      }, calculate: function(val) {
299
+        return Math.round(parseFloat(val) * 100) / 100
300
+      }, GetConfigInfo: function() {
301
+        GetAllConfig().then(response => {
302
+          if (response.data.state == 0) {
303
+            this.$message.error(response.data.msg)
304
+            return false
305
+          } else {
306
+            this.manufacturer = response.data.data.manufacturer
307
+            this.dealer = response.data.data.dealer
308
+            this.goodInfo = response.data.data.goodInfo
309
+
310
+          }
311
+        })
312
+      }, getManufactuerName: function(manufacturer_id) {
313
+        for (let i = 0; i < this.manufacturer.length; i++) {
314
+          if (this.manufacturer[i].id == manufacturer_id) {
315
+            return this.manufacturer[i].manufacturer_name
316
+          }
317
+        }
318
+      }, getDealerName: function(dealer_id) {
319
+        for (let i = 0; i < this.dealer.length; i++) {
320
+          if (this.dealer[i].id == dealer_id) {
321
+            return this.dealer[i].dealer_name
322
+          }
323
+        }
324
+      }, handleEdit: function(index, row) {
325
+        this.$router.push({ name: 'cancelStockDetail', query: { id: row.id,type: this.type }})
326
+      }, handleDelete: function(index, row) {
327
+        const ids = []
328
+        ids.push(row.id)
329
+        const idStr = ids.join(',')
330
+
331
+        const params = {
332
+          ids: idStr
333
+        }
334
+
335
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
336
+          confirmButtonText: '确定',
337
+          cancelButtonText: '取消',
338
+          type: 'warning'
339
+        }).then(() => {
340
+          deleteCancelStock(params).then(response => {
341
+            if (response.data.state == 0) {
342
+              this.$message.error(response.data.msg)
343
+              return false
344
+            } else {
345
+              this.$notify({
346
+                title: '成功',
347
+                message: '删除成功',
348
+                type: 'success',
349
+                duration: 2000
350
+              })
351
+              for (let i = 0; i < ids.length; i++) {
352
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
353
+                  if (ids[i] == this.cancelStockDate[y].id) {
354
+                    this.cancelStockDate.splice(y, 1)
355
+                  }
356
+                }
357
+              }
358
+            }
359
+          })
360
+        }).catch(() => {
361
+        })
362
+      }, changeAllSelected: function(val) {
363
+        if (val) {
364
+          this.$refs.multipleTable.toggleAllSelection()
365
+        } else {
366
+          this.$refs.multipleTable.clearSelection()
367
+        }
368
+      }, select(selection) {
369
+        this.selectedTableData = selection
370
+      }, batchDelete() {
371
+        if (this.selectedTableData.length <= 0) {
372
+          this.$message.error('请选择要删除的记录')
373
+          return
374
+        }
375
+        const ids = []
376
+        for (let i = 0; i < this.selectedTableData.length; i++) {
377
+          ids.push(this.selectedTableData[i].id)
378
+        }
379
+        const idStr = ids.join(',')
380
+        const params = {
381
+          ids: idStr
382
+        }
383
+        this.$confirm('确认删除出库退库单记录?', '删除出库退库单记录', {
384
+          confirmButtonText: '确定',
385
+          cancelButtonText: '取消',
386
+          type: 'warning'
387
+        }).then(() => {
388
+          deleteCancelStock(params).then(response => {
389
+            if (response.data.state == 0) {
390
+              this.$message.error(response.data.msg)
391
+              return false
392
+            } else {
393
+              this.$notify({
394
+                title: '成功',
395
+                message: '删除成功',
396
+                type: 'success',
397
+                duration: 2000
398
+              })
399
+
400
+              for (let i = 0; i < ids.length; i++) {
401
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
402
+                  if (ids[i] == this.cancelStockDate[y].id) {
403
+                    this.cancelStockDate.splice(y, 1)
404
+                  }
405
+                }
406
+              }
407
+            }
408
+          })
409
+        }).catch(() => {
410
+        })
411
+      }
412
+    }
413
+  }
414
+</script>
415
+
416
+<style rel="stylesheet/css" lang="scss" scoped>
417
+  .information {
418
+    border: 1px #dcdfe6 solid;
419
+    padding: 30px 20px 30px 20px;
420
+
421
+  .border {
422
+    border-bottom: 1px #dcdfe6 solid;
423
+    margin: 0px 0 20px 0;
424
+  }
425
+
426
+  }
427
+
428
+
429
+  .edit_separater {
430
+    border-top: 1px solid rgb(233, 233, 233);
431
+    margin-top: 15px;
432
+    margin-bottom: 15px;
433
+  }
434
+
435
+</style>
436
+
437
+<style>
438
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
439
+    font-size: 12px;
440
+  }
441
+
442
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
443
+    background: #6fb5fa;
444
+  }
445
+
446
+  .count {
447
+    color: #bd2c00;
448
+
449
+  }
450
+
451
+</style>

+ 64 - 0
src/xt_pages/stock/stockDetailIndex.vue 查看文件

@@ -0,0 +1,64 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+    <div class="app-container">
7
+      <div class="service-box">
8
+        <el-tabs v-model="activeName">
9
+          <el-tab-pane label="入库明细" name="first">
10
+            <stock-in-detail></stock-in-detail>
11
+          </el-tab-pane>
12
+          <el-tab-pane label="退货明细">
13
+            <sales-return-detail></sales-return-detail>
14
+
15
+          </el-tab-pane>
16
+          <el-tab-pane label="出库明细">
17
+            <stock-out-detail></stock-out-detail>
18
+
19
+          </el-tab-pane>
20
+          <el-tab-pane label="退库明细">
21
+           <cancel-stock-detail></cancel-stock-detail>
22
+          </el-tab-pane>
23
+
24
+        </el-tabs>
25
+      </div>
26
+    </div>
27
+  </div>
28
+</template>
29
+
30
+<script>
31
+
32
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
33
+  import StockInDetail from './detail/stockInDetail'
34
+  import StockOutDetail from './detail/stockOutDetail'
35
+  import SalesReturnDetail from './detail/salesReturnDetail'
36
+  import CancelStockDetail from './detail/cancelStockDetail'
37
+
38
+  export default {
39
+    name: 'stockDetailIndex',
40
+    components: {
41
+      CancelStockDetail,
42
+      SalesReturnDetail,
43
+      StockOutDetail,
44
+      StockInDetail,
45
+      BreadCrumb
46
+    },
47
+    data() {
48
+      return {
49
+        crumbs: [
50
+          { path: false, name: '库存管理' },
51
+          { path: '/stock/detail', name: '出入库明细查询' }
52
+        ],
53
+        activeName: 'first'
54
+      }
55
+    },
56
+    methods: {
57
+      handleClick(tab, event) {
58
+        console.log(tab, event, this.activeName)
59
+      }
60
+    }
61
+  }
62
+</script>
63
+
64
+

+ 28 - 1
src/xt_pages/stock/stockInOrder.vue 查看文件

@@ -9,7 +9,7 @@
9 9
 
10 10
     <div class="app-container">
11 11
     <div class="cell clearfix">
12
-      <el-input   style="width: 400px;" v-model="searchKey" class="filter-item"  placeholder="单据日期/单据编码/制单人/供应商" />
12
+      <el-input   style="width: 400px;" v-model="searchKey" class="filter-item"  placeholder="单据编码/制单人/厂商" />
13 13
       <el-button  class="filter-item" type="primary" icon="el-icon-search" @click="search" >搜索</el-button>
14 14
     </div>
15 15
 
@@ -162,10 +162,12 @@
162 162
     },
163 163
     data() {
164 164
       return {
165
+
165 166
         crumbs: [
166 167
           { path: false, name: '库存管理' },
167 168
           { path: '/stock/in', name: '入库单' }
168 169
         ],
170
+        searchKey:'',
169 171
         type: 1,
170 172
         page: 1,
171 173
         limit: 7,
@@ -196,6 +198,31 @@
196 198
       }
197 199
     },
198 200
     methods: {
201
+      search:function(){
202
+        const Params = {
203
+          page: this.page,
204
+          limit: this.limit,
205
+          start_time: this.start_time,
206
+          end_time: this.end_time,
207
+          type: this.type,
208
+          keywords:this.searchKey,
209
+        }
210
+        this.Warehouse.warehouseDate = []
211
+        getWarehouseList(Params).then(response => {
212
+          if (response.data.state == 0) {
213
+            this.Warehouse.loading = false
214
+            this.$message.error(response.data.msg)
215
+            return false
216
+          } else {
217
+            this.Warehouse.loading = false
218
+            this.total = response.data.data.total
219
+            for (let i = 0; i < response.data.data.list.length; i++) {
220
+              this.Warehouse.warehouseDate.push(response.data.data.list[i])
221
+            }
222
+          }
223
+        })
224
+
225
+      },
199 226
       GetWarehouse: function() {
200 227
         const Params = {
201 228
           page: this.page,

+ 6 - 1
src/xt_pages/stock/stockInOrderAdd.vue 查看文件

@@ -428,7 +428,12 @@
428 428
         tempObj['manufacturer'] = ''
429 429
         this.recordInfo.recordData.push(tempObj)
430 430
       }, handleDelete: function(index, row) {
431
-        this.recordInfo.recordData.splice(index, 1)
431
+        if( this.recordInfo.recordData.length <= 1){
432
+          this.$message.error('只有一条记录的时候无法删除')
433
+          return
434
+        }else{
435
+          this.recordInfo.recordData.splice(index, 1)
436
+        }
432 437
       }, calculate: function(val) {
433 438
         if (val == 0) {
434 439
           return ''

+ 18 - 1
src/xt_pages/stock/stockInOrderEdit.vue 查看文件

@@ -131,7 +131,7 @@
131 131
               </template>
132 132
             </el-table-column>
133 133
 
134
-            <el-table-column label="操作" align="center" width="150">
134
+            <el-table-column label="操作" fixed="right" align="center" width="150">
135 135
               <template slot-scope="scope">
136 136
                 <el-tooltip class="item" effect="dark" content="新增" placement="top">
137 137
 
@@ -257,6 +257,7 @@ export default {
257 257
       }
258 258
   },
259 259
     methods: {
260
+
260 261
       comfirm: function(val) {
261 262
         this.isVisibility = false
262 263
         if (val.selectedGoodInfo.length > 0) {
@@ -459,6 +460,22 @@ export default {
459 460
             this.form.manufacturer = this.warehouse.manufacturer
460 461
             this.form.dealer = this.warehouse.dealer
461 462
             this.warehousing_time = this.getTime(this.warehouse.warehousing_time, '{y}-{m}-{d}')
463
+
464
+            if(this.recordInfo.recordData.length == 0){
465
+              const tempObj = {}
466
+              tempObj['id'] = 0
467
+              tempObj['good_type_id'] = 0
468
+              tempObj['good_id'] = 0
469
+              tempObj['number'] = ''
470
+              tempObj['product_date'] = ''
471
+              tempObj['expiry_date'] = ''
472
+              tempObj['warehousing_count'] = ''
473
+              tempObj['price'] = ''
474
+              tempObj['remark'] = ''
475
+              tempObj['dealer'] = ''
476
+              tempObj['manufacturer'] = ''
477
+              this.recordInfo.recordData.push(tempObj)
478
+            }
462 479
           }
463 480
         })
464 481
       }

+ 29 - 5
src/xt_pages/stock/stockOutOrder.vue 查看文件

@@ -7,7 +7,7 @@
7 7
     </div>
8 8
     <div class="app-container">
9 9
       <div class="cell clearfix">
10
-        <el-input style="width: 400px;" class="filter-item" placeholder="单据日期/单据编码/制单人/供应商"/>
10
+        <el-input style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/厂商"/>
11 11
         <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
12 12
       </div>
13 13
 
@@ -160,6 +160,7 @@ export default {
160 160
   },
161 161
   data() {
162 162
     return {
163
+      searchKey:"",
163 164
       crumbs: [
164 165
         { path: false, name: "库存管理" },
165 166
         { path: "/stock/out", name: "出库单" }
@@ -185,6 +186,29 @@ export default {
185 186
     };
186 187
   },
187 188
   methods: {
189
+    search:function(){
190
+      const Params = {
191
+        page: this.page,
192
+        limit: this.limit,
193
+        start_time: this.start_time,
194
+        end_time: this.end_time,
195
+        type: this.type,
196
+        keywords:this.searchKey,
197
+      }
198
+      this.warehouseOutDate = [];
199
+      getWarehouseOutList(Params).then(response => {
200
+        if (response.data.state == 0) {
201
+          this.$message.error(response.data.msg);
202
+          return false;
203
+        } else {
204
+          this.total = response.data.data.total;
205
+          for (let i = 0; i < response.data.data.list.length; i++) {
206
+            this.warehouseOutDate.push(response.data.data.list[i]);
207
+          }
208
+        }
209
+      });
210
+
211
+    },
188 212
     AddNewOrder: function() {
189 213
       this.$router.push({
190 214
         name: "stockOutOrderAdd",
@@ -254,17 +278,17 @@ export default {
254 278
     },
255 279
     handleSizeChange(val) {
256 280
       this.limit = val;
257
-      this.GetWarehouse();
281
+      this.GetWarehouseOut();
258 282
     },
259 283
     handleCurrentChange(val) {
260 284
       this.page = val;
261
-      this.GetWarehouse();
285
+      this.GetWarehouseOut();
262 286
     },
263 287
     startTimeChange(val) {
264
-      this.GetWarehouse();
288
+      this.GetWarehouseOut();
265 289
     },
266 290
     endTimeChange(val) {
267
-      this.GetWarehouse();
291
+      this.GetWarehouseOut();
268 292
     },
269 293
     calculate: function(val) {
270 294
       return Math.round(parseFloat(val) * 100) / 100;

+ 6 - 1
src/xt_pages/stock/stockOutOrderAdd.vue 查看文件

@@ -300,7 +300,12 @@
300 300
 
301 301
         this.recordInfo.recordData.push(tempObj)
302 302
       }, handleDelete: function(index, row) {
303
-        this.recordInfo.recordData.splice(index, 1)
303
+        if( this.recordInfo.recordData.length <= 1){
304
+          this.$message.error('只有一条记录的时候无法删除')
305
+          return
306
+        }else{
307
+          this.recordInfo.recordData.splice(index, 1)
308
+        }
304 309
       }, calculate: function(val) {
305 310
         if (isNaN(val)) {
306 311
           return ''

+ 13 - 0
src/xt_pages/stock/stockOutOrderEdit.vue 查看文件

@@ -372,6 +372,19 @@
372 372
             this.warehouseOut = response.data.data.info
373 373
             this.warehouse_out_time = this.getTime(this.warehouseOut.warehouse_out_time, '{y}-{m}-{d}')
374 374
           }
375
+
376
+          if( this.recordInfo.recordData.length == 0){
377
+            const tempObj = {}
378
+            tempObj['id'] = 0
379
+            tempObj['good_type_id'] = 0
380
+            tempObj['good_id'] = 0
381
+            tempObj['count'] = ''
382
+            tempObj['price'] = ''
383
+            tempObj['remark'] = ''
384
+            this.recordInfo.recordData.push(tempObj)
385
+          }
386
+
387
+
375 388
         })
376 389
       }, calculate: function(val) {
377 390
         if (val == 0) {