Browse Source

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

see999 3 years ago
parent
commit
ddd2cd579a

+ 2 - 2
config/dev.env.js View File

7
   NODE_ENV: '"development"',
7
   NODE_ENV: '"development"',
8
   ENV_CONFIG: '"dev"',
8
   ENV_CONFIG: '"dev"',
9
   //BASE_API: '"http://new_mobile.xt.api.sgjyun.com"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
9
   //BASE_API: '"http://new_mobile.xt.api.sgjyun.com"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
10
-  // BASE_API: '"http://api.xt.test.sgjyun.com"',
11
-  BASE_API: '"http://localhost:9529"',
10
+  BASE_API: '"http://api.xt.test.sgjyun.com"',
11
+  // BASE_API: '"http://localhost:9529"',
12
   SSO_HOST: '"http://testsso.sgjyun.com"',
12
   SSO_HOST: '"http://testsso.sgjyun.com"',
13
   SRCM_HOST: '"http://test1.sgjyun.com"',
13
   SRCM_HOST: '"http://test1.sgjyun.com"',
14
   XT_HOST: '"http://xt.test.sgjyun.com"',
14
   XT_HOST: '"http://xt.test.sgjyun.com"',

+ 87 - 50
src/api/supply.js View File

157
     url: '/api/supply/getallgoodreturnorderlist',
157
     url: '/api/supply/getallgoodreturnorderlist',
158
     method: 'get',
158
     method: 'get',
159
     params: params
159
     params: params
160
-  })}
161
-
162
-
163
-  export function getSupplierId(params) {
164
-    return request({
165
-      url: '/api/supply/getsupplycode',
166
-      method: 'get',
167
-      params: params
168
-    })
169
-  }
170
-
171
-  export function getsupplytype(params) {
172
-    return request({
173
-      url: '/api/supply/getsupplytype',
174
-      method: 'get',
175
-      params: params
176
-    })
177
-  }
178
-
179
-  export function getGoodReturnDetail(id, params) {
180
-    return request({
181
-      url: '/api/supply/getgoodreturndetail?id=' + id,
182
-      method: 'get',
183
-      params: params
184
-    })}
185
-
186
-
187
-    export function getexporthistory(params) {
188
-      return request({
189
-        url: '/api/supply/getsupplylist',
190
-        method: 'get',
191
-        params: params
192
-      })
193
-    }
194
-
195
-    export function delsupplys(id, data) {
196
-      return request({
197
-        url: '/api/supply/delsupply?id=' + id,
198
-        method: 'post',
199
-        data: data
200
-      })
201
-    }
202
-
203
-    export function getsupplyandcontactone(params) {
204
-      return request({
205
-        url: '/api/supply/getsupplyandcontactone',
206
-        method: 'get',
207
-        params: params
208
-      })
209
-    }
160
+  })
161
+}
162
+
163
+
164
+export function getSupplierId(params) {
165
+  return request({
166
+    url: '/api/supply/getsupplycode',
167
+    method: 'get',
168
+    params: params
169
+  })
170
+}
171
+
172
+export function getsupplytype(params) {
173
+  return request({
174
+    url: '/api/supply/getsupplytype',
175
+    method: 'get',
176
+    params: params
177
+  })
178
+}
179
+
180
+export function getGoodReturnDetail(id, params) {
181
+  return request({
182
+    url: '/api/supply/getgoodreturndetail?id=' + id,
183
+    method: 'get',
184
+    params: params
185
+  })
186
+}
187
+
188
+
189
+export function getexporthistory(params) {
190
+  return request({
191
+    url: '/api/supply/getsupplylist',
192
+    method: 'get',
193
+    params: params
194
+  })
195
+}
196
+
197
+export function delsupplys(id, data) {
198
+  return request({
199
+    url: '/api/supply/delsupply?id=' + id,
200
+    method: 'post',
201
+    data: data
202
+  })
203
+}
204
+
205
+export function getsupplyandcontactone(params) {
206
+  return request({
207
+    url: '/api/supply/getsupplyandcontactone',
208
+    method: 'get',
209
+    params: params
210
+  })
211
+}
210
 
212
 
211
 export function updateGoodReturn(data, warehouse_out_id, start_time, rate_of_concession, discount_amount, arrearage, payment, supplier_id, return_number) {
213
 export function updateGoodReturn(data, warehouse_out_id, start_time, rate_of_concession, discount_amount, arrearage, payment, supplier_id, return_number) {
212
   return request({
214
   return request({
239
     params: params
241
     params: params
240
   })
242
   })
241
 }
243
 }
244
+
245
+export function getSupplyWarehouseOutById(id, params) {
246
+  return request({
247
+    url: '/api/supply/getsupplywarehouseoutbyid?id=' + id,
248
+    method: 'get',
249
+    params: params
250
+  })
251
+}
252
+
253
+export function delcontactone(params) {
254
+  return request({
255
+    url: '/api/supply/delcontactone',
256
+    method: 'get',
257
+    params: params
258
+  })
259
+}
260
+
261
+export function savesupply(data) {
262
+  return request({
263
+    url: '/api/supply/savesupply',
264
+    method: 'post',
265
+    data: data
266
+  })
267
+}
268
+
269
+export function updatesupply(data) {
270
+  return request({
271
+    url: '/api/supply/updatesupply',
272
+    method: 'post',
273
+    data: data
274
+  })
275
+}
276
+
277
+
278
+

+ 3 - 3
src/views/layout/Layout.vue View File

16
           <i class="iconfont icon-computer_fill navIcon"></i>
16
           <i class="iconfont icon-computer_fill navIcon"></i>
17
           <p>透析管理</p>
17
           <p>透析管理</p>
18
         </div>
18
         </div>
19
-        <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
20
-          <i class="iconfont icon-kccx navIcon"></i>
19
+        <!-- <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
20
+         <i class="iconfont icon-kccx navIcon"></i>
21
           <p>采购管理</p>
21
           <p>采购管理</p>
22
-        </div>
22
+        </div> -->
23
         <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
23
         <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
24
           <i class="iconfont icon-kccx navIcon"></i>
24
           <i class="iconfont icon-kccx navIcon"></i>
25
           <p>库房管理</p>
25
           <p>库房管理</p>

+ 8 - 7
src/xt_pages/data/components/addDrugs.vue View File

354
                             </el-date-picker>
354
                             </el-date-picker>
355
                         </el-form-item>
355
                         </el-form-item>
356
                       
356
                       
357
-                        <!-- <el-form-item label="是否零用:">
357
+                        <el-form-item label="是否零用:">
358
 
358
 
359
                             <el-select v-model="form.is_user" style="width:160px" filterable placeholder="请选择">
359
                             <el-select v-model="form.is_user" style="width:160px" filterable placeholder="请选择">
360
                                 <el-option
360
                                 <el-option
364
                                         :value="item.id">
364
                                         :value="item.id">
365
                                 </el-option>
365
                                 </el-option>
366
                             </el-select>
366
                             </el-select>
367
-                        </el-form-item> -->
367
+                        </el-form-item>
368
                       
368
                       
369
 
369
 
370
                         <el-form-item label="药品备注:">
370
                         <el-form-item label="药品备注:">
595
           prescribing_number_unit:"",
595
           prescribing_number_unit:"",
596
           total:"",
596
           total:"",
597
           specification_name:"",
597
           specification_name:"",
598
-          is_user:2,
598
+          is_user:"2",
599
         },
599
         },
600
 
600
 
601
         rules: {
601
         rules: {
648
         minNumberShow:false,
648
         minNumberShow:false,
649
         packingUnit:[],
649
         packingUnit:[],
650
         userList: [{
650
         userList: [{
651
-          id: '1',
652
-          name: '是'
651
+          id: "1",
652
+          name: "是"
653
         }, {
653
         }, {
654
-          id: '2',
655
-          name: '否'
654
+          id: "2",
655
+          name: "否"
656
         }],
656
         }],
657
       }
657
       }
658
     },
658
     },
781
           }
781
           }
782
 
782
 
783
           this.form['lmt_used_flag'] = 0
783
           this.form['lmt_used_flag'] = 0
784
+          this.form['is_user'] = "2"
784
 
785
 
785
         } else {
786
         } else {
786
           for (let key in obj) {
787
           for (let key in obj) {

+ 75 - 76
src/xt_pages/supply/components/addGoodOrder.vue View File

7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
     <div>
8
     <div>
9
         <span style="color:red">*</span><span>供应商:</span>
9
         <span style="color:red">*</span><span>供应商:</span>
10
-        <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
11
-        @change="changeTypeName">
10
+        <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择">
12
         <el-option
11
         <el-option
13
             v-for="item in supplyList"
12
             v-for="item in supplyList"
14
             :key="item.id"
13
             :key="item.id"
28
         align="right"
27
         align="right"
29
         format="yyyy-MM-dd"
28
         format="yyyy-MM-dd"
30
         value-format="yyyy-MM-dd"
29
         value-format="yyyy-MM-dd"
31
-        @change="startTimeChange"
32
         ></el-date-picker>
30
         ></el-date-picker>
33
         <!-- <span>交货日期:</span> -->
31
         <!-- <span>交货日期:</span> -->
34
         <!-- <el-date-picker
32
         <!-- <el-date-picker
52
          <el-button size="small" type="primary" @click="updateGoodOrder" v-show="showTwo">保存</el-button>
50
          <el-button size="small" type="primary" @click="updateGoodOrder" v-show="showTwo">保存</el-button>
53
         <el-button size="small" type="primary"  @click="checkPurchaseOrder">审核</el-button>
51
         <el-button size="small" type="primary"  @click="checkPurchaseOrder">审核</el-button>
54
 
52
 
55
-       
53
+
56
     </div>
54
     </div>
57
     </div>
55
     </div>
58
 
56
 
75
         </template>
73
         </template>
76
         <template slot-scope="scope">
74
         <template slot-scope="scope">
77
            <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
75
            <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
78
-            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
76
+            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择商品" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
79
                 <el-option
77
                 <el-option
80
                     v-for="(item,index) in tabList"
78
                     v-for="(item,index) in tabList"
81
                     :key="index"
79
                     :key="index"
91
             <span>商品类别</span>
89
             <span>商品类别</span>
92
         </template>
90
         </template>
93
         <template slot-scope="scope">
91
         <template slot-scope="scope">
94
-            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
92
+            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"  placeholder="商品类别"></el-input>
95
             <div style="visibility: hidden">/</div>
93
             <div style="visibility: hidden">/</div>
96
         </template>
94
         </template>
97
     </el-table-column>
95
     </el-table-column>
98
-    <el-table-column label="规格&单位" align="center" width="120px">
96
+    <el-table-column label="规格&单位" align="center" width="150px">
99
         <template slot-scope="scope">
97
         <template slot-scope="scope">
100
-            <el-input v-model="scope.row.supply_specification_name" style="width:100px" :disabled="true"></el-input>
98
+            <el-input v-model="scope.row.supply_specification_name" style="width:120px" :disabled="true" placeholder="规格&单位"></el-input>
101
             <div style="visibility: hidden">/</div>
99
             <div style="visibility: hidden">/</div>
102
         </template>
100
         </template>
103
     </el-table-column>
101
     </el-table-column>
115
                         :value="item.name">
113
                         :value="item.name">
116
                     </el-option>
114
                     </el-option>
117
              </el-select>
115
              </el-select>
118
-          </el-form-item>  
116
+          </el-form-item>
119
         </template>
117
         </template>
120
     </el-table-column>
118
     </el-table-column>
121
-    <el-table-column label="批号" align="center" width="130px">
119
+    <el-table-column label="批号" align="center" width="200px">
122
          <template slot="header" slot-scope="scope">
120
          <template slot="header" slot-scope="scope">
123
             <span>批号<span style="color: red">*</span></span>
121
             <span>批号<span style="color: red">*</span></span>
124
         </template>
122
         </template>
125
         <template slot-scope="scope">
123
         <template slot-scope="scope">
126
            <el-form-item  :prop="'tableList.' + scope.$index + '.supply_batch_number'" :rules='tableRules.supply_batch_number'>
124
            <el-form-item  :prop="'tableList.' + scope.$index + '.supply_batch_number'" :rules='tableRules.supply_batch_number'>
127
-             <el-input v-model="scope.row.supply_batch_number" style="width:80px" :disabled="disabled"></el-input>
125
+             <el-input v-model="scope.row.supply_batch_number" style="width:180px" :disabled="disabled" placeholder="请输入批号"></el-input>
128
           </el-form-item>
126
           </el-form-item>
129
         </template>
127
         </template>
130
     </el-table-column>
128
     </el-table-column>
142
              </el-form-item>
140
              </el-form-item>
143
        </template>
141
        </template>
144
     </el-table-column>
142
     </el-table-column>
145
-    <el-table-column label="可用库存" align="center" width="100px">
143
+    <el-table-column label="可用库存" align="center" width="150px">
146
         <template slot-scope="scope">
144
         <template slot-scope="scope">
147
-            <el-input v-model="scope.row.supply_total" style="width:80px" :disabled="true"></el-input>
145
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
148
             <div style="visibility: hidden">/</div>
146
             <div style="visibility: hidden">/</div>
149
         </template>
147
         </template>
150
     </el-table-column>
148
     </el-table-column>
151
-    <el-table-column label="数量" align="center" width="120px">
149
+    <el-table-column label="数量" align="center" width="140px">
152
         <template slot="header" slot-scope="scope">
150
         <template slot="header" slot-scope="scope">
153
             <span>数量<span style="color: red">*</span></span>
151
             <span>数量<span style="color: red">*</span></span>
154
         </template>
152
         </template>
155
         <template slot-scope="scope">
153
         <template slot-scope="scope">
156
           <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
154
           <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
157
-             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
155
+             <el-input v-model="scope.row.supply_count" style="width:100px" :disabled="disabled" placeholder="请输入数量"></el-input>
158
           </el-form-item>
156
           </el-form-item>
159
         </template>
157
         </template>
160
     </el-table-column>
158
     </el-table-column>
161
 
159
 
162
-    <el-table-column label="采购单价" align="center" width="120px">
160
+    <el-table-column label="采购单价" align="center" width="180px">
163
         <template slot-scope="scope">
161
         <template slot-scope="scope">
164
-        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
162
+        <el-input v-model="scope.row.supply_price" style="width:140px" :disabled="disabled"  placeholder="请输入采购单价"></el-input>
165
         <div style="visibility: hidden">/</div>
163
         <div style="visibility: hidden">/</div>
166
         </template>
164
         </template>
167
     </el-table-column>
165
     </el-table-column>
216
 
214
 
217
     <el-table-column label="备注" align="center" width="200px">
215
     <el-table-column label="备注" align="center" width="200px">
218
         <template slot-scope="scope">
216
         <template slot-scope="scope">
219
-        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
217
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled" placeholder="请输入备注"></el-input>
220
         <div style="visibility: hidden">/</div>
218
         <div style="visibility: hidden">/</div>
221
         </template>
219
         </template>
222
     </el-table-column>
220
     </el-table-column>
243
         </template>
241
         </template>
244
     </el-table-column>
242
     </el-table-column>
245
   </el-table>
243
   </el-table>
244
+   <div style="margin-top: 10px">
245
+        <el-input
246
+          type="textarea"
247
+          :rows="2"
248
+          placeholder="备注信息"
249
+          v-model="return_remark"
250
+        >
251
+        </el-input>
252
+   </div>
246
 </el-form>
253
 </el-form>
247
    <!-- <div style="margin-top:10px">
254
    <!-- <div style="margin-top:10px">
248
       合计:{{getAllPrice()}} 元
255
       合计:{{getAllPrice()}} 元
249
    </div>
256
    </div>
250
    <div style="margin-top:10px">
257
    <div style="margin-top:10px">
251
-        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
258
+        <span>优惠率:<el-input style="width:150px" v-model="rate_of_concession" placeholder="请输入优惠率"></el-input>%</span>
252
 
259
 
253
-        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
254
-      
255
-        <span>本次付款:<el-input style="width:100px" v-model="payment"></el-input></span>
260
+        <span>优惠金额:<el-input style="width:150px" v-model="discount_amount" placeholder="请输入优惠金额"></el-input></span>
256
 
261
 
262
+        <span>本次付款:<el-input style="width:150px" v-model="payment" placeholder="请输入本次付款"></el-input></span>
263
+
264
+        <span>本次欠款:<el-input style="width:150px" v-model="arrearage" placeholder="请输入本次欠款"></el-input></span>
265
+    </div>
257
         <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
266
         <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
258
     </div> -->
267
     </div> -->
259
     <Computed :total="total_price" :rate_of_concession="rate_of_concession" :discount_amount="discount_amount"></Computed>
268
     <Computed :total="total_price" :rate_of_concession="rate_of_concession" :discount_amount="discount_amount"></Computed>
346
    showOne:true,
355
    showOne:true,
347
    showTwo:false,
356
    showTwo:false,
348
    warese_out_id:0,
357
    warese_out_id:0,
358
+   return_remark:"",
349
   };
359
   };
350
 },
360
 },
351
 methods:{
361
 methods:{
392
         if(drugList[i].max_unit == drugList[i].min_unit){
402
         if(drugList[i].max_unit == drugList[i].min_unit){
393
           drugList[i].unitList = [{id:1,name:""}]
403
           drugList[i].unitList = [{id:1,name:""}]
394
         }
404
         }
395
-       
396
-        drugList[i].supply_unit = drugList[i].max_unit 
405
+
406
+        drugList[i].supply_unit = drugList[i].max_unit
397
         for(let j=0;j<drugList[i].unitList.length;j++){
407
         for(let j=0;j<drugList[i].unitList.length;j++){
398
           if(drugList[i].max_unit != drugList[i].min_unit){
408
           if(drugList[i].max_unit != drugList[i].min_unit){
399
             drugList[i].unitList[0].name = drugList[i].max_unit
409
             drugList[i].unitList[0].name = drugList[i].max_unit
433
         goodList[i].unitList =  [{id:1,name:""}]
443
         goodList[i].unitList =  [{id:1,name:""}]
434
         goodList[i].supply_unit = goodList[i].packing_unit
444
         goodList[i].supply_unit = goodList[i].packing_unit
435
         for(let j=0;j<goodList[i].unitList.length;j++){
445
         for(let j=0;j<goodList[i].unitList.length;j++){
436
-           goodList[i].unitList[0].name = goodList[i].packing_unit 
446
+           goodList[i].unitList[0].name = goodList[i].packing_unit
437
         }
447
         }
438
         this.tabList.push(goodList[i])
448
         this.tabList.push(goodList[i])
439
         }
449
         }
440
         this.goodList = goodList
450
         this.goodList = goodList
441
-    } 
451
+    }
442
     })
452
     })
443
 },
453
 },
444
 changeGoodName(val){
454
 changeGoodName(val){
445
   this.currentIndex = val
455
   this.currentIndex = val
446
 },
456
 },
447
 changeName(val){
457
 changeName(val){
448
-  
458
+
449
    for(let i=0;i<this.recordInfo.tableList.length;i++){
459
    for(let i=0;i<this.recordInfo.tableList.length;i++){
450
     if(this.currentIndex == i){
460
     if(this.currentIndex == i){
451
         this.recordInfo.tableList[i].project_id = val.id
461
         this.recordInfo.tableList[i].project_id = val.id
471
         this.recordInfo.tableList[i].unitList = val.unitList
481
         this.recordInfo.tableList[i].unitList = val.unitList
472
      }
482
      }
473
     }
483
     }
474
-   
484
+
475
 
485
 
476
 },
486
 },
477
 handleEdit(){
487
 handleEdit(){
507
         this.recordInfo.tableList.splice(index, 1)
517
         this.recordInfo.tableList.splice(index, 1)
508
    }
518
    }
509
 },
519
 },
510
-
511
-changeTypeName(){
512
-
513
-},
514
-startTimeChange(){
515
-
516
-},
517
-endTimeChange(){
518
-
519
-},
520
-search(){
521
-
522
-},
523
-
524
 getWarehoseInfo(arr,max_unit,min_unit,min_number){
520
 getWarehoseInfo(arr,max_unit,min_unit,min_number){
525
     var total = 0
521
     var total = 0
526
     var max_str=  ""
522
     var max_str=  ""
574
    var total_price = 0
570
    var total_price = 0
575
    for(let i=0;i<this.recordInfo.tableList.length;i++){
571
    for(let i=0;i<this.recordInfo.tableList.length;i++){
576
       total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
572
       total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
577
-   }  
573
+   }
578
    return total_price.toFixed(2)
574
    return total_price.toFixed(2)
579
  },
575
  },
580
  checkPurchaseOrder(id,index){
576
  checkPurchaseOrder(id,index){
582
     confirmButtonText: '确 定',
578
     confirmButtonText: '确 定',
583
     cancelButtonText: '取 消',
579
     cancelButtonText: '取 消',
584
     type: 'warning'
580
     type: 'warning'
585
-    }).then(() => { 
581
+    }).then(() => {
586
     checkPurchaseOrder(this.id).then(response => {
582
     checkPurchaseOrder(this.id).then(response => {
587
         if (response.data.state == 1) {
583
         if (response.data.state == 1) {
588
           var info = response.data.data.info
584
           var info = response.data.data.info
589
           this.disabled = true
585
           this.disabled = true
590
           this.$message.success("审核成功!")
586
           this.$message.success("审核成功!")
591
           this.getPurchaseOrderDetail()
587
           this.getPurchaseOrderDetail()
592
-        } 
588
+        }
593
      })
589
      })
594
     })
590
     })
595
     .catch(() => {
591
     .catch(() => {
596
-    }) 
592
+    })
597
   },
593
   },
598
   getPurchaseOrderDetail(){
594
   getPurchaseOrderDetail(){
599
-     
595
+
600
       var id = this.$route.query.id
596
       var id = this.$route.query.id
601
       var ids = this.$route.query.ids
597
       var ids = this.$route.query.ids
602
     getPurchaseOrderInfo(id,ids).then(response=>{
598
     getPurchaseOrderInfo(id,ids).then(response=>{
609
         this.discount_amount = info.discount_amount
605
         this.discount_amount = info.discount_amount
610
         this.number = info.number
606
         this.number = info.number
611
         var orderInfo = response.data.data.orderInfo
607
         var orderInfo = response.data.data.orderInfo
612
-        
608
+
613
         for(let i=0;i<orderInfo.length;i++){
609
         for(let i=0;i<orderInfo.length;i++){
614
           orderInfo[i].supply_batch_number = ""
610
           orderInfo[i].supply_batch_number = ""
615
           orderInfo[i].supply_product_date = ""
611
           orderInfo[i].supply_product_date = ""
640
                     orderInfo[i].unitList[0].name = drugList[j].max_unit
636
                     orderInfo[i].unitList[0].name = drugList[j].max_unit
641
                   }
637
                   }
642
                 }
638
                 }
643
-             }  
644
-            } 
639
+             }
640
+            }
645
           if(orderInfo[i].is_source == 2){
641
           if(orderInfo[i].is_source == 2){
646
             for(let j=0;j<goodList.length;j++){
642
             for(let j=0;j<goodList.length;j++){
647
                 if(orderInfo[i].project_id == goodList[j].id){
643
                 if(orderInfo[i].project_id == goodList[j].id){
648
                     orderInfo[i].unitList = [{id:1,name:""}]
644
                     orderInfo[i].unitList = [{id:1,name:""}]
649
                     orderInfo[i].unitList[0].name = goodList[j].packing_unit
645
                     orderInfo[i].unitList[0].name = goodList[j].packing_unit
650
                 }
646
                 }
651
-            }  
652
-          } 
647
+            }
648
+          }
653
         }
649
         }
654
-      
650
+
655
         this.recordInfo.tableList= []
651
         this.recordInfo.tableList= []
656
         this.recordInfo.tableList = orderInfo
652
         this.recordInfo.tableList = orderInfo
657
-       
653
+
658
           console.log("orderINFO23323232",this.recordInfo.tableList)
654
           console.log("orderINFO23323232",this.recordInfo.tableList)
659
       }
655
       }
660
-    })  
656
+    })
661
   },
657
   },
662
   toPrint(){
658
   toPrint(){
663
      var id = this.$route.query.id
659
      var id = this.$route.query.id
664
-     this.$router.push({path:"/purchase/order/print?&id="+id})  
660
+     this.$router.push({path:"/purchase/order/print?&id="+id})
665
   },
661
   },
666
-  saveGoodOrder(){ 
667
-   
662
+  saveGoodOrder(){
663
+
668
     if(this.supplier_name == 0 || this.supplier_name == ""){
664
     if(this.supplier_name == 0 || this.supplier_name == ""){
669
        this.$message.error("供应商不能为空!")
665
        this.$message.error("供应商不能为空!")
670
        this.loading = false
666
        this.loading = false
671
        return false
667
        return false
672
-    } 
668
+    }
673
 
669
 
674
     for(let i=0;i<this.recordInfo.tableList.length;i++){
670
     for(let i=0;i<this.recordInfo.tableList.length;i++){
675
 
671
 
677
         this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
673
         this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
678
         this.recordInfo.tableList[i].supply_total_price= this.recordInfo.tableList[i].supply_total_price.toString()
674
         this.recordInfo.tableList[i].supply_total_price= this.recordInfo.tableList[i].supply_total_price.toString()
679
         this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
675
         this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
680
-       
676
+
681
         for(let j=0;j<this.manufactuerList.length;j++){
677
         for(let j=0;j<this.manufactuerList.length;j++){
682
             if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
678
             if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
683
               this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
679
               this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
694
            this.loading = true
690
            this.loading = true
695
            var warehousing_id = this.$route.query.id
691
            var warehousing_id = this.$route.query.id
696
            var params = {
692
            var params = {
697
-             "stockIn":this.recordInfo.tableList,
693
+             stockIn:this.recordInfo.tableList,
694
+             return_remake:this.return_remark,
698
            }
695
            }
699
-        console.log("stockIN2323322332322323",params)  
700
-       
696
+        console.log("stockIN2323322332322323",params)
697
+
701
         addGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehousing_id,this.number,this.rate_of_concession,this.discount_amount).then(response=>{
698
         addGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehousing_id,this.number,this.rate_of_concession,this.discount_amount).then(response=>{
702
           if(response.data.state == 1){
699
           if(response.data.state == 1){
703
              this.loading = false
700
              this.loading = false
713
              this.payment =warehouseOut.payment
710
              this.payment =warehouseOut.payment
714
              this.arrearage =warehouseOut.arrearage
711
              this.arrearage =warehouseOut.arrearage
715
              this.supplier_name = warehouseOut.supplier_id
712
              this.supplier_name = warehouseOut.supplier_id
713
+             this.return_remake = warehouseOut.return_remake
716
              this.start_time = this.getTimes(warehouseOut.document_date)
714
              this.start_time = this.getTimes(warehouseOut.document_date)
717
             for(let i=0;i< orderInfo.length;i++){
715
             for(let i=0;i< orderInfo.length;i++){
718
               orderInfo[i].supply_count =  orderInfo[i].count
716
               orderInfo[i].supply_count =  orderInfo[i].count
737
                       orderInfo[i].unitList[0].name = this.drugList[j].max_unit
735
                       orderInfo[i].unitList[0].name = this.drugList[j].max_unit
738
                     }
736
                     }
739
                   }
737
                   }
740
-              }  
741
-              } 
738
+              }
739
+              }
742
             if(orderInfo[i].is_source == 2){
740
             if(orderInfo[i].is_source == 2){
743
               for(let j=0;j<this.goodList.length;j++){
741
               for(let j=0;j<this.goodList.length;j++){
744
                   if(orderInfo[i].project_id == this.goodList[j].id){
742
                   if(orderInfo[i].project_id == this.goodList[j].id){
745
                       orderInfo[i].unitList = [{id:1,name:""}]
743
                       orderInfo[i].unitList = [{id:1,name:""}]
746
                       orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
744
                       orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
747
                   }
745
                   }
748
-              }  
749
-            } 
746
+              }
747
+            }
750
           }
748
           }
751
           this.recordInfo.tableList= []
749
           this.recordInfo.tableList= []
752
           this.recordInfo.tableList = orderInfo
750
           this.recordInfo.tableList = orderInfo
753
-            
751
+
754
            }
752
            }
755
          })
753
          })
756
         }
754
         }
757
     })
755
     })
758
   },
756
   },
759
-  updateGoodOrder(){ 
760
-   
757
+  updateGoodOrder(){
758
+
761
     if(this.supplier_name == 0 || this.supplier_name == ""){
759
     if(this.supplier_name == 0 || this.supplier_name == ""){
762
        this.$message.error("供应商不能为空!")
760
        this.$message.error("供应商不能为空!")
763
        this.loading = false
761
        this.loading = false
764
        return false
762
        return false
765
-    } 
763
+    }
766
     console.log("表哥2323233232",this.recordInfo.tableList)
764
     console.log("表哥2323233232",this.recordInfo.tableList)
767
     for(let i=0;i<this.recordInfo.tableList.length;i++){
765
     for(let i=0;i<this.recordInfo.tableList.length;i++){
768
 
766
 
770
         this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
768
         this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
771
         this.recordInfo.tableList[i].supply_total_price= this.recordInfo.tableList[i].supply_total_price.toString()
769
         this.recordInfo.tableList[i].supply_total_price= this.recordInfo.tableList[i].supply_total_price.toString()
772
         this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
770
         this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
773
-        
771
+
774
         for(let j=0;j<this.manufactuerList.length;j++){
772
         for(let j=0;j<this.manufactuerList.length;j++){
775
             if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
773
             if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
776
               this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
774
               this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
787
            this.loading = true
785
            this.loading = true
788
            var warehose_out_id = this.$route.query.id
786
            var warehose_out_id = this.$route.query.id
789
            var params = {
787
            var params = {
790
-             "stockIn":this.recordInfo.tableList,
791
-           } 
788
+             stockIn:this.recordInfo.tableList,
789
+             return_remake:this.return_remake,
790
+           }
792
            console.log("sotckind23232232323232323232",params)
791
            console.log("sotckind23232232323232323232",params)
793
-           
792
+
794
            updateGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehose_out_id,this.number,this.rate_of_concession,this.discount_amount,this.good_number).then(response=>{
793
            updateGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehose_out_id,this.number,this.rate_of_concession,this.discount_amount,this.good_number).then(response=>{
795
            if(response.data.state == 1){
794
            if(response.data.state == 1){
796
              this.loading = false
795
              this.loading = false
797
              this.$message.success("保存成功!")
796
              this.$message.success("保存成功!")
798
-             
797
+
799
            }
798
            }
800
          })
799
          })
801
         }
800
         }

+ 9 - 4
src/xt_pages/supply/components/addGoodReturn.vue View File

96
                   v-model="scope.row.name"
96
                   v-model="scope.row.name"
97
                   style="width: 160px"
97
                   style="width: 160px"
98
                   filterable
98
                   filterable
99
-                  placeholder="请选择"
99
+                  placeholder="请选择商品"
100
                   @change="changeName"
100
                   @change="changeName"
101
                   @input="changeGoodName(scope.$index)"
101
                   @input="changeGoodName(scope.$index)"
102
                   :disabled="disabled"
102
                   :disabled="disabled"
121
                 v-model="scope.row.supply_type"
121
                 v-model="scope.row.supply_type"
122
                 style="width: 120px"
122
                 style="width: 120px"
123
                 :disabled="true"
123
                 :disabled="true"
124
+                placeholder="商品类别"
124
               ></el-input>
125
               ></el-input>
125
             </template>
126
             </template>
126
           </el-table-column>
127
           </el-table-column>
130
                 v-model="scope.row.supply_specification_name"
131
                 v-model="scope.row.supply_specification_name"
131
                 style="width: 150px"
132
                 style="width: 150px"
132
                 :disabled="true"
133
                 :disabled="true"
134
+                 placeholder="规格&单位"
133
               ></el-input>
135
               ></el-input>
134
             </template>
136
             </template>
135
           </el-table-column>
137
           </el-table-column>
166
                 v-model="scope.row.supply_specification_name"
168
                 v-model="scope.row.supply_specification_name"
167
                 style="width: 150px"
169
                 style="width: 150px"
168
                 :disabled="true"
170
                 :disabled="true"
171
+                placeholder="可退数量"
169
               ></el-input>
172
               ></el-input>
170
             </template>
173
             </template>
171
           </el-table-column>
174
           </el-table-column>
187
             </template>
190
             </template>
188
           </el-table-column>
191
           </el-table-column>
189
 
192
 
190
-          <el-table-column label="购货单价" align="center" width="120px">
193
+          <el-table-column label="采购单价" align="center" width="180px">
191
             <template slot-scope="scope">
194
             <template slot-scope="scope">
192
               <el-input
195
               <el-input
193
                 v-model="scope.row.supply_price"
196
                 v-model="scope.row.supply_price"
194
-                style="width: 80px"
197
+                style="width: 140px"
195
                 :disabled="disabled"
198
                 :disabled="disabled"
199
+                 placeholder="请输入采购单价"
196
               ></el-input>
200
               ></el-input>
197
             </template>
201
             </template>
198
           </el-table-column>
202
           </el-table-column>
199
 
203
 
200
-          <el-table-column label="购金额" align="center" width="120px">
204
+          <el-table-column label="购金额" align="center" width="120px">
201
             <template slot-scope="scope">
205
             <template slot-scope="scope">
202
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
206
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
203
             </template>
207
             </template>
250
                 v-model="scope.row.supply_remake"
254
                 v-model="scope.row.supply_remake"
251
                 style="width: 160px"
255
                 style="width: 160px"
252
                 :disabled="disabled"
256
                 :disabled="disabled"
257
+                placeholder="请输入备注"
253
               ></el-input>
258
               ></el-input>
254
             </template>
259
             </template>
255
           </el-table-column>
260
           </el-table-column>

+ 108 - 136
src/xt_pages/supply/components/addPurchaseOrder.vue View File

14
       >
14
       >
15
         <div>
15
         <div>
16
           <span style="color: red">*</span><span>供应商:</span>
16
           <span style="color: red">*</span><span>供应商:</span>
17
-          <el-select cxpib`*+9.`
17
+          <el-select
18
             v-model="supplier_name"
18
             v-model="supplier_name"
19
             style="width: 140px; margin-right: 10px"
19
             style="width: 140px; margin-right: 10px"
20
             placeholder="请选择"
20
             placeholder="请选择"
191
               <div style="visibility: hidden">/</div>
191
               <div style="visibility: hidden">/</div>
192
             </template>
192
             </template>
193
           </el-table-column>
193
           </el-table-column>
194
-          <el-table-column label="数量" align="center" width="120px">
194
+          <el-table-column label="数量" align="center" width="180px">
195
             <template slot="header" slot-scope="scope">
195
             <template slot="header" slot-scope="scope">
196
               <span>数量<span style="color: red">*</span></span>
196
               <span>数量<span style="color: red">*</span></span>
197
             </template>
197
             </template>
203
               >
203
               >
204
                 <el-input
204
                 <el-input
205
                   v-model="scope.row.supply_count"
205
                   v-model="scope.row.supply_count"
206
-                  style="width: 80px"
206
+                  style="width: 140px"
207
                   :disabled="disabled"
207
                   :disabled="disabled"
208
+                  placeholder="请输入数量"
208
                 ></el-input>
209
                 ></el-input>
209
               </el-form-item>
210
               </el-form-item>
210
             </template>
211
             </template>
309
             </template>
310
             </template>
310
           </el-table-column>
311
           </el-table-column>
311
         </el-table>
312
         </el-table>
313
+         <div style="margin-top: 10px">
314
+        <el-input
315
+          type="textarea"
316
+          :rows="2"
317
+          placeholder="备注信息"
318
+          v-model="return_remark"
319
+        >
320
+        </el-input>
321
+       </div>
312
         <!-- 审核水印 -->
322
         <!-- 审核水印 -->
313
         <img src="@/assets/purchase/Reviewed.png" alt="正在加载..." class="reviewImg" v-show="Reviewed == true" />
323
         <img src="@/assets/purchase/Reviewed.png" alt="正在加载..." class="reviewImg" v-show="Reviewed == true" />
314
 
324
 
317
       <div style="margin-top: 10px">
327
       <div style="margin-top: 10px">
318
         <span
328
         <span
319
           >优惠率:<el-input
329
           >优惠率:<el-input
320
-            style="width: 100px"
330
+            style="width: 150px"
321
             v-model="rate_of_concession"
331
             v-model="rate_of_concession"
322
             @input="addressChange"
332
             @input="addressChange"
323
-            @placeholder="请输入优惠率"
333
+            placeholder="请输入优惠率"
324
           ></el-input
334
           ></el-input
325
           >%</span
335
           >%</span
326
         >
336
         >
327
 
337
 
328
         <span
338
         <span
329
           >优惠金额:<el-input
339
           >优惠金额:<el-input
330
-            style="width: 100px"
340
+            style="width: 150px"
331
             v-model="discount_amount"
341
             v-model="discount_amount"
332
-            @placeholder="请输入优惠金额"
342
+            placeholder="请输入优惠金额"
333
           ></el-input
343
           ></el-input
334
         ></span>
344
         ></span>
335
       </div>
345
       </div>
351
 import { getDataConfig } from "@/utils/data";
361
 import { getDataConfig } from "@/utils/data";
352
 export default {
362
 export default {
353
   name: "addPurchaseOrder",
363
   name: "addPurchaseOrder",
354
-  created() {
355
-    this.org_id = this.$store.getters.xt_user.org_id;
356
-
357
-    var start_time = window.sessionStorage.getItem("start_time");
358
-    var end_time = window.sessionStorage.getItem("end_time");
359
 
364
 
360
-    if (start_time != null) {
361
-      this.start_time = start_time;
362
-    }
363
-    if (end_time != null) {
364
-      this.end_time = end_time;
365
-    }
366
-    window.sessionStorage.removeItem("start_time");
367
-    window.sessionStorage.removeItem("end_time");
368
-  },
369
   components: {
365
   components: {
370
     BreadCrumb,
366
     BreadCrumb,
371
   },
367
   },
430
       ],
426
       ],
431
       goodList: [{ id: 1, name: "" }],
427
       goodList: [{ id: 1, name: "" }],
432
       total_price: 0,
428
       total_price: 0,
429
+      return_remark:"",
433
     };
430
     };
434
   },
431
   },
435
   methods: {
432
   methods: {
436
-    getInitOrder() {
437
-      getInitOrder().then((response) => {
438
-        if (response.data.state == 1) {
439
-          var drugList = response.data.data.drugList;
440
-
441
-          this.manufactuerList = response.data.data.manufactuerList;
442
-          this.goodTypeList = response.data.data.goodTypeList;
443
-          this.drugTypeList = response.data.data.drugTypeList;
444
-          this.supplyList = response.data.data.supplyList;
445
-          for (let i = 0; i < drugList.length; i++) {
446
-            for (let z = 0; z < drugList[i].drug_warehouse_info.length; z++) {
447
-              drugList[i].drug_warehouse_info[z].stock_max_number =
448
-                drugList[i].drug_warehouse_info[z].stock_max_number *
449
-                drugList[i].min_number;
450
-            }
451
-            for (let j = 0; j < this.manufactuerList.length; j++) {
452
-              if (drugList[i].manufacturer == this.manufactuerList[j].id) {
453
-                drugList[i].manufacturer =
454
-                  this.manufactuerList[j].manufacturer_name;
455
-              }
433
+   getInitOrder(){
434
+    getInitOrder().then(response=>{
435
+    if(response.data.state == 1){
436
+        var drugList = response.data.data.drugList
437
+        this.manufactuerList = response.data.data.manufactuerList
438
+        this.goodTypeList = response.data.data.goodTypeList
439
+        this.drugTypeList = response.data.data.drugTypeList
440
+        this.supplyList = response.data.data.supplyList
441
+       for(let i=0;i<drugList.length;i++){
442
+          for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
443
+            if(drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit){
444
+              drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
456
             }
445
             }
457
-            for (let y = 0; y < this.drugTypeList.length; y++) {
458
-              if (drugList[i].drug_type == this.drugTypeList[y].value) {
459
-                drugList[i].drug_type = this.drugTypeList[y].name;
460
-              }
446
+          }
447
+        for(let j=0;j<this.manufactuerList.length;j++){
448
+            if(drugList[i].manufacturer == this.manufactuerList[j].id){
449
+                drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
461
             }
450
             }
462
-            drugList[i].supply_name =
463
-              drugList[i].drug_name +
464
-              " " +
465
-              drugList[i].dose +
466
-              drugList[i].dose_unit +
467
-              "*" +
468
-              drugList[i].min_number +
469
-              drugList[i].min_unit +
470
-              "/" +
471
-              drugList[i].max_unit +
472
-              " " +
473
-              drugList[i].manufacturer;
474
-            drugList[i].supply_type = drugList[i].drug_type;
475
-            drugList[i].supply_specification_name =
476
-              drugList[i].dose +
477
-              drugList[i].dose_unit +
478
-              "*" +
479
-              drugList[i].min_number +
480
-              drugList[i].min_unit +
481
-              "/" +
482
-              drugList[i].max_unit;
483
-            drugList[i].supply_total = this.getWarehoseInfo(
484
-              drugList[i].drug_warehouse_info,
485
-              drugList[i].max_unit,
486
-              drugList[i].min_unit,
487
-              drugList[i].min_number
488
-            );
489
-            drugList[i].supply_count = "";
490
-            drugList[i].supply_total_price = "";
491
-            drugList[i].supply_manufacturer = drugList[i].manufacturer;
492
-            drugList[i].supply_license_number = drugList[i].number;
493
-            drugList[i].supply_remake = "";
494
-            drugList[i].type = 1;
495
-            drugList[i].supply_price = drugList[i].last_price;
496
-            drugList[i].name = drugList[i].drug_name;
497
-            drugList[i].supply_unit = drugList[i].max_unit;
498
-            drugList[i].unitList = [
499
-              { id: 1, name: "" },
500
-              { id: 2, name: "" },
501
-            ];
502
-            for (let j = 0; j < drugList[i].unitList.length; j++) {
503
-              drugList[i].unitList[0].name = drugList[i].max_unit;
504
-              drugList[i].unitList[1].name = drugList[i].min_unit;
451
+        }
452
+        for(let y=0;y<this.drugTypeList.length;y++){
453
+            if(drugList[i].drug_type == this.drugTypeList[y].value){
454
+            drugList[i].drug_type = this.drugTypeList[y].name
505
             }
455
             }
506
-            this.tabList.push(drugList[i]);
456
+        }
457
+        drugList[i].supply_name =  drugList[i].drug_name + " " + drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit + " " + drugList[i].manufacturer
458
+        drugList[i].supply_type = drugList[i].drug_type
459
+        drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
460
+        drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
461
+        drugList[i].supply_count = ""
462
+        drugList[i].supply_total_price = ""
463
+        drugList[i].supply_manufacturer=  drugList[i].manufacturer
464
+        drugList[i].supply_license_number= drugList[i].number
465
+        drugList[i].supply_remake = ""
466
+        drugList[i].type = 1
467
+        drugList[i].supply_price = drugList[i].last_price
468
+        drugList[i].name = drugList[i].drug_name
469
+        if(drugList[i].max_unit!=drugList[i].min_unit){
470
+          drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
471
+        }
472
+        if(drugList[i].max_unit == drugList[i].min_unit){
473
+          drugList[i].unitList = [{id:1,name:""}]
474
+        }
475
+      
476
+        drugList[i].supply_unit = drugList[i].max_unit 
477
+        for(let j=0;j<drugList[i].unitList.length;j++){
478
+          if(drugList[i].max_unit!=drugList[i].min_unit){
479
+            drugList[i].unitList[0].name = drugList[i].max_unit
480
+            drugList[i].unitList[1].name = drugList[i].min_unit
507
           }
481
           }
508
-          this.drugList = drugList;
509
-          var goodList = response.data.data.goodList;
510
-
511
-          for (let i = 0; i < goodList.length; i++) {
512
-            for (let j = 0; j < this.manufactuerList.length; j++) {
513
-              if (goodList[i].manufacturer == this.manufactuerList[j].id) {
514
-                goodList[i].manufacturer =
515
-                  this.manufactuerList[j].manufacturer_name;
516
-              }
517
-            }
518
-            for (let y = 0; y < this.goodTypeList.length; y++) {
519
-              if (goodList[i].good_type_id == this.goodTypeList[y].id) {
520
-                goodList[i].good_type_id = this.goodTypeList[y].type_name;
521
-              }
482
+          if(drugList[i].max_unit ==drugList[i].min_unit){
483
+            drugList[i].unitList[0].name = drugList[i].max_unit
484
+          }
485
+         
486
+        }
487
+        this.tabList.push(drugList[i])
488
+        }
489
+        this.drugList = drugList
490
+        var goodList =  response.data.data.goodList
491
+        for(let i=0;i<goodList.length;i++){
492
+        for(let j=0;j<this.manufactuerList.length;j++){
493
+            if(goodList[i].manufacturer == this.manufactuerList[j].id){
494
+                goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
522
             }
495
             }
523
-            goodList[i].supply_name =
524
-              goodList[i].good_name +
525
-              " " +
526
-              goodList[i].specification_name +
527
-              " " +
528
-              goodList[i].manufacturer;
529
-            goodList[i].supply_type = goodList[i].good_type_id;
530
-            goodList[i].supply_specification_name =
531
-              goodList[i].specification_name;
532
-            goodList[i].supply_price = goodList[i].buy_price;
533
-            goodList[i].supply_total = this.getTotalStockCount(
534
-              goodList[i].good_warehouse_info
535
-            );
536
-            goodList[i].supply_count = "";
537
-            goodList[i].supply_total_price = "";
538
-            goodList[i].supply_manufacturer = goodList[i].manufacturer;
539
-            goodList[i].supply_license_number = "";
540
-            goodList[i].supply_remake = "";
541
-            goodList[i].type = 2;
542
-            goodList[i].name = goodList[i].good_name;
543
-            goodList[i].supply_unit = goodList[i].packing_unit;
544
-            goodList[i].unitList = [
545
-              { id: 1, name: "" },
546
-              { id: 2, name: "" },
547
-            ];
548
-            for (let j = 0; j < goodList[i].unitList.length; j++) {
549
-              goodList[i].unitList[0].name = goodList[i].packing_unit;
496
+        }
497
+        for(let y=0;y<this.goodTypeList.length;y++){
498
+            if(goodList[i].good_type_id == this.goodTypeList[y].id){
499
+                goodList[i].good_type_id = this.goodTypeList[y].type_name
550
             }
500
             }
551
-            this.tabList.push(goodList[i]);
552
-          }
553
-          this.goodList = goodList;
554
         }
501
         }
555
-      });
556
-    },
502
+        goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
503
+        goodList[i].supply_type = goodList[i].good_type_id
504
+        goodList[i].supply_specification_name =goodList[i].specification_name
505
+        goodList[i].supply_price = goodList[i].buy_price
506
+        goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
507
+        goodList[i].supply_count = ""
508
+        goodList[i].supply_total_price = ""
509
+        goodList[i].supply_manufacturer = goodList[i].manufacturer
510
+        goodList[i].supply_license_number = ""
511
+        goodList[i].supply_remake = ""
512
+        goodList[i].type = 2
513
+        goodList[i].name = goodList[i].good_name
514
+        goodList[i].unitList =  [{id:1,name:""}]
515
+        goodList[i].supply_unit = goodList[i].packing_unit
516
+        for(let j=0;j<goodList[i].unitList.length;j++){
517
+           goodList[i].unitList[0].name = goodList[i].packing_unit 
518
+        }
519
+        this.tabList.push(goodList[i])
520
+        }
521
+        this.goodList = goodList
522
+        console.log(this.goodList,'oo')
523
+    } 
524
+    })
525
+},
557
     changeGoodName(val) {
526
     changeGoodName(val) {
558
       this.currentIndex = val;
527
       this.currentIndex = val;
559
     },
528
     },
659
           var end = this.getTimes(this.end_time);
628
           var end = this.getTimes(this.end_time);
660
           const params = {
629
           const params = {
661
             stockIn: this.recordInfo.tableList,
630
             stockIn: this.recordInfo.tableList,
631
+            return_remake:this.return_remark,
662
           };
632
           };
663
 
633
 
664
           console.log("params23322323", params);
634
           console.log("params23322323", params);
681
               this.number = warehouseInfo.number;
651
               this.number = warehouseInfo.number;
682
               this.id = warehouseInfo.id;
652
               this.id = warehouseInfo.id;
683
               this.recordInfo.tableList = [];
653
               this.recordInfo.tableList = [];
654
+              this.return_remark = warehouseInfo.return_remake
684
               var orderInfo = response.data.data.orderInfo;
655
               var orderInfo = response.data.data.orderInfo;
685
               for (let i = 0; i < orderInfo.length; i++) {
656
               for (let i = 0; i < orderInfo.length; i++) {
686
                 if (orderInfo[i].is_source == 1) {
657
                 if (orderInfo[i].is_source == 1) {
824
           var end = this.getTimes(this.end_time);
795
           var end = this.getTimes(this.end_time);
825
           const params = {
796
           const params = {
826
             stockIn: this.recordInfo.tableList,
797
             stockIn: this.recordInfo.tableList,
798
+            return_remake:this.return_remark,
827
           };
799
           };
828
           console.log("params23232233223", params);
800
           console.log("params23232233223", params);
829
 
801
 
978
   bottom: 20px;
950
   bottom: 20px;
979
   height: 100%;
951
   height: 100%;
980
 }
952
 }
981
-</style>
953
+</style>

+ 132 - 104
src/xt_pages/supply/components/addSupply.vue View File

72
             backgroundColor: 'rgb(245, 247, 250)',
72
             backgroundColor: 'rgb(245, 247, 250)',
73
             color: '#606266',
73
             color: '#606266',
74
           }"
74
           }"
75
-          :data="recordInfo.tableList"
75
+          :data="recordInfo.contacts"
76
           :class="signAndWeighBoxPatients"
76
           :class="signAndWeighBoxPatients"
77
           border
77
           border
78
           style="width: 100%"
78
           style="width: 100%"
85
             </template>
85
             </template>
86
             <template slot-scope="scope">
86
             <template slot-scope="scope">
87
               <el-form-item
87
               <el-form-item
88
-                :prop="'tableList.' + scope.$index + '.supply_count'"
89
-                :rules="tableRules.contacts"
88
+                :prop="'contacts.' + scope.$index + '.name'"
89
+                :rules="tableRules.name"
90
               >
90
               >
91
                 <el-input
91
                 <el-input
92
                   v-model="scope.row.name"
92
                   v-model="scope.row.name"
121
               <span>首要联系人<span style="color: red">*</span></span>
121
               <span>首要联系人<span style="color: red">*</span></span>
122
             </template>
122
             </template>
123
             <template slot-scope="scope">
123
             <template slot-scope="scope">
124
-              <el-form-item :prop="'tableList.' + scope.$index + '.name'">
125
-                <!-- :prop="'tableList.' + scope.$index + '.name'"  如需添加可在上方标签加入 -->
124
+              <el-form-item :prop="'contacts.' + scope.$index + '.name'">
125
+                <!-- :prop="'contacts.' + scope.$index + '.name'"  如需添加可在上方标签加入 -->
126
                 <el-select
126
                 <el-select
127
-                  v-model="scope.row.is_first"
127
+                  v-model="scope.row.isfirst"
128
                   style="width: 90px"
128
                   style="width: 90px"
129
                   placeholder="请选择"
129
                   placeholder="请选择"
130
                   @change="changeName($event, scope)"
130
                   @change="changeName($event, scope)"
133
                     v-for="(item, index) in tabList"
133
                     v-for="(item, index) in tabList"
134
                     :key="index"
134
                     :key="index"
135
                     :label="item.label"
135
                     :label="item.label"
136
-                    :value="item"
136
+                    :value="item.value"
137
                   >
137
                   >
138
                   </el-option>
138
                   </el-option>
139
                 </el-select>
139
                 </el-select>
186
 
186
 
187
     <span slot="footer" class="dialog-footer">
187
     <span slot="footer" class="dialog-footer">
188
       <el-button @click="closePop">取 消</el-button>
188
       <el-button @click="closePop">取 消</el-button>
189
-      <el-button type="primary" @click="submitForm('supplier')"
189
+      <el-button type="primary" @click="submitForm('supplier', 'recordInfo')"
190
         >确 定</el-button
190
         >确 定</el-button
191
       >
191
       >
192
     </span>
192
     </span>
198
   getSupplierId,
198
   getSupplierId,
199
   getsupplytype,
199
   getsupplytype,
200
   getsupplyandcontactone,
200
   getsupplyandcontactone,
201
+  delcontactone,
202
+  savesupply,
203
+  updatesupply,
201
 } from "@/api/supply";
204
 } from "@/api/supply";
202
 import Template from "../../data/template.vue";
205
 import Template from "../../data/template.vue";
203
 export default {
206
 export default {
204
   data() {
207
   data() {
205
     return {
208
     return {
209
+      show_type: 1,
210
+      supplier_ids: "",
206
       title: "",
211
       title: "",
207
       Template,
212
       Template,
208
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
213
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
209
       list: ["001", "002"],
214
       list: ["001", "002"],
210
       // 表单验证规则
215
       // 表单验证规则
211
       rules: {
216
       rules: {
212
-        id: [
217
+        supplierCode: [
213
           {
218
           {
214
             required: true,
219
             required: true,
215
             message: "请填写供应商编号",
220
             message: "请填写供应商编号",
216
             trigger: "blur",
221
             trigger: "blur",
217
           },
222
           },
218
         ],
223
         ],
219
-        name: [
224
+        supplierName: [
220
           {
225
           {
221
             required: true,
226
             required: true,
222
             message: "请填写供应商名称",
227
             message: "请填写供应商名称",
226
       },
231
       },
227
       tabList: [
232
       tabList: [
228
         {
233
         {
229
-          value: 0,
234
+          value: 1,
230
           label: "是",
235
           label: "是",
231
         },
236
         },
232
         {
237
         {
233
-          value: 1,
238
+          value: 0,
234
           label: "否",
239
           label: "否",
235
         },
240
         },
236
       ],
241
       ],
237
       tableRules: {
242
       tableRules: {
238
-        contacts: [
239
-          { required: true, message: "联系人不能为空", trigger: "blur" },
240
-        ],
243
+        name: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
241
       },
244
       },
242
       recordInfo: {
245
       recordInfo: {
243
-        tableList: [{}],
246
+        contacts: [{}],
244
       },
247
       },
245
       tableData: [
248
       tableData: [
246
         {
249
         {
251
           operate: "",
254
           operate: "",
252
         },
255
         },
253
       ],
256
       ],
254
-      options: [
255
-        {
256
-          value: "1",
257
-          label: "是",
258
-        },
259
-        {
260
-          value: "2",
261
-          label: "否",
262
-        },
263
-      ],
264
-      value: "",
265
       dialogVisible: false,
257
       dialogVisible: false,
266
       supplier: {
258
       supplier: {
267
-        supplierName: "a",
259
+        supplierName: "",
268
         supplierCode: "gsy001",
260
         supplierCode: "gsy001",
269
         supplierType: "",
261
         supplierType: "",
270
-        vatRate: 10,
262
+        vatRate: "",
271
         number: "",
263
         number: "",
272
         bank: "",
264
         bank: "",
273
         bankAccount: "",
265
         bankAccount: "",
285
     show(data, type) {
277
     show(data, type) {
286
       if (type == 1) {
278
       if (type == 1) {
287
         this.initSupplierData();
279
         this.initSupplierData();
280
+        this.show_type = 1;
288
         this.title = "新增供应商";
281
         this.title = "新增供应商";
289
         this.dialogVisible = true;
282
         this.dialogVisible = true;
290
       } else if (type == 2) {
283
       } else if (type == 2) {
284
+        this.show_type = 2;
285
+        this.supplier_ids = data.ID;
291
         this.title = "编辑供应商";
286
         this.title = "编辑供应商";
292
         this.supplier.supplierCode = data.SupplierCode;
287
         this.supplier.supplierCode = data.SupplierCode;
293
         this.supplier.supplierName = data.SupplierName;
288
         this.supplier.supplierName = data.SupplierName;
310
       this.supplier.number = "";
305
       this.supplier.number = "";
311
       this.supplier.bank = "";
306
       this.supplier.bank = "";
312
       this.supplier.bankAccount = "";
307
       this.supplier.bankAccount = "";
313
-      this.recordInfo.tableList = [{}];
308
+      this.recordInfo.contacts = [{}];
314
     },
309
     },
315
 
310
 
316
     // 获取供应商编码接口
311
     // 获取供应商编码接口
317
     initSupplierData() {
312
     initSupplierData() {
318
-      let Arr = [];
319
       getSupplierId().then((res) => {
313
       getSupplierId().then((res) => {
320
-        Arr = res.data.data;
321
-        Arr.supplycode.forEach((o) => {
322
-          this.supply_code.push(o.supplier_code);
323
-        });
324
-      });
325
-      this.orderIdAdd();
326
-    },
327
-
328
-    // 供应商编码动态递增
329
-    orderIdAdd() {
330
-      let data = this.supply_code;
331
-      let len = 3;
332
-      data.forEach((o, index) => {
333
-        o = o.split("gsy");
334
-        index = index + 1;
335
-        let index1 = index;
336
-        index1 = parseInt(index1, 10);
337
-        index1 = index1.toString();
338
-        while (index1.length < len) index1 = "0" + index1;
339
-        if (o[1] != index1) {
340
-          data.splice(index - 1, 0, `gsy${index1}`);
341
-          // console.log(`gsy${index1}`);
342
-          this.supplier.id = `gsy${index1}`;
314
+        if (res.data.state == 1) {
315
+          this.supplier.supplierCode =
316
+            res.data.data.supplycode[0].supplier_code;
343
         }
317
         }
344
       });
318
       });
345
     },
319
     },
376
     },
350
     },
377
 
351
 
378
     handleSelect(item) {
352
     handleSelect(item) {
379
-      console.log(item, "l");
380
       this.supplier.name = item.value;
353
       this.supplier.name = item.value;
381
       this.supplier.value = item.name;
354
       this.supplier.value = item.name;
382
     },
355
     },
383
 
356
 
384
     //  验证表单内容
357
     //  验证表单内容
385
-    submitForm(formName) {
386
-      this.$refs[formName].validate((valid) => {
387
-        if (valid) {
388
-          alert("submit!");
389
-          this.dialogVisible = false;
390
-        } else {
391
-          return false;
392
-        }
393
-      });
358
+    submitForm(supplier, formName) {
359
+      if (this.show_type == 1) {
360
+        this.$refs[supplier].validate((valid) => {
361
+          if (valid) {
362
+            this.$refs[formName].validate((valid) => {
363
+              if (valid) {
364
+                let params = {
365
+                  ...this.supplier,
366
+                  ...this.recordInfo,
367
+                };
368
+                console.log(params, "dhas");
369
+                savesupply(params).then((res) => {});
370
+              } else {
371
+                return false;
372
+              }
373
+            });
374
+
375
+            this.dialogVisible = false;
376
+          } else {
377
+            return false;
378
+          }
379
+        });
380
+      } else if (this.show_type == 2) {
381
+        this.$refs[supplier].validate((valid) => {
382
+          if (valid) {
383
+            this.$refs[formName].validate((valid) => {
384
+              if (valid) {
385
+                let params = {
386
+                  ...this.supplier,
387
+                  ...this.recordInfo,
388
+                };
389
+                console.log(params, "dhas");
390
+                updatesupply(params).then((res) => {
391
+                  console.log(res, "oo");
392
+                });
393
+              } else {
394
+                return false;
395
+              }
396
+            });
397
+
398
+            this.dialogVisible = false;
399
+          } else {
400
+            return false;
401
+          }
402
+        });
403
+      }
394
 
404
 
395
       this.contactsinfo();
405
       this.contactsinfo();
396
     },
406
     },
402
         label: "是",
412
         label: "是",
403
       };
413
       };
404
       getsupplyandcontactone({ id: val }).then((res) => {
414
       getsupplyandcontactone({ id: val }).then((res) => {
405
-        console.log(res, "oo");
406
         if (res.data.code == 0) {
415
         if (res.data.code == 0) {
407
-          this.recordInfo.tableList = res.data.data.contact;
408
-          if (this.recordInfo.tableList.length == 0) {
409
-            this.recordInfo.tableList = [{}];
410
-            this.recordInfo.tableList[0].is_first = data;
411
-            this.$forceUpdate();
416
+          this.recordInfo.contacts = res.data.data.contact;
417
+          if (this.recordInfo.contacts.length == 0) {
418
+            this.recordInfo.contacts = [{}];
419
+            this.recordInfo.contacts[0].isfirst = data;
420
+          } else if (this.recordInfo.contacts.length == 1) {
421
+            let val = res.data.data.contact[0];
422
+            this.recordInfo.contacts[0].isfirst = data;
423
+            this.recordInfo.contacts[0] = {
424
+              name: val.name,
425
+              address: val.address,
426
+              phone: val.phone,
427
+              isfirst: val.is_first,
428
+            };
412
           } else {
429
           } else {
413
-            this.recordInfo.tableList.forEach((o) => {
414
-              if (o.is_first == 0) {
415
-                o.is_first = "否";
416
-              } else if (o.is_first == 1) {
417
-                o.is_first = "是";
430
+            this.recordInfo.contacts.forEach((o) => {
431
+              if (o.isfirst == 0) {
432
+                this.tabList.label = "否";
433
+              } else if (o.isfirst == 1) {
434
+                this.tabList.label = "是";
418
               }
435
               }
419
             });
436
             });
420
           }
437
           }
421
-
422
-          console.log(this.recordInfo.tableList, "this.recordInfo.tableList");
423
         }
438
         }
424
       });
439
       });
425
-
426
-      if (this.recordInfo.tableList.length == 1) {
427
-        this.recordInfo.tableList[0].is_first = data;
428
-        this.$forceUpdate();
429
-      }
430
     },
440
     },
431
 
441
 
432
     // 首要联系人选择变更动态展示
442
     // 首要联系人选择变更动态展示
433
     changeName(data, scope) {
443
     changeName(data, scope) {
434
       let data1 = {
444
       let data1 = {
435
-        value: 1,
445
+        value: 0,
436
         label: "否",
446
         label: "否",
437
       };
447
       };
438
-
439
       let data2 = {
448
       let data2 = {
440
-        value: 0,
449
+        value: 1,
441
         label: "是",
450
         label: "是",
442
       };
451
       };
443
       let arr = [];
452
       let arr = [];
444
-      if (this.recordInfo.tableList.length == 1) {
445
-        this.recordInfo.tableList[0] = data2;
446
-        this.$forceUpdate();
447
-      }
448
-      this.recordInfo.tableList.forEach((el, index) => {
449
-        if (scope.$index == index) {
450
-          el.is_first = data;
451
-          // console.log(scope);
452
-          this.$forceUpdate();
453
+      if (this.recordInfo.contacts.length <= 1) {
454
+        this.recordInfo.contacts[0].isfirst = data2.value;
455
+      } else {
456
+        this.recordInfo.contacts.forEach((el, index) => {
457
+          console.log(scope.$index, index, "oo");
458
+          if (scope.$index == index) {
459
+            el.isfirst = data;
460
+          } else {
461
+            el.isfirst = data1.value;
462
+          }
463
+          arr.push(el.isfirst);
464
+        });
465
+        if (arr.includes(1)) {
466
+          return;
453
         } else {
467
         } else {
454
-          el.is_first = data1;
455
-          this.$forceUpdate();
468
+          this.recordInfo.contacts[0].isfirst = data2.value;
456
         }
469
         }
457
-        arr.push(el.is_first.value);
458
-      });
459
-      if (arr.includes(0)) {
460
-        return;
461
-      } else {
462
-        this.recordInfo.tableList[0].is_first = data2;
463
       }
470
       }
464
     },
471
     },
465
 
472
 
466
     // 添加表单行
473
     // 添加表单行
467
     handleAdd() {
474
     handleAdd() {
468
       let data = {};
475
       let data = {};
469
-      this.recordInfo.tableList.push(data);
476
+      this.recordInfo.contacts.push(data);
470
     },
477
     },
471
     // 删除表单行
478
     // 删除表单行
472
-    handleDelete() {},
479
+    handleDelete(index, data) {
480
+      let params = {
481
+        id: data.id,
482
+      };
483
+
484
+      if (this.show_type == 1) {
485
+        if (this.recordInfo.contacts.length <= 1) {
486
+          return;
487
+        } else {
488
+          this.recordInfo.contacts.splice(index, 1);
489
+        }
490
+      } else if (this.show_type == 2) {
491
+        delcontactone(params).then((res) => {
492
+          if (res.data.data.list == "删除成功") {
493
+            this.$message.success(res.data.data.list);
494
+            this.getcontacts(this.supplier_ids);
495
+          } else {
496
+            this.$message.error(res.data.data.list);
497
+          }
498
+        });
499
+      }
500
+    },
473
 
501
 
474
     //表格判断是否填入信息
502
     //表格判断是否填入信息
475
     contactsinfo() {
503
     contactsinfo() {

+ 50 - 29
src/xt_pages/supply/components/editGoodOrder.vue View File

91
             <span>商品类别</span>
91
             <span>商品类别</span>
92
         </template>
92
         </template>
93
         <template slot-scope="scope">
93
         <template slot-scope="scope">
94
-            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
94
+            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true" placeholder="商品类别"></el-input>
95
             <div style="visibility: hidden">/</div>
95
             <div style="visibility: hidden">/</div>
96
         </template>
96
         </template>
97
     </el-table-column>
97
     </el-table-column>
98
-    <el-table-column label="规格&单位" align="center" width="120px">
98
+    <el-table-column label="规格&单位" align="center" width="150px">
99
         <template slot-scope="scope">
99
         <template slot-scope="scope">
100
-            <el-input v-model="scope.row.supply_specification_name" style="width:100px" :disabled="true"></el-input>
100
+            <el-input v-model="scope.row.supply_specification_name" style="width:120px" :disabled="true" placeholder="规格&单位"></el-input>
101
             <div style="visibility: hidden">/</div>
101
             <div style="visibility: hidden">/</div>
102
         </template>
102
         </template>
103
     </el-table-column>
103
     </el-table-column>
118
           </el-form-item>  
118
           </el-form-item>  
119
         </template>
119
         </template>
120
     </el-table-column>
120
     </el-table-column>
121
-    <el-table-column label="批号" align="center" width="130px">
121
+    <el-table-column label="批号" align="center" width="200px">
122
          <template slot="header" slot-scope="scope">
122
          <template slot="header" slot-scope="scope">
123
             <span>批号<span style="color: red">*</span></span>
123
             <span>批号<span style="color: red">*</span></span>
124
         </template>
124
         </template>
125
         <template slot-scope="scope">
125
         <template slot-scope="scope">
126
            <el-form-item  :prop="'tableList.' + scope.$index + '.supply_batch_number'" :rules='tableRules.supply_batch_number'>
126
            <el-form-item  :prop="'tableList.' + scope.$index + '.supply_batch_number'" :rules='tableRules.supply_batch_number'>
127
-             <el-input v-model="scope.row.supply_batch_number" style="width:80px" :disabled="disabled"></el-input>
127
+             <el-input v-model="scope.row.supply_batch_number" style="width:180px" :disabled="disabled" placeholder="请输入批号"></el-input>
128
           </el-form-item>
128
           </el-form-item>
129
         </template>
129
         </template>
130
     </el-table-column>
130
     </el-table-column>
142
              </el-form-item>
142
              </el-form-item>
143
        </template>
143
        </template>
144
     </el-table-column>
144
     </el-table-column>
145
-    <el-table-column label="可用库存" align="center" width="100px">
145
+    <el-table-column label="可用库存" align="center" width="150px">
146
         <template slot-scope="scope">
146
         <template slot-scope="scope">
147
-            <el-input v-model="scope.row.supply_total" style="width:80px" :disabled="true"></el-input>
147
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
148
             <div style="visibility: hidden">/</div>
148
             <div style="visibility: hidden">/</div>
149
         </template>
149
         </template>
150
     </el-table-column>
150
     </el-table-column>
154
         </template>
154
         </template>
155
         <template slot-scope="scope">
155
         <template slot-scope="scope">
156
           <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
156
           <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
157
-             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
157
+             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled" placeholder="请输入数量"></el-input>
158
           </el-form-item>
158
           </el-form-item>
159
         </template>
159
         </template>
160
     </el-table-column>
160
     </el-table-column>
161
 
161
 
162
-    <el-table-column label="采购单价" align="center" width="120px">
162
+    <el-table-column label="采购单价" align="center" width="180px">
163
         <template slot-scope="scope">
163
         <template slot-scope="scope">
164
-        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
164
+        <el-input v-model="scope.row.supply_price" style="width:140px" :disabled="disabled" placeholder="请输入采购单价"></el-input>
165
         <div style="visibility: hidden">/</div>
165
         <div style="visibility: hidden">/</div>
166
         </template>
166
         </template>
167
     </el-table-column>
167
     </el-table-column>
216
 
216
 
217
     <el-table-column label="备注" align="center" width="200px">
217
     <el-table-column label="备注" align="center" width="200px">
218
         <template slot-scope="scope">
218
         <template slot-scope="scope">
219
-        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
219
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled" placeholder="请输入备注"></el-input>
220
         <div style="visibility: hidden">/</div>
220
         <div style="visibility: hidden">/</div>
221
         </template>
221
         </template>
222
     </el-table-column>
222
     </el-table-column>
243
         </template>
243
         </template>
244
     </el-table-column>
244
     </el-table-column>
245
   </el-table>
245
   </el-table>
246
+   <div style="margin-top: 10px">
247
+      <el-input
248
+        type="textarea"
249
+        :rows="2"
250
+        placeholder="备注信息"
251
+        v-model="return_remark"
252
+      >
253
+      </el-input>
254
+  </div>
246
 </el-form>
255
 </el-form>
247
    <div style="margin-top:10px">
256
    <div style="margin-top:10px">
248
       合计:{{getAllPrice()}} 元
257
       合计:{{getAllPrice()}} 元
249
    </div>
258
    </div>
250
    <div style="margin-top:10px">
259
    <div style="margin-top:10px">
251
-        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
260
+        <span>优惠率:<el-input style="width:150px" v-model="rate_of_concession" placeholder="请输入优惠率"></el-input>%</span>
252
 
261
 
253
-        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
262
+        <span>优惠金额:<el-input style="width:150px" v-model="discount_amount" placeholder="请输入优惠金额"></el-input></span>
254
       
263
       
255
-        <span>本次付款:<el-input style="width:100px" v-model="payment"></el-input></span>
264
+        <span>本次付款:<el-input style="width:150px" v-model="payment" placeholder="请输入本次付款"></el-input></span>
256
 
265
 
257
-        <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
266
+        <span>本次欠款:<el-input style="width:150px" v-model="arrearage" placeholder="请输入本次欠款"></el-input></span>
258
     </div>
267
     </div>
259
     <!-- <Computed></Computed> -->
268
     <!-- <Computed></Computed> -->
260
 </div>
269
 </div>
261
 
270
 
262
-  <!-- <el-dialog
263
-  title="提示"
264
-  :visible.sync="dialogVisible"
265
-  width="30%"
266
-  :before-close="handleClose">
267
-  <span>这是一段信息</span>
268
-  <span slot="footer" class="dialog-footer">
269
-    <el-button @click="dialogVisible = false">取 消</el-button>
270
-    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
271
-  </span>
272
-  </el-dialog> -->
273
 </div>
271
 </div>
274
 </template>
272
 </template>
275
 
273
 
277
 import Computed from "../../components/Computed/index_1.vue"
275
 import Computed from "../../components/Computed/index_1.vue"
278
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
276
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
279
 import {uParseTime } from '@/utils/tools'
277
 import {uParseTime } from '@/utils/tools'
280
-import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList,ModefySupplyWarehousing,MofyGoodOrder,UpdateSupplyWahouseingInfo} from "@/api/supply"
278
+import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList,ModefySupplyWarehousing,MofyGoodOrder,UpdateSupplyWahouseingInfo,getSupplyWarehouseOutById} from "@/api/supply"
281
 export default {
279
 export default {
282
 name: "addPurchaseOrder",
280
 name: "addPurchaseOrder",
283
 components: {
281
 components: {
344
    good_number:"",
342
    good_number:"",
345
    orderInfo:[],
343
    orderInfo:[],
346
    warese_out_id:0,
344
    warese_out_id:0,
347
-   
345
+   return_remark:"",
348
   };
346
   };
349
 },
347
 },
350
 methods:{
348
 methods:{
613
         this.arrearage = out.arrearage
611
         this.arrearage = out.arrearage
614
         this.number = out.number
612
         this.number = out.number
615
         this.good_number = out.good_number
613
         this.good_number = out.good_number
614
+        this.return_remark = out.return_remake
616
         this.start_time = this.getTimes(out.document_date)
615
         this.start_time = this.getTimes(out.document_date)
617
         var orderInfo = response.data.data.list
616
         var orderInfo = response.data.data.list
618
         
617
         
696
            this.loading = true
695
            this.loading = true
697
            var warehose_out_id = this.$route.query.id
696
            var warehose_out_id = this.$route.query.id
698
            var params = {
697
            var params = {
699
-             "stockIn":this.recordInfo.tableList,
698
+             stockIn:this.recordInfo.tableList,
699
+             return_remake:this.return_remark,
700
            } 
700
            } 
701
            updateGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehose_out_id,this.number,this.rate_of_concession,this.discount_amount,this.good_number).then(response=>{
701
            updateGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehose_out_id,this.number,this.rate_of_concession,this.discount_amount,this.good_number).then(response=>{
702
            if(response.data.state == 1){
702
            if(response.data.state == 1){
820
     })
820
     })
821
   },
821
   },
822
   toClick(){
822
   toClick(){
823
+    //先判断采购单号有没有关联的采购退货单号,如果没有,则为首次生成采购退货单
824
+     if(this.is_check == 2){
825
+      this.$message.error("该采购单未审核,不能生成退货单数据!")
826
+      return false
827
+     }
828
+     var id = this.$route.query.id
829
+    getSupplyWarehouseOutById(id).then(response=>{
830
+      if(response.data.state == 1){
831
+        var cancelList = response.data.data.cancelList
832
+        console.log("cancelList23232232323323223",cancelList)
833
+        if(cancelList.length >0){
834
+
835
+        }
836
+        var outList = response.data.data.outList
837
+        console.log("outList2332232332",outList)
838
+        var cancelOrderList = response.data.data.cancelOrderList
839
+        console.log("cancelOrderList2323322322332",cancelOrderList)
840
+        var drugList = response.data.data.drugList
841
+        console.log("drugList233223232323232",drugList)
842
+      }
843
+    })
823
     this.$router.push({path:"/good/return/add?id="+this.id})
844
     this.$router.push({path:"/good/return/add?id="+this.id})
824
   },
845
   },
825
   //反审核
846
   //反审核

+ 10 - 4
src/xt_pages/supply/components/editGoodReturn.vue View File

92
                   v-model="scope.row.name"
92
                   v-model="scope.row.name"
93
                   style="width: 160px"
93
                   style="width: 160px"
94
                   filterable
94
                   filterable
95
-                  placeholder="请选择"
95
+                  placeholder="请选择商品"
96
                   @change="changeName"
96
                   @change="changeName"
97
                   @input="changeGoodName(scope.$index)"
97
                   @input="changeGoodName(scope.$index)"
98
                   :disabled="disabled"
98
                   :disabled="disabled"
117
                 v-model="scope.row.supply_type"
117
                 v-model="scope.row.supply_type"
118
                 style="width: 120px"
118
                 style="width: 120px"
119
                 :disabled="true"
119
                 :disabled="true"
120
+                placeholder="商品类别"
120
               ></el-input>
121
               ></el-input>
121
             </template>
122
             </template>
122
           </el-table-column>
123
           </el-table-column>
126
                 v-model="scope.row.supply_specification_name"
127
                 v-model="scope.row.supply_specification_name"
127
                 style="width: 150px"
128
                 style="width: 150px"
128
                 :disabled="true"
129
                 :disabled="true"
130
+                placeholder="规格&单位"
129
               ></el-input>
131
               ></el-input>
130
             </template>
132
             </template>
131
           </el-table-column>
133
           </el-table-column>
168
           <el-table-column label="数量" align="center" width="120px">
170
           <el-table-column label="数量" align="center" width="120px">
169
             <template slot="header" slot-scope="scope">
171
             <template slot="header" slot-scope="scope">
170
               <span>数量<span style="color: red">*</span></span>
172
               <span>数量<span style="color: red">*</span></span>
173
+
171
             </template>
174
             </template>
172
             <template slot-scope="scope">
175
             <template slot-scope="scope">
173
               <el-form-item
176
               <el-form-item
178
                   v-model="scope.row.supply_count"
181
                   v-model="scope.row.supply_count"
179
                   style="width: 80px"
182
                   style="width: 80px"
180
                   :disabled="disabled"
183
                   :disabled="disabled"
184
+                  placeholder="请输入数量"
181
                 ></el-input>
185
                 ></el-input>
182
               </el-form-item>
186
               </el-form-item>
183
             </template>
187
             </template>
184
           </el-table-column>
188
           </el-table-column>
185
 
189
 
186
-          <el-table-column label="购货单价" align="center" width="120px">
190
+          <el-table-column label="采购单价" align="center" width="180px">
187
             <template slot-scope="scope">
191
             <template slot-scope="scope">
188
               <el-input
192
               <el-input
189
                 v-model="scope.row.supply_price"
193
                 v-model="scope.row.supply_price"
190
-                style="width: 80px"
194
+                style="width: 140px"
191
                 :disabled="disabled"
195
                 :disabled="disabled"
196
+                placeholder="请输入采购单价"
192
               ></el-input>
197
               ></el-input>
193
             </template>
198
             </template>
194
           </el-table-column>
199
           </el-table-column>
195
 
200
 
196
-          <el-table-column label="购金额" align="center" width="120px">
201
+          <el-table-column label="购金额" align="center" width="120px">
197
             <template slot-scope="scope">
202
             <template slot-scope="scope">
198
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
203
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
199
             </template>
204
             </template>
246
                 v-model="scope.row.supply_remake"
251
                 v-model="scope.row.supply_remake"
247
                 style="width: 160px"
252
                 style="width: 160px"
248
                 :disabled="disabled"
253
                 :disabled="disabled"
254
+                placeholder="请输入备注"
249
               ></el-input>
255
               ></el-input>
250
             </template>
256
             </template>
251
           </el-table-column>
257
           </el-table-column>

File diff suppressed because it is too large
+ 757 - 1080
src/xt_pages/supply/components/editPurchaseOrder.vue


+ 1 - 1
src/xt_pages/supply/goodOrderQuery.vue View File

107
        </el-table-column>
107
        </el-table-column>
108
         <el-table-column label="已付款" align="center">
108
         <el-table-column label="已付款" align="center">
109
          <template slot-scope="scope">
109
          <template slot-scope="scope">
110
-           {{scope.row.payment}}
110
+           <span v-if="scope.row.payment >0">{{scope.row.payment}}</span> 
111
          </template>
111
          </template>
112
        </el-table-column>
112
        </el-table-column>
113
        <el-table-column label="数量" align="center">
113
        <el-table-column label="数量" align="center">