huangyw 3 gadus atpakaļ
vecāks
revīzija
1f310ffbbe

+ 2 - 2
config/dev.env.js Parādīt failu

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

+ 149 - 0
src/assets/LodopFuncs.js Parādīt failu

@@ -0,0 +1,149 @@
1
+//==本JS是加载Lodop插件或Web打印服务CLodop/Lodop7的综合示例,可直接使用,建议理解后融入自己程序==
2
+
3
+var CreatedOKLodopObject, CLodopIsLocal, CLodopJsState;
4
+
5
+//==判断是否需要CLodop(那些不支持插件的浏览器):==
6
+function needCLodop() {
7
+    try {
8
+        var ua = navigator.userAgent;
9
+        if (ua.match(/Windows\sPhone/i))   return true;
10
+        if (ua.match(/iPhone|iPod|iPad/i)) return true;
11
+        if (ua.match(/Android/i))          return true;
12
+        if (ua.match(/Edge\D?\d+/i))       return true;
13
+
14
+        var verTrident = ua.match(/Trident\D?\d+/i);
15
+        var verIE = ua.match(/MSIE\D?\d+/i);
16
+        var verOPR = ua.match(/OPR\D?\d+/i);
17
+        var verFF = ua.match(/Firefox\D?\d+/i);
18
+        var x64 = ua.match(/x64/i);
19
+        if ((!verTrident) && (!verIE) && (x64)) return true;
20
+        else if (verFF) {
21
+            verFF = verFF[0].match(/\d+/);
22
+            if ((verFF[0] >= 41) || (x64)) return true;
23
+        } else if (verOPR) {
24
+            verOPR = verOPR[0].match(/\d+/);
25
+            if (verOPR[0] >= 32) return true;
26
+        } else if ((!verTrident) && (!verIE)) {
27
+            var verChrome = ua.match(/Chrome\D?\d+/i);
28
+            if (verChrome) {
29
+                verChrome = verChrome[0].match(/\d+/);
30
+                if (verChrome[0] >= 41) return true;
31
+            }
32
+        }
33
+        return false;
34
+    } catch (err) {
35
+        return true;
36
+    }
37
+}
38
+
39
+//加载CLodop时用双端口(http是8000/18000,而https是8443/8444)以防其中某端口被占,
40
+//主JS文件名“CLodopfuncs.js”是固定名称,其内容是动态的,与其链接的打印环境有关:
41
+function loadCLodop() {
42
+    if (CLodopJsState == "loading" || CLodopJsState == "complete") return;
43
+    CLodopJsState = "loading";
44
+    var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
45
+    var JS1 = document.createElement("script");
46
+    var JS2 = document.createElement("script");
47
+
48
+    if (window.location.protocol=='https:') {
49
+      JS1.src = "https://localhost.lodop.net:8443/CLodopfuncs.js";
50
+      JS2.src = "https://localhost.lodop.net:8444/CLodopfuncs.js";
51
+    } else {
52
+      JS1.src = "http://localhost:8000/CLodopfuncs.js";
53
+      JS2.src = "http://localhost:18000/CLodopfuncs.js";
54
+    }
55
+    JS1.onload  = JS2.onload  = function()    {CLodopJsState = "complete";}
56
+    JS1.onerror = JS2.onerror = function(evt) {CLodopJsState = "complete";}
57
+    head.insertBefore(JS1, head.firstChild);
58
+    head.insertBefore(JS2, head.firstChild);
59
+    CLodopIsLocal = !!((JS1.src + JS2.src).match(/\/\/localho|\/\/127.0.0./i));
60
+}
61
+
62
+if (needCLodop()){loadCLodop();}//开始加载
63
+
64
+//==获取LODOP对象主过程,判断是否安装、需否升级:==
65
+function getLodop(oOBJECT, oEMBED) {
66
+    var strFontTag= "<br><font color='#FF00FF'>打印控件";
67
+    var strLodopInstall   = strFontTag+"未安装!点击这里<a href='install_lodop32.exe' target='_self'>执行安装</a>";
68
+    var strLodopUpdate    = strFontTag+"需要升级!点击这里<a href='install_lodop32.exe' target='_self'>执行升级</a>";
69
+    var strLodop64Install = strFontTag+"未安装!点击这里<a href='install_lodop64.exe' target='_self'>执行安装</a>";
70
+    var strLodop64Update  = strFontTag+"需要升级!点击这里<a href='install_lodop64.exe' target='_self'>执行升级</a>";
71
+    var strCLodopInstallA = "<br><font color='#FF00FF'>Web打印服务CLodop未安装启动,点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>下载执行安装</a>";
72
+    var strCLodopInstallB = "<br>(若此前已安装过,可<a href='CLodop.protocol:setup' target='_self'>点这里直接再次启动</a>)";
73
+    var strCLodopUpdate   = "<br><font color='#FF00FF'>Web打印服务CLodop需升级!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>";
74
+    var strLodop7FontTag    = "<br><font color='#FF00FF'>Web打印服务Lodop7";
75
+    var strLodop7HrefX86    = "点击这里<a href='Lodop7_Linux_X86_64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
76
+    var strLodop7HrefARM    = "点击这里<a href='Lodop7_Linux_ARM64.tar.gz'  target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
77
+    var strLodop7Install_X86 = strLodop7FontTag+"未安装启动,"+strLodop7HrefX86;
78
+    var strLodop7Install_ARM = strLodop7FontTag+"未安装启动,"+strLodop7HrefARM;
79
+    var strLodop7Update_X86  = strLodop7FontTag+"需升级,"+strLodop7HrefX86;
80
+    var strLodop7Update_ARM  = strLodop7FontTag+"需升级,"+strLodop7HrefARM;
81
+    var strInstallOK = ",成功后请刷新本页面或重启浏览器。</font>";
82
+    var LODOP;
83
+    try {
84
+        var isWinIE    = (/MSIE/i.test(navigator.userAgent)) || (/Trident/i.test(navigator.userAgent));
85
+        var isWinIE64  = isWinIE && (/x64/i.test(navigator.userAgent));
86
+        var isLinuxX86 = (/Linux/i.test(navigator.platform)) && (/x86/i.test(navigator.platform));
87
+        var isLinuxARM = (/Linux/i.test(navigator.platform)) && (/aarch/i.test(navigator.platform));
88
+
89
+        if (needCLodop() || isLinuxX86 || isLinuxARM) {
90
+            try {
91
+                LODOP = getCLodop();
92
+            } catch (err) {}
93
+            if (!LODOP && CLodopJsState !== "complete") {
94
+                if (CLodopJsState == "loading") alert("网页还没下载完毕,请稍等一下再操作."); else alert("未曾加载Lodop主JS文件,请先调用loadCLodop过程.");
95
+                return;
96
+            }
97
+            var strAlertMessage;
98
+            if (!LODOP) {
99
+                if (isLinuxX86) strAlertMessage = strLodop7Install_X86; else
100
+                if (isLinuxARM) strAlertMessage = strLodop7Install_ARM; else
101
+                strAlertMessage = strCLodopInstallA + (CLodopIsLocal ? strCLodopInstallB : "") ;
102
+                document.body.innerHTML = strAlertMessage + strInstallOK + document.body.innerHTML;
103
+                return;
104
+            } else {
105
+                if (isLinuxX86 && LODOP.CVERSION < "7.0.4.2") strAlertMessage = strLodop7Update_X86; else
106
+                if (isLinuxARM && LODOP.CVERSION < "7.0.4.2") strAlertMessage = strLodop7Update_ARM; else
107
+                if (CLODOP.CVERSION < "4.1.5.8")              strAlertMessage = strCLodopUpdate;
108
+
109
+                if (strAlertMessage) document.body.innerHTML = strAlertMessage+ strInstallOK + document.body.innerHTML;
110
+            }
111
+        } else { //==如果页面有Lodop插件就直接使用,否则新建:==
112
+            if (oOBJECT || oEMBED) {
113
+                if (isWinIE)
114
+                    LODOP = oOBJECT;
115
+                else
116
+                    LODOP = oEMBED;
117
+            } else if (!CreatedOKLodopObject) {
118
+                LODOP = document.createElement("object");
119
+                LODOP.setAttribute("width", 0);
120
+                LODOP.setAttribute("height", 0);
121
+                LODOP.setAttribute("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;");
122
+                if (isWinIE)
123
+                    LODOP.setAttribute("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
124
+                else
125
+                    LODOP.setAttribute("type", "application/x-print-lodop");
126
+                document.documentElement.appendChild(LODOP);
127
+                CreatedOKLodopObject = LODOP;
128
+            } else
129
+                LODOP = CreatedOKLodopObject;
130
+            //==Lodop插件未安装时提示下载地址:==
131
+            if ((!LODOP) || (!LODOP.VERSION)) {
132
+                document.body.innerHTML = (isWinIE64 ? strLodop64Install : strLodopInstall) + strInstallOK + document.body.innerHTML;
133
+                return LODOP;
134
+            }
135
+            if (LODOP.VERSION < "6.2.2.6") {
136
+                document.body.innerHTML = (isWinIE64 ? strLodop64Update : strLodopUpdate) + strInstallOK + document.body.innerHTML;
137
+            }
138
+        }
139
+        //===如下空白位置适合调用统一功能(如注册语句、语言选择等):=======================
140
+
141
+
142
+        //===============================================================================
143
+        return LODOP;
144
+    } catch (err) {
145
+        alert("getLodop出错:" + err);
146
+    }
147
+}
148
+
149
+export { getLodop }; //导出getLodop

Binārs
src/assets/purchase/Reviewed.png Parādīt failu


+ 8 - 0
src/xt_pages/supply/components/addGoodOrder.vue Parādīt failu

@@ -92,11 +92,13 @@
92 92
         </template>
93 93
         <template slot-scope="scope">
94 94
             <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
95
+            <div style="visibility: hidden">/</div>
95 96
         </template>
96 97
     </el-table-column>
97 98
     <el-table-column label="规格&单位" align="center" width="120px">
98 99
         <template slot-scope="scope">
99 100
             <el-input v-model="scope.row.supply_specification_name" style="width:100px" :disabled="true"></el-input>
101
+            <div style="visibility: hidden">/</div>
100 102
         </template>
101 103
     </el-table-column>
102 104
      <el-table-column label="单位" align="center" width="120px">
@@ -143,6 +145,7 @@
143 145
     <el-table-column label="可用库存" align="center" width="100px">
144 146
         <template slot-scope="scope">
145 147
             <el-input v-model="scope.row.supply_total" style="width:80px" :disabled="true"></el-input>
148
+            <div style="visibility: hidden">/</div>
146 149
         </template>
147 150
     </el-table-column>
148 151
     <el-table-column label="数量" align="center" width="120px">
@@ -159,6 +162,7 @@
159 162
     <el-table-column label="采购单价" align="center" width="120px">
160 163
         <template slot-scope="scope">
161 164
         <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
165
+        <div style="visibility: hidden">/</div>
162 166
         </template>
163 167
     </el-table-column>
164 168
 
@@ -191,6 +195,7 @@
191 195
                   :value="option.id">
192 196
                 </el-option>
193 197
           </el-select>
198
+          <div style="visibility: hidden">/</div>
194 199
         </template>
195 200
     </el-table-column>
196 201
 
@@ -198,18 +203,21 @@
198 203
     <el-table-column label="批准文号" align="center" width="200px">
199 204
         <template slot-scope="scope">
200 205
         <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="true"></el-input>
206
+        <div style="visibility: hidden">/</div>
201 207
         </template>
202 208
     </el-table-column>
203 209
 
204 210
      <el-table-column label="关联采购订单号" align="center" width="200px">
205 211
         <template slot-scope="scope">
206 212
         <el-input v-model="scope.row.order_number" style="width:160px" :disabled="true"></el-input>
213
+        <div style="visibility: hidden">/</div>
207 214
         </template>
208 215
     </el-table-column>
209 216
 
210 217
     <el-table-column label="备注" align="center" width="200px">
211 218
         <template slot-scope="scope">
212 219
         <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
220
+        <div style="visibility: hidden">/</div>
213 221
         </template>
214 222
     </el-table-column>
215 223
 

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 883 - 650
src/xt_pages/supply/components/addPurchaseOrder.vue


+ 60 - 31
src/xt_pages/supply/components/addSupply.vue Parādīt failu

@@ -58,7 +58,7 @@
58 58
       <el-form
59 59
         :rules="tableRules"
60 60
         :model="recordInfo"
61
-        ref="tableForm"
61
+        ref="recordInfo"
62 62
         class="tableclass"
63 63
       >
64 64
         <el-table
@@ -117,11 +117,12 @@
117 117
             </template>
118 118
             <template slot-scope="scope">
119 119
               <el-form-item :prop="'tableList.' + scope.$index + '.name'">
120
+                <!-- :prop="'tableList.' + scope.$index + '.name'"  如需添加可在上方标签加入 -->
120 121
                 <el-select
121 122
                   v-model="scope.row.name"
122 123
                   style="width: 90px"
123 124
                   placeholder="请选择"
124
-                  @change="changeName"
125
+                  @change="changeName($event, scope)"
125 126
                 >
126 127
                   <el-option
127 128
                     v-for="(item, index) in tabList"
@@ -194,6 +195,7 @@ export default {
194 195
     return {
195 196
       Template,
196 197
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
198
+      list: ["001", "002"],
197 199
       // 表单验证规则
198 200
       rules: {
199 201
         id: [
@@ -227,7 +229,7 @@ export default {
227 229
         ],
228 230
       },
229 231
       recordInfo: {
230
-        tableList: [1],
232
+        tableList: [{}],
231 233
       },
232 234
       tableData: [
233 235
         {
@@ -263,12 +265,13 @@ export default {
263 265
   },
264 266
   created() {
265 267
     this.supplier.id = "gys001";
268
+    this.getcontacts();
266 269
   },
267 270
   methods: {
268 271
     show() {
269 272
       this.dialogVisible = true;
270 273
       this.orderIdAdd();
271
-      this.continueArr();
274
+      // this.continueArr();
272 275
     },
273 276
     //  验证表单内容
274 277
     submitForm(formName) {
@@ -285,41 +288,67 @@ export default {
285 288
       this.contactsinfo();
286 289
     },
287 290
 
291
+    // 首次打开新增页面判断是否有首要联系人
292
+    getcontacts() {
293
+      let data = {
294
+        value: 0,
295
+        label: "是",
296
+      };
297
+      if (this.recordInfo.tableList.length == 1) {
298
+        this.recordInfo.tableList[0].name = data;
299
+        this.$forceUpdate();
300
+      }
301
+    },
302
+
288 303
     // 首要联系人选择变更动态展示
289
-    changeName() {},
304
+    changeName(data, scope) {
305
+      let data1 = {
306
+        value: 1,
307
+        label: "否",
308
+      };
290 309
 
291
-    // 供应商编码动态递增
292
-    orderIdAdd() {
293
-      // 模拟情景
294
-      let data = ["gsy001", "gsy002", "gsy004"];
295
-      let data1 = [];
296
-      let num = 0;
310
+      let data2 = {
311
+        value: 0,
312
+        label: "是",
313
+      };
314
+      if (this.recordInfo.tableList.length == 1) {
315
+        this.recordInfo.tableList[0].name = data2;
316
+        this.$forceUpdate();
317
+      }
297 318
 
298
-      data.forEach((o) => {
299
-        o = o.split("gsy");
300
-        data1.push(o[1]);
319
+      this.recordInfo.tableList.forEach((el, index) => {
320
+        console.log(el, "oo");
321
+        if (scope.$index == index) {
322
+          el.name = data2;
323
+          this.$forceUpdate();
324
+          console.log(el.name.value, scope.$index, index);
325
+        } else {
326
+          el.name = data1;
327
+          this.$forceUpdate();
328
+          console.log("kkk");
329
+        }
301 330
       });
302
-
303
-      console.log(data1, "现有数据");
304
-
305
-      this.continueArr();
306 331
     },
307 332
 
308
-    //递增数判断
309
-    continueArr() {
310
-      var num = 0;
311
-      let arr = ["001", "002", "004", "005", "006"];
312
-
313
-      let len = 3; //显示的长度
314
-      num = parseInt(num, 10) + 1;
315
-      num = num.toString();
316
-      for (let i = 0; i < arr.length; i++) {
317
-        while (num.length < len) {
318
-          num = "0" + num;
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}`
319 349
         }
320 350
         
321
-      }
322
-      console.log(num,'d')
351
+      });
323 352
     },
324 353
 
325 354
     // 添加表单行

+ 8 - 0
src/xt_pages/supply/components/editGoodOrder.vue Parādīt failu

@@ -91,11 +91,13 @@
91 91
         </template>
92 92
         <template slot-scope="scope">
93 93
             <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
94
+            <div style="visibility: hidden">/</div>
94 95
         </template>
95 96
     </el-table-column>
96 97
     <el-table-column label="规格&单位" align="center" width="120px">
97 98
         <template slot-scope="scope">
98 99
             <el-input v-model="scope.row.supply_specification_name" style="width:100px" :disabled="true"></el-input>
100
+            <div style="visibility: hidden">/</div>
99 101
         </template>
100 102
     </el-table-column>
101 103
      <el-table-column label="单位" align="center" width="120px">
@@ -142,6 +144,7 @@
142 144
     <el-table-column label="可用库存" align="center" width="100px">
143 145
         <template slot-scope="scope">
144 146
             <el-input v-model="scope.row.supply_total" style="width:80px" :disabled="true"></el-input>
147
+            <div style="visibility: hidden">/</div>
145 148
         </template>
146 149
     </el-table-column>
147 150
     <el-table-column label="数量" align="center" width="120px">
@@ -158,6 +161,7 @@
158 161
     <el-table-column label="采购单价" align="center" width="120px">
159 162
         <template slot-scope="scope">
160 163
         <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
164
+        <div style="visibility: hidden">/</div>
161 165
         </template>
162 166
     </el-table-column>
163 167
 
@@ -190,6 +194,7 @@
190 194
                   :value="option.id">
191 195
                 </el-option>
192 196
           </el-select>
197
+          <div style="visibility: hidden">/</div>
193 198
         </template>
194 199
     </el-table-column>
195 200
 
@@ -197,18 +202,21 @@
197 202
     <el-table-column label="批准文号" align="center" width="200px">
198 203
         <template slot-scope="scope">
199 204
         <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="true"></el-input>
205
+        <div style="visibility: hidden">/</div>
200 206
         </template>
201 207
     </el-table-column>
202 208
 
203 209
      <el-table-column label="关联采购订单号" align="center" width="200px">
204 210
         <template slot-scope="scope">
205 211
         <el-input v-model="scope.row.order_number" style="width:160px" :disabled="true"></el-input>
212
+        <div style="visibility: hidden">/</div>
206 213
         </template>
207 214
     </el-table-column>
208 215
 
209 216
     <el-table-column label="备注" align="center" width="200px">
210 217
         <template slot-scope="scope">
211 218
         <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
219
+        <div style="visibility: hidden">/</div>
212 220
         </template>
213 221
     </el-table-column>
214 222
 

+ 3 - 0
src/xt_pages/supply/components/editPurchaseOrder.vue Parādīt failu

@@ -382,6 +382,7 @@ getInitOrder(){
382 382
         this.tabList.push(goodList[i])
383 383
         }
384 384
         this.goodList = goodList
385
+        console.log(this.goodList,'oo')
385 386
     } 
386 387
     })
387 388
 },
@@ -554,6 +555,7 @@ getTimes(time) {
554 555
       } 
555 556
    })
556 557
  },
558
+
557 559
  getAllPrice(){
558 560
    var total_price = 0
559 561
    for(let i=0;i<this.recordInfo.tableList.length;i++){
@@ -562,6 +564,7 @@ getTimes(time) {
562 564
    this.total_price = total_price
563 565
    return total_price.toFixed(2)
564 566
  },
567
+
565 568
  checkPurchaseOrder(id,index){
566 569
    this.$confirm('是否审核?', {
567 570
     confirmButtonText: '确 定',

+ 266 - 200
src/xt_pages/supply/components/purchaseOrderPrint.vue Parādīt failu

@@ -1,224 +1,274 @@
1 1
 <template>
2
-    <div class="main-contain">
3
-        <div class="position">
4
-        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
-        <el-row style="float:right;">
6
-            <el-col :span="24">
7
-            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
-            </el-col>
9
-        </el-row>
10
-        </div>
11
-        <div class="app-container" style="background-color: white;">
12
-            <div id="print_content">
13
-                <div class="print_main_content">
14
-                    <div class="order_title_panl">
15
-                        <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
16
-                        <span style="font-weight:500;font-size:18px;">购货单</span>
17
-                    </div>
18
-                    <div style="display:flex;justify-content: space-between;">
19
-                      <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
20
-                        供应商:{{getSupplyName(supplier_id)}}
21
-                      </div>
22
-                      <div style="margin-bottom:1px;font-size: 18px;">
23
-                        单据日期:{{rate_of_concession}}
24
-                      </div>
25
-                      <div style="margin-bottom:1px;font-size: 18px;">
26
-                        单据编号:{{number}}
27
-                      </div>
28
-                      <div style="margin-bottom:1px;font-size: 18px;">
29
-                        币别:RMB
30
-                      </div>
31
-                    </div>
32
-                    
33
-                    <div class="table_panel">
34
-                        <table class="table">
35
-                            <thead>
36
-                                <tr>
37
-                                    <td style="line-height:18px;" width="80">序号</td>
38
-                                    <td style="line-height:18px;" width="80">商品</td>
39
-                                    <td style="line-height:18px;" width="80">单位</td>
40
-                                    <td style="line-height:18px;" width="80">数量</td>
41
-                                    <td style="line-height:18px;" width="80">购货单价</td>
42
-                                    <td style="line-height:18px;" width="80">折扣率</td>
43
-                                    <td style="line-height:18px;" width="80">折扣额</td> 
44
-                                    <td style="line-height:18px;" width="60">购物金额</td>
45
-                                    <td style="line-height:18px;" width="80">仓库</td>
46
-                                </tr>
47
-                            </thead>
48
-                            <tbody>
49
-                                <tr v-for='(item,index) in tableList' :key="index">
50
-                                    <td style="line-height:18px;"><span>{{index+ 1}}</span></td>
51
-                                    <td style="line-height:18px;"><span>{{item.name}}</span></td>
52
-                                    <td style="line-height:18px;"><span>{{item.supply_unit}}</span></td>
53
-                                    <td style="line-height:18px;"><span>{{item.count}}</span></td>
54
-                                    <td style="line-height:18px;"><span>{{item.price}}</span></td>
55
-                                    <td style="line-height:18px;"><span>{{rate_of_concession}}</span></td>
56
-                                    <td style="line-height:18px;"><span>{{discount_amount}}</span></td>
57
-                                    <td style="line-height:18px;"><span>{{(item.count * item.price).toFixed(2)}}</span></td>
58
-                                    <td style="line-height:18px;"><span></span></td>
59
-                                </tr>
60
-                                <tr>
61
-                                  <td>合计</td>
62
-                                  <td colspan="12" style="text-align:right;"></td>
63
-                               </tr>
64
-                            </tbody>
65
-                        </table>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+      <el-row style="float: right">
6
+        <el-col :span="24">
7
+          <el-button
8
+            size="small"
9
+            icon="el-icon-printer"
10
+            type="primary"
11
+            @click="printAction"
12
+            >打印</el-button
13
+          >
14
+        </el-col>
15
+      </el-row>
16
+    </div>
17
+    <div class="app-container" style="background-color: white">
18
+      <div id="print_content">
19
+        <div class="print_main_content">
20
+          <div class="order_title_panl">
21
+            <div style="font-size: 22px; font-weight: bold">{{ orgName }}</div>
22
+            <span style="font-weight: 500; font-size: 18px">购货单</span>
23
+          </div>
24
+          <div style="display: flex; justify-content: space-between">
25
+            <div style="text-align: left; margin-bottom: 1px; font-size: 18px">
26
+              供应商:{{ getSupplyName(supplier_id) }}
27
+            </div>
28
+            <div style="margin-bottom: 1px; font-size: 18px">
29
+              单据日期:{{ rate_of_concession }}
30
+            </div>
31
+            <div style="margin-bottom: 1px; font-size: 18px">
32
+              单据编号:{{ number }}
33
+            </div>
34
+            <div style="margin-bottom: 1px; font-size: 18px">币别:RMB</div>
35
+          </div>
66 36
 
67
-                        <div style="margin-top:1px;">
68
-                            <div style="width:100px;">折扣额:</div><div style="width:100px;"></div>
69
-                            <div style="width:100px;">折扣金额:</div><div style="width:100px;"><span></span></div>
70
-                            <div style="width:100px;">本次付款:</div><div style="width:100px;"><span></span></div>
71
-                            <div style="width:100px;">本次欠款:</div><div style="width:100px;"></div>
72
-                       </div>
73
-                        <div style="margin-top:1px;">
74
-                            <div style="width:100px;">备注</div><div style="width:100px;"></div>
75
-                       </div>
76
-                       <div style="margin-top:1px;">
77
-                            <div style="width:100px;">制单人:</div><div style="width:100px;"></div>
78
-                            <div style="width:100px;">收货人签字:</div><div style="width:100px;"><span></span></div>
79
-                            <div style="width:100px;">供应商签字:</div><div style="width:100px;"><span></span></div>
80
-                       </div>
81
-                    </div>
82
-                </div>
37
+          <div class="table_panel">
38
+            <table class="table">
39
+              <thead>
40
+                <tr>
41
+                  <td style="line-height: 18px" width="80">序号</td>
42
+                  <td style="line-height: 18px" width="80">商品</td>
43
+                  <td style="line-height: 18px" width="80">单位</td>
44
+                  <td style="line-height: 18px" width="80">数量</td>
45
+                  <td style="line-height: 18px" width="80">购货单价</td>
46
+                  <td style="line-height: 18px" width="80">折扣率</td>
47
+                  <td style="line-height: 18px" width="80">折扣额</td>
48
+                  <td style="line-height: 18px" width="60">购物金额</td>
49
+                  <td style="line-height: 18px" width="80">仓库</td>
50
+                </tr>
51
+              </thead>
52
+              <tbody>
53
+                <tr v-for="(item, index) in tableList" :key="index">
54
+                  <td style="line-height: 18px">
55
+                    <span>{{ index + 1 }}</span>
56
+                  </td>
57
+                  <td style="line-height: 18px">
58
+                    <span>{{ item.name }}</span>
59
+                  </td>
60
+                  <td style="line-height: 18px">
61
+                    <span>{{ item.supply_unit }}</span>
62
+                  </td>
63
+                  <td style="line-height: 18px">
64
+                    <span>{{ item.count }}</span>
65
+                  </td>
66
+                  <td style="line-height: 18px">
67
+                    <span>{{ item.price }}</span>
68
+                  </td>
69
+                  <td style="line-height: 18px">
70
+                    <span>{{ rate_of_concession }}</span>
71
+                  </td>
72
+                  <td style="line-height: 18px">
73
+                    <span>{{ discount_amount }}</span>
74
+                  </td>
75
+                  <td style="line-height: 18px">
76
+                    <span>{{ (item.count * item.price).toFixed(2) }}</span>
77
+                  </td>
78
+                  <td style="line-height: 18px"><span></span></td>
79
+                </tr>
80
+                <tr>
81
+                  <td>合计</td>
82
+                  <td colspan="12" style="text-align: right"></td>
83
+                </tr>
84
+              </tbody>
85
+            </table>
86
+
87
+            <!-- <div style="margin-top: 1px">
88
+              <div style="width: 100px">折扣额:</div>
89
+              <div style="width: 100px"></div>
90
+              <div style="width: 100px">折扣金额:</div>
91
+              <div style="width: 100px"><span></span></div>
92
+              <div style="width: 100px">本次付款:</div>
93
+              <div style="width: 100px"><span></span></div>
94
+              <div style="width: 100px">本次欠款:</div>
95
+              <div style="width: 100px"></div>
96
+            </div>
97
+            <div style="margin-top: 1px">
98
+              <div style="width: 100px">备注</div>
99
+              <div style="width: 100px"></div>
83 100
             </div>
101
+            <div style="margin-top: 1px">
102
+              <div style="width: 100px">制单人:</div>
103
+              <div style="width: 100px"></div>
104
+              <div style="width: 100px">收货人签字:</div>
105
+              <div style="width: 100px"><span></span></div>
106
+              <div style="width: 100px">供应商签字:</div>
107
+              <div style="width: 100px"><span></span></div>
108
+            </div> -->
109
+            <div class="description">
110
+              <div class="content">折扣额:</div>
111
+              <div class="content">折扣金额:</div>
112
+              <div class="content">本次付款:</div>
113
+              <div class="content">本次欠款:</div>
114
+              <div class="content_1">备注:</div>
115
+              <div class="content">制单人:</div>
116
+              <div class="content">收货人签字:</div>
117
+              <div class="content">供应商签字:</div>
118
+            </div>
119
+          </div>
84 120
         </div>
121
+      </div>
85 122
     </div>
123
+  </div>
86 124
 </template>
87 125
 
88 126
 <script>
89
-import BreadCrumb from '@/xt_pages/components/bread-crumb'
127
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
90 128
 
91 129
 import { fetchAllAdminUsers } from "@/api/doctor";
92
-import {getPurchaseOrderDetail} from "@/api/supply"
93
-import print from 'print-js'
94
-const moment = require('moment')
95
-import { uParseTime } from '@/utils/tools'
130
+import { getPurchaseOrderDetail } from "@/api/supply";
131
+import print from "print-js";
132
+import { getLodop } from "@/assets/LodopFuncs";
133
+const moment = require("moment");
134
+import { uParseTime } from "@/utils/tools";
96 135
 export default {
97
-    components:{
98
-        BreadCrumb
136
+  components: {
137
+    BreadCrumb,
138
+  },
139
+  data() {
140
+    return {
141
+      size: "medium ",
142
+      crumbs: [
143
+        { path: false, name: "库存管理" },
144
+        { path: false, name: "耗材管理" },
145
+        { path: false, name: "入库单打印" },
146
+      ],
147
+      isEdit: 0,
148
+      checked: false,
149
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
150
+      time_now: moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
151
+      orgName: "",
152
+      orgId: "",
153
+      adminUserOptions: [],
154
+      tableList: [],
155
+      number: "",
156
+      id: "",
157
+      supplier_id: "",
158
+      rate_of_concession: "",
159
+      discount_amount: "",
160
+      supplyList: [],
161
+      document_date: "",
162
+    };
163
+  },
164
+  methods: {
165
+    printAction: function () {
166
+      const style =
167
+        "@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 14px; padding: 1px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 12px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }";
168
+      printJS({
169
+        printable: "print_content",
170
+        type: "html",
171
+        documentTitle: "  ",
172
+        style: style,
173
+        scanStyles: false,
174
+      });
99 175
     },
100
-    data(){
101
-        return{
102
-          crumbs: [
103
-            { path: false, name: '库存管理' },
104
-            { path: false, name: '耗材管理' },
105
-            { path: false, name: '入库单打印' },
106
-          ],
107
-            isEdit: 0,
108
-            checked: false,
109
-            signAndWeighBoxPatients: "sign-and-weigh-box-patients", 
110
-            time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
111
-            orgName:'',
112
-            orgId:'',
113
-            adminUserOptions:[],
114
-            tableList:[],
115
-            number:"",
116
-            id:"",
117
-            supplier_id:"",
118
-            rate_of_concession:"",
119
-            discount_amount:"",
120
-            supplyList:[],
121
-            document_date:"",
122
-        }
176
+    // 打印功能
177
+    btnClickPrint: function () {
178
+      let LODOP = getLodop(); //调用getLodop获取LODOP对象
179
+      LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_整页缩放打印输出");
180
+      
181
+      LODOP.ADD_PRINT_BARCODE(15, 15, 300, 300, "QRCode", "xxxxxxxxxxxxx");
182
+      LODOP.SET_PRINT_STYLEA(0, "Stretch", 1); //(可变形)扩展缩放模式
183
+      LODOP.PREVIEW(); //预览(预览打印无脚标)
184
+      // LODOP.PRINT();  //打印
185
+      LODOP.RINT_DESIGN();
123 186
     },
124
-    methods:{
125
-      printAction: function() {
126
-          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 14px; padding: 1px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 12px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
127
-          printJS({
128
-          printable: 'print_content',
129
-          type: 'html',
130
-          documentTitle: '  ',
131
-          style: style,
132
-          scanStyles: false
133
-          })
134
-      },
135
-
136
-      getTime(val) {
137
-         if(val < 0){
138
-           return ""
139
-         }
140
-         if(val == ""){
141
-          return ""
142
-         }else {
143
-          return uParseTime(val, '{y}-{m}-{d}')
144
-         }
145
-      },
146
-      fetchAllAdminUsers() {
147
-        fetchAllAdminUsers().then(response => {
148
-          if (response.data.state == 1) {
149
-            this.adminUserOptions = response.data.data.users
150 187
 
151
-          }
152
-        })
153
-      },
154
-      getXuserName(id) {
155
-        if (id <= 0) {
156
-          return "";
157
-        }
158
-        var name = "";
159
-        if (
160
-          this.adminUserOptions == null ||
161
-          typeof this.adminUserOptions.length === "undefined"
162
-        ) {
163
-          return name;
188
+    getTime(val) {
189
+      if (val < 0) {
190
+        return "";
191
+      }
192
+      if (val == "") {
193
+        return "";
194
+      } else {
195
+        return uParseTime(val, "{y}-{m}-{d}");
196
+      }
197
+    },
198
+    fetchAllAdminUsers() {
199
+      fetchAllAdminUsers().then((response) => {
200
+        if (response.data.state == 1) {
201
+          this.adminUserOptions = response.data.data.users;
164 202
         }
165
-        var leng = this.adminUserOptions.length;
166
-        if (leng == 0) {
167
-          return name;
203
+      });
204
+    },
205
+    getXuserName(id) {
206
+      if (id <= 0) {
207
+        return "";
208
+      }
209
+      var name = "";
210
+      if (
211
+        this.adminUserOptions == null ||
212
+        typeof this.adminUserOptions.length === "undefined"
213
+      ) {
214
+        return name;
215
+      }
216
+      var leng = this.adminUserOptions.length;
217
+      if (leng == 0) {
218
+        return name;
219
+      }
220
+      for (let index = 0; index < leng; index++) {
221
+        if (this.adminUserOptions[index].id == id) {
222
+          name = this.adminUserOptions[index].name;
223
+          break;
168 224
         }
169
-        for (let index = 0; index < leng; index++) {
170
-          if (this.adminUserOptions[index].id == id) {
171
-            name = this.adminUserOptions[index].name;
172
-            break;
225
+      }
226
+      return name;
227
+    },
228
+    getPurchaseOrderDetail() {
229
+      var id = this.$route.query.id;
230
+      getPurchaseOrderDetail(id).then((response) => {
231
+        if (response.data.state == 1) {
232
+          var info = response.data.data.info;
233
+          this.is_check = info.is_check;
234
+          this.number = info.number;
235
+          this.id = info.id;
236
+          this.supplier_id = info.supplier_id;
237
+          this.rate_of_concession = info.rate_of_concession;
238
+          this.discount_amount = info.discount_amount;
239
+          this.document_date = info.document_date;
240
+          var orderInfo = response.data.data.orderInfo;
241
+          var supplyList = response.data.data.supplyList;
242
+          this.supplyList = supplyList;
243
+          for (let i = 0; i < orderInfo.length; i++) {
244
+            orderInfo[i].supply_count = orderInfo[i].count;
245
+            orderInfo[i].supply_price = orderInfo[i].price;
246
+            orderInfo[i].supply_remake = orderInfo[i].remark;
247
+            orderInfo[i].type = orderInfo[i].is_source;
248
+            orderInfo[i].project_id = orderInfo[i].project_id;
173 249
           }
250
+          console.log("orderINFO23323232", orderInfo);
251
+          this.tableList = orderInfo;
174 252
         }
175
-        return name;
176
-      },
177
-      getPurchaseOrderDetail(){
178
-        var id = this.$route.query.id
179
-        getPurchaseOrderDetail(id).then(response=>{
180
-        if(response.data.state == 1){
181
-            var info = response.data.data.info
182
-            this.is_check = info.is_check
183
-            this.number = info.number
184
-            this.id = info.id
185
-            this.supplier_id = info.supplier_id
186
-            this.rate_of_concession = info.rate_of_concession
187
-            this.discount_amount = info.discount_amount
188
-            this.document_date = info.document_date
189
-            var orderInfo = response.data.data.orderInfo
190
-            var supplyList = response.data.data.supplyList
191
-            this.supplyList = supplyList
192
-            for(let i=0;i<orderInfo.length;i++){
193
-                orderInfo[i].supply_count = orderInfo[i].count
194
-                orderInfo[i].supply_price = orderInfo[i].price
195
-                orderInfo[i].supply_remake = orderInfo[i].remark
196
-                orderInfo[i].type = orderInfo[i].is_source
197
-                orderInfo[i].project_id = orderInfo[i].project_id
198
-            }
199
-            console.log("orderINFO23323232",orderInfo)
200
-            this.tableList = orderInfo
201
-        }
202
-      })  
253
+      });
203 254
     },
204
-    getSupplyName(id){
205
-      var name = ""
206
-      for(let i=0;i<this.supplyList.length;i++){
207
-        if(id == this.supplyList[i].id){
208
-          name = this.supplyList[i].supplier_name
255
+    getSupplyName(id) {
256
+      var name = "";
257
+      for (let i = 0; i < this.supplyList.length; i++) {
258
+        if (id == this.supplyList[i].id) {
259
+          name = this.supplyList[i].supplier_name;
209 260
         }
210 261
       }
211
-      return name
262
+      return name;
212 263
     },
213
-    },
214
-    created(){
215
-      this.orgName = this.$store.getters.xt_user.org.org_name;
216
-      this.orgId = this.$store.getters.xt_user.org.id;
217
-      this.fetchAllAdminUsers()
218
-      this.getPurchaseOrderDetail()
219
-    
220
-    }
221
-}
264
+  },
265
+  created() {
266
+    this.orgName = this.$store.getters.xt_user.org.org_name;
267
+    this.orgId = this.$store.getters.xt_user.org.id;
268
+    this.fetchAllAdminUsers();
269
+    this.getPurchaseOrderDetail();
270
+  },
271
+};
222 272
 </script>
223 273
 
224 274
 
@@ -244,7 +294,6 @@ export default {
244 294
       border: 1px solid;
245 295
       border-collapse: collapse;
246 296
       padding: 2px;
247
-      
248 297
 
249 298
       thead {
250 299
         tr {
@@ -289,4 +338,21 @@ export default {
289 338
     }
290 339
   }
291 340
 }
341
+
342
+.description {
343
+  width: 100%;
344
+  display: flex;
345
+  flex: 1;
346
+  justify-content: flex-start;
347
+  flex-wrap: wrap;
348
+  .content {
349
+    width: 25%;
350
+  }
351
+  .content_1 {
352
+    width: 100%;
353
+  }
354
+  // .content_2{
355
+  //   width: 33%;
356
+  // }
357
+}
292 358
 </style>

+ 2 - 2
src/xt_pages/supply/purchaseOrderQuery.vue Parādīt failu

@@ -204,7 +204,7 @@ export default {
204 204
       goodInfo: [],
205 205
       org_id:0,
206 206
       types:[],
207
-      tableList:[],
207
+      tableList:[{}],
208 208
       type_name:"",
209 209
       checkList:[
210 210
         {id:0,name:"请选择"},
@@ -361,7 +361,7 @@ export default {
361 361
     this.end_time = this.getTimes(new Date())
362 362
     this.org_id =  this.$store.getters.xt_user.org_id
363 363
     this.getAllSupply()
364
-    this.getlist()
364
+    // this.getlist()
365 365
   },
366 366
  
367 367
 };

+ 7 - 7
src/xt_pages/supply/supplyQuery.vue Parādīt failu

@@ -167,7 +167,7 @@ import addSupply from "./components/addSupply.vue"
167 167
 export default {
168 168
   name: "stockIn",
169 169
   created() {
170
-    this.initSupplierData()
170
+    // this.initSupplierData()
171 171
     this.org_id =  this.$store.getters.xt_user.org_id
172 172
 
173 173
     var start_time =  window.sessionStorage.getItem('start_time')
@@ -205,17 +205,17 @@ export default {
205 205
       goodInfo: [],
206 206
       org_id:0,
207 207
       types:[],
208
-      tableList:[],
208
+      tableList:[1],
209 209
       tyep_name:"",
210 210
     };
211 211
   },
212 212
   methods:{
213 213
     // 获取供应商编码接口
214
-    initSupplierData(){
215
-      getSupplierId().then(res => {
216
-        console.log(res,'sss')
217
-      })
218
-    },
214
+    // initSupplierData(){
215
+    //   getSupplierId().then(res => {
216
+    //     console.log(res,'sss')
217
+    //   })
218
+    // },
219 219
 
220 220
      toAdd(){
221 221
       //  console.log("res32323232323223",this.$refs.addSupply)

+ 13 - 13
src/xt_permission.js Parādīt failu

@@ -12,19 +12,19 @@ const permissionWhiteList = loginWhiteList.concat(['/']) // 权限验证白名
12 12
 
13 13
 router.beforeEach((to, from, next) => {
14 14
   // 线上注释
15
-  // if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
-  //   store.dispatch('VerifyConfigList', []).then(() => {
17
-  //     next()
18
-  //   })
19
-  // }
20
-  // if (store.getters.permission_routers === undefined) {
21
-  //   store.dispatch('xt_GenerateRoutes', []).then(() => {
22
-  //     next()
23
-  //   })
24
-  // } else {
25
-  //   next()
26
-  // }
27
-  // return
15
+  if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
+    store.dispatch('VerifyConfigList', []).then(() => {
17
+      next()
18
+    })
19
+  }
20
+  if (store.getters.permission_routers === undefined) {
21
+    store.dispatch('xt_GenerateRoutes', []).then(() => {
22
+      next()
23
+    })
24
+  } else {
25
+    next()
26
+  }
27
+  return
28 28
   // 线上注释
29 29
   NProgress.start()
30 30
   // console.log(store.getters.current_role_urls.indexOf(to.path))