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
a8825cf60f

+ 70 - 6
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
+    }
210
+
211
+export function updateGoodReturn(data, warehouse_out_id, start_time, rate_of_concession, discount_amount, arrearage, payment, supplier_id, return_number) {
212
+  return request({
213
+    url: '/api/supply/updategoodreturn?warehouse_out_id=' + warehouse_out_id + '&start=' + start_time + '&rate_of_concession=' + rate_of_concession + '&discount_amount=' + discount_amount + '&arrerage=' + arrearage + '&payment=' + payment + '&supplier_id=' + supplier_id + '&return_number=' + return_number,
214
+    method: 'post',
215
+    data: data
160
   })
216
   })
161
 }
217
 }
162
 
218
 
163
-export function getGoodReturnDetail(id, params) {
219
+export function MofyGoodOrder(params) {
164
   return request({
220
   return request({
165
-    url: '/api/supply/getgoodreturndetail?id=' + id,
221
+    url: '/api/supply/mofygoodorder',
166
     method: 'get',
222
     method: 'get',
167
     params: params
223
     params: params
168
   })
224
   })
169
 }
225
 }
170
 
226
 
171
-export function updateGoodReturn(data, warehouse_out_id, start_time, rate_of_concession, discount_amount, arrearage, payment, supplier_id, return_number) {
227
+export function UpdateSupplyWahouseingInfo(params) {
172
   return request({
228
   return request({
173
-    url: '/api/supply/updategoodreturn?warehouse_out_id=' + warehouse_out_id + '&start=' + start_time + '&rate_of_concession=' + rate_of_concession + '&discount_amount=' + discount_amount + '&arrerage=' + arrearage + '&payment=' + payment + '&supplier_id=' + supplier_id + '&return_number=' + return_number,
174
-    method: 'post',
175
-    data: data
229
+    url: '/api/supply/updatesupplywarehousing',
230
+    method: 'get',
231
+    params: params
232
+  })
233
+}
234
+
235
+export function deleteGoodOrder(id, params) {
236
+  return request({
237
+    url: '/api/supply/deletegoodorder?id=' + id,
238
+    method: 'get',
239
+    params: params
176
   })
240
   })
177
 }
241
 }

BIN
src/assets/Popup/alert.png View File


+ 22 - 0
src/components/Popup/index.js View File

1
+import Vue from 'vue'
2
+import Popup from './index.vue'
3
+
4
+const PopupBox = Vue.extend(Popup)
5
+
6
+Popup.install = function (data) {
7
+  let instance = new PopupBox({
8
+    data
9
+  }).$mount()
10
+
11
+  document.body.appendChild(instance.$el)
12
+
13
+  Vue.nextTick(() => {
14
+    instance.show = true
15
+    // show 和弹窗组件里的show对应,用于控制显隐
16
+    setTimeout(() => {
17
+      instance.show = false
18
+    }, 3000);
19
+  })
20
+}
21
+
22
+export default Popup

+ 165 - 0
src/components/Popup/index.vue View File

1
+<template>
2
+  <transition-group name="fade">
3
+    <!-- 蒙版 -->
4
+    <div
5
+      class="mask"
6
+      key="1"
7
+      @click="show = false"
8
+      v-if="show"
9
+      @touchmove.prevent
10
+    ></div>
11
+    <div class="pop" v-show="show" key="2">
12
+      <div class="title">
13
+        <span>{{ title }}</span>
14
+      </div>
15
+
16
+      <div class="content">
17
+        <div class="content_1">
18
+          <img
19
+            src="../../assets/Popup/alert.png"
20
+            alt="正在加载.."
21
+            class="alertImg"
22
+          />
23
+        </div>
24
+
25
+        <div class="content_2">
26
+          <p>
27
+            购货订单<span style="color: #46a3ff">{{ content }}</span
28
+            >已有以下关联数据,不能反审核
29
+          </p>
30
+          <div v-for="(item, index) in orderList" :key="index">
31
+            <li>
32
+              购货单 {{ item.good_number
33
+              }}<a @click="toClick(item.id)">点击查看</a>
34
+            </li>
35
+          </div>
36
+        </div>
37
+      </div>
38
+
39
+      <div class="btn">
40
+        <el-button @click="btnClick">{{ btnText }}</el-button>
41
+      </div>
42
+    </div>
43
+  </transition-group>
44
+</template>
45
+
46
+<script>
47
+export default {
48
+  name: "Popup",
49
+  data() {
50
+    return {
51
+      show: false,
52
+      imgUrl: "",
53
+      title: "系统提示",
54
+      content: "",
55
+      btnText: "关闭",
56
+      orderList: [],
57
+    };
58
+  },
59
+  created() {},
60
+  methods: {
61
+    btnClick() {
62
+      this.click();
63
+      this.show = false;
64
+    },
65
+    toClick(id) {
66
+      this.$router.push("/good/order/edit?id=" + id);
67
+    },
68
+  },
69
+};
70
+</script>
71
+
72
+
73
+<style lang="scss" scoped>
74
+// 渐变过渡
75
+.fade-enter,
76
+.fade-leave-active {
77
+  opacity: 0;
78
+}
79
+.fade-enter-active,
80
+.fade-leave-active {
81
+  transition: opacity 0.35s;
82
+}
83
+// 全局弹窗
84
+.mask {
85
+  background: rgba(0, 0, 0, 0.5);
86
+  position: fixed;
87
+  top: 0;
88
+  z-index: 10;
89
+  width: 100%;
90
+  height: 100%;
91
+}
92
+
93
+.pop {
94
+  height: 205px;
95
+  width: 435px;
96
+  background: #fff;
97
+  border-radius: 8px;
98
+  position: fixed;
99
+  top: 100px;
100
+  left: 50%;
101
+  transform: translateX(-50%);
102
+  z-index: 20;
103
+  text-align: center;
104
+  .title {
105
+    height: 40px;
106
+    line-height: 40px;
107
+    span {
108
+      float: left;
109
+      margin-left: 15px;
110
+    }
111
+  }
112
+  .content {
113
+    height: 125px;
114
+    display: flex;
115
+    .content_1 {
116
+      width: 20%;
117
+      .alertImg {
118
+        width: 45px;
119
+        height: 45px;
120
+      }
121
+    }
122
+
123
+    .content_2 {
124
+      p {
125
+        line-height: 43px !important;
126
+        text-align: left !important;
127
+      }
128
+
129
+      li {
130
+        list-style: disc;
131
+        text-align: left;
132
+        a {
133
+          float: right;
134
+          margin-right: 60px;
135
+        }
136
+      }
137
+    }
138
+  }
139
+
140
+  .btn {
141
+    height: 40px;
142
+    line-height: 40px;
143
+    button {
144
+      float: right;
145
+      margin-right: 15px;
146
+    }
147
+  }
148
+  // button {
149
+  //   background: #f95644;
150
+  //   border-radius: 32px;
151
+  //   width: 30px;
152
+  //   height: 20px;
153
+  //   font-size: 18px;
154
+  //   color: #ffffff;
155
+  // }
156
+  .close {
157
+    top: 0;
158
+    right: 10px;
159
+    position: absolute;
160
+    display: block;
161
+    width: 40px;
162
+    height: 40px;
163
+  }
164
+}
165
+</style>

+ 8 - 0
src/main.js View File

33
 import 'default-passive-events'
33
 import 'default-passive-events'
34
 Vue.prototype.voicePrompt = voicePromptFun.voicePrompt  //语音提醒
34
 Vue.prototype.voicePrompt = voicePromptFun.voicePrompt  //语音提醒
35
 
35
 
36
+import Popup from "./components/Popup/index"  //全局删除弹框控件
37
+Vue.prototype.$popup = Popup.install
38
+
39
+import Computed from "../src/xt_pages/components/Computed/index"  //自动计算金额控件
40
+Vue.component("Computed",Computed)
41
+
42
+
43
+
36
 Vue.use(Element, {
44
 Vue.use(Element, {
37
   size: 'medium', // set element-ui default size
45
   size: 'medium', // set element-ui default size
38
   i18n: (key, value) => i18n.t(key, value)
46
   i18n: (key, value) => i18n.t(key, value)

+ 9 - 0
src/router/modules/supply.js View File

27
       meta: { title: 'addSupply', noCache: true },
27
       meta: { title: 'addSupply', noCache: true },
28
       isChild: true
28
       isChild: true
29
     },
29
     },
30
+    {
31
+      path: '/supply/edit',
32
+      component: () => import('@/xt_pages/supply/components/editSupply'),
33
+      name: 'editSupply',
34
+      hidden: true,
35
+      is_menu: false,
36
+      meta: { title: 'editSupply', noCache: true },
37
+      isChild: true
38
+    },
30
     {
39
     {
31
       path: 'purchase/order/query',
40
       path: 'purchase/order/query',
32
       component: () => import('@/xt_pages/supply/purchaseOrderQuery'),
41
       component: () => import('@/xt_pages/supply/purchaseOrderQuery'),

+ 2 - 2
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,'采购管理')">
19
+        <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
20
           <i class="iconfont icon-kccx navIcon"></i>
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>

+ 62 - 0
src/xt_pages/components/Computed/index.vue View File

1
+<template>
2
+  <div>
3
+    <div style="margin-top: 10px">合计: {{ new_total || total_money }}元</div>
4
+    <div style="margin-top: 10px">
5
+      <span
6
+        >优惠率:<el-input
7
+          style="width: 100px"
8
+          v-model="rate_of_concession"
9
+          @input="addressChange"
10
+        ></el-input
11
+        >%</span
12
+      >
13
+
14
+      <span
15
+        >优惠金额:<el-input
16
+          style="width: 100px"
17
+          v-model="discount_amount"
18
+          @input="count_discount"
19
+        ></el-input
20
+      ></span>
21
+    </div>
22
+  </div>
23
+</template>
24
+
25
+<script>
26
+export default {
27
+  props: {
28
+    total_price: {
29
+      type: Number,
30
+      default: 1000,
31
+    },
32
+  },
33
+  data() {
34
+    return {
35
+      rate_of_concession: 0,
36
+      discount_amount: 0,
37
+      total_money: this.$props.total_price,
38
+      new_total: 0,
39
+    };
40
+  },
41
+  created() {
42
+    this.addressChange();
43
+  },
44
+
45
+  methods: {
46
+    addressChange() {
47
+      this.new_total = (this.total_money * (100 - this.rate_of_concession) * 0.01).toFixed(2);
48
+      this.discount_amount = (this.total_money - this.new_total).toFixed(2);
49
+     console.log(this.discount_amount)
50
+    },
51
+
52
+    count_discount() {
53
+      this.rate_of_concession =
54
+      (this.discount_amount / (this.total_money * 0.01)).toFixed(2);
55
+      this.new_total = this.total_money - this.discount_amount;
56
+    },
57
+  },
58
+};
59
+</script>
60
+
61
+<style scoped>
62
+</style>

+ 99 - 0
src/xt_pages/components/Computed/index_1.vue View File

1
+<template>
2
+  <div>
3
+    <div style="margin-top: 10px">合计: {{ new_total || total_money }}元</div>
4
+    <div style="margin-top: 10px">
5
+      <span
6
+        >优惠率:<el-input
7
+          style="width: 100px"
8
+          v-model="rate_of_concession"
9
+          @input="addressChange"
10
+        ></el-input
11
+        >%</span
12
+      >
13
+
14
+      <span
15
+        >优惠金额:<el-input
16
+          style="width: 100px"
17
+          v-model="discount_amount"
18
+          @input="count_discount"
19
+        ></el-input
20
+      ></span>
21
+
22
+      <span
23
+        >本次付款:<el-input
24
+          style="width: 100px"
25
+          v-model="payment"
26
+          @input="count_payment"
27
+        ></el-input
28
+      ></span>
29
+
30
+      <span
31
+        >本次欠款:<el-input
32
+          style="width: 100px"
33
+          v-model="arrearage"
34
+          @input="count_arrearage"
35
+        ></el-input
36
+      ></span>
37
+    </div>
38
+  </div>
39
+</template>
40
+
41
+<script>
42
+export default {
43
+  props: {
44
+    total_price: {
45
+      type: Number,
46
+      default: 1000,
47
+    },
48
+  },
49
+  data() {
50
+    return {
51
+      rate_of_concession: 0,
52
+      discount_amount: 0,
53
+      total_money: this.$props.total_price,
54
+      new_total: 0,
55
+      payment:0,
56
+      arrearage:0
57
+    };
58
+  },
59
+  created() {
60
+    this.addressChange();
61
+  },
62
+
63
+  methods: {
64
+    addressChange() {
65
+      this.new_total = (
66
+        this.total_money *
67
+        (100 - this.rate_of_concession) *
68
+        0.01
69
+      ).toFixed(2);
70
+      this.discount_amount = (this.total_money - this.new_total).toFixed(2);
71
+      console.log(this.discount_amount);
72
+    },
73
+
74
+    count_discount() {
75
+      this.rate_of_concession = (
76
+        this.discount_amount /
77
+        (this.total_money * 0.01)
78
+      ).toFixed(2);
79
+      this.new_total = this.total_money - this.discount_amount;
80
+    },
81
+    count_payment() {
82
+        if(this.new_total){
83
+            this.arrearage = this.new_total - this.payment
84
+        }
85
+
86
+    },
87
+
88
+    count_arrearage() {
89
+         if(this.new_total){
90
+            this.payment = this.new_total - this.arrearage
91
+        }
92
+
93
+    },
94
+  },
95
+};
96
+</script>
97
+
98
+<style scoped>
99
+</style>

+ 24 - 2
src/xt_pages/data/components/addDrugs.vue View File

342
                             <el-input v-model="form.social_security_directory_code" style="width:160px"></el-input>
342
                             <el-input v-model="form.social_security_directory_code" style="width:160px"></el-input>
343
                         </el-form-item>
343
                         </el-form-item>
344
 
344
 
345
-
345
+                      
346
 
346
 
347
                         <el-form-item label="备案日期:">
347
                         <el-form-item label="备案日期:">
348
                             <el-date-picker
348
                             <el-date-picker
353
                                     placeholder="选择日期时间">
353
                                     placeholder="选择日期时间">
354
                             </el-date-picker>
354
                             </el-date-picker>
355
                         </el-form-item>
355
                         </el-form-item>
356
+                      
357
+                        <!-- <el-form-item label="是否零用:">
358
+
359
+                            <el-select v-model="form.is_user" style="width:160px" filterable placeholder="请选择">
360
+                                <el-option
361
+                                        v-for="(item,index) in userList"
362
+                                        :key="index"
363
+                                        :label="item.name"
364
+                                        :value="item.id">
365
+                                </el-option>
366
+                            </el-select>
367
+                        </el-form-item> -->
368
+                      
356
 
369
 
357
                         <el-form-item label="药品备注:">
370
                         <el-form-item label="药品备注:">
358
                             <el-input v-model="form.drug_remark" style="width:160px"></el-input>
371
                             <el-input v-model="form.drug_remark" style="width:160px"></el-input>
582
           prescribing_number_unit:"",
595
           prescribing_number_unit:"",
583
           total:"",
596
           total:"",
584
           specification_name:"",
597
           specification_name:"",
598
+          is_user:2,
585
         },
599
         },
586
 
600
 
587
         rules: {
601
         rules: {
632
         dosageShow:false,
646
         dosageShow:false,
633
         unitList:[],
647
         unitList:[],
634
         minNumberShow:false,
648
         minNumberShow:false,
635
-        packingUnit:[]
649
+        packingUnit:[],
650
+        userList: [{
651
+          id: '1',
652
+          name: '是'
653
+        }, {
654
+          id: '2',
655
+          name: '否'
656
+        }],
636
       }
657
       }
637
     },
658
     },
638
     props: {
659
     props: {
897
         form['min_price'] = this.form.min_price
918
         form['min_price'] = this.form.min_price
898
         form['prescribing_number_unit'] = this.form.prescribing_number_unit
919
         form['prescribing_number_unit'] = this.form.prescribing_number_unit
899
         form['specification_name'] = this.form.specification_name
920
         form['specification_name'] = this.form.specification_name
921
+        form['is_user'] = this.form.is_user
900
         return form
922
         return form
901
       },
923
       },
902
       getlist() {
924
       getlist() {

+ 10 - 1
src/xt_pages/data/components/drugs.vue View File

324
           min_price:'',
324
           min_price:'',
325
           drug_day:"",//默认开药天数,
325
           drug_day:"",//默认开药天数,
326
           total:"",
326
           total:"",
327
+          is_user:"",
327
         },
328
         },
328
         tempFormValue: {
329
         tempFormValue: {
329
           drug_name: '',//药品名称
330
           drug_name: '',//药品名称
383
           packing_price:"",//包装零售价
384
           packing_price:"",//包装零售价
384
           drug_day:"",//默认开药天数
385
           drug_day:"",//默认开药天数
385
           total:"",
386
           total:"",
386
-
387
+          is_user:"",
387
         },
388
         },
388
 
389
 
389
         current_id: 0,
390
         current_id: 0,
629
 
630
 
630
               }
631
               }
631
 
632
 
633
+              // if(this.formValue.is_user <= 0){
634
+
635
+              //   this.formValue.is_user = ''
636
+              // } else{
637
+              //   this.formValue.is_user = this.formValue.is_user.toString()
638
+              // }
639
+
640
+
632
               if(this.formValue.is_charge_predict <= 0){
641
               if(this.formValue.is_charge_predict <= 0){
633
 
642
 
634
                 this.formValue.is_charge_predict = ''
643
                 this.formValue.is_charge_predict = ''

+ 1 - 0
src/xt_pages/outpatientCharges/components/registerDialog.vue View File

590
                   }).catch(() => {
590
                   }).catch(() => {
591
                   })
591
                   })
592
                 } else {
592
                 } else {
593
+                  that.InsuplcAdmdvs = []
593
                   for(let i =0; i < response.data.data.info.output.insuinfo.length; i++){
594
                   for(let i =0; i < response.data.data.info.output.insuinfo.length; i++){
594
                     that.InsuplcAdmdvs.push({
595
                     that.InsuplcAdmdvs.push({
595
                       value:response.data.data.info.output.insuinfo[i].insuplc_admdvs,
596
                       value:response.data.data.info.output.insuinfo[i].insuplc_admdvs,

+ 1 - 0
src/xt_pages/outpatientCharges/components/registerDialog9504.vue View File

541
         let params = {
541
         let params = {
542
           'id_card_type': this.form.id_card_type,
542
           'id_card_type': this.form.id_card_type,
543
           'admin_user_id':this.$store.getters.xt_user.user.id,
543
           'admin_user_id':this.$store.getters.xt_user.user.id,
544
+          'certificates': this.form.certificates
544
 
545
 
545
         }
546
         }
546
         this.read_loading = true
547
         this.read_loading = true

+ 17 - 3
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue View File

695
         { value: 11, label: '普通门诊' },
695
         { value: 11, label: '普通门诊' },
696
         { value: 14, label: '门诊特殊病' },
696
         { value: 14, label: '门诊特殊病' },
697
         { value: '1111', label: '精一' },
697
         { value: '1111', label: '精一' },
698
-        { value: '1112', label: '精二' }
698
+        { value: '1112', label: '精二' },
699
+        { value: '9922', label: '家庭通道' }
700
+
699
       ],
701
       ],
700
 
702
 
701
       registerThree: [
703
       registerThree: [
705
         { value: '1112', label: '精二' },
707
         { value: '1112', label: '精二' },
706
         { value: '9933', label: '门诊特殊病(9933)' },
708
         { value: '9933', label: '门诊特殊病(9933)' },
707
         { value: '990602', label: '门诊特殊病(990602)' },
709
         { value: '990602', label: '门诊特殊病(990602)' },
708
-        { value: '1402', label: '门诊特殊病(1402)' }
710
+        { value: '1402', label: '门诊特殊病(1402)' },
711
+        { value: '1402', label: '门诊特殊病(1402)' },
712
+        { value: '9922', label: '家庭通道' }
713
+
714
+
709
 
715
 
710
       ],
716
       ],
711
       register_two: [
717
       register_two: [
713
         { value: '14', label: '门诊特殊病' },
719
         { value: '14', label: '门诊特殊病' },
714
         { value: '9933', label: '门诊特殊病(9933)' },
720
         { value: '9933', label: '门诊特殊病(9933)' },
715
         { value: '990602', label: '门诊特殊病(990602)' },
721
         { value: '990602', label: '门诊特殊病(990602)' },
716
-        { value: '1402', label: '门诊特殊病(1402)' }
722
+        { value: '1402', label: '门诊特殊病(1402)' },
723
+        { value: '9922', label: '家庭通道' }
724
+
717
 
725
 
718
       ],
726
       ],
719
       loading: false,
727
       loading: false,
2152
           this.$message({ message: '该患者尚未挂号,请先挂号', type: 'error' })
2160
           this.$message({ message: '该患者尚未挂号,请先挂号', type: 'error' })
2153
           return
2161
           return
2154
         }
2162
         }
2163
+        console.log( "-------")
2164
+        console.log(this.getTotalFour(prescriptions))
2165
+        console.log( this.currentOrder)
2166
+        console.log( this.hisPatientInfo)
2167
+
2155
 
2168
 
2156
         if (this.hisPatientInfo.id_card_type == 1) {
2169
         if (this.hisPatientInfo.id_card_type == 1) {
2157
           if (this.hisPatientInfo.balance_accounts_type != 2 && this.$store.getters.xt_user.org_id != 10088 && this.$store.getters.xt_user.org_id != 10106 && this.$store.getters.xt_user.org_id != 10188) {
2170
           if (this.hisPatientInfo.balance_accounts_type != 2 && this.$store.getters.xt_user.org_id != 10088 && this.$store.getters.xt_user.org_id != 10106 && this.$store.getters.xt_user.org_id != 10188) {
2166
 
2179
 
2167
           }
2180
           }
2168
         } else {
2181
         } else {
2182
+
2169
           if (this.activeName == 'first') {
2183
           if (this.activeName == 'first') {
2170
             this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
2184
             this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
2171
           } else {
2185
           } else {

+ 2 - 0
src/xt_pages/outpatientCharges/statementTemplate/printOne.vue View File

1
 <template>
1
 <template>
2
   <div id="statement-print" class="statement-print">
2
   <div id="statement-print" class="statement-print">
3
     <div class="statementTitle" v-if="info.fixmedins_code == 'H32092103007'">江苏省社会医疗保险医疗费用结算单</div>
3
     <div class="statementTitle" v-if="info.fixmedins_code == 'H32092103007'">江苏省社会医疗保险医疗费用结算单</div>
4
+    <div class="statementTitle" v-if="info.fixmedins_code == 'H42138100547'">广水源生堂社会医疗保险医疗费用结算单</div>
5
+
4
     <div class="statementTitle" v-else>广东省社会医疗保险医疗费用结算单</div>
6
     <div class="statementTitle" v-else>广东省社会医疗保险医疗费用结算单</div>
5
 
7
 
6
     <table class="statementTable" border="1">
8
     <table class="statementTable" border="1">

+ 1 - 1
src/xt_pages/stock/detail/print.vue View File

51
               <td style="line-height: 50px">
51
               <td style="line-height: 50px">
52
                 <span v-if="type == 1"> {{ item.warehousing_count }}</span>
52
                 <span v-if="type == 1"> {{ item.warehousing_count }}</span>
53
                 <span v-if="type == 2"> 
53
                 <span v-if="type == 2"> 
54
-                  <span  v-if= "org_id == 3907 || org_id ==9919">{{getStockCount(item.good_id) }}</span>  
54
+                  <span  v-if= "org_id == 3907 || org_id == 9919 || org_id == 9583">{{getStockCount(item.good_id) }}</span>  
55
                   <span v-else>{{item.count}}</span>
55
                   <span v-else>{{item.count}}</span>
56
                 </span>
56
                 </span>
57
                
57
                

+ 8 - 4
src/xt_pages/supply/components/addGoodOrder.vue View File

187
     </el-table-column>
187
     </el-table-column>
188
     <el-table-column label="生产厂家" align="center" width="200px">
188
     <el-table-column label="生产厂家" align="center" width="200px">
189
         <template slot-scope="scope">
189
         <template slot-scope="scope">
190
-         <el-select size="small" v-model="scope.row.supply_manufacturer" filterable placeholder="请选择厂家" :disabled="true">
190
+         <el-select size="small" v-model="scope.row.supply_manufacturer" filterable  :disabled="true">
191
                 <el-option
191
                 <el-option
192
                   v-for="(option, index) in manufactuerList"
192
                   v-for="(option, index) in manufactuerList"
193
                   :key="index"
193
                   :key="index"
244
     </el-table-column>
244
     </el-table-column>
245
   </el-table>
245
   </el-table>
246
 </el-form>
246
 </el-form>
247
-   <div style="margin-top:10px">
247
+   <!-- <div style="margin-top:10px">
248
       合计:{{getAllPrice()}} 元
248
       合计:{{getAllPrice()}} 元
249
    </div>
249
    </div>
250
    <div style="margin-top:10px">
250
    <div style="margin-top:10px">
255
         <span>本次付款:<el-input style="width:100px" v-model="payment"></el-input></span>
255
         <span>本次付款:<el-input style="width:100px" v-model="payment"></el-input></span>
256
 
256
 
257
         <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
257
         <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
258
-    </div>
258
+    </div> -->
259
+    <Computed :total="total_price" :rate_of_concession="rate_of_concession" :discount_amount="discount_amount"></Computed>
259
 </div>
260
 </div>
260
 
261
 
261
   <!-- <el-dialog
262
   <!-- <el-dialog
273
 </template>
274
 </template>
274
 
275
 
275
 <script>
276
 <script>
277
+import Computed from "../../components/Computed/index_1.vue"
276
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
278
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
277
 import {uParseTime } from '@/utils/tools'
279
 import {uParseTime } from '@/utils/tools'
278
 import {getInitOrder,checkPurchaseOrder,getPurchaseOrderInfo,addGoodOrder,updateGoodOrder} from "@/api/supply"
280
 import {getInitOrder,checkPurchaseOrder,getPurchaseOrderInfo,addGoodOrder,updateGoodOrder} from "@/api/supply"
279
 export default {
281
 export default {
280
 name: "addPurchaseOrder",
282
 name: "addPurchaseOrder",
281
 components: {
283
 components: {
282
-BreadCrumb
284
+BreadCrumb,
285
+Computed
283
 },
286
 },
284
 data() {
287
 data() {
285
 return {
288
 return {
315
     drugTypeList:[],
318
     drugTypeList:[],
316
     supplier_name:"",
319
     supplier_name:"",
317
     supplyList:[],
320
     supplyList:[],
321
+    total_price:0,
318
     rate_of_concession:"",
322
     rate_of_concession:"",
319
     discount_amount:"",
323
     discount_amount:"",
320
     start_time:"",
324
     start_time:"",

+ 10 - 4
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
17
+          <el-select cxpib`*+9.`
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="请选择"
113
                   v-model="scope.row.name"
113
                   v-model="scope.row.name"
114
                   style="width: 160px"
114
                   style="width: 160px"
115
                   filterable
115
                   filterable
116
-                  placeholder="请选择"
116
+                  placeholder="请选择商品"
117
                   @change="changeName"
117
                   @change="changeName"
118
                   @input="changeGoodName(scope.$index)"
118
                   @input="changeGoodName(scope.$index)"
119
                   :disabled="disabled"
119
                   :disabled="disabled"
138
                 v-model="scope.row.supply_type"
138
                 v-model="scope.row.supply_type"
139
                 style="width: 120px"
139
                 style="width: 120px"
140
                 :disabled="true"
140
                 :disabled="true"
141
+                 placeholder="商品类别"
141
               ></el-input>
142
               ></el-input>
142
               <div style="visibility: hidden">/</div>
143
               <div style="visibility: hidden">/</div>
143
             </template>
144
             </template>
145
           <el-table-column label="规格&单位" align="center" width="200px">
146
           <el-table-column label="规格&单位" align="center" width="200px">
146
             <template slot-scope="scope">
147
             <template slot-scope="scope">
147
               <el-input
148
               <el-input
149
+                placeholder="规格&单位"
148
                 v-model="scope.row.supply_specification_name"
150
                 v-model="scope.row.supply_specification_name"
149
                 style="width: 150px"
151
                 style="width: 150px"
150
                 :disabled="true"
152
                 :disabled="true"
197
               <el-form-item
199
               <el-form-item
198
                 :prop="'tableList.' + scope.$index + '.supply_count'"
200
                 :prop="'tableList.' + scope.$index + '.supply_count'"
199
                 :rules="tableRules.supply_count"
201
                 :rules="tableRules.supply_count"
202
+                 placeholder="请输入数量"
200
               >
203
               >
201
                 <el-input
204
                 <el-input
202
                   v-model="scope.row.supply_count"
205
                   v-model="scope.row.supply_count"
207
             </template>
210
             </template>
208
           </el-table-column>
211
           </el-table-column>
209
 
212
 
210
-          <el-table-column label="购货单价" align="center" width="120px">
213
+          <el-table-column label="购货单价" align="center" width="140px">
211
             <template slot-scope="scope">
214
             <template slot-scope="scope">
212
               <el-input
215
               <el-input
213
                 v-model="scope.row.supply_price"
216
                 v-model="scope.row.supply_price"
214
                 style="width: 80px"
217
                 style="width: 80px"
215
                 :disabled="disabled"
218
                 :disabled="disabled"
219
+                 placeholder="请输入购货单价"
216
               ></el-input>
220
               ></el-input>
217
               <div style="visibility: hidden">/</div>
221
               <div style="visibility: hidden">/</div>
218
             </template>
222
             </template>
230
                 size="small"
234
                 size="small"
231
                 v-model="scope.row.supply_manufacturer"
235
                 v-model="scope.row.supply_manufacturer"
232
                 filterable
236
                 filterable
233
-                placeholder="请选择生产厂家"
234
                 :disabled="true"
237
                 :disabled="true"
235
               >
238
               >
236
                 <el-option
239
                 <el-option
262
                 v-model="scope.row.supply_remake"
265
                 v-model="scope.row.supply_remake"
263
                 style="width: 160px"
266
                 style="width: 160px"
264
                 :disabled="disabled"
267
                 :disabled="disabled"
268
+                placeholder="请输入备注"
265
               ></el-input>
269
               ></el-input>
266
               <div style="visibility: hidden">/</div>
270
               <div style="visibility: hidden">/</div>
267
             </template>
271
             </template>
316
             style="width: 100px"
320
             style="width: 100px"
317
             v-model="rate_of_concession"
321
             v-model="rate_of_concession"
318
             @input="addressChange"
322
             @input="addressChange"
323
+            @placeholder="请输入优惠率"
319
           ></el-input
324
           ></el-input
320
           >%</span
325
           >%</span
321
         >
326
         >
324
           >优惠金额:<el-input
329
           >优惠金额:<el-input
325
             style="width: 100px"
330
             style="width: 100px"
326
             v-model="discount_amount"
331
             v-model="discount_amount"
332
+            @placeholder="请输入优惠金额"
327
           ></el-input
333
           ></el-input
328
         ></span>
334
         ></span>
329
       </div>
335
       </div>

+ 186 - 67
src/xt_pages/supply/components/addSupply.vue View File

1
 <template>
1
 <template>
2
-  <el-dialog title="新增供应商" :visible.sync="dialogVisible" width="35%">
2
+  <el-dialog :title="title" :visible.sync="dialogVisible" width="35%">
3
     <!-- :before-close="handleClose" 如需要可添加进上方 -->
3
     <!-- :before-close="handleClose" 如需要可添加进上方 -->
4
     <div>
4
     <div>
5
       <el-form
5
       <el-form
12
       >
12
       >
13
         <el-row>
13
         <el-row>
14
           <el-col span="6">
14
           <el-col span="6">
15
-            <el-form-item label="供应商编码" prop="id">
16
-              <el-input v-model="supplier.id"></el-input>
15
+            <el-form-item label="供应商编码" prop="supplierCode">
16
+              <el-input v-model="supplier.supplierCode"></el-input>
17
             </el-form-item>
17
             </el-form-item>
18
           </el-col>
18
           </el-col>
19
           <el-col span="6">
19
           <el-col span="6">
20
-            <el-form-item label="供应商名称" prop="name">
21
-              <el-input v-model="supplier.name"></el-input>
20
+            <el-form-item label="供应商名称" prop="supplierName">
21
+              <el-input v-model="supplier.supplierName"></el-input>
22
             </el-form-item>
22
             </el-form-item>
23
           </el-col>
23
           </el-col>
24
         </el-row>
24
         </el-row>
25
         <el-row>
25
         <el-row>
26
           <el-col span="6">
26
           <el-col span="6">
27
-            <el-form-item label="供应商类别">
28
-              <el-input v-model="supplier.type"></el-input>
27
+            <el-form-item label="供应商类别" prop="supplierType">
28
+              <!-- <el-input v-model="supplier.type"></el-input> -->
29
+              <el-autocomplete
30
+                v-model="supplier.supplierType"
31
+                :fetch-suggestions="querySearchAsync"
32
+                @select="handleSelect"
33
+              ></el-autocomplete>
29
             </el-form-item>
34
             </el-form-item>
30
           </el-col>
35
           </el-col>
31
           <el-col span="6">
36
           <el-col span="6">
32
-            <el-form-item label="增值税税率">
33
-              <el-input v-model="supplier.rate"></el-input>
37
+            <el-form-item label="增值税税率" prop="vatRate">
38
+              <el-input v-model="supplier.vatRate"></el-input>
34
             </el-form-item>
39
             </el-form-item>
35
           </el-col>
40
           </el-col>
36
         </el-row>
41
         </el-row>
37
         <el-row>
42
         <el-row>
38
           <el-col span="6">
43
           <el-col span="6">
39
-            <el-form-item label="纳税人识别号">
40
-              <el-input v-model="supplier.taxerId"></el-input>
44
+            <el-form-item label="纳税人识别号" prop="number">
45
+              <el-input v-model="supplier.number"></el-input>
41
             </el-form-item>
46
             </el-form-item>
42
           </el-col>
47
           </el-col>
43
           <el-col span="6">
48
           <el-col span="6">
44
-            <el-form-item label="开户银行">
45
-              <el-input v-model="supplier.bankname"></el-input>
49
+            <el-form-item label="开户银行" prop="bank">
50
+              <el-input v-model="supplier.bank"></el-input>
46
             </el-form-item>
51
             </el-form-item>
47
           </el-col>
52
           </el-col>
48
         </el-row>
53
         </el-row>
49
         <el-row>
54
         <el-row>
50
           <el-col span="6">
55
           <el-col span="6">
51
-            <el-form-item label="银行账号">
52
-              <el-input v-model="supplier.bankId"></el-input>
56
+            <el-form-item label="银行账号" prop="bankAccount">
57
+              <el-input v-model="supplier.bankAccount"></el-input>
53
             </el-form-item>
58
             </el-form-item>
54
           </el-col>
59
           </el-col>
55
         </el-row>
60
         </el-row>
84
                 :rules="tableRules.contacts"
89
                 :rules="tableRules.contacts"
85
               >
90
               >
86
                 <el-input
91
                 <el-input
87
-                  v-model="scope.row.supply_count"
92
+                  v-model="scope.row.name"
88
                   style="width: 80px; margin-top: 3px"
93
                   style="width: 80px; margin-top: 3px"
89
                 ></el-input>
94
                 ></el-input>
90
               </el-form-item>
95
               </el-form-item>
94
           <el-table-column label="手机" align="center" width="100px">
99
           <el-table-column label="手机" align="center" width="100px">
95
             <template slot-scope="scope">
100
             <template slot-scope="scope">
96
               <el-input
101
               <el-input
97
-                v-model="scope.row.supply_price"
102
+                v-model="scope.row.phone"
98
                 style="width: 80px"
103
                 style="width: 80px"
99
               ></el-input>
104
               ></el-input>
100
               <div style="visibility: hidden">/</div>
105
               <div style="visibility: hidden">/</div>
104
           <el-table-column label="联系地址" align="center" width="130px">
109
           <el-table-column label="联系地址" align="center" width="130px">
105
             <template slot-scope="scope">
110
             <template slot-scope="scope">
106
               <el-input
111
               <el-input
107
-                v-model="scope.row.supply_license_number"
112
+                v-model="scope.row.address"
108
                 style="width: 115px"
113
                 style="width: 115px"
109
               ></el-input>
114
               ></el-input>
110
               <div style="visibility: hidden">/</div>
115
               <div style="visibility: hidden">/</div>
119
               <el-form-item :prop="'tableList.' + scope.$index + '.name'">
124
               <el-form-item :prop="'tableList.' + scope.$index + '.name'">
120
                 <!-- :prop="'tableList.' + scope.$index + '.name'"  如需添加可在上方标签加入 -->
125
                 <!-- :prop="'tableList.' + scope.$index + '.name'"  如需添加可在上方标签加入 -->
121
                 <el-select
126
                 <el-select
122
-                  v-model="scope.row.name"
127
+                  v-model="scope.row.is_first"
123
                   style="width: 90px"
128
                   style="width: 90px"
124
                   placeholder="请选择"
129
                   placeholder="请选择"
125
                   @change="changeName($event, scope)"
130
                   @change="changeName($event, scope)"
180
     </div>
185
     </div>
181
 
186
 
182
     <span slot="footer" class="dialog-footer">
187
     <span slot="footer" class="dialog-footer">
183
-      <el-button @click="dialogVisible = false">取 消</el-button>
188
+      <el-button @click="closePop">取 消</el-button>
184
       <el-button type="primary" @click="submitForm('supplier')"
189
       <el-button type="primary" @click="submitForm('supplier')"
185
         >确 定</el-button
190
         >确 定</el-button
186
       >
191
       >
189
 </template>
194
 </template>
190
 
195
 
191
 <script>
196
 <script>
197
+import {
198
+  getSupplierId,
199
+  getsupplytype,
200
+  getsupplyandcontactone,
201
+} from "@/api/supply";
192
 import Template from "../../data/template.vue";
202
 import Template from "../../data/template.vue";
193
 export default {
203
 export default {
194
   data() {
204
   data() {
195
     return {
205
     return {
206
+      title: "",
196
       Template,
207
       Template,
197
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
208
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
198
       list: ["001", "002"],
209
       list: ["001", "002"],
253
       value: "",
264
       value: "",
254
       dialogVisible: false,
265
       dialogVisible: false,
255
       supplier: {
266
       supplier: {
256
-        name: "",
257
-        id: "",
258
-        type: "",
259
-        rate: 10,
260
-        taxerId: "",
261
-        bankId: "",
262
-        bankname: "",
267
+        supplierName: "a",
268
+        supplierCode: "gsy001",
269
+        supplierType: "",
270
+        vatRate: 10,
271
+        number: "",
272
+        bank: "",
273
+        bankAccount: "",
263
       },
274
       },
275
+      supply_code: [],
276
+      select_supply: [],
277
+      type: "",
278
+      timeout: null,
279
+      id: "",
280
+      name: "",
264
     };
281
     };
265
   },
282
   },
266
-  created() {
267
-    this.supplier.id = "gys001";
268
-    this.getcontacts();
269
-  },
283
+  created() {},
270
   methods: {
284
   methods: {
271
-    show() {
272
-      this.dialogVisible = true;
285
+    show(data, type) {
286
+      if (type == 1) {
287
+        this.initSupplierData();
288
+        this.title = "新增供应商";
289
+        this.dialogVisible = true;
290
+      } else if (type == 2) {
291
+        this.title = "编辑供应商";
292
+        this.supplier.supplierCode = data.SupplierCode;
293
+        this.supplier.supplierName = data.SupplierName;
294
+        this.supplier.supplierType = data.SupplierType;
295
+        this.supplier.vatRate = data.VatRate;
296
+        this.supplier.number = data.Number;
297
+        this.supplier.bank = data.Bank;
298
+        this.supplier.bankAccount = data.BankAccount;
299
+        this.getcontacts(data.ID);
300
+        this.dialogVisible = true;
301
+      }
302
+    },
303
+    closePop() {
304
+      this.dialogVisible = false;
305
+      this.supply_code = [];
306
+      this.supplier.supplierCode = "";
307
+      this.supplier.supplierName = "";
308
+      this.supplier.supplierType = "";
309
+      this.supplier.vatRate = "";
310
+      this.supplier.number = "";
311
+      this.supplier.bank = "";
312
+      this.supplier.bankAccount = "";
313
+      this.recordInfo.tableList = [{}];
314
+    },
315
+
316
+    // 获取供应商编码接口
317
+    initSupplierData() {
318
+      let Arr = [];
319
+      getSupplierId().then((res) => {
320
+        Arr = res.data.data;
321
+        Arr.supplycode.forEach((o) => {
322
+          this.supply_code.push(o.supplier_code);
323
+        });
324
+      });
273
       this.orderIdAdd();
325
       this.orderIdAdd();
274
-      // this.continueArr();
275
     },
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}`;
343
+        }
344
+      });
345
+    },
346
+
347
+    querySearchAsync(queryString, cb) {
348
+      clearTimeout(this.timeout);
349
+      var results = [];
350
+      if (queryString == "") {
351
+        cb(results);
352
+      } else {
353
+        // 获取供应商类别接口
354
+        getsupplytype()
355
+          .then((res) => {
356
+            if (res.status == 200) {
357
+              var result = res.data.data.list;
358
+              //远程搜索需要的数组
359
+              for (let i = 0; i < result.length; i++) {
360
+                const element = result[i];
361
+                results.push({
362
+                  value: element.name,
363
+                  name: element.value,
364
+                });
365
+              }
366
+              cb(results);
367
+            } else {
368
+              results = [];
369
+              cb(results);
370
+            }
371
+          })
372
+          .catch((err) => {
373
+            console.log(err);
374
+          });
375
+      }
376
+    },
377
+
378
+    handleSelect(item) {
379
+      console.log(item, "l");
380
+      this.supplier.name = item.value;
381
+      this.supplier.value = item.name;
382
+    },
383
+
276
     //  验证表单内容
384
     //  验证表单内容
277
     submitForm(formName) {
385
     submitForm(formName) {
278
       this.$refs[formName].validate((valid) => {
386
       this.$refs[formName].validate((valid) => {
280
           alert("submit!");
388
           alert("submit!");
281
           this.dialogVisible = false;
389
           this.dialogVisible = false;
282
         } else {
390
         } else {
283
-          console.log("error submit!!");
284
           return false;
391
           return false;
285
         }
392
         }
286
       });
393
       });
289
     },
396
     },
290
 
397
 
291
     // 首次打开新增页面判断是否有首要联系人
398
     // 首次打开新增页面判断是否有首要联系人
292
-    getcontacts() {
399
+    getcontacts(val) {
293
       let data = {
400
       let data = {
294
         value: 0,
401
         value: 0,
295
         label: "是",
402
         label: "是",
296
       };
403
       };
404
+      getsupplyandcontactone({ id: val }).then((res) => {
405
+        console.log(res, "oo");
406
+        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();
412
+          } 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 = "是";
418
+              }
419
+            });
420
+          }
421
+
422
+          console.log(this.recordInfo.tableList, "this.recordInfo.tableList");
423
+        }
424
+      });
425
+
297
       if (this.recordInfo.tableList.length == 1) {
426
       if (this.recordInfo.tableList.length == 1) {
298
-        this.recordInfo.tableList[0].name = data;
427
+        this.recordInfo.tableList[0].is_first = data;
299
         this.$forceUpdate();
428
         this.$forceUpdate();
300
       }
429
       }
301
     },
430
     },
311
         value: 0,
440
         value: 0,
312
         label: "是",
441
         label: "是",
313
       };
442
       };
443
+      let arr = [];
314
       if (this.recordInfo.tableList.length == 1) {
444
       if (this.recordInfo.tableList.length == 1) {
315
-        this.recordInfo.tableList[0].name = data2;
445
+        this.recordInfo.tableList[0] = data2;
316
         this.$forceUpdate();
446
         this.$forceUpdate();
317
       }
447
       }
318
-
319
       this.recordInfo.tableList.forEach((el, index) => {
448
       this.recordInfo.tableList.forEach((el, index) => {
320
-        console.log(el, "oo");
321
         if (scope.$index == index) {
449
         if (scope.$index == index) {
322
-          el.name = data2;
450
+          el.is_first = data;
451
+          // console.log(scope);
323
           this.$forceUpdate();
452
           this.$forceUpdate();
324
-          console.log(el.name.value, scope.$index, index);
325
         } else {
453
         } else {
326
-          el.name = data1;
454
+          el.is_first = data1;
327
           this.$forceUpdate();
455
           this.$forceUpdate();
328
-          console.log("kkk");
329
         }
456
         }
457
+        arr.push(el.is_first.value);
330
       });
458
       });
331
-    },
332
-
333
-    // 供应商编码动态递增
334
-    orderIdAdd() {
335
-      // 模拟情景
336
-      let data = ["gsy001","gsy002", "gsy003", "gsy006"];
337
-      let len = 3;
338
-      data.forEach((o, index) => {
339
-        o = o.split("gsy");
340
-        index = index + 1;
341
-        let index1 = index;
342
-        index1 = parseInt(index1, 10);
343
-        index1 = index1.toString();
344
-        while (index1.length < len) index1 = "0" + index1;
345
-        if (o[1] != index1) {
346
-          data.splice(index - 1, 0, `gsy${index1}`);
347
-          console.log(`gsy${index1}`);
348
-          this.supplier.id = `gsy${index1}`
349
-        }
350
-        
351
-      });
459
+      if (arr.includes(0)) {
460
+        return;
461
+      } else {
462
+        this.recordInfo.tableList[0].is_first = data2;
463
+      }
352
     },
464
     },
353
 
465
 
354
     // 添加表单行
466
     // 添加表单行
382
         // }
494
         // }
383
       })
495
       })
384
         .then((res) => {
496
         .then((res) => {
385
-          console.log(res, "ooo");
497
+          // console.log(res, "ooo");
386
         })
498
         })
387
         .catch((err) => {
499
         .catch((err) => {
388
-          console.log(err, "ddd");
500
+          // console.log(err, "ddd");
389
         });
501
         });
390
     },
502
     },
391
   },
503
   },
401
     width: 75%;
513
     width: 75%;
402
   }
514
   }
403
 }
515
 }
516
+.el-dialog__body {
517
+  .el-form-item__content {
518
+    .el-autocomplete {
519
+      width: 75% !important;
520
+    }
521
+  }
522
+}
404
 
523
 
405
 .tablebtn {
524
 .tablebtn {
406
   padding: 10px 12px;
525
   padding: 10px 12px;

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

49
     <div>
49
     <div>
50
         <el-button size="small" type="primary" @click="updateGoodOrder">保存</el-button>
50
         <el-button size="small" type="primary" @click="updateGoodOrder">保存</el-button>
51
         <el-button size="small" type="primary"  @click="toClick" v-show="showThree">生成采购退货单</el-button>
51
         <el-button size="small" type="primary"  @click="toClick" v-show="showThree">生成采购退货单</el-button>
52
-        <el-button size="small" type="primary"  v-show="showOne">审核</el-button>
53
-        <el-button size="small" type="primary"  v-show="showTwo">反审核</el-button>
52
+        <el-button size="small" type="primary"  v-show="showOne" @click="checkGoodOrder">审核</el-button>
53
+        <el-button size="small" type="primary"  v-show="showTwo" @click="MofyGoodOrder">反审核</el-button>
54
 
54
 
55
        
55
        
56
     </div>
56
     </div>
187
     </el-table-column>
187
     </el-table-column>
188
     <el-table-column label="生产厂家" align="center" width="200px">
188
     <el-table-column label="生产厂家" align="center" width="200px">
189
         <template slot-scope="scope">
189
         <template slot-scope="scope">
190
-         <el-select size="small" v-model="scope.row.supply_manufacturer" filterable placeholder="请选择厂家" :disabled="true">
190
+         <el-select size="small" v-model="scope.row.supply_manufacturer" filterable  :disabled="true">
191
                 <el-option
191
                 <el-option
192
                   v-for="(option, index) in manufactuerList"
192
                   v-for="(option, index) in manufactuerList"
193
                   :key="index"
193
                   :key="index"
256
 
256
 
257
         <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
257
         <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
258
     </div>
258
     </div>
259
+    <!-- <Computed></Computed> -->
259
 </div>
260
 </div>
260
 
261
 
261
   <!-- <el-dialog
262
   <!-- <el-dialog
273
 </template>
274
 </template>
274
 
275
 
275
 <script>
276
 <script>
277
+import Computed from "../../components/Computed/index_1.vue"
276
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
278
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
277
 import {uParseTime } from '@/utils/tools'
279
 import {uParseTime } from '@/utils/tools'
278
-import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList,ModefySupplyWarehousing} from "@/api/supply"
280
+import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList,ModefySupplyWarehousing,MofyGoodOrder,UpdateSupplyWahouseingInfo} from "@/api/supply"
279
 export default {
281
 export default {
280
 name: "addPurchaseOrder",
282
 name: "addPurchaseOrder",
281
 components: {
283
 components: {
282
-BreadCrumb
284
+BreadCrumb,
285
+Computed
283
 },
286
 },
284
 data() {
287
 data() {
285
 return {
288
 return {
818
   },
821
   },
819
   toClick(){
822
   toClick(){
820
     this.$router.push({path:"/good/return/add?id="+this.id})
823
     this.$router.push({path:"/good/return/add?id="+this.id})
824
+  },
825
+  //反审核
826
+  MofyGoodOrder(){
827
+     var id = this.$route.query.id
828
+     var warehousing_id = this.$route.query.warehousing_id
829
+     var params = {
830
+       id:id,
831
+       warehousing_id:warehousing_id,
832
+     }
833
+    MofyGoodOrder(params).then(response=>{
834
+      if(response.data.state == 1){
835
+        var msg = response.data.data.msg
836
+        if(msg == 1){
837
+          this.$message.success("反审核成功!")
838
+        }
839
+        if(msg == 2){
840
+          this.$message.error("该单有自动出库或生成了退货单,反审核失败!")
841
+          
842
+        }
843
+
844
+        var purcaseOrder = response.data.data.purcaseOrder
845
+        console.log("采购订单",purcaseOrder)
846
+        
847
+        var goodOrder = response.data.data.goodOrder
848
+        console.log("采购单",goodOrder)
849
+        var drugList = response.data.data.drugList
850
+        console.log("druglist23323223",drugList)
851
+        var ids =""
852
+        // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
853
+        if(goodOrder.length == 0){
854
+          this.$router.push({path:"/good/order/add?id="+id+"&ids="+ids})
855
+        } 
856
+        for(let i=0;i<purcaseOrder.length;i++){
857
+          for(let j=0;j<drugList.length;j++){
858
+             if(purcaseOrder[i].is_source == 1){
859
+               if(purcaseOrder[i].supply_unit == drugList[j].max_unit){
860
+                  purcaseOrder[i].count = purcaseOrder[i].count * drugList[j].min_number
861
+               }
862
+             }
863
+          }
864
+        }
865
+
866
+        for(let i=0;i<goodOrder.length;i++){
867
+          for(let j=0;j<drugList.length;j++){
868
+            if(goodOrder[i].is_source == 1){
869
+              if(goodOrder[i].supply_unit == drugList[j].max_unit){
870
+                 goodOrder[i].count = goodOrder[i].count * drugList[j].min_number
871
+              }
872
+            }
873
+          }
874
+        }
875
+        
876
+        let objInfo = {}
877
+        if (goodOrder.length >0){
878
+          goodOrder.forEach((item,index)=>{
879
+            let { project_id } = item
880
+            if(!objInfo[project_id]){
881
+              objInfo[project_id] = {
882
+                project_id,
883
+                child:[],
884
+                count:0,
885
+              }
886
+            }
887
+          })
888
+          let newArr = Object.values(objInfo);
889
+        
890
+          for(let i=0;i<goodOrder.length;i++){
891
+            for(let j=0;j<newArr.length;j++){
892
+              if(goodOrder[i].project_id == newArr[j].project_id){
893
+                newArr[j].child.push(goodOrder[i])
894
+              }
895
+            }
896
+          }
897
+          console.log("newAr2332232323",newArr)
898
+        
899
+          for(let i=0;i<newArr.length;i++){
900
+           for(let j=0;j<newArr[i].child.length;j++){
901
+             newArr[i].count += newArr[i].child[j].count
902
+           }
903
+          }
904
+
905
+          var arr = []
906
+          var total = 0
907
+          var str = ""
908
+         
909
+          //如果采购单有数据,则需要比较数量
910
+          if(newArr.length > 0){
911
+            for(let i=0;i<purcaseOrder.length;i++){
912
+              for(let j=0;j<newArr.length;j++){
913
+                if(purcaseOrder[i].project_id == newArr[j].project_id){
914
+                    //根据商品ID比较数量大小,如果采购单的数量大于采购订单的数据
915
+                    if(purcaseOrder[i].count < newArr[j].count){
916
+                      arr.push(purcaseOrder[i].project_id)
917
+                    }
918
+
919
+                }
920
+              }
921
+            }
922
+            //如果total的长度等于0,怎修改该订单的状态为全部入库
923
+        
924
+            if(arr.length > 0){
925
+              //修改采购订单的状态为全部入库
926
+              this.UpdateSupplyWahouseingInfo()
927
+            }
928
+          }
929
+        }
930
+        
931
+      }
932
+    })
933
+  },
934
+  UpdateSupplyWahouseingInfo(){
935
+     var params = {
936
+       warehousing_id:this.$route.query.warehousing_id,
937
+     }
938
+    UpdateSupplyWahouseingInfo(params).then(response =>{
939
+       if(response.data.state == 1){
940
+         var msg = response.data.data.msg
941
+       }
942
+    })
821
   }
943
   }
822
 },
944
 },
823
 created(){
945
 created(){

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


+ 924 - 0
src/xt_pages/supply/components/editSupply.vue View File

1
+<template>
2
+<div class="main-contain">
3
+<div class="position">
4
+    <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+</div>
6
+<div class="app-container"  v-loading="loading">
7
+    <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
+    <div>
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">
12
+        <el-option
13
+            v-for="item in supplyList"
14
+            :key="item.id"
15
+            :label="item.supplier_name"
16
+            :value="item.id">
17
+        </el-option>
18
+        </el-select>
19
+        <span>单据日期:</span>
20
+        <el-date-picker
21
+        size="small"
22
+        v-model="start_time"
23
+        prefix-icon="el-icon-date"
24
+        :editable="false"
25
+        style="width: 196px;"
26
+        type="date"
27
+        placeholder="选择日期时间"
28
+        align="right"
29
+        format="yyyy-MM-dd"
30
+        value-format="yyyy-MM-dd"
31
+        @change="startTimeChange"
32
+        ></el-date-picker>
33
+        <!-- <span>交货日期:</span> -->
34
+        <!-- <el-date-picker
35
+            size="small"
36
+            v-model="end_time"
37
+            prefix-icon="el-icon-date"
38
+            :editable="false"
39
+            style="width: 196px;"
40
+            type="date"
41
+            placeholder="选择日期时间"
42
+            align="right"
43
+            format="yyyy-MM-dd"
44
+            value-format="yyyy-MM-dd"
45
+            @change="endTimeChange"
46
+        ></el-date-picker> -->
47
+        <span>单据编码:{{good_number}}</span>
48
+
49
+    </div>
50
+    <div>
51
+        <el-button size="small" type="primary" @click="updateGoodOrder">修改</el-button>
52
+        <el-button size="small" type="primary"  @click="checkGoodOrder">审核</el-button>
53
+
54
+       
55
+    </div>
56
+    </div>
57
+
58
+   <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
59
+    <el-table
60
+    :row-style="{ color: '#303133' }"
61
+    :header-cell-style="{
62
+        backgroundColor: 'rgb(245, 247, 250)',
63
+        color: '#606266'
64
+    }"
65
+    :data="recordInfo.tableList"
66
+    :class="signAndWeighBoxPatients"
67
+    border
68
+    style="width: 100%"
69
+    max-height="450"
70
+    >
71
+    <el-table-column align="center" width="200px">
72
+        <template slot="header" slot-scope="scope">
73
+            <span>商品<span style="color: red">*</span></span>
74
+        </template>
75
+        <template slot-scope="scope">
76
+           <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
77
+            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
78
+                <el-option
79
+                    v-for="(item,index) in tabList"
80
+                    :key="index"
81
+                    :label="item.supply_name"
82
+                    :value="item">
83
+                </el-option>
84
+             </el-select>
85
+           </el-form-item>
86
+        </template>
87
+    </el-table-column>
88
+    <el-table-column  align="center" width="150px">
89
+        <template slot="header" slot-scope="scope">
90
+            <span>商品类别</span>
91
+        </template>
92
+        <template slot-scope="scope">
93
+            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
94
+            <div style="visibility: hidden">/</div>
95
+        </template>
96
+    </el-table-column>
97
+    <el-table-column label="规格&单位" align="center" width="120px">
98
+        <template slot-scope="scope">
99
+            <el-input v-model="scope.row.supply_specification_name" style="width:100px" :disabled="true"></el-input>
100
+            <div style="visibility: hidden">/</div>
101
+        </template>
102
+    </el-table-column>
103
+     <el-table-column label="单位" align="center" width="120px">
104
+        <template slot="header" slot-scope="scope">
105
+            <span>单位<span style="color: red">*</span></span>
106
+        </template>
107
+        <template slot-scope="scope">
108
+          <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
109
+            <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择"  :disabled="disabled">
110
+                    <el-option
111
+                        v-for="(item,index) in scope.row.unitList"
112
+                        :key="index"
113
+                        :label="item.name"
114
+                        :value="item.name">
115
+                    </el-option>
116
+             </el-select>
117
+          </el-form-item>  
118
+        </template>
119
+    </el-table-column>
120
+    <el-table-column label="批号" align="center" width="130px">
121
+         <template slot="header" slot-scope="scope">
122
+            <span>批号<span style="color: red">*</span></span>
123
+        </template>
124
+        <template slot-scope="scope">
125
+           <el-form-item  :prop="'tableList.' + scope.$index + '.supply_batch_number'" :rules='tableRules.supply_batch_number'>
126
+             <el-input v-model="scope.row.supply_batch_number" style="width:80px" :disabled="disabled"></el-input>
127
+          </el-form-item>
128
+        </template>
129
+    </el-table-column>
130
+     <el-table-column label="有效日期" align="center" width="200px">
131
+        <template slot="header" slot-scope="scope">
132
+              <span>有效日期<span style="color: red">*</span></span>
133
+            </template>
134
+            <template slot-scope="scope">
135
+              <el-form-item  :prop="'tableList.' + scope.$index + '.supply_expiry_date'"
136
+                :rules="tableRules.supply_expiry_date">
137
+                <el-date-picker prefix-icon="el-icon-date" style="width:180px" v-model="scope.row.supply_expiry_date"
138
+                                type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
139
+                                value-format="yyyy-MM-dd">
140
+                </el-date-picker>
141
+             </el-form-item>
142
+       </template>
143
+    </el-table-column>
144
+    <el-table-column label="可用库存" align="center" width="100px">
145
+        <template slot-scope="scope">
146
+            <el-input v-model="scope.row.supply_total" style="width:80px" :disabled="true"></el-input>
147
+            <div style="visibility: hidden">/</div>
148
+        </template>
149
+    </el-table-column>
150
+    <el-table-column label="数量" align="center" width="120px">
151
+        <template slot="header" slot-scope="scope">
152
+            <span>数量<span style="color: red">*</span></span>
153
+        </template>
154
+        <template slot-scope="scope">
155
+          <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
156
+             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
157
+          </el-form-item>
158
+        </template>
159
+    </el-table-column>
160
+
161
+    <el-table-column label="采购单价" align="center" width="120px">
162
+        <template slot-scope="scope">
163
+        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
164
+        <div style="visibility: hidden">/</div>
165
+        </template>
166
+    </el-table-column>
167
+
168
+    <el-table-column label="采购金额" align="center" width="120px">
169
+        <template slot-scope="scope">
170
+          {{calculate(scope.row.supply_count * scope.row.supply_price)}}
171
+        </template>
172
+    </el-table-column>
173
+    <el-table-column label="生产日期" align="center" width="200px">
174
+         <template slot="header" slot-scope="scope">
175
+            <span>生产日期<span style="color: red">*</span></span>
176
+        </template>
177
+        <template slot-scope="scope">
178
+          <el-form-item  :prop="'tableList.' + scope.$index + '.supply_product_date'"
179
+                :rules="tableRules.supply_product_date">
180
+                <el-date-picker prefix-icon="el-icon-date" style="width: 180px" v-model="scope.row.supply_product_date"
181
+                                type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
182
+                                value-format="yyyy-MM-dd">
183
+                </el-date-picker>
184
+          </el-form-item>
185
+        </template>
186
+    </el-table-column>
187
+    <el-table-column label="生产厂家" align="center" width="200px">
188
+        <template slot-scope="scope">
189
+         <el-select size="small" v-model="scope.row.supply_manufacturer" filterable placeholder="请选择厂家" :disabled="true">
190
+                <el-option
191
+                  v-for="(option, index) in manufactuerList"
192
+                  :key="index"
193
+                  :label="option.manufacturer_name"
194
+                  :value="option.id">
195
+                </el-option>
196
+          </el-select>
197
+          <div style="visibility: hidden">/</div>
198
+        </template>
199
+    </el-table-column>
200
+
201
+
202
+    <el-table-column label="批准文号" align="center" width="200px">
203
+        <template slot-scope="scope">
204
+        <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="true"></el-input>
205
+        <div style="visibility: hidden">/</div>
206
+        </template>
207
+    </el-table-column>
208
+
209
+     <el-table-column label="关联采购订单号" align="center" width="200px">
210
+        <template slot-scope="scope">
211
+        <el-input v-model="scope.row.order_number" style="width:160px" :disabled="true"></el-input>
212
+        <div style="visibility: hidden">/</div>
213
+        </template>
214
+    </el-table-column>
215
+
216
+    <el-table-column label="备注" align="center" width="200px">
217
+        <template slot-scope="scope">
218
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
219
+        <div style="visibility: hidden">/</div>
220
+        </template>
221
+    </el-table-column>
222
+
223
+    <el-table-column label="操作" align="center" width="150px" fixed="right" >
224
+        <template slot-scope="scope">
225
+        <el-tooltip class="item" effect="dark" content="新增" placement="top" >
226
+            <el-button
227
+                size="mini"
228
+                type="primary"
229
+                icon="el-icon-circle-plus-outline"
230
+                @click="handleEdit(scope.$index, scope.row)">
231
+            </el-button>
232
+       </el-tooltip>
233
+       <el-tooltip class="item" effect="dark" content="删除" placement="top">
234
+            <el-button
235
+                size="mini"
236
+                type="danger"
237
+                icon="el-icon-delete"
238
+                @click="handleDelete(scope.$index, scope.row)">
239
+            </el-button>
240
+        </el-tooltip>
241
+
242
+        </template>
243
+    </el-table-column>
244
+  </el-table>
245
+</el-form>
246
+   <div style="margin-top:10px">
247
+      合计:{{getAllPrice()}} 元
248
+   </div>
249
+   <div style="margin-top:10px">
250
+        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
251
+
252
+        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
253
+      
254
+        <span>本次付款:<el-input style="width:100px" v-model="payment"></el-input></span>
255
+
256
+        <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
257
+    </div>
258
+    <!-- <Computed></Computed> -->
259
+</div>
260
+
261
+  <!-- <el-dialog
262
+  title="提示"
263
+  :visible.sync="dialogVisible"
264
+  width="30%"
265
+  :before-close="handleClose">
266
+  <span>这是一段信息</span>
267
+  <span slot="footer" class="dialog-footer">
268
+    <el-button @click="dialogVisible = false">取 消</el-button>
269
+    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
270
+  </span>
271
+  </el-dialog> -->
272
+</div>
273
+</template>
274
+
275
+<script>
276
+import Computed from "../../components/Computed/index_1.vue"
277
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
278
+import {uParseTime } from '@/utils/tools'
279
+import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList,ModefySupplyWarehousing} from "@/api/supply"
280
+export default {
281
+name: "addPurchaseOrder",
282
+components: {
283
+BreadCrumb,
284
+Computed
285
+},
286
+data() {
287
+return {
288
+    crumbs: [
289
+       { path: false, name: "采购管理" },
290
+       { path: "/supply/good/order/query", name: "编辑供应商" }
291
+    ],
292
+    showTwo:true,
293
+    showOne:false,
294
+    recordInfo: {
295
+      tableList:[],
296
+    },
297
+    keywords: "",
298
+    total: 0,
299
+    multipleSelection: [],
300
+    signAndWeighBoxPatients: "sign-and-weigh-box-patients",
301
+    start_time: "",
302
+    end_time: "",
303
+    page: 1,
304
+    limit: 10,
305
+    goodType: [],
306
+    goodInfo: [],
307
+    org_id:0,
308
+    types:[],
309
+    tyep_name:"",
310
+    form:{
311
+    manufacturer_id:"",
312
+    },
313
+    tabList:[],
314
+    manufactuerList:[],
315
+    currentIndex: 0,
316
+    goodTypeList:[],
317
+    drugTypeList:[],
318
+    supplier_name:"",
319
+    supplyList:[],
320
+    rate_of_concession:"",
321
+    discount_amount:"",
322
+    start_time:"",
323
+    end_time:"",
324
+    tableRules: {
325
+     name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
326
+     supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
327
+     supply_batch_number:[{required:true,message:"批号不能为空", trigger: 'blur'}],
328
+     supply_product_date:[{required:true,message:"生产日期不能为空", trigger: 'blur'}],
329
+     supply_expiry_date:[{required:true,message:"有效日期不能为空",trigger: 'blur'}]
330
+   },
331
+   warehousing_id:0,
332
+   number:"",
333
+   loading:false,
334
+   drugList:[],
335
+   goodList:[],
336
+   id:0,
337
+   disabled:false,
338
+   is_check:0,
339
+   dialogVisible:false,
340
+   arrearage:"",
341
+   payment:"",
342
+   good_number:"",
343
+   orderInfo:[],
344
+   showOne:true,
345
+   showTwo:false,
346
+   warese_out_id:0,
347
+  };
348
+},
349
+methods:{
350
+
351
+getInitOrder(){
352
+    getInitOrder().then(response=>{
353
+    if(response.data.state == 1){
354
+        var drugList = response.data.data.drugList
355
+        this.manufactuerList = response.data.data.manufactuerList
356
+        this.goodTypeList = response.data.data.goodTypeList
357
+        this.drugTypeList = response.data.data.drugTypeList
358
+        this.supplyList = response.data.data.supplyList
359
+       for(let i=0;i<drugList.length;i++){
360
+          for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
361
+             if(drugList[i].max_unit == drugList[i].drug_warehouse_info[z].max_unit){
362
+              drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
363
+            }
364
+          }
365
+        for(let j=0;j<this.manufactuerList.length;j++){
366
+            if(drugList[i].manufacturer == this.manufactuerList[j].id){
367
+                drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
368
+            }
369
+        }
370
+        for(let y=0;y<this.drugTypeList.length;y++){
371
+            if(drugList[i].drug_type == this.drugTypeList[y].value){
372
+            drugList[i].drug_type = this.drugTypeList[y].name
373
+            }
374
+        }
375
+        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
376
+        drugList[i].supply_type = drugList[i].drug_type
377
+        drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
378
+        drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
379
+        drugList[i].supply_count = ""
380
+        drugList[i].supply_total_price = ""
381
+        drugList[i].supply_manufacturer=  drugList[i].manufacturer
382
+        drugList[i].supply_license_number= drugList[i].number
383
+        drugList[i].supply_remake = ""
384
+        drugList[i].type = 1
385
+        drugList[i].supply_price = drugList[i].last_price
386
+        drugList[i].name = drugList[i].drug_name
387
+        if(drugList[i].max_unit != drugList[i].min_unit){
388
+          drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
389
+        }
390
+        if(drugList[i].max_unit == drugList[i].min_unit){
391
+          drugList[i].unitList = [{id:1,name:""}]
392
+        }
393
+       
394
+        drugList[i].warehouse_info_id = 0
395
+        drugList[i].warehousing_id= 0
396
+        drugList[i].supply_unit = drugList[i].max_unit 
397
+        for(let j=0;j<drugList[i].unitList.length;j++){
398
+          if(drugList[i].max_unit != drugList[i].min_unit){
399
+            drugList[i].unitList[0].name = drugList[i].max_unit
400
+            drugList[i].unitList[1].name = drugList[i].min_unit
401
+          }
402
+          if(drugList[i].max_unit  == drugList[i].min_unit){
403
+            drugList[i].unitList[0].name = drugList[i].max_unit
404
+          }
405
+        }
406
+        this.tabList.push(drugList[i])
407
+        }
408
+        this.drugList = drugList
409
+        var goodList =  response.data.data.goodList
410
+        for(let i=0;i<goodList.length;i++){
411
+        for(let j=0;j<this.manufactuerList.length;j++){
412
+            if(goodList[i].manufacturer == this.manufactuerList[j].id){
413
+                goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
414
+            }
415
+        }
416
+        for(let y=0;y<this.goodTypeList.length;y++){
417
+            if(goodList[i].good_type_id == this.goodTypeList[y].id){
418
+                goodList[i].good_type_id = this.goodTypeList[y].type_name
419
+            }
420
+        }
421
+        goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
422
+        goodList[i].supply_type = goodList[i].good_type_id
423
+        goodList[i].supply_specification_name =goodList[i].specification_name
424
+        goodList[i].supply_price = goodList[i].buy_price
425
+        goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
426
+        goodList[i].supply_count = ""
427
+        goodList[i].supply_total_price = ""
428
+        goodList[i].supply_manufacturer = goodList[i].manufacturer
429
+        goodList[i].supply_license_number = ""
430
+        goodList[i].supply_remake = ""
431
+        goodList[i].type = 2
432
+        goodList[i].name = goodList[i].good_name
433
+        goodList[i].unitList =  [{id:1,name:""}]
434
+        goodList[i].supply_unit = goodList[i].packing_unit
435
+        goodList[i].warehouse_info_id = 0
436
+        goodList[i].warehousing_id= 0
437
+        for(let j=0;j<goodList[i].unitList.length;j++){
438
+           goodList[i].unitList[0].name = goodList[i].packing_unit 
439
+        }
440
+        this.tabList.push(goodList[i])
441
+        }
442
+        this.goodList = goodList
443
+    } 
444
+    })
445
+},
446
+changeGoodName(val){
447
+  this.currentIndex = val
448
+},
449
+changeName(val){
450
+  
451
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
452
+    if(this.currentIndex == i){
453
+        this.recordInfo.tableList[i].project_id = val.id
454
+        this.recordInfo.tableList[i].type = val.type
455
+        this.recordInfo.tableList[i].name = val.name
456
+        this.recordInfo.tableList[i].supply_name = val.supply_name
457
+        this.recordInfo.tableList[i].supply_type = val.supply_type
458
+        this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
459
+        this.recordInfo.tableList[i].supply_total = val.supply_total
460
+       
461
+        if(val.supply_count == NaN){
462
+           this.recordInfo.tableList[i].supply_count = ""
463
+        }else{
464
+          this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
465
+        }
466
+
467
+        this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
468
+        this.recordInfo.tableList[i].supply_total_price = (val.supply_count * val.supply_price).toFixed(2)
469
+        this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
470
+        this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
471
+        this.recordInfo.tableList[i].supply_remake = val.supply_remake
472
+        this.recordInfo.tableList[i].is_total = val.is_total
473
+        this.recordInfo.tableList[i].supply_unit = val.supply_unit
474
+        this.recordInfo.tableList[i].unitList = val.unitList
475
+        this.recordInfo.tableList[i].warehouse_info_id = val.warehouse_info_id
476
+        this.recordInfo.tableList[i].warehousing_id = val.warehousing_id
477
+     }
478
+    }
479
+   
480
+
481
+},
482
+handleEdit(){
483
+    const tempObj = {}
484
+    tempObj["id"] = 0
485
+    tempObj["name"] = ""
486
+    tempObj['supply_name'] = ""
487
+    tempObj['supply_type'] = ""
488
+    tempObj['supply_specification_name'] = ''
489
+    tempObj['supply_total'] = ""
490
+    tempObj['supply_count'] = ""
491
+    tempObj['supply_price'] = ""
492
+    tempObj['supply_total_price'] = ""
493
+    tempObj['supply_manufacturer'] = ''
494
+    tempObj['supply_license_number'] = ''
495
+    tempObj['supply_remake'] = ''
496
+    tempObj['type'] = 0
497
+    tempObj['is_total'] = 1
498
+    tempObj["project_id"] = 0
499
+    tempObj["supply_unit"] = ""
500
+    tempObj["supply_batch_number"] = ""
501
+    tempObj["supply_product_date"] = ""
502
+    tempObj["order_number"] = ""
503
+    tempObj["supply_expiry_date"] = ""
504
+    tempObj["manufacturer_id"] = ""
505
+    tempObj["warehouse_info_id"] = ""
506
+    tempObj["warehousing_id"]= ""
507
+    this.recordInfo.tableList.push(tempObj)
508
+},
509
+handleDelete: function(index, row) {
510
+  if (this.recordInfo.tableList.length <= 1) {
511
+        this.$message.error('只有一条记录的时候无法删除')
512
+        return
513
+   } else {
514
+        this.recordInfo.tableList.splice(index, 1)
515
+   }
516
+},
517
+
518
+changeTypeName(){
519
+
520
+},
521
+startTimeChange(){
522
+
523
+},
524
+endTimeChange(){
525
+
526
+},
527
+search(){
528
+
529
+},
530
+
531
+getWarehoseInfo(arr,max_unit,min_unit,min_number){
532
+    var total = 0
533
+    var max_str=  ""
534
+    var min_str = ""
535
+    if (arr.length > 0) {
536
+      for(let i=0;i<arr.length;i++){
537
+        total += parseInt(arr[i].stock_max_number+arr[i].stock_min_number)
538
+      }
539
+    }
540
+    if (total < min_number){
541
+        min_str = total + min_unit
542
+    }
543
+    if (total == 0) {
544
+        min_str = ""
545
+        max_str = ""
546
+    }
547
+   if (total >=min_number) {
548
+    if(parseInt(total/min_number)!=0){
549
+        max_str = parseInt(total/min_number) + max_unit
550
+    }
551
+    if(total%min_number!=0){
552
+       min_str = total%min_number + min_unit
553
+    }
554
+  }
555
+ return max_str + min_str
556
+ },
557
+getTotalStockCount(arr){
558
+  var total_count = 0
559
+  for(let i=0;i<arr.length;i++){
560
+    total_count += arr[i].stock_count
561
+  }
562
+  return total_count
563
+},
564
+calculate: function(val) {
565
+    if (isNaN(val)) {
566
+        return "";
567
+    }
568
+    if (val == 0) {
569
+        return "";
570
+    }
571
+    return Math.round(parseFloat(val) * 100) / 100;
572
+  },
573
+getTimes(time) {
574
+    if (time === '') {
575
+    return ''
576
+    }
577
+    return uParseTime(time, '{y}-{m}-{d}')
578
+},
579
+
580
+ getAllPrice(){
581
+   var total_price = 0
582
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
583
+      total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
584
+   }  
585
+   return total_price.toFixed(2)
586
+ },
587
+ checkPurchaseOrder(id,index){
588
+   this.$confirm('是否审核?', {
589
+    confirmButtonText: '确 定',
590
+    cancelButtonText: '取 消',
591
+    type: 'warning'
592
+    }).then(() => { 
593
+    checkPurchaseOrder(this.id).then(response => {
594
+        if (response.data.state == 1) {
595
+          var info = response.data.data.info
596
+          this.disabled = true
597
+          this.$message.success("审核成功!")
598
+          this.getPurchaseOrderDetail()
599
+        } 
600
+     })
601
+    })
602
+    .catch(() => {
603
+    }) 
604
+  },
605
+  getGoodOrderDetail(){
606
+     
607
+      var id = this.$route.query.id
608
+    getGoodOrderDetail(id).then(response=>{
609
+      if(response.data.state == 1){
610
+        var out = response.data.data.out
611
+        this.is_check = out.is_check
612
+        this.id = out.id
613
+        this.supplier_name = out.supplier_id
614
+        this.rate_of_concession = out.rate_of_concession
615
+        this.discount_amount = out.discount_amount
616
+        this.payment = out.payment
617
+        this.arrearage = out.arrearage
618
+        this.number = out.number
619
+        this.good_number = out.good_number
620
+        this.start_time = this.getTimes(out.document_date)
621
+        var orderInfo = response.data.data.list
622
+        
623
+        var drugList = response.data.data.drugList
624
+        var goodList = response.data.data.goodList
625
+        for(let i=0;i< orderInfo.length;i++){
626
+             
627
+             orderInfo[i].supply_count =  orderInfo[i].count
628
+             orderInfo[i].supply_price =  orderInfo[i].price
629
+             orderInfo[i].supply_remake =  orderInfo[i].remark
630
+             orderInfo[i].type =  orderInfo[i].is_source
631
+             orderInfo[i].project_id =  orderInfo[i].project_id
632
+             orderInfo[i].supply_unit =  orderInfo[i].supply_unit
633
+             orderInfo[i].order_number =  orderInfo[i].order_number
634
+             orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
635
+             orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
636
+             orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
637
+           if(orderInfo[i].is_source == 1){
638
+            for(let j=0;j<drugList.length;j++){
639
+                if( orderInfo[i].project_id == drugList[j].id){
640
+                  if(drugList[j].max_unit!=drugList[j].min_unit){
641
+                    orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
642
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit
643
+                    orderInfo[i].unitList[1].name = drugList[j].min_unit
644
+                  }
645
+                  if(drugList[j].max_unit ==drugList[j].min_unit){
646
+                    orderInfo[i].unitList = [{id:1,name:""}]
647
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit
648
+                  }
649
+                
650
+                }
651
+             }  
652
+            } 
653
+          if(orderInfo[i].is_source == 2){
654
+            for(let j=0;j<goodList.length;j++){
655
+                if(orderInfo[i].project_id == goodList[j].id){
656
+                    orderInfo[i].unitList = [{id:1,name:""}]
657
+                    orderInfo[i].unitList[0].name = goodList[j].packing_unit
658
+                }
659
+            }  
660
+          } 
661
+        }
662
+      
663
+        this.recordInfo.tableList= []
664
+        this.recordInfo.tableList = orderInfo
665
+       
666
+          console.log("orderINFO23323232",this.recordInfo.tableList)
667
+      }
668
+    })  
669
+  },
670
+  toPrint(){
671
+     var id = this.$route.query.id
672
+     this.$router.push({path:"/purchase/order/print?&id="+id})  
673
+  },
674
+  updateGoodOrder(){ 
675
+   
676
+    if(this.supplier_name == 0 || this.supplier_name == ""){
677
+       this.$message.error("供应商不能为空!")
678
+       this.loading = false
679
+       return false
680
+    } 
681
+    console.log("表哥2323233232",this.recordInfo.tableList)
682
+    for(let i=0;i<this.recordInfo.tableList.length;i++){
683
+
684
+        this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
685
+        this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
686
+        this.recordInfo.tableList[i].supply_total_price= this.recordInfo.tableList[i].supply_total_price.toString()
687
+        this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
688
+        if(this.recordInfo.tableList[i].id > 0){
689
+          this.recordInfo.tableList[i].type = 1
690
+        }
691
+        if(this.recordInfo.tableList[i].id == 0){
692
+          this.recordInfo.tableList[i].type = 2
693
+        }
694
+        for(let j=0;j<this.manufactuerList.length;j++){
695
+            if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
696
+              this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
697
+            }
698
+            if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id){
699
+              this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name
700
+            }
701
+
702
+        }
703
+    }
704
+    var start = this.start_time
705
+    this.$refs["tableForm"].validate((valid)=>{
706
+        if(valid){
707
+           this.loading = true
708
+           var warehose_out_id = this.$route.query.id
709
+           var params = {
710
+             "stockIn":this.recordInfo.tableList,
711
+           } 
712
+           console.log("sotckind23232232323232323232",params)
713
+           
714
+           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=>{
715
+           if(response.data.state == 1){
716
+             this.loading = false
717
+             this.$message.success("修改成功!")
718
+             
719
+           }
720
+         })
721
+        }
722
+    })
723
+  },
724
+  checkGoodOrder(){
725
+    var id = this.$route.query.id
726
+    var warehousing_id = this.$route.query.warehousing_id
727
+    getGoodOrderCountList(id,warehousing_id).then(response=>{
728
+      if(response.data.state == 1){
729
+        this.$message.success("审核成功!")
730
+        var purcaseOrder = response.data.data.purcaseOrder
731
+        console.log("采购订单",purcaseOrder)
732
+        
733
+        var goodOrder = response.data.data.goodOrder
734
+        console.log("采购单",goodOrder)
735
+        var drugList = response.data.data.drugList
736
+        console.log("druglist23323223",drugList)
737
+        var is_warehouse = 0
738
+        for(let i=0;i<purcaseOrder.length;i++){
739
+          for(let j=0;j<drugList.length;j++){
740
+             if(purcaseOrder[i].is_source == 1){
741
+               if(purcaseOrder[i].supply_unit == drugList[j].max_unit){
742
+                  purcaseOrder[i].count = purcaseOrder[i].count * drugList[j].min_number
743
+               }
744
+             }
745
+          }
746
+        }
747
+
748
+        for(let i=0;i<goodOrder.length;i++){
749
+          for(let j=0;j<drugList.length;j++){
750
+            if(goodOrder[i].is_source == 1){
751
+              if(goodOrder[i].supply_unit == drugList[j].max_unit){
752
+                 goodOrder[i].count = goodOrder[i].count * drugList[j].min_number
753
+              }
754
+            }
755
+          }
756
+        }
757
+        
758
+        let objInfo = {}
759
+        if (goodOrder.length >0){
760
+          goodOrder.forEach((item,index)=>{
761
+            let { project_id } = item
762
+            if(!objInfo[project_id]){
763
+              objInfo[project_id] = {
764
+                project_id,
765
+                child:[],
766
+                count:0,
767
+              }
768
+            }
769
+          })
770
+          let newArr = Object.values(objInfo);
771
+        
772
+          for(let i=0;i<goodOrder.length;i++){
773
+            for(let j=0;j<newArr.length;j++){
774
+              if(goodOrder[i].project_id == newArr[j].project_id){
775
+                newArr[j].child.push(goodOrder[i])
776
+              }
777
+            }
778
+          }
779
+          console.log("newAr2332232323",newArr)
780
+        
781
+          for(let i=0;i<newArr.length;i++){
782
+           for(let j=0;j<newArr[i].child.length;j++){
783
+             newArr[i].count += newArr[i].child[j].count
784
+           }
785
+          }
786
+
787
+          var arr = []
788
+          var total = 0
789
+          var str = ""
790
+         
791
+          //如果采购单有数据,则需要比较数量
792
+          if(newArr.length > 0){
793
+            for(let i=0;i<purcaseOrder.length;i++){
794
+              for(let j=0;j<newArr.length;j++){
795
+                if(purcaseOrder[i].project_id == newArr[j].project_id){
796
+                    //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,部分入库
797
+                    if(purcaseOrder[i].count > newArr[j].count){
798
+                      arr.push(purcaseOrder[i].project_id)
799
+                    }
800
+                }
801
+              } 
802
+            }
803
+            //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成,全部入库
804
+          
805
+            if(arr.length == 0){
806
+              is_warehouse = 1
807
+              this.ModefySupplyWarehousing(is_warehouse,warehousing_id)
808
+            }
809
+            
810
+            //部分入库
811
+            if(total!=goodOrder.length){
812
+               //修改订购单
813
+               is_warehouse = 3
814
+               this.ModefySupplyWarehousing(is_warehouse,warehousing_id)
815
+            }
816
+          }
817
+        }
818
+      }
819
+    })
820
+  },
821
+  ModefySupplyWarehousing(is_warehouse,warehousing_id){
822
+     var params = {
823
+       is_warehouse:is_warehouse,
824
+       warehousing_id:warehousing_id,
825
+     }
826
+    ModefySupplyWarehousing(params).then(response=>{
827
+      if(response.data.state == 1){
828
+        var msg = response.data.data.msg
829
+      }
830
+    })
831
+  }
832
+},
833
+created(){
834
+    const tempObj = {}
835
+    tempObj["id"] = 0
836
+    tempObj["name"] = ""
837
+    tempObj['supply_name'] = ""
838
+    tempObj['supply_type'] = ""
839
+    tempObj['supply_specification_name'] = ''
840
+    tempObj['supply_total'] = ""
841
+    tempObj['supply_count'] = ""
842
+    tempObj['supply_price'] = ""
843
+    tempObj['supply_total_price'] = ""
844
+    tempObj['supply_manufacturer'] = ''
845
+    tempObj['supply_license_number'] = ''
846
+    tempObj['supply_remake'] = ''
847
+    tempObj['type'] = 0
848
+    tempObj['is_total'] = 1
849
+    tempObj["project_id"] = 0
850
+    tempObj["supply_unit"] = ""
851
+    tempObj["supply_batch_number"] = ""
852
+    tempObj["supply_product_date"] = ""
853
+    tempObj["order_number"] = ""
854
+    tempObj["supply_expiry_date"] = ""
855
+    tempObj["manufacturer_id"] = ""
856
+    tempObj["warehouse_info_id"] = ""
857
+    tempObj["warehousing_id"]= ""
858
+    this.recordInfo.tableList.push(tempObj)
859
+    this.getInitOrder()
860
+    if(parseInt(this.$route.query.id) > 0){
861
+      this.getGoodOrderDetail()
862
+    }
863
+    this.start_time = this.getTimes(new Date())
864
+    this.end_time = this.getTimes(new Date())
865
+}
866
+};
867
+</script>
868
+
869
+<style rel="stylesheet/css" lang="scss" scoped>
870
+.information {
871
+border: 1px #dcdfe6 solid;
872
+padding: 30px 20px 30px 20px;
873
+
874
+.border {
875
+border-bottom: 1px #dcdfe6 solid;
876
+margin: 0px 0 20px 0;
877
+}
878
+}
879
+
880
+.title {
881
+background: #409eff;
882
+height: 44px;
883
+line-height: 44px;
884
+padding: 0 0 0 10px;
885
+color: #fff;
886
+margin: 0 0 10px 0;
887
+}
888
+
889
+.edit_separater {
890
+border-top: 1px solid rgb(233, 233, 233);
891
+margin-top: 15px;
892
+margin-bottom: 15px;
893
+}
894
+</style>
895
+
896
+<style>
897
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
898
+font-size: 12px;
899
+}
900
+
901
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
902
+background: #6fb5fa;
903
+}
904
+
905
+.count {
906
+color: #bd2c00;
907
+}
908
+.el-table td,
909
+.el-table th.is-leaf,
910
+.el-table--border,
911
+.el-table--group {
912
+border-color: #d0d3da;
913
+}
914
+.el-table--border::after,
915
+.el-table--group::after,
916
+.el-table::before {
917
+background-color: #d0d3da;
918
+}
919
+.el-table__fixed-right{
920
+  width:150px;
921
+  bottom: 20px;
922
+  height: 100%;
923
+}
924
+</style>

+ 32 - 3
src/xt_pages/supply/goodOrderQuery.vue View File

149
                 icon="el-icon-delete"
149
                 icon="el-icon-delete"
150
                 size="small"
150
                 size="small"
151
                 type="danger"
151
                 type="danger"
152
-                @click="toClickOne(scope.row)"
152
+                @click="toDelete(scope.row)"
153
               >删除
153
               >删除
154
               </el-button>
154
               </el-button>
155
           </template>
155
           </template>
175
 <script>
175
 <script>
176
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
176
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
177
 
177
 
178
-import {getAllSupply,getAllGoodOrderList} from "@/api/supply"
178
+import {getAllSupply,getAllGoodOrderList,deleteGoodOrder} from "@/api/supply"
179
 import {uParseTime } from '@/utils/tools'
179
 import {uParseTime } from '@/utils/tools'
180
 export default {
180
 export default {
181
   name: "stockIn",
181
   name: "stockIn",
337
       
337
       
338
      },
338
      },
339
      toClick(val){
339
      toClick(val){
340
+       
340
        this.$router.push({path:"/good/order/edit?id="+val.id+"&warehousing_id="+val.warehousing_id})
341
        this.$router.push({path:"/good/order/edit?id="+val.id+"&warehousing_id="+val.warehousing_id})
341
-     }
342
+     },
343
+     toDelete(val,index){
344
+       console.log("val323223233223",val)
345
+       if(val.is_check == 1){
346
+         this.$message.error("已审核单据,不能删除!")
347
+         return false
348
+       }
349
+       if(val.cancelOut.length >0 ){
350
+         this.$message.error("已关联单据,不能删除!")
351
+         return false
352
+       }
353
+       this.$confirm('确认删除吗?', '删除', {
354
+          confirmButtonText: '确 定',
355
+          cancelButtonText: '取 消',
356
+          type: 'warning'
357
+        }).then(() => {
358
+          deleteGoodOrder(val.id).then(response => {
359
+            if (response.data.state == 1) {
360
+                var msg = response.data.data.msg
361
+                this.tableList.splice(index, 1);
362
+                this.$message.success("删除成功")
363
+            } else {
364
+                this.$message.error("删除失败")
365
+            }
366
+          })
367
+        })
368
+        .catch(() => {
369
+        }) 
370
+      }
342
   },
371
   },
343
   created() {
372
   created() {
344
     var now = new Date(); //当前日期 
373
     var now = new Date(); //当前日期 

+ 162 - 124
src/xt_pages/supply/supplyQuery.vue View File

3
     <div class="position">
3
     <div class="position">
4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5
     </div>
5
     </div>
6
-    <div class="app-container ">
7
-      <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
6
+    <div class="app-container">
7
+      <div
8
+        style="
9
+          justify-content: space-between;
10
+          margin: 0px 0 12px 0;
11
+          display: flex;
12
+          align-items: center;
13
+        "
14
+      >
8
         <div>
15
         <div>
9
-          <el-select v-model="type_name" style="width:140px;margin-right:10px;" placeholder="请选择"
10
-          @change="changeTypeName">
16
+          <el-select
17
+            v-model="type_name"
18
+            style="width: 140px; margin-right: 10px"
19
+            placeholder="请选择"
20
+            @change="changeTypeName"
21
+          >
11
             <el-option
22
             <el-option
12
               v-for="item in types"
23
               v-for="item in types"
13
               :key="item.id"
24
               :key="item.id"
14
               :label="item.type_name"
25
               :label="item.type_name"
15
-              :value="item.id">
26
+              :value="item.id"
27
+            >
16
             </el-option>
28
             </el-option>
17
           </el-select>
29
           </el-select>
18
           <el-date-picker
30
           <el-date-picker
20
             v-model="start_time"
32
             v-model="start_time"
21
             prefix-icon="el-icon-date"
33
             prefix-icon="el-icon-date"
22
             :editable="false"
34
             :editable="false"
23
-            style="width: 196px;"
35
+            style="width: 196px"
24
             type="date"
36
             type="date"
25
             placeholder="选择日期时间"
37
             placeholder="选择日期时间"
26
             align="right"
38
             align="right"
27
             format="yyyy-MM-dd"
39
             format="yyyy-MM-dd"
28
             value-format="yyyy-MM-dd"
40
             value-format="yyyy-MM-dd"
29
             @change="startTimeChange"
41
             @change="startTimeChange"
30
-           ></el-date-picker>-
31
-            <el-date-picker
32
-              size="small"
33
-              v-model="end_time"
34
-              prefix-icon="el-icon-date"
35
-              :editable="false"
36
-              style="width: 196px;"
37
-              type="date"
38
-              placeholder="选择日期时间"
39
-              align="right"
40
-              format="yyyy-MM-dd"
41
-              value-format="yyyy-MM-dd"
42
-              @change="endTimeChange"
42
+          ></el-date-picker
43
+          >-
44
+          <el-date-picker
45
+            size="small"
46
+            v-model="end_time"
47
+            prefix-icon="el-icon-date"
48
+            :editable="false"
49
+            style="width: 196px"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+            @change="endTimeChange"
43
           ></el-date-picker>
56
           ></el-date-picker>
44
           <el-input
57
           <el-input
45
             size="small"
58
             size="small"
46
-            style="width: 200px;margin-left:10px;"
59
+            style="width: 200px; margin-left: 10px"
47
             class="filter-item"
60
             class="filter-item"
48
             v-model.trim="keywords"
61
             v-model.trim="keywords"
49
             placeholder="耗材名称"
62
             placeholder="耗材名称"
58
           >
71
           >
59
         </div>
72
         </div>
60
         <div>
73
         <div>
61
-          <el-button size="small" type="primary" @click="toAdd">新增</el-button>
74
+          <el-button size="small" type="primary" @click="toAdd(1)"
75
+            >新增</el-button
76
+          >
62
           <addSupply ref="addSupply"></addSupply>
77
           <addSupply ref="addSupply"></addSupply>
63
         </div>
78
         </div>
64
       </div>
79
       </div>
65
 
80
 
66
-
67
-       <el-table
81
+      <el-table
68
         :row-style="{ color: '#303133' }"
82
         :row-style="{ color: '#303133' }"
69
         :header-cell-style="{
83
         :header-cell-style="{
70
           backgroundColor: 'rgb(245, 247, 250)',
84
           backgroundColor: 'rgb(245, 247, 250)',
71
-          color: '#606266'
85
+          color: '#606266',
72
         }"
86
         }"
73
         :data="tableList"
87
         :data="tableList"
74
         :class="signAndWeighBoxPatients"
88
         :class="signAndWeighBoxPatients"
75
         border
89
         border
76
       >
90
       >
77
-        <el-table-column label="供应商类别" align="center">
91
+        <el-table-column prop="SupplierType" label="供应商类别" align="center">
78
           <template slot-scope="scope">
92
           <template slot-scope="scope">
79
-            <span></span>
80
-         </template>
93
+            <span>{{ scope.row.SupplierType }}</span>
94
+          </template>
81
         </el-table-column>
95
         </el-table-column>
82
-        <el-table-column label="供应商编码" align="center">
96
+        <el-table-column prop="SupplierCode" label="供应商编码" align="center">
83
           <template slot-scope="scope">
97
           <template slot-scope="scope">
84
-
98
+            {{ scope.row.SupplierCode }}
85
           </template>
99
           </template>
86
         </el-table-column>
100
         </el-table-column>
87
-        <el-table-column label="供应商名称" align="center">
88
-            <template slot-scope="scope">
89
-              <span></span>
90
-            </template>
91
-         </el-table-column>
92
-        <el-table-column label="首要联系人" align="center">
101
+        <el-table-column prop="SupplierName" label="供应商名称" align="center">
93
           <template slot-scope="scope">
102
           <template slot-scope="scope">
94
-
103
+            <span>{{ scope.row.SupplierName }}</span>
95
           </template>
104
           </template>
96
         </el-table-column>
105
         </el-table-column>
97
-        <el-table-column label="增值税税率(%)" align="center">
106
+        <el-table-column prop="ConName" label="首要联系人" align="center">
98
           <template slot-scope="scope">
107
           <template slot-scope="scope">
99
-
108
+            {{ scope.row.ConName }}
109
+          </template>
110
+        </el-table-column>
111
+        <el-table-column prop="VatRate" label="增值税税率(%)" align="center">
112
+          <template slot-scope="scope">
113
+            {{ scope.row.VatRate }}
114
+          </template>
115
+        </el-table-column>
116
+        <el-table-column prop="BankAccount" label="银行账号" align="center">
117
+          <template slot-scope="scope">
118
+            {{ scope.row.BankAccount }}
119
+          </template>
120
+        </el-table-column>
121
+        <el-table-column prop="Bank" label="开户银行" align="center">
122
+          <template slot-scope="scope">
123
+            {{ scope.row.Bank }}
100
           </template>
124
           </template>
101
         </el-table-column>
125
         </el-table-column>
102
-       <el-table-column label="银行账号" align="center">
103
-         <template slot-scope="scope">
104
-
105
-         </template>
106
-       </el-table-column>
107
-       <el-table-column label="开户银行" align="center">
108
-         <template slot-scope="scope">
109
-
110
-          </span>
111
-
112
-         </template>
113
-       </el-table-column>
114
-
115
-        <el-table-column label="纳税人识别号" align="center" >
116
-         <template slot-scope="scope">
117
-
118
-         </template>
119
-       </el-table-column>
120
-
121
 
126
 
122
-      <el-table-column label="手机" align="center">
123
-         <template slot-scope="scope">
127
+        <el-table-column prop="Number" label="纳税人识别号" align="center">
128
+          <template slot-scope="scope">
129
+            {{ scope.row.Number }}
130
+          </template>
131
+        </el-table-column>
124
 
132
 
125
-         </template>
126
-       </el-table-column>
133
+        <el-table-column prop="Phone" label="手机" align="center">
134
+          <template slot-scope="scope">
135
+            {{ scope.row.Phone }}
136
+          </template>
137
+        </el-table-column>
127
 
138
 
128
-       <el-table-column label="操作" align="center" width="260px">
139
+        <el-table-column label="操作" align="center" width="200px">
129
           <template slot-scope="scope">
140
           <template slot-scope="scope">
130
-              <el-button
131
-                size="small"
132
-                type="primary"
133
-                @click="toClick(scope.row)"
134
-              >库存流水
135
-              </el-button>
136
-              <el-button
137
-                size="small"
138
-                type="primary"
139
-                @click="toClickOne(scope.row)"
140
-              >批次
141
-              </el-button>
141
+            <el-button
142
+              icon="el-icon-edit-outline"
143
+              size="small"
144
+              type="primary"
145
+              @click="toClick(scope.row, 2)"
146
+              >编辑
147
+            </el-button>
148
+            <el-button
149
+              icon="el-icon-delete"
150
+              size="small"
151
+              type="danger"
152
+              @click="toDelete(scope.row, scope.$index)"
153
+              >删除
154
+            </el-button>
142
           </template>
155
           </template>
143
         </el-table-column>
156
         </el-table-column>
144
       </el-table>
157
       </el-table>
158
+
145
       <el-pagination
159
       <el-pagination
146
         @size-change="handleSizeChange"
160
         @size-change="handleSizeChange"
147
         @current-change="handleCurrentChange"
161
         @current-change="handleCurrentChange"
148
-        :page-sizes="[10, 50, 100,200,500,1000]"
162
+        :page-sizes="[10, 50, 100, 200, 500, 1000]"
149
         :page-size="10"
163
         :page-size="10"
150
         background
164
         background
151
         align="right"
165
         align="right"
152
-        style="margin-top:20px;"
166
+        style="margin-top: 20px"
153
         layout="total, sizes, prev, pager, next, jumper"
167
         layout="total, sizes, prev, pager, next, jumper"
154
         :total="total"
168
         :total="total"
155
       >
169
       >
156
       </el-pagination>
170
       </el-pagination>
157
-      
158
-       
159
     </div>
171
     </div>
160
   </div>
172
   </div>
161
 </template>
173
 </template>
162
 
174
 
163
 <script>
175
 <script>
164
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
176
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
165
-import addSupply from "./components/addSupply.vue"
166
-// import {getSupplierId} from "@/api/supply"
177
+import addSupply from "./components/addSupply.vue";
178
+import {
179
+  getexporthistory,
180
+  delsupplys
181
+} from "@/api/supply";
167
 export default {
182
 export default {
168
   name: "stockIn",
183
   name: "stockIn",
169
   created() {
184
   created() {
170
     // this.initSupplierData()
185
     // this.initSupplierData()
171
-    this.org_id =  this.$store.getters.xt_user.org_id
186
+    this.org_id = this.$store.getters.xt_user.org_id;
172
 
187
 
173
-    var start_time =  window.sessionStorage.getItem('start_time')
174
-    var end_time =  window.sessionStorage.getItem('end_time')
188
+    var start_time = window.sessionStorage.getItem("start_time");
189
+    var end_time = window.sessionStorage.getItem("end_time");
175
 
190
 
176
-    if(start_time !=null){
177
-      this.start_time = start_time
191
+    if (start_time != null) {
192
+      this.start_time = start_time;
178
     }
193
     }
179
-    if(end_time!=null){
180
-      this.end_time = end_time
194
+    if (end_time != null) {
195
+      this.end_time = end_time;
181
     }
196
     }
182
-    window.sessionStorage.removeItem('start_time')
183
-    window.sessionStorage.removeItem('end_time')
197
+    window.sessionStorage.removeItem("start_time");
198
+    window.sessionStorage.removeItem("end_time");
199
+    this.initData();
184
   },
200
   },
185
   components: {
201
   components: {
186
     BreadCrumb,
202
     BreadCrumb,
187
-    addSupply
203
+    addSupply,
188
   },
204
   },
189
   data() {
205
   data() {
190
     return {
206
     return {
191
-      type_name:"",
207
+      page: 1,
208
+      limit: 10,
209
+
210
+      type_name: "",
192
       crumbs: [
211
       crumbs: [
193
         { path: false, name: "采购管理" },
212
         { path: false, name: "采购管理" },
194
-        { path: "/supply/good/order/query", name: "供应商管理" }
213
+        { path: "/supply/good/order/query", name: "供应商管理" },
195
       ],
214
       ],
196
       keywords: "",
215
       keywords: "",
197
       total: 0,
216
       total: 0,
203
       limit: 10,
222
       limit: 10,
204
       goodType: [],
223
       goodType: [],
205
       goodInfo: [],
224
       goodInfo: [],
206
-      org_id:0,
207
-      types:[],
208
-      tableList:[1],
209
-      tyep_name:"",
225
+      org_id: 0,
226
+      types: [],
227
+      tableList: [],
228
+      tyep_name: "",
210
     };
229
     };
211
   },
230
   },
212
-  methods:{
213
-    // 获取供应商编码接口
214
-    // initSupplierData(){
215
-    //   getSupplierId().then(res => {
216
-    //     console.log(res,'sss')
217
-    //   })
218
-    // },
231
+  methods: {
232
+    initData() {
233
+      let params = {
234
+        limit: this.limit,
235
+        page: this.page,
236
+      };
237
+      getexporthistory(params).then((res) => {
238
+        if (res.data.state == 1) {
239
+          this.tableList = res.data.data.list;
240
+          this.total = res.data.data.total;
241
+        }
242
+      });
243
+    },
219
 
244
 
220
-     toAdd(){
221
-      //  console.log("res32323232323223",this.$refs.addSupply)
222
-       this.$refs.addSupply.show()
223
-     },
224
-      changeTypeName(){
245
+    toDelete(val, index) {
246
+      delsupplys(val.ID)
247
+        .then((res) => {
248
+          if (res.data.code == 0) {
249
+            this.$message.success(res.data.data.list);
250
+          }
251
+        })
252
+        .then(() => {
253
+          this.initData();
254
+        })
255
+        .catch((err) => {
256
+          console.log(err);
257
+        });
258
+    },
225
 
259
 
226
-     },
227
-     startTimeChange(){
260
+   
228
 
261
 
229
-     },
230
-     endTimeChange(){
231
-
232
-     },
233
-     search(){
234
-
235
-     },
236
-     handleSizeChange(){
237
-
238
-     },
239
-     handleCurrentChange(){
240
-
241
-     }
242
-  }
262
+    toAdd(val) {
263
+      this.$refs.addSupply.show(1, val);
264
+    },
265
+    toClick(data, val) {
266
+      this.$refs.addSupply.show(data, val);
267
+    },
268
+    changeTypeName() {},
269
+    startTimeChange() {},
270
+    endTimeChange() {},
271
+    search() {},
272
+    handleSizeChange(val) {
273
+      this.limit = val;
274
+      this.initData();
275
+    },
276
+    handleCurrentChange(val) {
277
+      this.page = val;
278
+      this.initData();
279
+    },
280
+  },
243
 };
281
 };
244
 </script>
282
 </script>
245
 
283