Browse Source

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

csx 3 years ago
parent
commit
d91b8ca17a

+ 53 - 3
src/api/supply.js View File

@@ -160,7 +160,6 @@ export function getAllGoodReturnOrderList(params) {
160 160
   })
161 161
 }
162 162
 
163
-
164 163
 export function getSupplierId(params) {
165 164
   return request({
166 165
     url: '/api/supply/getsupplycode',
@@ -185,7 +184,6 @@ export function getGoodReturnDetail(id, params) {
185 184
   })
186 185
 }
187 186
 
188
-
189 187
 export function getexporthistory(params) {
190 188
   return request({
191 189
     url: '/api/supply/getsupplylist',
@@ -267,7 +265,7 @@ export function savesupply(data) {
267 265
 }
268 266
 
269 267
 export function updatesupply(data) {
270
-  console.log(data,'oopo')
268
+  console.log(data, 'oopo')
271 269
   return request({
272 270
     url: '/api/supply/updatesupply',
273 271
     method: 'post',
@@ -275,6 +273,13 @@ export function updatesupply(data) {
275 273
   })
276 274
 }
277 275
 
276
+export function checkGoodOrderById(id, params) {
277
+  return request({
278
+    url: '/api/supply/checkgoodorderbyid?id=' + id,
279
+    method: 'get',
280
+    params: params
281
+  })
282
+}
278 283
 
279 284
 // export function getsupplytype(params) {
280 285
 //   return request({
@@ -284,5 +289,50 @@ export function updatesupply(data) {
284 289
 //   })
285 290
 // }
286 291
 
292
+export function checkReturnOrder(params) {
293
+  return request({
294
+    url: '/api/supply/checkreturnorder',
295
+    method: 'Get',
296
+    params: params
297
+  })
298
+}
299
+
300
+export function deletePurchOder(params) {
301
+  return request({
302
+    url: '/api/supply/deletepurchaseorder',
303
+    method: 'get',
304
+    params: params
305
+  })
306
+}
307
+
308
+export function deleteGoodOrderById(params) {
309
+  return request({
310
+    url: '/api/supply/deletegoodorderbyid',
311
+    method: 'get',
312
+    params: params
313
+  })
314
+}
315
+
316
+export function deleteReturnOrder(id, params) {
317
+  return request({
318
+    url: '/api/supply/deletereturnorder?id=' + id,
319
+    method: 'Get',
320
+    params: params
321
+  })
322
+}
287 323
 
324
+export function deleteReturnOrderById(id, params) {
325
+  return request({
326
+    url: '/api/supply/deletereturnorderbyid?id=' + id,
327
+    method: 'get',
328
+    params: params
329
+  })
330
+}
288 331
 
332
+export function modefyReturnOrder(params) {
333
+  return request({
334
+    url: '/api/supply/modefyreturnorder',
335
+    method: 'get',
336
+    params: params
337
+  })
338
+}

+ 6 - 0
src/views/layout/Layout.vue View File

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

+ 6 - 5
src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue View File

@@ -76,7 +76,7 @@
76 76
             </div>
77 77
           </div>
78 78
         </div>
79
-        <div class="row">
79
+        <div class="row" v-if="org_id != 10307">
80 80
           <div class="inline_block">
81 81
             入科方式:
82 82
             <div v-for="(item, index) in way_arr" class="under_line" v-if="receiverTreatmentAccess.way == item.id" style="width: 180px;text-align: left">
@@ -776,7 +776,7 @@
776 776
               </div>
777 777
             </div>
778 778
           </div>
779
-          <div class="row" style="margin-bottom:10px;">
779
+          <div class="row" style="margin-bottom:10px;" v-if="org_id != 10307" >
780 780
             <div class="inline_block">
781 781
               入科方式:
782 782
               <!--<check-box v-for="item, index in nutrition_arr" :key="index" :text="item.name" :checked="receiverTreatmentAccess.nutrition == item.id?true:false"></check-box>-->
@@ -817,7 +817,7 @@
817 817
               <!--平车-->
818 818
               <!--</div>-->
819 819
             </div>
820
-            <div class="inline_block" style="margin-left: 10px;">
820
+            <div class="inline_block" style="margin-left: 10px;" >
821 821
               诊断:
822 822
               <div class="under_line" style="width: 640px;text-align: left;word-break: break-all;word-wrap: break-word;display: inline-block;">
823 823
                 {{ patientInfo.diagnose }}
@@ -888,12 +888,12 @@
888 888
                 </tr>
889 889
               </template>
890 890
 
891
-              <tr>
891
+              <tr v-if="org_id != 10307">
892 892
                 <td colspan="7" style="letter-spacing:5px;text-align:center;font-weight:520;font-size:16px;padding: 6px 8px;line-height: 30px;">
893 893
                   透析后情况
894 894
                 </td>
895 895
               </tr>
896
-              <tr>
896
+              <tr v-if="org_id != 10307">
897 897
                 <td colspan="7">
898 898
                   <div class="row" style="padding: 2px 0;line-height:23px; display:flex;">
899 899
                     <div class="inline_block" style="flex:1;">
@@ -2020,6 +2020,7 @@ export default {
2020 2020
     }
2021 2021
   },
2022 2022
   created() {
2023
+    console.log(this.org_id,'opop')
2023 2024
     this.way_arr = getDataConfig('hemodialysis', 'way')
2024 2025
     this.consciousness_arr = getDataConfig('hemodialysis', 'consciousness')
2025 2026
     this.appetite_arr = getDataConfig('hemodialysis', 'appetite')

+ 126 - 27
src/xt_pages/supply/components/addGoodOrder.vue View File

@@ -71,9 +71,7 @@
71 71
             v-show="showTwo"
72 72
             >保存</el-button
73 73
           >
74
-          <el-button size="small" type="primary" @click="checkPurchaseOrder"
75
-            >审核</el-button
76
-          >
74
+          <el-button size="small" type="primary" @click="checkGoodOrder" >审核</el-button>
77 75
         </div>
78 76
       </div>
79 77
 
@@ -449,6 +447,9 @@ import {
449 447
   getPurchaseOrderInfo,
450 448
   addGoodOrder,
451 449
   updateGoodOrder,
450
+  checkGoodOrderById,
451
+  getGoodOrderCountList,
452
+  ModefySupplyWarehousing
452 453
 } from "@/api/supply";
453 454
 export default {
454 455
   name: "addPurchaseOrder",
@@ -527,6 +528,7 @@ export default {
527 528
       showTwo: false,
528 529
       warese_out_id: 0,
529 530
       return_remark: "",
531
+      is_warehouse:0
530 532
     };
531 533
   },
532 534
   methods: {
@@ -631,11 +633,7 @@ export default {
631 633
                 goodList[i].good_type_id = this.goodTypeList[y].type_name;
632 634
               }
633 635
             }
634
-            goodList[i].supply_name =
635
-              goodList[i].good_name +
636
-              " " +
637
-              goodList[i].specification_name +
638
-              " " +
636
+            goodList[i].supply_name =goodList[i].good_name +" " +goodList[i].specification_name + " " +
639 637
               goodList[i].manufacturer;
640 638
             goodList[i].supply_type = goodList[i].good_type_id;
641 639
             goodList[i].supply_specification_name =
@@ -817,13 +815,12 @@ export default {
817 815
     count_arrearage() {
818 816
       this.payment = this.total_price - this.arrearage;
819 817
     },
820
-    checkPurchaseOrder(id, index) {
818
+    checkPurchaseOrder() {
821 819
       this.$confirm("是否审核?", {
822 820
         confirmButtonText: "确 定",
823 821
         cancelButtonText: "取 消",
824 822
         type: "warning",
825
-      })
826
-        .then(() => {
823
+      }).then(() => {
827 824
           checkPurchaseOrder(this.id).then((response) => {
828 825
             if (response.data.state == 1) {
829 826
               var info = response.data.data.info;
@@ -949,19 +946,7 @@ export default {
949 946
             stockIn: this.recordInfo.tableList,
950 947
             return_remake: this.return_remark,
951 948
           };
952
-          console.log("stockIN2323322332322323", params);
953
-
954
-          addGoodOrder(
955
-            params,
956
-            this.supplier_name,
957
-            start,
958
-            this.arrearage,
959
-            this.payment,
960
-            warehousing_id,
961
-            this.number,
962
-            this.rate_of_concession,
963
-            this.discount_amount
964
-          ).then((response) => {
949
+          addGoodOrder( params,this.supplier_name,start,this.arrearage,this.payment, warehousing_id,this.number,this.rate_of_concession,this.discount_amount).then((response) => {
965 950
             if (response.data.state == 1) {
966 951
               this.loading = false;
967 952
               this.$message.success("保存成功!");
@@ -977,6 +962,7 @@ export default {
977 962
               this.arrearage = warehouseOut.arrearage;
978 963
               this.supplier_name = warehouseOut.supplier_id;
979 964
               this.return_remake = warehouseOut.return_remake;
965
+              this.warehousing_id  = warehouseOut.warehousing_id
980 966
               this.start_time = this.getTimes(warehouseOut.document_date);
981 967
               for (let i = 0; i < orderInfo.length; i++) {
982 968
                 orderInfo[i].supply_count = orderInfo[i].count;
@@ -1042,7 +1028,6 @@ export default {
1042 1028
         this.loading = false;
1043 1029
         return false;
1044 1030
       }
1045
-      console.log("表哥2323233232", this.recordInfo.tableList);
1046 1031
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
1047 1032
         this.recordInfo.tableList[i].supply_count = parseInt(
1048 1033
           this.recordInfo.tableList[i].supply_count
@@ -1080,8 +1065,7 @@ export default {
1080 1065
             stockIn: this.recordInfo.tableList,
1081 1066
             return_remake: this.return_remake,
1082 1067
           };
1083
-          console.log("sotckind23232232323232323232", params);
1084
-
1068
+         
1085 1069
           updateGoodOrder(
1086 1070
             params,
1087 1071
             this.supplier_name,
@@ -1102,6 +1086,121 @@ export default {
1102 1086
         }
1103 1087
       });
1104 1088
     },
1089
+    checkGoodOrder() {
1090
+      var id = this.warese_out_id;
1091
+      var warehousing_id = this.warehousing_id;
1092
+      console.log("hhh2323232323232323",id,warehousing_id)
1093
+      getGoodOrderCountList(id, warehousing_id).then((response) => {
1094
+        if (response.data.state == 1) {
1095
+          this.$message.success("审核成功!");
1096
+          this.is_check = 1
1097
+          this.showOne = false;
1098
+          this.showTwo = true;
1099
+          this.showThree = true;
1100
+          var purcaseOrder = response.data.data.purcaseOrder;
1101
+          console.log("采购订单", purcaseOrder);
1102
+
1103
+          var goodOrder = response.data.data.goodOrder;
1104
+          console.log("采购单", goodOrder);
1105
+          var drugList = response.data.data.drugList;
1106
+          console.log("druglist23323223", drugList);
1107
+          var is_warehouse = 0;
1108
+          for (let i = 0; i < purcaseOrder.length; i++) {
1109
+            for (let j = 0; j < drugList.length; j++) {
1110
+              if (purcaseOrder[i].is_source == 1) {
1111
+                if (purcaseOrder[i].supply_unit == drugList[j].max_unit) {
1112
+                  purcaseOrder[i].count =
1113
+                    purcaseOrder[i].count * drugList[j].min_number;
1114
+                }
1115
+              }
1116
+            }
1117
+          }
1118
+
1119
+          for (let i = 0; i < goodOrder.length; i++) {
1120
+            for (let j = 0; j < drugList.length; j++) {
1121
+              if (goodOrder[i].is_source == 1) {
1122
+                if (goodOrder[i].supply_unit == drugList[j].max_unit) {
1123
+                  goodOrder[i].count =
1124
+                    goodOrder[i].count * drugList[j].min_number;
1125
+                }
1126
+              }
1127
+            }
1128
+          }
1129
+
1130
+          let objInfo = {};
1131
+          if (goodOrder.length > 0) {
1132
+            goodOrder.forEach((item, index) => {
1133
+              let { project_id } = item;
1134
+              if (!objInfo[project_id]) {
1135
+                objInfo[project_id] = {
1136
+                  project_id,
1137
+                  child: [],
1138
+                  count: 0,
1139
+                };
1140
+              }
1141
+            });
1142
+            let newArr = Object.values(objInfo);
1143
+
1144
+            for (let i = 0; i < goodOrder.length; i++) {
1145
+              for (let j = 0; j < newArr.length; j++) {
1146
+                if (goodOrder[i].project_id == newArr[j].project_id) {
1147
+                  newArr[j].child.push(goodOrder[i]);
1148
+                }
1149
+              }
1150
+            }
1151
+            console.log("newAr2332232323", newArr);
1152
+
1153
+            for (let i = 0; i < newArr.length; i++) {
1154
+              for (let j = 0; j < newArr[i].child.length; j++) {
1155
+                newArr[i].count += newArr[i].child[j].count;
1156
+              }
1157
+            }
1158
+
1159
+            var arr = [];
1160
+            var total = 0;
1161
+            var str = "";
1162
+
1163
+            //如果采购单有数据,则需要比较数量
1164
+            if (newArr.length > 0) {
1165
+              for (let i = 0; i < purcaseOrder.length; i++) {
1166
+                for (let j = 0; j < newArr.length; j++) {
1167
+                  if (purcaseOrder[i].project_id == newArr[j].project_id) {
1168
+                    //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,部分入库
1169
+                    if (purcaseOrder[i].count > newArr[j].count) {
1170
+                      arr.push(purcaseOrder[i].project_id);
1171
+                    }
1172
+                  }
1173
+                }
1174
+              }
1175
+              //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成,全部入库
1176
+
1177
+              if (arr.length == 0) {
1178
+                this.is_warehouse = 1;
1179
+                this.ModefySupplyWarehousing(is_warehouse, warehousing_id);
1180
+              }
1181
+
1182
+              //部分入库
1183
+              if (total != goodOrder.length) {
1184
+                //修改订购单
1185
+                this.is_warehouse = 3;
1186
+                this.ModefySupplyWarehousing(is_warehouse, warehousing_id);
1187
+              }
1188
+            }
1189
+          }
1190
+        }
1191
+      });
1192
+    },
1193
+    ModefySupplyWarehousing(is_warehouse, warehousing_id) {
1194
+      var params = {
1195
+        is_warehouse: this.is_warehouse,
1196
+        warehousing_id: this.warehousing_id,
1197
+      };
1198
+      ModefySupplyWarehousing(params).then((response) => {
1199
+        if (response.data.state == 1) {
1200
+          var msg = response.data.data.msg;
1201
+        }
1202
+      });
1203
+    },
1105 1204
   },
1106 1205
   created() {
1107 1206
     const tempObj = {};

+ 96 - 88
src/xt_pages/supply/components/addGoodReturn.vue View File

@@ -40,22 +40,8 @@
40 40
             align="right"
41 41
             format="yyyy-MM-dd"
42 42
             value-format="yyyy-MM-dd"
43
-            @change="startTimeChange"
44 43
           ></el-date-picker>
45
-          <!-- <span>交货日期:</span>
46
-        <el-date-picker
47
-            size="small"
48
-            v-model="end_time"
49
-            prefix-icon="el-icon-date"
50
-            :editable="false"
51
-            style="width: 196px;"
52
-            type="date"
53
-            placeholder="选择日期时间"
54
-            align="right"
55
-            format="yyyy-MM-dd"
56
-            value-format="yyyy-MM-dd"
57
-            @change="endTimeChange"
58
-        ></el-date-picker> -->
44
+         
59 45
           <span>单据编码:{{ number }}</span>
60 46
         </div>
61 47
         <div>
@@ -69,11 +55,11 @@
69 55
           <el-button
70 56
             size="small"
71 57
             type="primary"
72
-            @click=""
58
+            @click="updateGoodReturn"
73 59
             v-show="showTwo"
74 60
             >保存</el-button
75 61
           >
76
-          <el-button size="small" type="primary" @click="updatePurchaseOrder">审核</el-button>
62
+          <el-button size="small" type="primary" @click="checkReturnOrder">审核</el-button>
77 63
           <!-- <el-button size="small" type="primary" @click="toPrint">打印</el-button>
78 64
         <el-button size="small" type="primary" v-if="is_check == 2" @click="checkPurchaseOrder">审核</el-button>
79 65
         <el-button size="small" type="primary" v-if="is_check == 1" @click="checkPurchaseOrder">反审核</el-button> -->
@@ -133,6 +119,7 @@
133 119
                 :disabled="true"
134 120
                 placeholder="商品类别"
135 121
               ></el-input>
122
+               <div style="visibility: hidden">/</div>
136 123
             </template>
137 124
           </el-table-column>
138 125
           <el-table-column label="规格&单位" align="center" width="200px">
@@ -143,6 +130,7 @@
143 130
                 :disabled="true"
144 131
                 placeholder="规格&单位"
145 132
               ></el-input>
133
+               <div style="visibility: hidden">/</div>
146 134
             </template>
147 135
           </el-table-column>
148 136
 
@@ -162,12 +150,12 @@
162 150
                   placeholder="请选择"
163 151
                   :disabled="disabled"
164 152
                 >
165
-                  <!-- <el-option
166
-                            v-for="(item,index) in scope.row.unitList"
167
-                            :key="index"
168
-                            :label="item.name"
169
-                            :value="item.name">
170
-                        </el-option> -->
153
+                  <el-option
154
+                    v-for="(item,index) in scope.row.unitList"
155
+                    :key="index"
156
+                    :label="item.name"
157
+                    :value="item.name">
158
+                   </el-option>
171 159
                 </el-select>
172 160
               </el-form-item>
173 161
             </template>
@@ -179,16 +167,18 @@
179 167
                 style="width: 100px"
180 168
                 :disabled="true"
181 169
               ></el-input>
170
+               <div style="visibility: hidden">/</div>
182 171
             </template>
183 172
           </el-table-column>
184 173
           <el-table-column label="可退数量" align="center" width="200px">
185 174
             <template slot-scope="scope">
186 175
               <el-input
187
-                v-model="scope.row.supply_specification_name"
176
+                v-model="scope.row.count"
188 177
                 style="width: 150px"
189 178
                 :disabled="true"
190 179
                 placeholder="可退数量"
191 180
               ></el-input>
181
+               <div style="visibility: hidden">/</div>
192 182
             </template>
193 183
           </el-table-column>
194 184
           <el-table-column label="数量" align="center" width="120px">
@@ -217,6 +207,7 @@
217 207
                 :disabled="disabled"
218 208
                 placeholder="请输入采购单价"
219 209
               ></el-input>
210
+               <div style="visibility: hidden">/</div>
220 211
             </template>
221 212
           </el-table-column>
222 213
 
@@ -244,6 +235,7 @@
244 235
                 style="width: 160px"
245 236
                 :disabled="true"
246 237
               ></el-input>
238
+               <div style="visibility: hidden">/</div>
247 239
             </template>
248 240
           </el-table-column>
249 241
 
@@ -254,16 +246,18 @@
254 246
                 style="width: 160px"
255 247
                 :disabled="true"
256 248
               ></el-input>
249
+               <div style="visibility: hidden">/</div>
257 250
             </template>
258 251
           </el-table-column>
259 252
 
260
-          <el-table-column label="源购订单号" align="center" width="200px">
253
+          <el-table-column label="源购订单号" align="center" width="200px">
261 254
             <template slot-scope="scope">
262 255
               <el-input
263 256
                 v-model="scope.row.good_number"
264 257
                 style="width: 160px"
265 258
                 :disabled="true"
266 259
               ></el-input>
260
+               <div style="visibility: hidden">/</div>
267 261
             </template>
268 262
           </el-table-column>
269 263
 
@@ -275,6 +269,7 @@
275 269
                 :disabled="disabled"
276 270
                 placeholder="请输入备注"
277 271
               ></el-input>
272
+               <div style="visibility: hidden">/</div>
278 273
             </template>
279 274
           </el-table-column>
280 275
 
@@ -376,6 +371,8 @@ import {
376 371
   getInitOrder,
377 372
   getGoodOrderDetail,
378 373
   saveGoodReturnOrder,
374
+  checkReturnOrder,
375
+  updateGoodReturn
379 376
 } from "@/api/supply";
380 377
 export default {
381 378
   name: "addPurchaseOrder",
@@ -386,7 +383,7 @@ export default {
386 383
     return {
387 384
       tipsInfo: "",
388 385
       crumbs: [
389
-        { path: false, name: "货单" },
386
+        { path: false, name: "退货单" },
390 387
         { path: "/good/return/add", name: "新增退货单" },
391 388
       ],
392 389
       showTwo: false,
@@ -435,6 +432,7 @@ export default {
435 432
       is_check: 0,
436 433
       dialogVisible: false,
437 434
       return_remark: "",
435
+      warehouse_out_id:0,
438 436
     };
439 437
   },
440 438
   methods: {
@@ -603,6 +601,7 @@ export default {
603 601
       tempObj["supply_type"] = "";
604 602
       tempObj["supply_specification_name"] = "";
605 603
       tempObj["supply_total"] = "";
604
+      tempObj["count"] = "";
606 605
       tempObj["supply_count"] = "";
607 606
       tempObj["supply_price"] = "";
608 607
       tempObj["supply_total_price"] = "";
@@ -614,6 +613,11 @@ export default {
614 613
       tempObj["project_id"] = 0;
615 614
       tempObj["supply_unit"] = "";
616 615
       tempObj["order_number"] = ""
616
+      tempObj["supply_batch_number"] = ""
617
+      tempObj["supply_product_date"] = ""
618
+      tempObj["supply_expiry_date"] = ""
619
+      tempObj["warehousing_id"] =0
620
+      tempObj["warehouse_info_id"] =0
617 621
       this.recordInfo.tableList.push(tempObj);
618 622
     },
619 623
     handleDelete: function (index, row) {
@@ -624,12 +628,6 @@ export default {
624 628
         this.recordInfo.tableList.splice(index, 1);
625 629
       }
626 630
     },
627
-
628
-    changeTypeName() {},
629
-    startTimeChange() {},
630
-    endTimeChange() {},
631
-    search() {},
632
-
633 631
     getWarehoseInfo(arr, max_unit, min_unit, min_number) {
634 632
       var total = 0;
635 633
       var max_str = "";
@@ -678,53 +676,7 @@ export default {
678 676
       }
679 677
       return uParseTime(time, "{y}-{m}-{d}");
680 678
     },
681
-    updatePurchaseOrder() {
682
-      this.loading = true;
683
-      if (this.supplier_name == 0 || this.supplier_name == "") {
684
-        this.$message.error("供应商不能为空!");
685
-        this.loading = false;
686
-        return false;
687
-      }
688
-      this.$refs["tableForm"].validate((valid) => {
689
-        if (valid) {
690
-          for (let i = 0; i < this.recordInfo.tableList.length; i++) {
691
-            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count);
692
-            this.recordInfo.tableList[i].supply_license_number =this.recordInfo.tableList[i].supply_license_number.toString();
693
-            this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count *this.recordInfo.tableList[i].supply_price).toString();
694
-            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString();
695
-            this.recordInfo.tableList[i].supply_price =this.recordInfo.tableList[i].supply_price.toString();
696
-            for (let j = 0; j < this.manufactuerList.length; j++) {
697
-              if (this.recordInfo.tableList[i].supply_manufacturer ==this.manufactuerList[j].manufacturer_name) {
698
-                this.recordInfo.tableList[i].manufacturer_id =this.manufactuerList[j].id;
699
-              }
700
-            }
701
-          }
702
-          var start = this.getTimes(this.start_time);
703
-          var end = this.getTimes(this.end_time);
704
-          const params = {
705
-            stockIn: this.recordInfo.tableList,
706
-          };
707
-          console.log("param23232332", params);
708
-
709
-          updatePurchaseOrder(
710
-            params,
711
-            this.supplier_name,
712
-            start,
713
-            end,
714
-            this.rate_of_concession,
715
-            this.discount_amount,
716
-            this.id,
717
-            this.number
718
-          ).then((response) => {
719
-            if (response.data.state == 1) {
720
-              this.loading = false;
721
-              var warehousingInfo = response.data.data.warehousingInfo;
722
-              this.$message.success("保存成功!");
723
-            }
724
-          });
725
-        }
726
-      });
727
-    },
679
+   
728 680
     getAllPrice() {
729 681
       var total_price = 0;
730 682
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
@@ -795,6 +747,7 @@ export default {
795 747
           var goodList = response.data.data.goodList;
796 748
           for (let i = 0; i < orderInfo.length; i++) {
797 749
             orderInfo[i].supply_count = orderInfo[i].count;
750
+            orderInfo[i].count = orderInfo[i].count
798 751
             orderInfo[i].supply_price = orderInfo[i].price;
799 752
             orderInfo[i].supply_remake = orderInfo[i].remark;
800 753
             orderInfo[i].type = orderInfo[i].is_source;
@@ -802,15 +755,12 @@ export default {
802 755
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
803 756
             orderInfo[i].order_number = orderInfo[i].order_number;
804 757
             orderInfo[i].good_number = orderInfo[i].good_number;
805
-            orderInfo[i].supply_total_price = (
806
-              orderInfo[i].count * orderInfo[i].price
807
-            ).toFixed(2);
808
-            orderInfo[i].supply_expiry_date = this.getTimes(
809
-              orderInfo[i].supply_expiry_date
810
-            );
811
-            orderInfo[i].supply_product_date = this.getTimes(
812
-              orderInfo[i].supply_product_date
813
-            );
758
+            orderInfo[i].supply_total_price = ( orderInfo[i].count * orderInfo[i].price).toFixed(2);
759
+            orderInfo[i].supply_expiry_date = orderInfo[i].supply_expiry_date;
760
+            orderInfo[i].supply_product_date = orderInfo[i].supply_product_date;
761
+            orderInfo[i].supply_batch_number = orderInfo[i].supply_batch_number
762
+            orderInfo[i].warehousing_id = orderInfo[i].warehousing_id
763
+            orderInfo[i].warehouse_info_id = orderInfo[i].warehouse_info_id
814 764
             if (orderInfo[i].is_source == 1) {
815 765
               for (let j = 0; j < drugList.length; j++) {
816 766
                 if (orderInfo[i].project_id == drugList[j].id) {
@@ -865,6 +815,7 @@ export default {
865 815
                 this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name;
866 816
               }
867 817
             }
818
+          } 
868 819
            var params = {
869 820
             stockIn:this.recordInfo.tableList,
870 821
             return_marke:this.return_remark,
@@ -880,6 +831,7 @@ export default {
880 831
                 var warehouseCancel = response.data.data.warehouseCancel
881 832
                 var out = response.data.data.cancelOrder
882 833
                 this.id = out.id
834
+                this.warehouse_out_id = out.warehouse_out_id
883 835
                 this.supplier_name = out.supplier_id
884 836
                 this.rate_of_concession = out.rate_of_concession
885 837
                 this.discount_amount = out.discount_amount
@@ -929,9 +881,59 @@ export default {
929 881
                 }
930 882
              }
931 883
            })
884
+          
885
+        }
886
+      })
887
+    },
888
+    updateGoodReturn(){
889
+      var warehouse_out_id = this.id;
890
+      this.$refs["tableForm"].validate((valid)=>{
891
+        if(valid){
892
+          this.loading = true
893
+          for(let i=0;i<this.recordInfo.tableList.length;i++){
894
+            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
895
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
896
+            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
897
+            
898
+            for(let j=0;j<this.manufactuerList.length;j++){
899
+                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
900
+                  this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
901
+                }
902
+                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id){
903
+                  this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name
904
+                }
905
+
906
+            }
932 907
           }
908
+          var params = {
909
+            stockIn:this.recordInfo.tableList,
910
+            return_marke:this.return_remark,
911
+          }
912
+          console.log("start_time232233232",this.start_time)
913
+          console.log("arrage2323322323",params)
914
+          updateGoodReturn(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name,this.number).then(response=>{
915
+            if(response.data.state == 1){
916
+               var msg = response.data.msg
917
+               this.loading = false
918
+               this.$message.success("保存成功!")
919
+            }
920
+          })
933 921
         }
934 922
       })
923
+    },
924
+    checkReturnOrder(){
925
+      this.loading = true
926
+     var params = {
927
+       warehouse_out_id:this.warehouse_out_id,
928
+       id:this.id,
929
+     }
930
+     checkReturnOrder(params).then(response=>{
931
+       if(response.data.state == 1){
932
+        this.loading = false
933
+        var msg = response.data.data.msg
934
+        this.$message.success("保存成功!")
935
+       }
936
+     })
935 937
     }
936 938
    
937 939
   },
@@ -954,6 +956,12 @@ export default {
954 956
     tempObj["project_id"] = 0;
955 957
     tempObj["supply_unit"] = "";
956 958
     tempObj["order_number"] = ""
959
+    tempObj["supply_batch_number"] = ""
960
+    tempObj["supply_product_date"] = ""
961
+    tempObj["supply_expiry_date"] = ""
962
+    tempObj["warehousing_id"] =0
963
+    tempObj["warehouse_info_id"] =0
964
+    tempObj["count"] = "";
957 965
     this.recordInfo.tableList.push(tempObj);
958 966
     console.log("即哪里地方2",this.recordInfo.tableList)
959 967
     this.getInitOrder();

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

@@ -211,19 +211,19 @@
211 211
             </template>
212 212
           </el-table-column>
213 213
 
214
-          <el-table-column label="购单价" align="center" width="140px">
214
+          <el-table-column label="购单价" align="center" width="140px">
215 215
             <template slot-scope="scope">
216 216
               <el-input
217 217
                 v-model="scope.row.supply_price"
218 218
                 style="width: 80px"
219 219
                 :disabled="disabled"
220
-                 placeholder="请输入购单价"
220
+                 placeholder="请输入购单价"
221 221
               ></el-input>
222 222
               <div style="visibility: hidden">/</div>
223 223
             </template>
224 224
           </el-table-column>
225 225
 
226
-          <el-table-column label="购金额" align="center" width="120px">
226
+          <el-table-column label="购金额" align="center" width="120px">
227 227
             <template slot-scope="scope">
228 228
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
229 229
             </template>
@@ -369,8 +369,8 @@ export default {
369 369
     return {
370 370
       Reviewed:false,
371 371
       crumbs: [
372
-        { path: false, name: "购订单" },
373
-        { path: "/spply/query", name: "新增购订单" },
372
+        { path: false, name: "购订单" },
373
+        { path: "/spply/query", name: "新增购订单" },
374 374
       ],
375 375
       showTwo: true,
376 376
       showOne: false,

+ 52 - 59
src/xt_pages/supply/components/addSupply.vue View File

@@ -11,51 +11,61 @@
11 11
         ref="supplier"
12 12
       >
13 13
         <el-row>
14
-          <el-col span="6">
14
+          <el-col :span="6">
15 15
             <el-form-item label="供应商编码" prop="supplierCode">
16 16
               <el-input v-model="supplier.supplierCode"></el-input>
17 17
             </el-form-item>
18 18
           </el-col>
19
-          <el-col span="6">
19
+          <el-col :span="6">
20 20
             <el-form-item label="供应商名称" prop="supplierName">
21 21
               <el-input v-model="supplier.supplierName"></el-input>
22 22
             </el-form-item>
23 23
           </el-col>
24 24
         </el-row>
25 25
         <el-row>
26
-          <el-col span="6">
26
+          <el-col :span="6">
27 27
             <el-form-item label="供应商类别" prop="supplierType">
28 28
               <!-- <el-input v-model="supplier.type"></el-input> -->
29
-              <el-autocomplete
29
+              <!-- <el-autocomplete
30 30
                 v-model="supplier.supplierType"
31 31
                 :fetch-suggestions="querySearchAsync"
32 32
                 @select="handleSelect"
33
-              ></el-autocomplete>
33
+              ></el-autocomplete> -->
34
+
35
+              <el-select v-model="supplier.supplierType" @select="handleSelect">
36
+                <el-option
37
+                  v-for="item in supplierType"
38
+                  :key="item.value"
39
+                  :label="item.label"
40
+                  :value="item.value"
41
+                >
42
+                </el-option>
43
+              </el-select>
34 44
             </el-form-item>
35 45
           </el-col>
36
-          <el-col span="6">
46
+          <el-col :span="6">
37 47
             <el-form-item label="增值税税率" prop="vatRate">
38 48
               <el-input
39 49
                 v-model="supplier.vatRate"
40 50
                 @keyup.native="supplier.vatRate = oninput(supplier.vatRate)"
41
-              ></el-input>
51
+              ></el-input>%
42 52
             </el-form-item>
43 53
           </el-col>
44 54
         </el-row>
45 55
         <el-row>
46
-          <el-col span="6">
56
+          <el-col :span="6">
47 57
             <el-form-item label="纳税人识别号" prop="number">
48 58
               <el-input v-model="supplier.number"></el-input>
49 59
             </el-form-item>
50 60
           </el-col>
51
-          <el-col span="6">
61
+          <el-col :span="6">
52 62
             <el-form-item label="开户银行" prop="bank">
53 63
               <el-input v-model="supplier.bank"></el-input>
54 64
             </el-form-item>
55 65
           </el-col>
56 66
         </el-row>
57 67
         <el-row>
58
-          <el-col span="6">
68
+          <el-col :span="6">
59 69
             <el-form-item label="银行账号" prop="bankAccount">
60 70
               <el-input v-model="supplier.bankAccount"></el-input>
61 71
             </el-form-item>
@@ -91,7 +101,7 @@
91 101
                         {
92 102
                           required: 'true',
93 103
                           message: '请输入主要联系人',
94
-                          trigger: ['blur', 'change'],
104
+                          trigger: ['blur'],
95 105
                         },
96 106
                       ]
97 107
                     : null
@@ -227,6 +237,7 @@ export default {
227 237
       supplier_ids: "",
228 238
       title: "",
229 239
       Template,
240
+      supplierType: [],
230 241
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
231 242
       list: ["001", "002"],
232 243
       // 表单验证规则
@@ -297,8 +308,10 @@ export default {
297 308
         this.initSupplierData();
298 309
         this.show_type = 1;
299 310
         this.title = "新增供应商";
311
+        this.getsupplytype();
300 312
         this.dialogVisible = true;
301 313
       } else if (type == 2) {
314
+        this.getsupplytype();
302 315
         // console.log(data,'oop')
303 316
         this.show_type = 2;
304 317
         this.supplier_ids = data.ID;
@@ -306,6 +319,7 @@ export default {
306 319
         this.supplier.supplierCode = data.SupplierCode;
307 320
         this.supplier.supplierName = data.SupplierName;
308 321
         this.supplier.supplierType = data.SupplierType;
322
+
309 323
         this.supplier.vatRate = data.VatRate;
310 324
         this.supplier.number = data.Number;
311 325
         this.supplier.bank = data.Bank;
@@ -363,35 +377,17 @@ export default {
363 377
       });
364 378
     },
365 379
 
366
-    querySearchAsync(queryString, cb) {
367
-      clearTimeout(this.timeout);
368
-      var results = [];
369
-      if (queryString == "") {
370
-        cb(results);
371
-      } else {
372
-        // 获取供应商类别接口
373
-        getsupplytype()
374
-          .then((res) => {
375
-            if (res.status == 200) {
376
-              var result = res.data.data.list;
377
-              //远程搜索需要的数组
378
-              for (let i = 0; i < result.length; i++) {
379
-                const element = result[i];
380
-                results.push({
381
-                  value: element.name,
382
-                  name: element.value,
383
-                });
384
-              }
385
-              cb(results);
386
-            } else {
387
-              results = [];
388
-              cb(results);
389
-            }
390
-          })
391
-          .catch((err) => {
392
-            console.log(err);
393
-          });
394
-      }
380
+    getsupplytype() {
381
+      // 获取供应商类别接口
382
+      getsupplytype()
383
+        .then((res) => {
384
+          if (res.status == 200) {
385
+            this.supplierType = res.data.data.list;
386
+          }
387
+        })
388
+        .catch((err) => {
389
+          console.log(err);
390
+        });
395 391
     },
396 392
 
397 393
     handleSelect(item) {
@@ -429,11 +425,11 @@ export default {
429 425
                 };
430 426
                 savesupply(params).then((res) => {
431 427
                   if (res.data.state == 1) {
432
-                    this.$message.success("修改成功");
428
+                    this.$message.success("新增成功");
433 429
                     this.closePop();
434 430
                     this.$emit("init");
435 431
                   } else {
436
-                    this.$message.error("修改失败");
432
+                    this.$message.error("新增失败");
437 433
                     setTimeout(() => {
438 434
                       this.closePop();
439 435
                     }, 2000);
@@ -466,7 +462,7 @@ export default {
466 462
                 let params = {
467 463
                   suppliercode: this.supplier.supplierCode || "",
468 464
                   suppliername: this.supplier.supplierName || "",
469
-                  id: this.supplier.id|| 0,
465
+                  id: this.supplier_ids || 0,
470 466
                   suppliertype: this.supplier.supplierType || "",
471 467
                   vatrate: this.supplier.vatRate || 0,
472 468
                   number: this.supplier.number || "",
@@ -511,23 +507,17 @@ export default {
511 507
           if (this.recordInfo.contacts.length == 0) {
512 508
             this.recordInfo.contacts = [{}];
513 509
             this.recordInfo.contacts[0].is_first = data.value;
514
-          } else if (this.recordInfo.contacts.length == 1) {
515
-            let val = res.data.data.contact[0];
516
-            this.recordInfo.contacts[0].is_first = data.value;
517
-            this.recordInfo.contacts[0] = {
518
-              id: val.id,
519
-              name: val.name,
520
-              address: val.address,
521
-              phone: val.phone,
522
-            };
523
-            this.$forceUpdate();
524
-          } else {
525
-            this.recordInfo.contacts.forEach((o) => {
526
-              if (o.isfirst == 0) {
527
-              } else if (o.isfirst == 1) {
528
-              }
529
-            });
530 510
           }
511
+          // else if (this.recordInfo.contacts.length == 1) {
512
+          //     let val = res.data.data.contact[0];
513
+          //     this.recordInfo.contacts[0].is_first = data.value;
514
+          //     this.recordInfo.contacts[0] = {
515
+          //       id: parseFloat(val.id),
516
+          //       name: val.name,
517
+          //       address: val.address,
518
+          //       phone: val.phone,
519
+          //     };
520
+          //   }
531 521
         }
532 522
       });
533 523
     },
@@ -639,6 +629,9 @@ export default {
639 629
     .el-autocomplete {
640 630
       width: 75% !important;
641 631
     }
632
+    .el-select.el-select--medium {
633
+      width: 70% !important;
634
+    }
642 635
   }
643 636
 }
644 637
 

+ 62 - 30
src/xt_pages/supply/components/editGoodOrder.vue View File

@@ -448,6 +448,7 @@ import {
448 448
   MofyGoodOrder,
449 449
   UpdateSupplyWahouseingInfo,
450 450
   getSupplyWarehouseOutById,
451
+  deleteGoodOrderById
451 452
 } from "@/api/supply";
452 453
 
453 454
 export default {
@@ -711,12 +712,39 @@ export default {
711 712
       tempObj["good_number"] = "";
712 713
       this.recordInfo.tableList.push(tempObj);
713 714
     },
714
-    handleDelete: function (index, row) {
715
-      if (this.recordInfo.tableList.length <= 1) {
715
+    handleDelete: function (index, row) { 
716
+      if(this.is_check == 1){
717
+        this.$message.error("已审核单据,不能删除!")
718
+        return false
719
+      }
720
+      if(row.id == 0){
721
+        if (this.recordInfo.tableList.length <= 1) {
716 722
         this.$message.error("只有一条记录的时候无法删除");
717 723
         return;
718 724
       } else {
719 725
         this.recordInfo.tableList.splice(index, 1);
726
+       }
727
+      }else{
728
+         const params = {
729
+            id: row.id
730
+          }
731
+          this.$confirm('确认删除吗?', {
732
+            confirmButtonText: '确定',
733
+            cancelButtonText: '取消',
734
+            type: 'warning'
735
+          }).then(() => {
736
+            deleteGoodOrderById(params).then(response => {
737
+              if (response.data.state == 0) {
738
+                this.$message.error(response.data.msg)
739
+                return false
740
+              } else {
741
+                this.$message.success('删除成功')
742
+
743
+                this.recordInfo.tableList.splice(index, 1)
744
+              }
745
+            })
746
+          }).catch(() => {
747
+        })
720 748
       }
721 749
     },
722 750
 
@@ -931,19 +959,10 @@ export default {
931 959
           var params = {
932 960
             stockIn: this.recordInfo.tableList,
933 961
             return_remake: this.return_remark,
934
-          };
935
-          updateGoodOrder(
936
-            params,
937
-            this.supplier_name,
938
-            start,
939
-            this.arrearage,
940
-            this.payment,
941
-            warehose_out_id,
942
-            this.number,
943
-            this.rate_of_concession,
944
-            this.discount_amount,
945
-            this.good_number
946
-          ).then((response) => {
962
+          }
963
+          console.log("param23322332323",params)
964
+        
965
+          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) => {
947 966
             if (response.data.state == 1) {
948 967
               this.loading = false;
949 968
               this.$message.success("保存成功!");
@@ -1076,17 +1095,18 @@ export default {
1076 1095
       getSupplyWarehouseOutById(id).then((response) => {
1077 1096
         if (response.data.state == 1) {
1078 1097
           var cancelList = response.data.data.cancelList;
1079
-          console.log("cancelList23232232323323223", cancelList);
1098
+          console.log("退库单", cancelList);
1080 1099
            var drugList = response.data.data.drugList;
1081
-          console.log("drugList233223232323232", drugList);
1100
+          console.log("药品列表", drugList);
1082 1101
           var cancelOrderList = response.data.data.cancelOrderList;
1083
-          console.log("cancelOrderList2323322322332", cancelOrderList);
1102
+          console.log("退库单详情", cancelOrderList);
1084 1103
           var ids =""
1085 1104
           if(cancelList.length == 0){
1086 1105
             this.$router.push({ path: "/good/return/add?id=" + this.id+"&ids="+ids });
1087 1106
           }
1088 1107
           if (cancelList.length > 0) {
1089 1108
             var outList = response.data.data.outList;
1109
+            console.log("购货单2322323",outList)
1090 1110
             for(let i=0;i<outList.length;i++){
1091 1111
               if(outList[i].is_source == 1){
1092 1112
                 for(let j=0;j<drugList.length;j++){
@@ -1103,13 +1123,17 @@ export default {
1103 1123
             for(let i=0;i<cancelOrderList.length;i++){
1104 1124
              if(cancelOrderList[i].is_source == 1){
1105 1125
                 for(let j=0;j<drugList.length;j++){
1106
-                  if(cancelOrderList[i].supply_unit == drugList[j].max_unit){
1107
-                    cancelOrderList[i].count = cancelOrderList[i].count * drugList[j].min_number
1126
+                  if(cancelOrderList[i].project_id == drugList[j].id){
1127
+                    if(cancelOrderList[i].supply_unit == drugList[j].max_unit){
1128
+                      cancelOrderList[i].count = cancelOrderList[i].count * drugList[j].min_number
1129
+                    }
1108 1130
                   }
1109 1131
                  }
1110 1132
                }
1111 1133
             }
1112
-            
1134
+
1135
+            console.log("数据变了后23323233",outList)
1136
+           
1113 1137
             let objInfo = {};
1114 1138
             if(cancelOrderList.length >0){
1115 1139
               cancelOrderList.forEach((item, index) => {
@@ -1123,15 +1147,22 @@ export default {
1123 1147
                 }
1124 1148
               });
1125 1149
               let newArr = Object.values(objInfo)
1126
-
1127
-              console.log("outList2332232332", outList)
1150
+              console.log("最好的输3233232323323223", newArr)
1151
+              console.log("数据变了后23323233",cancelOrderList)
1128 1152
               for (let i = 0; i < cancelOrderList.length; i++) {
1129 1153
                 for (let j = 0; j < newArr.length; j++) {
1130 1154
                   if (cancelOrderList[i].project_id == newArr[j].project_id) {
1131 1155
                     newArr[j].child.push(cancelOrderList[i])
1132 1156
                 }
1133 1157
               }
1134
-              console.log("newAr2332232323", newArr)
1158
+              
1159
+             } 
1160
+
1161
+            for (let i = 0; i < newArr.length; i++) {
1162
+              for (let j = 0; j < newArr[i].child.length; j++) {
1163
+                newArr[i].count += newArr[i].child[j].count;
1164
+              }
1165
+            }
1135 1166
            
1136 1167
             var arr = []
1137 1168
             var total = 0;
@@ -1143,7 +1174,7 @@ export default {
1143 1174
                   if (outList[i].project_id == newArr[j].project_id) {
1144 1175
                     //根据商品ID比较数量大小,把数量不足的商品ID储存,表示退货单的数量未满足采购单的数据,可以继续生成退货单
1145 1176
                     if (outList[i].count > newArr[j].count) {
1146
-                      arr.push(outList[i].project_id);
1177
+                       arr.push(outList[i].project_id);
1147 1178
                     }
1148 1179
                   }
1149 1180
                 }
@@ -1151,16 +1182,16 @@ export default {
1151 1182
               //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1152 1183
 
1153 1184
               if (arr.length == 0) {
1154
-                this.$message.error("该订单已全部生成采购单,请知悉!");
1155
-                return;
1185
+                this.$message.error("该订单已全部生成退库单,请知悉!");
1186
+                return 
1156 1187
               }
1157
-
1158
-              if (total != cancelOrderList.length) {
1188
+              console.log("arr23323232232323",arr)
1189
+              if (arr.length > 0) {
1159 1190
                 str = arr.join(",");
1160 1191
                 this.$router.push({ path: "/good/return/edit?id=" + id + "&ids=" + str});
1161 1192
               }
1162 1193
              }
1163
-            }
1194
+         
1164 1195
           }
1165 1196
          }
1166 1197
         }
@@ -1180,6 +1211,7 @@ export default {
1180 1211
           var msg = response.data.data.msg;
1181 1212
           if (msg == 1) {
1182 1213
             this.$message.success("反审核成功!");
1214
+            return 
1183 1215
           }
1184 1216
           if (msg == 2) {
1185 1217
             var cancelList = response.data.data.cancelList

+ 273 - 97
src/xt_pages/supply/components/editGoodReturn.vue View File

@@ -60,7 +60,14 @@
60 60
         </div>
61 61
         <div>
62 62
           <el-button size="small" type="primary" @click="updateGoodReturn">保存</el-button>
63
-          <el-button size="small" type="primary" @click="updatePurchaseOrder">审核</el-button>
63
+          <el-button size="small" type="primary" @click="checkReturnOrder" v-if="is_check == 2">审核</el-button>
64
+          <el-button size="small" type="primary" @click="modefyReturnOrder" v-if="is_check == 1">反审核</el-button>
65
+          <el-button size="small" type="primary" @click="updateGoodReturn"
66
+            >保存</el-button
67
+          >
68
+          <el-button size="small" type="primary" @click="checkReturnOrder"
69
+            >审核</el-button
70
+          >
64 71
         </div>
65 72
       </div>
66 73
 
@@ -68,8 +75,8 @@
68 75
         <el-table
69 76
           :row-style="{ color: '#303133' }"
70 77
           :header-cell-style="{
71
-              backgroundColor: 'rgb(245, 247, 250)',
72
-              color: '#606266'
78
+            backgroundColor: 'rgb(245, 247, 250)',
79
+            color: '#606266',
73 80
           }"
74 81
           :data="recordInfo.tableList"
75 82
           :class="signAndWeighBoxPatients"
@@ -130,21 +137,30 @@
130 137
             </template>
131 138
           </el-table-column>
132 139
 
133
-        <el-table-column label="单位" align="center" width="120px">
140
+          <el-table-column label="单位" align="center" width="120px">
134 141
             <template slot="header" slot-scope="scope">
135
-                <span>单位<span style="color: red">*</span></span>
142
+              <span>单位<span style="color: red">*</span></span>
136 143
             </template>
137 144
             <template slot-scope="scope">
138
-              <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
139
-                <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择"  :disabled="disabled">
140
-                        <!-- <el-option
145
+              <el-form-item
146
+                :prop="'tableList.' + scope.$index + '.supply_unit'"
147
+                :rules="tableRules.supply_unit"
148
+              >
149
+                <el-select
150
+                  v-model="scope.row.supply_unit"
151
+                  style="width: 100px"
152
+                  filterable
153
+                  placeholder="请选择"
154
+                  :disabled="disabled"
155
+                >
156
+                  <!-- <el-option
141 157
                             v-for="(item,index) in scope.row.unitList"
142 158
                             :key="index"
143 159
                             :label="item.name"
144 160
                             :value="item.name">
145 161
                         </el-option> -->
146 162
                 </el-select>
147
-              </el-form-item>  
163
+              </el-form-item>
148 164
             </template>
149 165
           </el-table-column>
150 166
           <el-table-column label="可用库存" align="center" width="130px">
@@ -159,7 +175,7 @@
159 175
           <el-table-column label="可退数量" align="center" width="200px">
160 176
             <template slot-scope="scope">
161 177
               <el-input
162
-                v-model="scope.row.supply_specification_name"
178
+                v-model="scope.row.count"
163 179
                 style="width: 150px"
164 180
                 :disabled="true"
165 181
               ></el-input>
@@ -168,7 +184,6 @@
168 184
           <el-table-column label="数量" align="center" width="120px">
169 185
             <template slot="header" slot-scope="scope">
170 186
               <span>数量<span style="color: red">*</span></span>
171
-
172 187
             </template>
173 188
             <template slot-scope="scope">
174 189
               <el-form-item
@@ -233,7 +248,7 @@
233 248
             </template>
234 249
           </el-table-column>
235 250
 
236
-          <el-table-column label="源购订单号" align="center" width="200px">
251
+          <el-table-column label="源购订单号" align="center" width="200px">
237 252
             <template slot-scope="scope">
238 253
               <el-input
239 254
                 v-model="scope.row.good_number"
@@ -254,26 +269,43 @@
254 269
             </template>
255 270
           </el-table-column>
256 271
 
257
-          <el-table-column label="操作" align="center" width="150px" fixed="right">
272
+          <el-table-column
273
+            label="操作"
274
+            align="center"
275
+            width="150px"
276
+            fixed="right"
277
+          >
258 278
             <template slot-scope="scope">
259
-              <el-tooltip class="item" effect="dark" content="新增" placement="top" >
260
-                  <el-button
261
-                      size="mini"
262
-                      type="primary"
263
-                      icon="el-icon-circle-plus-outline"
264
-                      @click="handleEdit(scope.$index, scope.row)">
265
-                  </el-button>
266
-            </el-tooltip>
267
-            <el-tooltip class="item" effect="dark" content="删除" placement="top">
268
-                  <el-button
269
-                      size="mini"
270
-                      type="danger"
271
-                      icon="el-icon-delete"
272
-                      @click="handleDelete(scope.$index, scope.row)">
273
-                  </el-button>
279
+              <el-tooltip
280
+                class="item"
281
+                effect="dark"
282
+                content="新增"
283
+                placement="top"
284
+              >
285
+                <el-button
286
+                  size="mini"
287
+                  type="primary"
288
+                  icon="el-icon-circle-plus-outline"
289
+                  @click="handleEdit(scope.$index, scope.row)"
290
+                >
291
+                </el-button>
292
+              </el-tooltip>
293
+              <el-tooltip
294
+                class="item"
295
+                effect="dark"
296
+                content="删除"
297
+                placement="top"
298
+              >
299
+                <el-button
300
+                  size="mini"
301
+                  type="danger"
302
+                  icon="el-icon-delete"
303
+                  @click="handleDelete(scope.$index, scope.row)"
304
+                >
305
+                </el-button>
274 306
               </el-tooltip>
275 307
             </template>
276
-         </el-table-column>
308
+          </el-table-column>
277 309
         </el-table>
278 310
       </el-form>
279 311
       <div style="margin-top: 10px">
@@ -285,11 +317,14 @@
285 317
         >
286 318
         </el-input>
287 319
       </div>
320
+      <div style="margin-top: 10px">合计:{{ getAllPrice() }} 元</div>
288 321
       <div style="margin-top: 10px">
289 322
         <span
290 323
           >优惠率:<el-input
291 324
             style="width: 100px"
292 325
             v-model="rate_of_concession"
326
+            @input="addressChange"
327
+            placeholder="请输入优惠率"
293 328
           ></el-input
294 329
           >%</span
295 330
         >
@@ -298,6 +333,8 @@
298 333
           >优惠金额:<el-input
299 334
             style="width: 100px"
300 335
             v-model="discount_amount"
336
+            @input="count_discount"
337
+            placeholder="请输入优惠金额"
301 338
           ></el-input
302 339
         ></span>
303 340
 
@@ -305,6 +342,8 @@
305 342
           >本次付款:<el-input
306 343
             style="width: 100px"
307 344
             v-model="payment"
345
+            @input="count_payment"
346
+            placeholder="请输入本次付款"
308 347
           ></el-input
309 348
         ></span>
310 349
 
@@ -312,6 +351,8 @@
312 351
           >本次欠款:<el-input
313 352
             style="width: 100px"
314 353
             v-model="arrearage"
354
+            @input="count_arrearage"
355
+            placeholder="请输入本次欠款"
315 356
           ></el-input
316 357
         ></span>
317 358
       </div>
@@ -337,7 +378,10 @@ import { uParseTime } from "@/utils/tools";
337 378
 import {
338 379
   getInitOrder,
339 380
   getGoodReturnDetail,
340
-  updateGoodReturn
381
+  updateGoodReturn,
382
+  checkReturnOrder,
383
+  deleteReturnOrderById,
384
+  modefyReturnOrder
341 385
 } from "@/api/supply";
342 386
 export default {
343 387
   name: "addPurchaseOrder",
@@ -346,9 +390,9 @@ export default {
346 390
   },
347 391
   data() {
348 392
     return {
349
-      tipsInfo:"",
393
+      tipsInfo: "",
350 394
       crumbs: [
351
-        { path: false, name: "货单" },
395
+        { path: false, name: "退货单" },
352 396
         { path: "/good/return/add", name: "新增退货单" },
353 397
       ],
354 398
       showTwo: true,
@@ -380,8 +424,8 @@ export default {
380 424
       supplier_name: "",
381 425
       supplyList: [],
382 426
       rate_of_concession: "",
383
-      arrearage:"",
384
-      payment:"",
427
+      arrearage: "",
428
+      payment: "",
385 429
       discount_amount: "",
386 430
       tableRules: {
387 431
         name: [{ required: true, message: "商品不能为空", trigger: "blur" }],
@@ -398,7 +442,8 @@ export default {
398 442
       disabled: false,
399 443
       is_check: 0,
400 444
       dialogVisible: false,
401
-      return_remark:"",
445
+      return_remark: "",
446
+      warehouse_out_id: 0,
402 447
     };
403 448
   },
404 449
   methods: {
@@ -577,22 +622,48 @@ export default {
577 622
       tempObj["is_total"] = 1;
578 623
       tempObj["project_id"] = 0;
579 624
       tempObj["supply_unit"] = "";
625
+      tempObj["supply_batch_number"] = ""
626
+      tempObj["supply_product_date"] = ""
627
+      tempObj["supply_expiry_date"] = ""
628
+      tempObj["warehousing_id"] =0
629
+      tempObj["warehouse_info_id"] =0
630
+      tempObj["count"] = ""
631
+
580 632
       this.recordInfo.tableList.push(tempObj);
581 633
     },
582 634
     handleDelete: function (index, row) {
583
-      if (this.recordInfo.tableList.length <= 1) {
584
-        this.$message.error("只有一条记录的时候无法删除");
585
-        return;
586
-      } else {
587
-        this.recordInfo.tableList.splice(index, 1);
635
+      if(row.id == 0){
636
+        if (this.recordInfo.tableList.length <= 1) {
637
+          this.$message.error("只有一条记录的时候无法删除");
638
+          return;
639
+        } else {
640
+          this.recordInfo.tableList.splice(index, 1);
641
+        }
642
+      }
643
+      if(row.id >0){
644
+       if(this.is_check == 1){
645
+         this.$message.error("已审核单据,不能删除!")
646
+         return false
647
+       }
648
+       this.$confirm('确认删除吗?', '删除', {
649
+          confirmButtonText: '确 定',
650
+          cancelButtonText: '取 消',
651
+          type: 'warning'
652
+        }).then(() => {
653
+          deleteReturnOrderById(val.id).then(response => {
654
+            if (response.data.state == 1) {
655
+                var msg = response.data.data.msg
656
+                this.recordInfo.tableList.splice(index, 1);
657
+                this.$message.success("删除成功")
658
+            } else {
659
+                this.$message.error("删除失败")
660
+            }
661
+          })
662
+        }).catch(() => {
663
+       })
588 664
       }
589
-    },
590
-
591
-    changeTypeName() {},
592
-    startTimeChange() {},
593
-    endTimeChange() {},
594
-    search() {},
595 665
 
666
+    },
596 667
     getWarehoseInfo(arr, max_unit, min_unit, min_number) {
597 668
       var total = 0;
598 669
       var max_str = "";
@@ -707,8 +778,34 @@ export default {
707 778
           this.recordInfo.tableList[i].supply_price *
708 779
           this.recordInfo.tableList[i].supply_count;
709 780
       }
781
+      this.total_price = total_price;
710 782
       return total_price.toFixed(2);
711 783
     },
784
+
785
+    addressChange() {
786
+      var discount_amount = 0;
787
+      if (this.rate_of_concession > 0) {
788
+        discount_amount = (
789
+          (this.rate_of_concession / 100) *
790
+          this.total_price
791
+        ).toFixed(2);
792
+      }
793
+      this.discount_amount = discount_amount;
794
+    },
795
+    count_discount() {
796
+      this.rate_of_concession = (
797
+        this.discount_amount /
798
+        (this.total_price * 0.01)
799
+      ).toFixed(2);
800
+    },
801
+    count_payment() {
802
+      this.arrearage = this.total_price - this.payment;
803
+    },
804
+
805
+    count_arrearage() {
806
+      this.payment = this.total_price - this.arrearage;
807
+    },
808
+
712 809
     checkPurchaseOrder(id, index) {
713 810
       this.$confirm("是否审核?", {
714 811
         confirmButtonText: "确 定",
@@ -727,13 +824,15 @@ export default {
727 824
         })
728 825
         .catch(() => {});
729 826
     },
730
-    getGoodReturnDetail(){
731
-      
827
+   getGoodReturnDetail(){
828
+
732 829
       var id = this.$route.query.id
733 830
       getGoodReturnDetail(id).then(response=>{
734 831
         if(response.data.state == 1){
735 832
           var out = response.data.data.cancelDetail
736 833
           console.log("out23322323232323",out)
834
+          this.warehouse_out_id = out.warehouse_out_id
835
+          this.number = out.number
737 836
           this.is_check = out.is_check
738 837
           this.id = out.id
739 838
           this.supplier_name = out.supplier_id
@@ -743,12 +842,16 @@ export default {
743 842
           this.arrearage = out.arrearage
744 843
           this.start_time = this.getTimes(out.document_date)
745 844
           var orderInfo = response.data.data.orderCancelDetail
746
-          console.log("orderINFO233232232332",orderInfo)
845
+          if(out.is_check == 1){
846
+            this.disabled = true
847
+          }
848
+          console.log("退库单详情",orderInfo)
747 849
           var drugList = response.data.data.drugList
748 850
           var goodList = response.data.data.goodList
749 851
           for(let i=0;i< orderInfo.length;i++){
750
-              
852
+              orderInfo[i].id = orderInfo[i].id
751 853
               orderInfo[i].supply_count =  orderInfo[i].count
854
+              orderInfo[i].count = orderInfo[i].source_count
752 855
               orderInfo[i].supply_price =  orderInfo[i].price
753 856
               orderInfo[i].supply_remake =  orderInfo[i].remark
754 857
               orderInfo[i].type =  orderInfo[i].is_source
@@ -757,8 +860,8 @@ export default {
757 860
               orderInfo[i].order_number =  orderInfo[i].order_number
758 861
               orderInfo[i].good_number = orderInfo[i].good_number
759 862
               orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
760
-              orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
761
-              orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
863
+              orderInfo[i].supply_expiry_date =  orderInfo[i].supply_expiry_date
864
+              orderInfo[i].supply_product_date = orderInfo[i].supply_product_date
762 865
             if(orderInfo[i].is_source == 1){
763 866
               for(let j=0;j<drugList.length;j++){
764 867
                   if( orderInfo[i].project_id == drugList[j].id){
@@ -771,66 +874,133 @@ export default {
771 874
                       orderInfo[i].unitList = [{id:1,name:""}]
772 875
                       orderInfo[i].unitList[0].name = drugList[j].max_unit
773 876
                     }
774
-                  
877
+
775 878
                   }
776
-              }  
777
-              } 
879
+              }
880
+              }
778 881
             if(orderInfo[i].is_source == 2){
779 882
               for(let j=0;j<goodList.length;j++){
780 883
                   if(orderInfo[i].project_id == goodList[j].id){
781 884
                       orderInfo[i].unitList = [{id:1,name:""}]
782 885
                       orderInfo[i].unitList[0].name = goodList[j].packing_unit
783 886
                   }
784
-              }  
785
-            } 
887
+              }
888
+            }
786 889
           }
787
-        
788
-          this.recordInfo.tableList= []
789
-          this.recordInfo.tableList = orderInfo
790
-        
890
+
891
+          this.recordInfo.tableList = [];
892
+          this.recordInfo.tableList = orderInfo;
791 893
         }
792
-      })  
894
+      });
793 895
     },
794 896
     toPrint() {
795 897
       var id = this.$route.query.id;
796 898
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
797 899
     },
798
-    updateGoodReturn(){
799
-      var warehouse_out_id = this.$route.query.id;
800
-      this.$refs["tableForm"].validate((valid)=>{
801
-        if(valid){
802
-          this.loading = true
803
-          for(let i=0;i<this.recordInfo.tableList.length;i++){
804
-            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
805
-            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
806
-            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
807
-       
808
-            for(let j=0;j<this.manufactuerList.length;j++){
809
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
810
-                  this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
811
-                }
812
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id){
813
-                  this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name
814
-                }
900
+    // updateGoodReturn() {
901
+    //   var warehouse_out_id = this.$route.query.id;
902
+    //   this.$refs["tableForm"].validate((valid)=>{
903
+    //     if(valid){
904
+    //       this.loading = true
905
+    //       for(let i=0;i<this.recordInfo.tableList.length;i++){
906
+    //         this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
907
+    //         this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
908
+    //         this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
815 909
 
816
-            }
817
-          }
818
-          var params = {
819
-            "stockIn":this.recordInfo.tableList,
820
-            "return_marke":this.return_remark,
821
-          }
822
-          console.log("start_time232233232",this.start_time)
823
-          console.log("arrage2323322323",this.arrearage)
824
-          updateGoodReturn(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name,this.number).then(response=>{
825
-            if(response.data.state == 1){
826
-               var msg = response.data.msg
827
-               this.loading = false
828
-               this.$message.success("保存成功!")
829
-            }
830
-          })
831
-        }
832
-      })
833
-    }
910
+    //         for(let j=0;j<this.manufactuerList.length;j++){
911
+    //             if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
912
+    //               this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
913
+    //             }
914
+    //             if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id){
915
+    //               this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name
916
+    //             }
917
+
918
+    //   this.$refs["tableForm"].validate((valid) => {
919
+    //     if (valid) {
920
+    //       this.loading = true;
921
+    //       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
922
+    //         this.recordInfo.tableList[i].supply_count = parseInt(
923
+    //           this.recordInfo.tableList[i].supply_count
924
+    //         );
925
+    //         this.recordInfo.tableList[i].supply_price =
926
+    //           this.recordInfo.tableList[i].supply_price.toString();
927
+    //         this.recordInfo.tableList[i].supply_total =
928
+    //           this.recordInfo.tableList[i].supply_total.toString();
929
+
930
+    //         for (let j = 0; j < this.manufactuerList.length; j++) {
931
+    //           if (
932
+    //             this.recordInfo.tableList[i].supply_manufacturer ==
933
+    //             this.manufactuerList[j].manufacturer_name
934
+    //           ) {
935
+    //             this.recordInfo.tableList[i].manufacturer_id =
936
+    //               this.manufactuerList[j].id;
937
+    //           }
938
+    //           if (
939
+    //             this.recordInfo.tableList[i].supply_manufacturer ==
940
+    //             this.manufactuerList[j].id
941
+    //           ) {
942
+    //             this.recordInfo.tableList[i].supply_manufacturer =
943
+    //               this.manufactuerList[j].manufacturer_name;
944
+    //           }
945
+    //         }
946
+    //       }
947
+    //       var params = {
948
+    //         stockIn:this.recordInfo.tableList,
949
+    //         return_marke:this.return_remark,
950
+    //       }
951
+    //       console.log("start_time232233232",this.start_time)
952
+    //       console.log("arrage2323322323",params)
953
+    //       updateGoodReturn(
954
+    //         params,
955
+    //         warehouse_out_id,
956
+    //         this.start_time,
957
+    //         this.rate_of_concession,
958
+    //         this.discount_amount,
959
+    //         this.arrearage,
960
+    //         this.payment,
961
+    //         this.supplier_name,
962
+    //         this.number
963
+    //       ).then((response) => {
964
+    //         if (response.data.state == 1) {
965
+    //           var msg = response.data.msg;
966
+    //           this.loading = false;
967
+    //           this.$message.success("保存成功!");
968
+    //         }
969
+    //       })
970
+    // },
971
+    checkReturnOrder(){
972
+      this.loading = true
973
+     var params = {
974
+       warehouse_out_id:this.warehouse_out_id,
975
+       id:this.id,
976
+     }
977
+     checkReturnOrder(params).then(response=>{
978
+       if(response.data.state == 1){
979
+        this.loading = false
980
+        var msg = response.data.data.msg
981
+        this.$message.success("保存成功!")
982
+       }
983
+     })
984
+    },
985
+    modefyReturnOrder(){
986
+      this.loading = true
987
+     var params = {
988
+       warehouse_out_id:this.warehouse_out_id,
989
+       id:this.id,
990
+     }
991
+     modefyReturnOrder(params).then(response=>{
992
+       if(response.data.state == 1){
993
+
994
+       }
995
+     })
996
+    },
997
+    checkReturnOrder() {
998
+      var params = {
999
+        warehouse_out_id: this.warehouse_out_id,
1000
+        id: this.id,
1001
+      };
1002
+      checkReturnOrder(params).then((response) => {});
1003
+    },
834 1004
   },
835 1005
   created() {
836 1006
     const tempObj = {};
@@ -850,6 +1020,12 @@ export default {
850 1020
     tempObj["is_total"] = 1;
851 1021
     tempObj["project_id"] = 0;
852 1022
     tempObj["supply_unit"] = "";
1023
+    tempObj["supply_batch_number"] = ""
1024
+    tempObj["supply_product_date"] = ""
1025
+    tempObj["supply_expiry_date"] = ""
1026
+    tempObj["warehousing_id"] =0
1027
+    tempObj["warehouse_info_id"] =0
1028
+    tempObj["count"] = ""
853 1029
     this.recordInfo.tableList.push(tempObj);
854 1030
     this.getInitOrder();
855 1031
     //获取购货单列表

+ 40 - 13
src/xt_pages/supply/components/editPurchaseOrder.vue View File

@@ -374,6 +374,7 @@ import {
374 374
   getAllOrderCountList,
375 375
   getGoodOrderList,
376 376
   getReturnOrder,
377
+  deletePurchaseOrder
377 378
 } from "@/api/supply";
378 379
 export default {
379 380
   name: "addPurchaseOrder",
@@ -383,8 +384,8 @@ export default {
383 384
   },
384 385
   data() {
385 386
     return {
386
-      content_2:"购单",
387
-      content:"购订单",
387
+      content_2:"购单",
388
+      content:"购订单",
388 389
       content_1:"已有以下关联数据,不能反审核",
389 390
       type:1,
390 391
       Reviewed: false,
@@ -630,12 +631,41 @@ export default {
630 631
       this.recordInfo.tableList.push(tempObj);
631 632
     },
632 633
     handleDelete: function (index, row) {
633
-      if (this.recordInfo.tableList.length <= 1) {
634
-        this.$message.error("只有一条记录的时候无法删除");
635
-        return;
636
-      } else {
637
-        this.recordInfo.tableList.splice(index, 1);
634
+      if(this.is_check == 1){
635
+         this.$message.error("已审核单据,不能删除!")
636
+         return false
638 637
       }
638
+      if(row.id == 0){
639
+        if (this.recordInfo.tableList.length <= 1) {
640
+          this.$message.error("只有一条记录的时候无法删除");
641
+          return;
642
+        } else {
643
+          this.recordInfo.tableList.splice(index, 1);
644
+        }
645
+      }else{
646
+          const params = {
647
+            id: row.id
648
+          }
649
+          this.$confirm('确认删除吗?', {
650
+            confirmButtonText: '确定',
651
+            cancelButtonText: '取消',
652
+            type: 'warning'
653
+          }).then(() => {
654
+            deletePurchaseOrder(params).then(response => {
655
+              if (response.data.state == 0) {
656
+                this.$message.error(response.data.msg)
657
+                return false
658
+              } else {
659
+                this.$message.success('删除成功')
660
+
661
+                this.recordInfo.tableList.splice(index, 1)
662
+              }
663
+            })
664
+          }).catch(() => {
665
+        })
666
+        
667
+      }
668
+      
639 669
     },
640 670
 
641 671
     changeTypeName() {},
@@ -769,8 +799,7 @@ export default {
769 799
         confirmButtonText: "确 定",
770 800
         cancelButtonText: "取 消",
771 801
         type: "warning",
772
-      })
773
-        .then(() => {
802
+      }).then(() => {
774 803
           checkPurchaseOrder(this.id).then((response) => {
775 804
             if (response.data.state == 1) {
776 805
               var info = response.data.data.info;
@@ -882,9 +911,7 @@ export default {
882 911
           var ids = "";
883 912
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
884 913
           if (goodOrder.length == 0) {
885
-            this.$router.push({
886
-              path: "/good/order/add?id=" + id + "&ids=" + ids,
887
-            });
914
+            this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + ids});
888 915
           }
889 916
           for (let i = 0; i < purcaseOrder.length; i++) {
890 917
             for (let j = 0; j < drugList.length; j++) {
@@ -958,7 +985,7 @@ export default {
958 985
                 return;
959 986
               }
960 987
 
961
-              if (total != goodOrder.length) {
988
+              if (arr.length >0) {
962 989
                 str = arr.join(",");
963 990
                 this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + str});
964 991
               }

+ 40 - 14
src/xt_pages/supply/goodreturn.vue View File

@@ -105,29 +105,29 @@
105 105
         </el-table-column>
106 106
         <el-table-column label="购货金额" align="center" width="200">
107 107
           <template slot-scope="scope">
108
-             <!-- <span v-if="getAllBuyPrice(scope.row.orderInfo)>0">{{getAllBuyPrice(scope.row.orderInfo)}}</span>  -->
108
+             <span v-if="getAllBuyPrice(scope.row.cancelOrder)>0">{{getAllBuyPrice(scope.row.cancelOrder)}}</span> 
109 109
           </template>
110 110
         </el-table-column>
111 111
         <el-table-column label="优惠后金额" align="center" width="200">
112 112
          <template slot-scope="scope">
113
-           <!-- {{getAllCount(scope.row.orderInfo)}} -->
113
+          <span v-if="getAllBuyPrice(scope.row.cancelOrder)>0">{{getAllBuyPrice(scope.row.cancelOrder) - scope.row.discount_amount}}</span> 
114 114
          </template>
115 115
        </el-table-column>
116
-        <el-table-column label="已退款" align="center" width="200">
116
+        <!-- <el-table-column label="已退款" align="center" width="200">
117 117
          <template slot-scope="scope">
118
-           <!-- {{getAllCount(scope.row.orderInfo)}} -->
118
+         
119 119
          </template>
120
-       </el-table-column>
120
+       </el-table-column> -->
121 121
        <el-table-column label="源数量" align="center" width="200">
122 122
          <template slot-scope="scope">
123
-           <!-- {{getAllCount(scope.row.orderInfo)}} -->
123
+           {{scope.row.source_count}}
124 124
          </template>
125 125
        </el-table-column>
126 126
 
127
-       <el-table-column label="退款状态" align="center" width="200">
127
+       <el-table-column label="款状态" align="center" width="200">
128 128
          <template slot-scope="scope">
129
-           <span v-if="scope.row.is_check == 2">未审核</span>
130
-           <span v-if="scope.row.is_check == 1">已审核</span>
129
+           <!-- <span v-if="scope.row.is_check == 2">未审核</span>
130
+           <span v-if="scope.row.is_check == 1">已审核</span> -->
131 131
          </template>
132 132
        </el-table-column>
133 133
       
@@ -183,7 +183,7 @@
183 183
 <script>
184 184
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
185 185
 
186
-import {getAllSupply,getAllGoodReturnOrderList} from "@/api/supply"
186
+import {getAllSupply,getAllGoodReturnOrderList,deleteReturnOrder} from "@/api/supply"
187 187
 import {uParseTime } from '@/utils/tools'
188 188
 export default {
189 189
   name: "stockIn",
@@ -228,16 +228,16 @@ export default {
228 228
        this.$router.push({path:"/good/return/add"})
229 229
      },
230 230
      changeTypeName(){
231
-
231
+       this.getlist()
232 232
      },
233 233
      startTimeChange(){
234
-
234
+       this.getlist()
235 235
      },
236 236
      endTimeChange(){
237
-
237
+      this.getlist()
238 238
      },
239 239
      search(){
240
-
240
+      this.getlist()
241 241
      },
242 242
      handleSizeChange(val){
243 243
        this.limit = val
@@ -324,6 +324,32 @@ export default {
324 324
      },
325 325
      editGoodReturn(id){
326 326
        this.$router.push({path:"/good/return/edit?id="+id})
327
+     },
328
+     toClickOne(val,index){
329
+       if(val.is_check == 1){
330
+         this.$message.error("已审核单据,不能删除!")
331
+         return false
332
+       }
333
+       if(val.cancelOut.length >0 ){
334
+         this.$message.error("已关联单据,不能删除!")
335
+         return false
336
+       }
337
+       this.$confirm('确认删除吗?', '删除', {
338
+          confirmButtonText: '确 定',
339
+          cancelButtonText: '取 消',
340
+          type: 'warning'
341
+        }).then(() => {
342
+          deleteReturnOrder(val.id).then(response => {
343
+            if (response.data.state == 1) {
344
+                var msg = response.data.data.msg
345
+                this.tableList.splice(index, 1);
346
+                this.$message.success("删除成功")
347
+            } else {
348
+                this.$message.error("删除失败")
349
+            }
350
+          })
351
+        }).catch(() => {
352
+       }) 
327 353
      }
328 354
   },
329 355
   created() {

+ 3 - 3
src/xt_pages/supply/supplyQuery.vue View File

@@ -180,7 +180,7 @@ export default {
180 180
       page: 1,
181 181
       limit: 10,
182 182
 
183
-      type_name: 0,
183
+      type_name: "请选择",
184 184
       crumbs: [
185 185
         { path: false, name: "采购管理" },
186 186
         { path: "/supply/good/order/query", name: "供应商管理" },
@@ -213,7 +213,7 @@ export default {
213 213
       };
214 214
       getexporthistory(params).then((res) => {
215 215
         if (res.data.state == 1) {
216
-          console.log(res.data.data.list, "res.data.data.list");
216
+
217 217
           this.tableList = res.data.data.list;
218 218
           this.total = res.data.data.total;
219 219
         }
@@ -225,7 +225,7 @@ export default {
225 225
         if (res.data.state == 1) {
226 226
           this.sType = res.data.data.list;
227 227
         }
228
-        console.log(res, "oo");
228
+
229 229
       });
230 230
     },
231 231