Parcourir la source

接口供应商

huangyw il y a 3 ans
Parent
révision
c904ff1e01

+ 65 - 16
src/api/supply.js Voir le fichier

@@ -157,21 +157,70 @@ export function getAllGoodReturnOrderList(params) {
157 157
     url: '/api/supply/getallgoodreturnorderlist',
158 158
     method: 'get',
159 159
     params: params
160
-  })
161
-}
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 updateGoodReturn(data, warehouse_out_id, start_time, rate_of_concession, discount_amount, arrearage, payment, supplier_id, return_number) {
196
+      return request({
197
+        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,
198
+        method: 'get',
199
+        params: params
200
+      })
201
+    }
202
+
203
+
204
+
205
+    export function delsupplys(id, data) {
206
+      return request({
207
+        url: '/api/supply/delsupply?id=' + id,
208
+        method: 'post',
209
+        data: data
210
+      })
211
+    }
212
+
213
+    export function getsupplyandcontactone(params) {
214
+      return request({
215
+        url: '/api/supply/getsupplyandcontactone',
216
+        method: 'get',
217
+        params: params
218
+      })
219
+    }
220
+
221
+
222
+
223
+
224
+
162 225
 
163
-export function getGoodReturnDetail(id, params) {
164
-  return request({
165
-    url: '/api/supply/getgoodreturndetail?id=' + id,
166
-    method: 'get',
167
-    params: params
168
-  })
169
-}
170 226
 
171
-export function updateGoodReturn(data, warehouse_out_id, start_time, rate_of_concession, discount_amount, arrearage, payment, supplier_id, return_number) {
172
-  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
176
-  })
177
-}

BIN
src/assets/Popup/alert.png Voir le fichier


+ 22 - 0
src/components/Popup/index.js Voir le fichier

@@ -0,0 +1,22 @@
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 Voir le fichier

@@ -0,0 +1,165 @@
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 Voir le fichier

@@ -33,6 +33,14 @@ import * as voicePromptFun from './utils/voicePrompt'
33 33
 import 'default-passive-events'
34 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 44
 Vue.use(Element, {
37 45
   size: 'medium', // set element-ui default size
38 46
   i18n: (key, value) => i18n.t(key, value)

+ 9 - 0
src/router/modules/supply.js Voir le fichier

@@ -27,6 +27,15 @@ export default {
27 27
       meta: { title: 'addSupply', noCache: true },
28 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 40
       path: 'purchase/order/query',
32 41
       component: () => import('@/xt_pages/supply/purchaseOrderQuery'),

+ 2 - 2
src/views/layout/Layout.vue Voir le fichier

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

+ 62 - 0
src/xt_pages/components/Computed/index.vue Voir le fichier

@@ -0,0 +1,62 @@
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 Voir le fichier

@@ -0,0 +1,99 @@
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>

+ 7 - 3
src/xt_pages/supply/components/addGoodOrder.vue Voir le fichier

@@ -244,7 +244,7 @@
244 244
     </el-table-column>
245 245
   </el-table>
246 246
 </el-form>
247
-   <div style="margin-top:10px">
247
+   <!-- <div style="margin-top:10px">
248 248
       合计:{{getAllPrice()}} 元
249 249
    </div>
250 250
    <div style="margin-top:10px">
@@ -255,7 +255,8 @@
255 255
         <span>本次付款:<el-input style="width:100px" v-model="payment"></el-input></span>
256 256
 
257 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 260
 </div>
260 261
 
261 262
   <!-- <el-dialog
@@ -273,13 +274,15 @@
273 274
 </template>
274 275
 
275 276
 <script>
277
+import Computed from "../../components/Computed/index_1.vue"
276 278
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
277 279
 import {uParseTime } from '@/utils/tools'
278 280
 import {getInitOrder,checkPurchaseOrder,getPurchaseOrderInfo,addGoodOrder,updateGoodOrder} from "@/api/supply"
279 281
 export default {
280 282
 name: "addPurchaseOrder",
281 283
 components: {
282
-BreadCrumb
284
+BreadCrumb,
285
+Computed
283 286
 },
284 287
 data() {
285 288
 return {
@@ -315,6 +318,7 @@ return {
315 318
     drugTypeList:[],
316 319
     supplier_name:"",
317 320
     supplyList:[],
321
+    total_price:0,
318 322
     rate_of_concession:"",
319 323
     discount_amount:"",
320 324
     start_time:"",

+ 1 - 1
src/xt_pages/supply/components/addPurchaseOrder.vue Voir le fichier

@@ -14,7 +14,7 @@
14 14
       >
15 15
         <div>
16 16
           <span style="color: red">*</span><span>供应商:</span>
17
-          <el-select
17
+          <el-select cxpib`*+9.`
18 18
             v-model="supplier_name"
19 19
             style="width: 140px; margin-right: 10px"
20 20
             placeholder="请选择"

+ 160 - 59
src/xt_pages/supply/components/addSupply.vue Voir le fichier

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <el-dialog title="新增供应商" :visible.sync="dialogVisible" width="35%">
2
+  <el-dialog :title="title" :visible.sync="dialogVisible" width="35%">
3 3
     <!-- :before-close="handleClose" 如需要可添加进上方 -->
4 4
     <div>
5 5
       <el-form
@@ -12,44 +12,49 @@
12 12
       >
13 13
         <el-row>
14 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 17
             </el-form-item>
18 18
           </el-col>
19 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 22
             </el-form-item>
23 23
           </el-col>
24 24
         </el-row>
25 25
         <el-row>
26 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 34
             </el-form-item>
30 35
           </el-col>
31 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 39
             </el-form-item>
35 40
           </el-col>
36 41
         </el-row>
37 42
         <el-row>
38 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 46
             </el-form-item>
42 47
           </el-col>
43 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 51
             </el-form-item>
47 52
           </el-col>
48 53
         </el-row>
49 54
         <el-row>
50 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 58
             </el-form-item>
54 59
           </el-col>
55 60
         </el-row>
@@ -180,7 +185,7 @@
180 185
     </div>
181 186
 
182 187
     <span slot="footer" class="dialog-footer">
183
-      <el-button @click="dialogVisible = false">取 消</el-button>
188
+      <el-button @click="closePop">取 消</el-button>
184 189
       <el-button type="primary" @click="submitForm('supplier')"
185 190
         >确 定</el-button
186 191
       >
@@ -189,10 +194,16 @@
189 194
 </template>
190 195
 
191 196
 <script>
197
+import {
198
+  getSupplierId,
199
+  getsupplytype,
200
+  getsupplyandcontactone,
201
+} from "@/api/supply";
192 202
 import Template from "../../data/template.vue";
193 203
 export default {
194 204
   data() {
195 205
     return {
206
+      title: "",
196 207
       Template,
197 208
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
198 209
       list: ["001", "002"],
@@ -253,26 +264,124 @@ export default {
253 264
       value: "",
254 265
       dialogVisible: false,
255 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 283
   created() {
267
-    this.supplier.id = "gys001";
268
-    this.getcontacts();
284
+    
269 285
   },
270 286
   methods: {
271
-    show() {
272
-      this.dialogVisible = true;
287
+    show(data, type) {
288
+      if (type == 1) {
289
+        this.initSupplierData();
290
+        this.title = "新增供应商";
291
+        this.dialogVisible = true;
292
+      } else if (type == 2) {
293
+        this.title = "编辑供应商";
294
+        this.supplier.supplierCode = data.SupplierCode;
295
+        this.supplier.supplierName = data.SupplierName;
296
+        this.supplier.supplierType = data.SupplierType;
297
+        this.supplier.vatRate = data.VatRate;
298
+        this.supplier.number = data.Number;
299
+        this.supplier.bank = data.Bank;
300
+        this.supplier.bankAccount = data.BankAccount;
301
+        this.getcontacts(data.ID);
302
+        this.dialogVisible = true;
303
+      }
304
+    },
305
+    closePop() {
306
+      this.dialogVisible = false;
307
+      this.supply_code = [];
308
+      this.supplier.supplierCode = "";
309
+      this.supplier.supplierName = "";
310
+      this.supplier.supplierType = "";
311
+      this.supplier.vatRate = "";
312
+      this.supplier.number = "";
313
+      this.supplier.bank = "";
314
+      this.supplier.bankAccount = "";
315
+    },
316
+
317
+    // 获取供应商编码接口
318
+    initSupplierData() {
319
+      let Arr = [];
320
+      getSupplierId().then((res) => {
321
+        Arr = res.data.data;
322
+        Arr.supplycode.forEach((o) => {
323
+          this.supply_code.push(o.supplier_code);
324
+        });
325
+      });
273 326
       this.orderIdAdd();
274
-      // this.continueArr();
275 327
     },
328
+
329
+    // 供应商编码动态递增
330
+    orderIdAdd() {
331
+      let data = this.supply_code;
332
+      let len = 3;
333
+      data.forEach((o, index) => {
334
+        o = o.split("gsy");
335
+        index = index + 1;
336
+        let index1 = index;
337
+        index1 = parseInt(index1, 10);
338
+        index1 = index1.toString();
339
+        while (index1.length < len) index1 = "0" + index1;
340
+        if (o[1] != index1) {
341
+          data.splice(index - 1, 0, `gsy${index1}`);
342
+          // console.log(`gsy${index1}`);
343
+          this.supplier.id = `gsy${index1}`;
344
+        }
345
+      });
346
+    },
347
+
348
+    querySearchAsync(queryString, cb) {
349
+      clearTimeout(this.timeout);
350
+      var results = [];
351
+      if (queryString == "") {
352
+        cb(results);
353
+      } else {
354
+        // 获取供应商类别接口
355
+        getsupplytype()
356
+          .then((res) => {
357
+            if (res.status == 200) {
358
+              var result = res.data.data.list;
359
+              //远程搜索需要的数组
360
+              for (let i = 0; i < result.length; i++) {
361
+                const element = result[i];
362
+                results.push({
363
+                  value: element.name,
364
+                  name: element.value,
365
+                });
366
+              }
367
+              cb(results);
368
+            } else {
369
+              results = [];
370
+              cb(results);
371
+            }
372
+          })
373
+          .catch((err) => {
374
+            console.log(err);
375
+          });
376
+      }
377
+    },
378
+
379
+    handleSelect(item) {
380
+      console.log(item, "l");
381
+      this.supplier.name = item.value;
382
+      this.supplier.value = item.name;
383
+    },
384
+
276 385
     //  验证表单内容
277 386
     submitForm(formName) {
278 387
       this.$refs[formName].validate((valid) => {
@@ -280,7 +389,6 @@ export default {
280 389
           alert("submit!");
281 390
           this.dialogVisible = false;
282 391
         } else {
283
-          console.log("error submit!!");
284 392
           return false;
285 393
         }
286 394
       });
@@ -289,7 +397,10 @@ export default {
289 397
     },
290 398
 
291 399
     // 首次打开新增页面判断是否有首要联系人
292
-    getcontacts() {
400
+    getcontacts(val) {
401
+      getsupplyandcontactone({id:val}).then((res) => {
402
+        console.log(res, "oo");
403
+      });
293 404
       let data = {
294 405
         value: 0,
295 406
         label: "是",
@@ -311,44 +422,27 @@ export default {
311 422
         value: 0,
312 423
         label: "是",
313 424
       };
425
+      let arr = [];
314 426
       if (this.recordInfo.tableList.length == 1) {
315
-        this.recordInfo.tableList[0].name = data2;
427
+        this.recordInfo.tableList[0] = data2;
316 428
         this.$forceUpdate();
317 429
       }
318
-
319 430
       this.recordInfo.tableList.forEach((el, index) => {
320
-        console.log(el, "oo");
321 431
         if (scope.$index == index) {
322
-          el.name = data2;
432
+          el.name = data;
433
+          // console.log(scope);
323 434
           this.$forceUpdate();
324
-          console.log(el.name.value, scope.$index, index);
325 435
         } else {
326 436
           el.name = data1;
327 437
           this.$forceUpdate();
328
-          console.log("kkk");
329
-        }
330
-      });
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 438
         }
350
-        
439
+        arr.push(el.name.value);
351 440
       });
441
+      if (arr.includes(0)) {
442
+        return;
443
+      } else {
444
+        this.recordInfo.tableList[0].name = data2;
445
+      }
352 446
     },
353 447
 
354 448
     // 添加表单行
@@ -382,10 +476,10 @@ export default {
382 476
         // }
383 477
       })
384 478
         .then((res) => {
385
-          console.log(res, "ooo");
479
+          // console.log(res, "ooo");
386 480
         })
387 481
         .catch((err) => {
388
-          console.log(err, "ddd");
482
+          // console.log(err, "ddd");
389 483
         });
390 484
     },
391 485
   },
@@ -401,6 +495,13 @@ export default {
401 495
     width: 75%;
402 496
   }
403 497
 }
498
+.el-dialog__body {
499
+  .el-form-item__content {
500
+    .el-autocomplete {
501
+      width: 75% !important;
502
+    }
503
+  }
504
+}
404 505
 
405 506
 .tablebtn {
406 507
   padding: 10px 12px;

+ 4 - 1
src/xt_pages/supply/components/editGoodOrder.vue Voir le fichier

@@ -256,6 +256,7 @@
256 256
 
257 257
         <span>本次欠款:<el-input style="width:100px" v-model="arrearage"></el-input></span>
258 258
     </div>
259
+    <!-- <Computed></Computed> -->
259 260
 </div>
260 261
 
261 262
   <!-- <el-dialog
@@ -273,13 +274,15 @@
273 274
 </template>
274 275
 
275 276
 <script>
277
+import Computed from "../../components/Computed/index_1.vue"
276 278
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
277 279
 import {uParseTime } from '@/utils/tools'
278 280
 import {getInitOrder,checkPurchaseOrder,getGoodOrderDetail,updateGoodOrder,getGoodOrderCountList,ModefySupplyWarehousing} from "@/api/supply"
279 281
 export default {
280 282
 name: "addPurchaseOrder",
281 283
 components: {
282
-BreadCrumb
284
+BreadCrumb,
285
+Computed
283 286
 },
284 287
 data() {
285 288
 return {

Fichier diff supprimé car celui-ci est trop grand
+ 872 - 660
src/xt_pages/supply/components/editPurchaseOrder.vue


+ 924 - 0
src/xt_pages/supply/components/editSupply.vue Voir le fichier

@@ -0,0 +1,924 @@
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>

+ 162 - 124
src/xt_pages/supply/supplyQuery.vue Voir le fichier

@@ -3,16 +3,28 @@
3 3
     <div class="position">
4 4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5 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 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 22
             <el-option
12 23
               v-for="item in types"
13 24
               :key="item.id"
14 25
               :label="item.type_name"
15
-              :value="item.id">
26
+              :value="item.id"
27
+            >
16 28
             </el-option>
17 29
           </el-select>
18 30
           <el-date-picker
@@ -20,30 +32,31 @@
20 32
             v-model="start_time"
21 33
             prefix-icon="el-icon-date"
22 34
             :editable="false"
23
-            style="width: 196px;"
35
+            style="width: 196px"
24 36
             type="date"
25 37
             placeholder="选择日期时间"
26 38
             align="right"
27 39
             format="yyyy-MM-dd"
28 40
             value-format="yyyy-MM-dd"
29 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 56
           ></el-date-picker>
44 57
           <el-input
45 58
             size="small"
46
-            style="width: 200px;margin-left:10px;"
59
+            style="width: 200px; margin-left: 10px"
47 60
             class="filter-item"
48 61
             v-model.trim="keywords"
49 62
             placeholder="耗材名称"
@@ -58,140 +71,146 @@
58 71
           >
59 72
         </div>
60 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 77
           <addSupply ref="addSupply"></addSupply>
63 78
         </div>
64 79
       </div>
65 80
 
66
-
67
-       <el-table
81
+      <el-table
68 82
         :row-style="{ color: '#303133' }"
69 83
         :header-cell-style="{
70 84
           backgroundColor: 'rgb(245, 247, 250)',
71
-          color: '#606266'
85
+          color: '#606266',
72 86
         }"
73 87
         :data="tableList"
74 88
         :class="signAndWeighBoxPatients"
75 89
         border
76 90
       >
77
-        <el-table-column label="供应商类别" align="center">
91
+        <el-table-column prop="SupplierType" label="供应商类别" align="center">
78 92
           <template slot-scope="scope">
79
-            <span></span>
80
-         </template>
93
+            <span>{{ scope.row.SupplierType }}</span>
94
+          </template>
81 95
         </el-table-column>
82
-        <el-table-column label="供应商编码" align="center">
96
+        <el-table-column prop="SupplierCode" label="供应商编码" align="center">
83 97
           <template slot-scope="scope">
84
-
98
+            {{ scope.row.SupplierCode }}
85 99
           </template>
86 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 102
           <template slot-scope="scope">
94
-
103
+            <span>{{ scope.row.SupplierName }}</span>
95 104
           </template>
96 105
         </el-table-column>
97
-        <el-table-column label="增值税税率(%)" align="center">
106
+        <el-table-column prop="ConName" label="首要联系人" align="center">
98 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 124
           </template>
101 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 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 155
           </template>
143 156
         </el-table-column>
144 157
       </el-table>
158
+
145 159
       <el-pagination
146 160
         @size-change="handleSizeChange"
147 161
         @current-change="handleCurrentChange"
148
-        :page-sizes="[10, 50, 100,200,500,1000]"
162
+        :page-sizes="[10, 50, 100, 200, 500, 1000]"
149 163
         :page-size="10"
150 164
         background
151 165
         align="right"
152
-        style="margin-top:20px;"
166
+        style="margin-top: 20px"
153 167
         layout="total, sizes, prev, pager, next, jumper"
154 168
         :total="total"
155 169
       >
156 170
       </el-pagination>
157
-      
158
-       
159 171
     </div>
160 172
   </div>
161 173
 </template>
162 174
 
163 175
 <script>
164 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 182
 export default {
168 183
   name: "stockIn",
169 184
   created() {
170 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 201
   components: {
186 202
     BreadCrumb,
187
-    addSupply
203
+    addSupply,
188 204
   },
189 205
   data() {
190 206
     return {
191
-      type_name:"",
207
+      page: 1,
208
+      limit: 10,
209
+
210
+      type_name: "",
192 211
       crumbs: [
193 212
         { path: false, name: "采购管理" },
194
-        { path: "/supply/good/order/query", name: "供应商管理" }
213
+        { path: "/supply/good/order/query", name: "供应商管理" },
195 214
       ],
196 215
       keywords: "",
197 216
       total: 0,
@@ -203,43 +222,62 @@ export default {
203 222
       limit: 10,
204 223
       goodType: [],
205 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 282
 </script>
245 283