linweizeng 3 лет назад
Родитель
Сommit
ed904be489

+ 7 - 0
common/router/modules/routes.js

@@ -195,6 +195,13 @@ const routes = [{
 		meta: {
 			title: '样品',
 		},
+	},
+	{
+		path: "/pages/tag/sampleTag",
+		name: 'sampleTag',
+		meta: {
+			title: '样品标签',
+		},
 	}
 ]
 export default routes

+ 3 - 1
package.json

@@ -4,8 +4,10 @@
   "description": "![JEECG](https://static.oschina.net/uploads/img/201905/24164523_XDhg.png \"JeecgBoot快速开发平台\")",
   "main": "index.js",
   "dependencies": {
+    "html2canvas": "^1.4.1",
     "ids": "^1.0.0",
-    "uview-ui": "^1.8.4"
+    "uview-ui": "^1.8.4",
+    "vue-barcode": "^1.3.0"
   },
   "devDependencies": {
     "node-sass": "^7.0.3",

+ 10 - 1
pages.json

@@ -227,7 +227,16 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/tag/sampleTag",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "样品标签",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"globalStyle": {
 		"mp-alipay": {
 			/* 支付宝小程序特有相关 */

+ 25 - 16
pages/jiance/jindu.vue

@@ -48,15 +48,16 @@
 
 				<view style=" width: 100%; text-align: right; padding-top: 5rpx;padding-bottom: 0rpx;">
 					<u-button class="m-r-15" type="error" size="mini" @click="repulse(item.id_)"
-						v-if="(item.zhuang_tai_ == '待运营中心审核' || item.zhuang_tai_ == '待检测中心审核' || item.zhuang_tai_ == '待财务审核' || item.zhuang_tai_ == '待样品接收') && item.shi_fou_guo_shen_ != '已退回'">
-						退回
+						v-if="(item.wei_tuo_zhuang_ta == '已编制' || item.wei_tuo_zhuang_ta == '已审核' || item.wei_tuo_zhuang_ta == '已审批') && item.shi_fou_guo_shen_ != '已退回'">
+						退回申请
 					</u-button>
 					<u-button class="m-r-15" type="primary" size="mini" style=""
-						@click="editOrder(item.id_,item.he_tong_bian_hao_,'0')">明细
+						@click="editOrder(item.id_,item.he_tong_bian_hao_,'0', 'detail')">明细
 					</u-button>
 					<u-button class="m-r-15" type="success" size="mini"
-						@click="editOrder(item.id_,item.he_tong_bian_hao_,'1')"
-						v-if="item.zhuang_tai_ == '待编制' || item.shi_fou_guo_shen_ == '已退回'">修改</u-button>
+						@click="editOrder(item.id_,item.he_tong_bian_hao_,'1', 'edit')"
+						v-if="item.wei_tuo_zhuang_ta == '待编制' || item.shi_fou_guo_shen_ == '已退回'">修改</u-button>
+					<u-button type="warning" size="mini" class="m-r-15" @click="getTag(item.id_)">样品标签</u-button>
 					<u-button type="warning" size="mini" @click="goto(item.id_)">查看报告</u-button>
 
 					<!-- 					<button style="margin-right: 15rpx; height: 50rpx;" size="mini"
@@ -159,10 +160,10 @@
 			 * @param {Object} buttonFlag
 			 * 页面跳转
 			 */
-			editOrder(editId, heTongBianHao, buttonFlag) {
+			editOrder(editId, heTongBianHao, buttonFlag, type) {
 				console.log(editId)
 				uni.navigateTo({
-					url: `/pages/jiance/editOrder?id=${editId}&buttonFlag=${buttonFlag}&heTongBianHao=${heTongBianHao}`
+					url: `/pages/jiance/order?id=${editId}&buttonFlag=${buttonFlag}&heTongBianHao=${heTongBianHao}&type=${type}`
 				})
 			},
 
@@ -188,7 +189,7 @@
 				// 	`{"sql":"select tb.*,td.he_tong_bian_hao_ as he_tong_ming_cheng_,ty.ke_hu_ming_cheng_ as ke_hu_dang_wei from t_mjwtsqb tb, t_bjd td,t_yxkh ty where tb.he_tong_bian_hao_ = td.id_ and td.ke_hu_ming_cheng_ = ty.id_ and tb.create_by_= '${useId}' and tb.wei_tuo_bian_hao_ like '%${keyworks}%' ORDER BY tb.id_ desc LIMIT ${page},10"}`
 
 				let sql =
-					`select * from t_lhwtsqb where create_by_= '${useId}' ORDER BY create_time_ desc LIMIT ${page},10`
+					`select tl.*,td.he_tong_bian_hao_ as he_tong_ming_cheng_ from t_lhwtsqb tl,t_bjd td where tl.he_tong_id_ = td.id_ and tl.create_by_= '${useId}' and tl.wei_tuo_bian_hao_ like '%${keyworks}%' ORDER BY tl.create_time_ desc LIMIT ${page},10`
 				let requestData = this.$sig(sql)
 
 
@@ -197,17 +198,19 @@
 						const data = res.data.variables.data
 						// this.resdata.push(...data)
 						data.forEach((item, index) => {
-							// this.getZhuangtai(item.wei_tuo_bian_hao_, (result) => {
-							// 	this.$set(item, 'zhuangtai', result)
-							// })
+							this.getZhuangtai(item.wei_tuo_bian_hao_, (result) => {
+								this.$set(item, 'zhuangtai', result)
+							})
 							this.resdata.push(item)
 						})
 						uni.stopPullDownRefresh();
 						if (data.length > 10) {
 							this.ReachBottomShow = false
-						} else {
+						}
+						if(data.length != 0){
 							this.current++
 						}
+						console.log(this.current)
 						uni.hideLoading()
 					}
 				})
@@ -217,12 +220,10 @@
 			 */
 			getZhuangtai(id, callback) {
 				let sql =
-					`{"sql":"select * from t_mjwtzsb where wei_tuo_bian_hao_ = '${id}'"}`
+					`select * from t_lhwtzsb where wei_tuo_bian_hao_ = '${id}'`
+					let requestData = this.$sig(sql)
 
 
-				let md5 = this.sig(sql) //加密, 获取md5密文
-				let requestData = sql.slice(0, 1) + '"sig":"' + md5 + '",' + sql.slice(1) //结果拼接
-
 				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
 					if (res.data.state == 200) {
 						const data = res.data.variables.data
@@ -277,6 +278,14 @@
 				this.show = false
 				// this.getData(this.keyword)
 			},
+			/**
+			 * 样品标签页
+			 */
+			getTag(id){
+				uni.navigateTo({ // 跳转页面
+					url: '/pages/tag/sampleTag?id=' + id
+				})
+			},
 
 
 			sig(sql) {

+ 25 - 3
pages/jiance/list/apply.vue

@@ -9,6 +9,11 @@
 </template>
 
 <script>
+	import {
+		ACCESS_TOKEN,
+		USER_NAME,
+		USER_INFO
+	} from "@/common/util/constants"
 	export default {
 		props: {
 			id: {
@@ -18,18 +23,35 @@
 		},
 		data() {
 			return {
-				value: ''
+				value: '',
+				userid: '',
+				time: ''
 			}
 		},
+		created() {
+			this.getInit()
+		},
 		methods: {
+			getInit(){
+				let info = uni.getStorageSync(USER_INFO);
+				if (info.employee.id) {
+					this.userid = info.employee.id || ''
+				}
+				var nowDate = new Date((new Date).getTime() + 8 * 60 * 60 * 1000)
+				var time = nowDate.toJSON().split('T').join(' ').substr(0, 19)
+				this.time = time
+			},
+			//提交
 			getSave() {
 				let pp = {
 					paramWhere: [{
 						id_: this.id
 					}],
-					tableName: "t_mjwtsqb",
+					tableName: "t_lhwtsqb",
 					paramCond: {
-						ke_hu_tui_hui_yua: this.value
+						xiu_gai_bei_zhu_: this.value,
+						update_time_: this.time,
+						update_by_: this.userid
 					}
 				}
 				let data = this.$sig(pp)

+ 0 - 1
pages/jiance/list/specimen.vue

@@ -116,7 +116,6 @@
 			if (info.employee.id) {
 				this.userid = info.employee.id || ''
 			}
-			console.log(info)
 			if (option.id) {
 				this.id = option.id
 				this.getDe(option.id)

+ 459 - 173
pages/jiance/order.vue

@@ -4,185 +4,236 @@
 			<block slot="backText">返回</block>
 			<block slot="content">检测委托</block>
 		</cu-custom>
-		<u-form :model="form" ref="form" label-width="220">
+		<u-form :model="form" ref="form" label-width="220" :disabled="type == 'detail' ? true : false">
 			<uni-group mode="card" title="委托信息">
 				<u-form-item label="委托类型">
 					<u-input v-model="form.weiTuoLeiXing" disabled />
 				</u-form-item>
 				<u-form-item label="委托编号">
-					<u-input v-model="form.weiTuoBianHao" disabled/>
+					<u-input v-model="form.weiTuoBianHao" disabled />
 				</u-form-item>
 				<u-form-item label="合同选择" prop="heTongId" required>
-					<uni-data-select v-model="form.heTongId" :localdata="hetong" @change="hetongChange">
+					<uni-data-select v-model="form.heTongId" :localdata="hetong" @change="hetongChange" v-if="type != 'detail'">
 					</uni-data-select>
+					
+					<text v-else>{{getButtChange(form.heTongId,hetong)}}</text>
 				</u-form-item>
 				<u-form-item label="委托来源">
-					<u-input v-model="form.weiTuoDanLaiYuan" disabled/>
-					<!-- <u-radio-group v-model="form.weiTuoDanLaiYuan">
-						<u-radio v-for="(item, index) in reportSourceList" :key="index" :name="item.name">
-							{{item.name}}
-						</u-radio>
-					</u-radio-group> -->
+					<u-input v-model="form.weiTuoDanLaiYuan" disabled />
 				</u-form-item>
 				<u-form-item label="合同类型" prop="weiTuoHeTong" required>
-					<u-input v-model="form.weiTuoHeTong" disabled/>
+					<u-input v-model="form.weiTuoHeTong" disabled />
 				</u-form-item>
 				<u-form-item label="委托单位">
-					<u-input v-model="form.weiTuoDanWei" />
+					<u-input v-model="form.weiTuoDanWei" disabled />
 				</u-form-item>
 				<u-form-item label="送检单位" prop="songJianDanWei" required>
 					<u-input v-model="form.songJianDanWei" />
 				</u-form-item>
-				
+
 			</uni-group>
 
 			<uni-group mode="card" :title="'记录' + (index+1)" v-for="(item,index) in form.lhypb" :key="index">
 				<u-form-item label="样品名称" prop="yangPinMingCheng" required>
-					<u-input v-model="item.yangPinMingCheng" />
+					<u-input v-model="item.yangPinMingCheng" :disabled="type == 'detail'?true :false"/>
 				</u-form-item>
 				<u-form-item label="样品编号">
-					<u-input v-model="item.yangPinBianHao" disabled/>
+					<u-input v-model="item.yangPinBianHao" disabled />
 				</u-form-item>
 				<u-form-item label="姓名">
 					<u-input v-model="item.xingMing" />
 				</u-form-item>
 				<u-form-item label="性别">
-					<u-radio-group v-model="item.xingBie">
+					<u-radio-group v-model="item.xingBie" v-if="type != 'detail'">
 						<u-radio v-for="(it, index) in sexList" :key="index" :name="it.name">
 							{{it.name}}
 						</u-radio>
 					</u-radio-group>
+					<text v-else>{{item.xingBie}}</text>
 				</u-form-item>
 				<u-form-item label="年龄">
 					<u-input v-model="item.nianLing" />
 				</u-form-item>
-				<u-form-item label="送检批号/编号" prop="songJianPiHaoBian" required>
-					<u-input v-model="item.songJianPiHaoBian" />
+				<u-form-item label="送检批号/编号" prop="songJianPiHao" required>
+					<u-input v-model="item.songJianPiHao" :disabled="type == 'detail'?true :false"/>
 				</u-form-item>
 				<u-form-item label="样本状态" prop="yangBenZhuangTai" required>
-					<u-input type="select" v-model="item.yangBenZhuangTai" @click="sheetClick('state',index)" />
+					<u-input type="select" v-model="item.yangBenZhuangTai" @click="sheetClick('state',index)" v-if="type != 'detail'"/>
+					
+					<text v-else>{{item.yangBenZhuangTai}}</text>
 				</u-form-item>
 				<u-form-item label="送检时间" prop="songJianShiJian" required>
-					<u-input type="select" v-model="item.songJianShiJian" @click="dateClick('inspect',index)" />
+					<u-input type="select" v-model="item.songJianShiJian" @click="dateClick('inspect',index)" v-if="type != 'detail'"/>
+					<text v-else>{{item.songJianShiJian}}</text>
 				</u-form-item>
-			
-				<u-form-item label="样本类型一" required>
-					<u-input type="select" v-model="item.yangPinLeiXing" @click="sheetClick('yangpinType1',index)" />
+
+				<u-form-item label="样本类型一">
+					<u-input type="select" v-model="item.yangPinLeiXing" @click="sheetClick('yangpinType1',index)"  v-if="type != 'detail'" />
+					<text v-else>{{item.yangPinLeiXing}}</text>
 				</u-form-item>
-				<u-form-item label="样本运输条件一" required>
+				<u-form-item label="样本运输条件一">
 					<u-input type="select" v-model="item.yangBenYunShuTiao"
-						@click="sheetClick('transportType1',index)" />
+						@click="sheetClick('transportType1',index)" v-if="type != 'detail'"/>
+						<text v-else>{{item.yangBenYunShuTiao}}</text>
 				</u-form-item>
 				<u-form-item label="数量一">
-					<u-number-box v-model="item.shuLiang"></u-number-box>
+					<u-number-box v-model="item.shuLiang" v-if="type != 'detail'"></u-number-box>
+					<text v-else>{{item.shuLiang}}</text>
 				</u-form-item>
-				<u-form-item label="样品规格一" required>
-					<u-input v-model="item.yangPinGuiGe" />
-					<u-button slot="right" type="success" size="mini" @click="sheetClick('specification1',index)">规格
+				<u-form-item label="样品规格一">
+					<u-input v-model="item.yangPinGuiGe" v-if="type != 'detail'"/>
+					<u-button slot="right" type="success" size="mini" @click="sheetClick('specification1',index)" v-if="type != 'detail'">规格
 					</u-button>
-				</u-form-item>	
-				
-				
-				<u-form-item label="样本类型二" required>
-					<u-input type="select" v-model="item.yangPinLeiXingEr" @click="sheetClick('yangpinType2',index)" />
+					<text v-else>{{item.yangPinGuiGe}}</text>
+				</u-form-item>
+
+
+				<u-form-item label="样本类型二">
+					<u-input type="select" v-model="item.yangPinLeiXingEr" @click="sheetClick('yangpinType2',index)" v-if="type != 'detail'"/>
+					<text v-else>{{item.yangPinLeiXingEr}}</text>
 				</u-form-item>
-				<u-form-item label="样本运输条件二" required>
+				<u-form-item label="样本运输条件二">
 					<u-input type="select" v-model="item.yangPinYunShuTiao"
-						@click="sheetClick('transportType2',index)" />
+						@click="sheetClick('transportType2',index)" v-if="type != 'detail'"/>
+						<text v-else>{{item.yangPinYunShuTiao}}</text>
 				</u-form-item>
 				<u-form-item label="数量二">
-					<u-number-box v-model="item.shuLiangEr"></u-number-box>
+					<u-number-box v-model="item.shuLiangEr" v-if="type != 'detail'"></u-number-box>
+					<text v-else>{{item.shuLiangEr}}</text>
 				</u-form-item>
-				<u-form-item label="样品规格二" required>
-					<u-input v-model="item.yangPinGuiGeEr" />
-					<u-button slot="right" type="success" size="mini" @click="sheetClick('specification2',index)">规格
+				<u-form-item label="样品规格二">
+					<u-input v-model="item.yangPinGuiGeEr" v-if="type != 'detail'"/>
+					<u-button slot="right" type="success" size="mini" @click="sheetClick('specification2',index)" v-if="type != 'detail'">规格
 					</u-button>
+					<text v-else>{{item.yangPinGuiGeEr}}</text>
 				</u-form-item>
-				
-				<u-form-item label="样本类型三" required>
-					<u-input type="select" v-model="item.yangPinLeiXingSan" @click="sheetClick('yangpinType3',index)" />
+
+				<u-form-item label="样本类型三">
+					<u-input type="select" v-model="item.yangPinLeiXingSan" @click="sheetClick('yangpinType3',index)" v-if="type != 'detail'"/>
+					<text v-else>{{item.yangPinLeiXingSan}}</text>
 				</u-form-item>
-				<u-form-item label="样本运输条件三" required>
+				<u-form-item label="样本运输条件三">
 					<u-input type="select" v-model="item.yangPinYunShuSan"
-						@click="sheetClick('transportType3',index)" />
+						@click="sheetClick('transportType3',index)" v-if="type != 'detail'"/>
+					<text v-else>{{item.yangPinLeiXingSan}}</text>
 				</u-form-item>
 				<u-form-item label="数量三">
-					<u-number-box v-model="item.shuLiangSan"></u-number-box>
+					<u-number-box v-model="item.shuLiangSan" v-if="type != 'detail'"></u-number-box>
+					<text v-else>{{item.shuLiangSan}}</text>
 				</u-form-item>
-				<u-form-item label="样品规格三" required>
-					<u-input v-model="item.yangPinGuiGeSan" />
-					<u-button slot="right" type="success" size="mini" @click="sheetClick('specification3',index)">规格
+				<u-form-item label="样品规格三">
+					<u-input v-model="item.yangPinGuiGeSan" v-if="type != 'detail'"/>
+					<u-button slot="right" type="success" size="mini" @click="sheetClick('specification3',index)" v-if="type != 'detail'">规格
 					</u-button>
+					<text v-else>{{item.yangPinGuiGeSan}}</text>
 				</u-form-item>
-				
-				<u-form-item label="样本类型四" required>
-					<u-input type="select" v-model="item.yangPinLeiXingSi" @click="sheetClick('yangpinType4',index)" />
+
+				<u-form-item label="样本类型四">
+					<u-input type="select" v-model="item.yangPinLeiXingSi" @click="sheetClick('yangpinType4',index)" v-if="type != 'detail'"/>
+					<text v-else>{{item.yangPinLeiXingSi}}</text>
 				</u-form-item>
 				<u-form-item label="样本运输条件四" required>
-					<u-input type="select" v-model="item.yangPinYunShuSi"
-						@click="sheetClick('transportType4',index)" />
+					<u-input type="select" v-model="item.yangPinYunShuSi" @click="sheetClick('transportType4',index)" v-if="type != 'detail'"/>
+					<text v-else>{{item.yangPinYunShuSi}}</text>
 				</u-form-item>
 				<u-form-item label="数量四">
-					<u-number-box v-model="item.shuLiangSi"></u-number-box>
+					<u-number-box v-model="item.shuLiangSi" v-if="type != 'detail'"></u-number-box>
+					<text v-else>{{item.shuLiangSi}}</text>
 				</u-form-item>
-				<u-form-item label="样品规格四" required>
-					<u-input v-model="item.yangPinGuiGeSi" />
-					<u-button slot="right" type="success" size="mini" @click="sheetClick('specification4',index)">规格
+				<u-form-item label="样品规格四">
+					<u-input v-model="item.yangPinGuiGeSi" v-if="type != 'detail'"/>
+					<u-button slot="right" type="success" size="mini" @click="sheetClick('specification4',index)" v-if="type != 'detail'">规格
 					</u-button>
+					<text v-else>{{item.yangPinGuiGeSi}}</text>
 				</u-form-item>
-				
+				<u-form-item label="项目名称" prop="xiangMuMingCheng" v-if="form.weiTuoHeTong == '技术服务协议'">
+					<u-input v-model="item.xiangMuMingCheng" :disabled="type == 'detail'?true :false"/>
+				</u-form-item>
+
+				<u-form-item label="检测类型" v-if="type != 'detail'">
+					<u-input type="select" v-model="item.jianCeType" @click="sheetClick('jianCeType',index)" />
+				</u-form-item>
+
 				<u-form-item label="检测项目" prop="name" label-position="top">
-					<div>55</div>
+					<checkbox-group v-for="(it, x) in item.jianCeList" :key="x" @click="changeIndex(it,index,x)" v-if="type != 'detail'">
+						<label class=" uni-list-cell uni-list-cell-pd" v-show="it.jian_ce_lei_bie_==item.jianCeType"
+							style="display: flex;margin: 15rpx 10rpx;font-size: 20rpx;line-height: 40rpx;">
+							<view>
+								<checkbox :checked="it.checked" :value="it.id_" />
+							</view>
+							<view style="margin-left: 10rpx;">
+								<view>{{it.jian_ce_lei_bie_}}-{{it.jian_ce_xiang_mu_}}</view>
+								<view>{{it.yi_ju_de_biao_zhu}}</view>
+							</view>
+						</label>
+					</checkbox-group>
+					<view v-for="(it, x) in item.jianCeList" :key="x" v-if="it.checked && type=='detail'" >
+						<view class="uni-list-cell uni-list-cell-pd">
+							<view style="margin-left: 10rpx;font-size: 20rpx;line-height: 40rpx;background: #eee;padding: 10rpx;">
+								<view>{{it.jian_ce_lei_bie_}}-{{it.jian_ce_xiang_mu_}}</view>
+								<view>{{it.yi_ju_de_biao_zhu}}</view>
+							</view>
+						</view>
+					</view>
+					
 				</u-form-item>
 
-				<u-button type="error" class="btn" @click="deletSing(index)">删除记录{{index+1}}</u-button>
+				<u-button type="error" class="btn" @click="deletSing(index)" v-if="type != 'detail'">删除记录{{index+1}}</u-button>
 			</uni-group>
 
-			<u-button type="success" class="btn" @click="getSing()">添加记录</u-button>
+			<u-button type="success" class="btn" @click="getSing()" v-if="type != 'detail'">添加记录</u-button>
 
 			<uni-group mode="card">
 				<u-form-item label="付款方式">
-					<u-input v-model="form.fuKuanFangShi" disabled/>
+					<u-input v-model="form.fuKuanFangShi" disabled />
 				</u-form-item>
 				<u-form-item label="报告类型">
-					<u-radio-group v-model="form.baoGaoLeiXing">
+					<u-radio-group v-model="form.baoGaoLeiXing" v-if="type != 'detail'">
 						<u-radio v-for="(item, index) in reportTypeList" :key="index" :name="item.name">
 							{{item.name}}
 						</u-radio>
 					</u-radio-group>
+					<text v-else>{{getButtChange(form.baoGaoLeiXing,reportTypeList)}}</text>
 				</u-form-item>
 				<u-form-item label="出报告要求" prop="name">
-					<u-radio-group v-model="form.chuJuBaoGaoYaoQiu">
+					<u-radio-group v-model="form.chuJuBaoGaoYaoQiu" v-if="type != 'detail'">
 						<u-radio v-for="(item, index) in reportRequireList" :key="index" :name="item.name">
 							{{item.name}}
 						</u-radio>
 					</u-radio-group>
+					<text v-else>{{getButtChange(form.chuJuBaoGaoYaoQiu,reportRequireList)}}</text>
 				</u-form-item>
 				<u-form-item label="出报告时间">
-					<u-input type="select" v-model="form.chuBaoGaoShiJian" @click="dateClick('report')" />
+					<u-input type="select" v-model="form.chuBaoGaoShiJian" @click="dateClick('report')" v-if="type != 'detail'"/>
+					<text v-else>{{form.chuBaoGaoShiJian}}</text>
 				</u-form-item>
 				<u-form-item label="样本处理" prop="yangBenChuLi" required>
-					<u-input type="select" v-model="form.yangBenChuLi" @click="sheetClick('disposition')" />
+					<u-input type="select" v-model="form.yangBenChuLi" @click="sheetClick('disposition')" v-if="type != 'detail'"/>
+					<text v-else>{{form.yangBenChuLi}}</text>
+				</u-form-item>
+				<u-form-item label="总价">
+					<u-input v-model="form.zongJia" disabled />
 				</u-form-item>
 			</uni-group>
 
 			<uni-group mode="card" title="委托人信息">
 				<u-form-item label="委托方">
-					<u-input v-model="form.weiTuoFangMingChe" />
+					<u-input v-model="form.weiTuoFangMingChe" :disabled="type == 'detail'?true :false"/>
 				</u-form-item>
 				<u-form-item label="联系人">
-					<u-input v-model="form.weiTuoFangLianXiR" />
+					<u-input v-model="form.weiTuoFangLianXiR" :disabled="type == 'detail'?true :false"/>
 				</u-form-item>
 				<u-form-item label="联系电话">
-					<u-input v-model="form.weiTuoFangLianXiD" />
+					<u-input v-model="form.weiTuoFangLianXiD" :disabled="type == 'detail'?true :false"/>
 				</u-form-item>
 				<u-form-item label="委托日期" prop="weiTuoRiQi">
-					<u-input v-model="form.weiTuoRiQi" />
+					<u-input type="select" v-model="form.weiTuoRiQi" @click="dateClick('weiTuo')" v-if="type != 'detail'"/>
+					<text v-else>{{form.weiTuoRiQi}}</text>
 				</u-form-item>
 				<u-form-item label="委托签名" label-position="top">
 					<view style="width: 100%;">
 						<view style="text-align: right;width: 100%;">
-							<view>
+							<view v-if="type != 'detail'">
 								<u-button type="primary" size="mini" @click="qianming(0)">
 									签名</u-button>
 								<u-button type="primary" size="mini" @click="deqianming(0)" style="margin-left: 15rpx;"
@@ -199,7 +250,7 @@
 
 				</u-form-item>
 			</uni-group>
-			<u-button type="primary" class="btn" @click="sumbit">提交</u-button>
+			<u-button type="primary" class="btn" @click="sumbit" v-if="type != 'detail'">提交</u-button>
 		</u-form>
 
 		<u-calendar v-model="dateShow" :mode="mode" max-date="2050-01-01" @change="dateChange"></u-calendar>
@@ -228,6 +279,7 @@
 		USER_NAME,
 		USER_INFO
 	} from "@/common/util/constants"
+	import service from './order/meth.js'
 	export default {
 		data() {
 			return {
@@ -250,8 +302,9 @@
 					weiTuoFangLianXiR: '',
 					weiTuoFangLianXiD: '',
 					weiTuoRiQi: '',
-					weiTuoFangQueRen: ''
-
+					weiTuoFangQueRen: '',
+					zongJia: '',
+					zhanShiBiaoId: this.generateUUID()
 				},
 				rules: {
 					heTongId: [{
@@ -259,51 +312,11 @@
 						message: '请选择合同',
 						trigger: ['change', 'blur'],
 					}],
-					weiTuoHeTong: [{
-						required: true,
-						message: '请选择合同类型',
-						trigger: ['change', 'blur'],
-					}],
 					songJianDanWei: [{
 						required: true,
 						message: '请输入送检单位',
 						trigger: 'blur',
 					}],
-					// qiWangWanChengShi: [{
-					// 	required: true,
-					// 	message: '请输入送检时间',
-					// 	trigger: 'change',
-					// }],
-					yangPinMingCheng: [{
-						required: true,
-						message: '请输入样品名称',
-						trigger: 'blur',
-					}],
-					// songJianPiHaoBian: [{
-					// 	required: true,
-					// 	message: '请输入送检批号/编号',
-					// 	trigger: 'blur',
-					// }],
-					// yangBenZhuangTai: [{
-					// 	required: true,
-					// 	message: '请选择样本状态',
-					// 	trigger: 'change',
-					// }],
-					// yangPinLeiXing: [{
-					// 	required: true,
-					// 	message: '请选择样本类型',
-					// 	trigger: ['change', 'blur'],
-					// }],
-					// yangBenYunShuTiao: [{
-					// 	required: true,
-					// 	message: '请选择样本运输条件',
-					// 	trigger: ['change', 'blur'],
-					// }],
-					// yangPinGuiGe: [{
-					// 	required: true,
-					// 	message: '请选择样品规格',
-					// 	trigger: ['change', 'blur'],
-					// }],
 					yangBenChuLi: [{
 						required: true,
 						message: '请选择样本处理',
@@ -347,36 +360,72 @@
 				userid: '',
 				time: '',
 				orgId: '',
-				
+
 				//合同
 				hetong: [],
-				hetongList: []
+				hetongList: [],
+				//检测项目
+				jianCeList: [],
+				//检测类型
+				jianCeType: '',
+				jianCeTypeList: [],
+
+				type: '', //判断哪个功能
+				id: '', //委托单id
+				taskId: ''
+
+
 			}
 		},
-		onLoad() {
+		onLoad(options) {
 			this.getInit()
-			this.getLhwtdh()
-			
-			
+			if (options.type && options.type != '') {
+				this.type = options.type
+			} else {
+				this.getLhwtdh()
+			}
+			if (options.id) {
+				this.id = options.id
+				this.getDe(options.id)
+				
+				if (options.type == 'edit') {
+					this.getTaskId(options.id)
+				}
+			}
+
+
 		},
 		onReady() {
 			this.$refs.form.setRules(this.rules);
 		},
 		methods: {
+			//根据委托单id查询 taskId
+			getTaskId(id) {
+				let sql =
+					`select TASK_ID_ from ibps_bpm_tasks where NAME_ = '编制' and NODE_ID_ = 'Activity_1n1jgcs' and PROC_DEF_KEY_ = 'Process_1589cp3' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_1n1jgcs' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
+			
+				let requestData = this.$sig(sql)
+			
+				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
+					if (res.data.state == 200) {
+						let result = res.data.variables.data[0]
+						this.taskId = result.TASK_ID_
+						console.log(this.taskId)
+					}
+				})
+			},
 			//初始化
 			getInit() {
 				//获取账号id
 				let info = uni.getStorageSync(USER_INFO)
-				console.log(info)
 				if (info.employee.id) {
 					this.userid = info.employee.id || ''
 				}
-				console.log(info.org !== null)
-				if(info.org !== null){
+				if (info.org !== null) {
 					this.orgId = info.org.id || ''
 				}
 				this.getDataHetong()
-				
+
 				//获取时间
 				let nowDate = new Date((new Date).getTime() + 8 * 60 * 60 * 1000)
 				let time = nowDate.toJSON().split('T').join(' ').substr(0, 10)
@@ -410,29 +459,63 @@
 					}
 				});
 			},
-			//获取合同
+			//自动获取委托详情数据
+			getDe(id) {
+				let sql =
+					`select  * from  t_lhwtsqb  where id_ = '${id}'`
+				let requestData = this.$sig(sql)
+				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
+					if (res.data.state == 200) {
+						let result = res.data.variables.data[0]
+						let form = service.getForm(result)
+						this.form = form
+
+						this.getJiance(result.he_tong_id_, this.type,id)
+					}
+				})
+			},
+			//获取样品
+			getYangPin(id) {
+				let sql =
+					`select  * from  t_lhypb  where parent_id_ = '${id}'`
+				let requestData = this.$sig(sql)
+				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
+					if (res.data.state == 200) {
+						let result = res.data.variables.data
+						let list = service.getListForm(result,this.jianCeList)
+						this.form.lhypb = list
+					}
+				})
+			},
+
+
+			//获取合同  //weiTouId 委托id特殊 在委托详情和修改才出现
 			getDataHetong() {
 				let info = uni.getStorageSync(USER_INFO);
 				if (info == undefined) {
 					return;
 				}
-				
+				// let sql =
+				// 	`select tb.*,ty.ke_hu_ming_cheng_ as ke_hu_dang_wei from t_bjd tb,t_yxkh ty where tb.ke_hu_ming_cheng_ = ty.id_  and tb.zhuang_tai_='生效中' and tb.shi_fou_guo_shen_ = '已完成'`
+
 				let sql =
 					`select tb.*,ty.ke_hu_ming_cheng_ as ke_hu_dang_wei from t_bjd tb,t_yxkh ty where tb.ke_hu_ming_cheng_ = ty.id_ and ty.ke_hu_ming_cheng_='${info.employee.name}' and tb.zhuang_tai_='生效中' and tb.shi_fou_guo_shen_ = '已完成'`
 				let requestData = this.$sig(sql)
 				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
 					if (res.data.state == 200) {
 						let result = res.data.variables.data
-						if(result.length > 0){
+						if (result.length > 0) {
 							this.hetongList = result
-						    result.forEach((item, index) => {
-						    	let obj = {
-						    		text: item.he_tong_bian_hao_,
-						    		value: item.id_
-						    	}
-						    	this.hetong.push(obj);
-						    })
-						}else {
+							let list = []
+							result.forEach((item, index) => {
+								let obj = {
+									text: item.he_tong_bian_hao_,
+									value: item.id_
+								}
+								list.push(obj);
+							})
+							this.hetong = list
+						} else {
 							uni.showToast({
 								title: '你好,该账户还没有与本公司签订合同,或者你合同已失效。',
 								icon: 'none',
@@ -442,22 +525,83 @@
 					}
 				});
 			},
-			hetongChange(e){
-				console.log(e)
+			//选择合同
+			hetongChange(e) {
 				//从合同中选择付款方式
 				if (e != '') {
-					console.log(this.hetong)
 					let data = this.hetongList.find((item, index) => item.id_ == e)
-					console.log(data)
 					this.form.weiTuoDanLaiYuan = data.wei_tuo_dan_lai_y
 					this.form.weiTuoHeTong = data.he_tong_lei_xing_
 					this.form.fuKuanFangShi = data.fu_kuan_fang_shi_
+					this.form.weiTuoDanWei = data.zhuan_huan_ke_hu_
+					this.getJiance(e)
 				}
 			},
+			//根据合同id选择检测项目
+			getJiance(id,type,weiTouId) {
+				let sql =
+					`select tw.*,tb.zhe_hou_jia_ge_,tb.xiang_mu_dan_jia_ from t_htjcxmjmb tb left join t_mjjcnlfw tw on tb.jian_ce_xiang_mu_ = tw.id_  where parent_id_ = '${id}'`
+				let requestData = this.$sig(sql)
+				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
+					if (res.data.state == 200) {
+						let result = res.data.variables.data
+						if (result.length > 0) {
+							result.forEach((item, index) => {
+								if (this.jianCeTypeList.length == 0) {
+									let obj = {
+										text: item.jian_ce_lei_bie_
+									}
+									this.jianCeTypeList.push(obj)
+								} else {
+									let gg = this.jianCeTypeList.findIndex(it => it.text == item
+										.jian_ce_lei_bie_)
+									if (gg < 0) {
+										let obj = {
+											text: item.jian_ce_lei_bie_
+										}
+										this.jianCeTypeList.push(obj)
+									}
+								}
+							})
+
+							result.forEach((item, index) => {
+								this.$set(item, 'checked', false)
+							})
+							this.jianCeList = result
+							
+							if(type != ""){
+								this.getYangPin(weiTouId)
+							}
+						} else {
+							uni.showToast({
+								title: '该合同没有检测项目',
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					}
+				});
+			},
+			//选择项目
+			changeIndex(it, index, x) {
+				this.form.lhypb[index].jianCeList[x].checked = !this.form.lhypb[index].jianCeList[x].checked
+				this.getTotal()
+			},
+			getTotal() {
+				var total = 0
+				this.form.lhypb.forEach((item, index) => {
+					item.jianCeList.forEach((it, x) => {
+						if (it.checked) {
+							total += parseInt(it.zhe_hou_jia_ge_)
+						}
+					})
+				})
+				this.form.zongJia = total
+			},
 
 
 			//调用日期组件
-			dateClick(type,index) {
+			dateClick(type, index) {
 				if (type == 'inspect') {
 					this.type = type
 					this.mode = 'date'
@@ -468,17 +612,24 @@
 					this.type = type
 					this.mode = 'date'
 					this.dateShow = true
-					
+				}
+				if (type == 'weiTuo') {
+					this.type = type
+					this.mode = 'date'
+					this.dateShow = true
 				}
 			},
 			//日期回调
 			dateChange(e) {
-				if (this.type = 'inspect') {
+				if (this.type == 'inspect') {
 					this.form.lhypb[this.listIndex].songJianShiJian = e.result
 				}
-				if (this.type = 'report') {
+				if (this.type == 'report') {
 					this.form.chuBaoGaoShiJian = e.result
 				}
+				if (this.type == 'weiTuo') {
+					this.form.weiTuoRiQi = e.result
+				}
 			},
 			sheetClick(type, index) {
 				this.listType = type
@@ -487,7 +638,7 @@
 					this.list = this.sampleStateList
 					this.listIndex = index
 				}
-				
+
 				//1
 				if (type.includes('yangpinType')) {
 					this.list = this.sampleTypeList
@@ -504,16 +655,21 @@
 				if (type == 'disposition') {
 					this.list = this.dispositionList
 				}
+
+				if (type == 'jianCeType') {
+					this.list = this.jianCeTypeList
+					this.listIndex = index
+				}
 			},
 			//下拉框回调
 			actionSheetCallback(e) {
 				let that = this
 				let lists = that.form.lhypb[this.listIndex]
-				
+
 				if (this.listType == 'state') {
 					lists.yangBenZhuangTai = this.list[e].text
 				}
-				
+
 				//1
 				if (this.listType == 'yangpinType1') {
 					lists.yangPinLeiXing = that.list[e].text
@@ -524,7 +680,7 @@
 				if (this.listType == 'specification1') {
 					lists.yangPinGuiGe = that.list[e].text
 				}
-				
+
 				//2
 				if (this.listType == 'yangpinType2') {
 					lists.yangPinLeiXingEr = that.list[e].text
@@ -535,7 +691,7 @@
 				if (this.listType == 'specification2') {
 					lists.yangPinGuiGeEr = that.list[e].text
 				}
-				
+
 				//3
 				if (this.listType == 'yangpinType3') {
 					lists.yangPinLeiXingSan = that.list[e].text
@@ -546,7 +702,7 @@
 				if (this.listType == 'specification3') {
 					lists.yangPinGuiGeSan = that.list[e].text
 				}
-				
+
 				//3
 				if (this.listType == 'yangpinType4') {
 					lists.yangPinLeiXingSi = that.list[e].text
@@ -557,10 +713,14 @@
 				if (this.listType == 'specification4') {
 					lists.yangPinGuiGeSi = that.list[e].text
 				}
-				
+
 				if (this.listType == 'disposition') {
 					this.form.yangBenChuLi = this.list[e].text
 				}
+
+				if (this.listType == 'jianCeType') {
+					lists.jianCeType = that.list[e].text
+				}
 			},
 
 			//提交
@@ -585,30 +745,64 @@
 					]
 				}
 
-				this.form.shiFouGuoShen = "编制"
+				this.form.shiFouGuoShen = "编制"
 				this.form.bianZhiRen = this.userid
 				this.form.bianZhiShiJian = this.time
 				this.form.bianZhiBuMen = this.orgId
+				this.form.weiTuoZhuangTai = '已编制'
+				
+
+				this.form.lhypb.forEach((item, index) => {
+					item.jianCeList.forEach((it, x) => {
+						if (it.checked) {
+							item.jianCeXiangMu2.push(it.id_)
+						}
+					})
+					item.jianCeXiangMu = item.jianCeXiangMu2.join(",")
+				})
+				
+				var editData = {}
+				if(this.type == 'edit'){
+					this.form.id = this.id
+					editData = {
+						data: JSON.stringify(this.form),
+						opinion: '',
+						taskId: this.taskId
+					}
+				}
 
 				para.parameters[2].value = JSON.stringify(this.form)
+				
+				var lhwt = []
+				if(this.type != 'edit' && this.type != 'detail'){
+					this.form.lhypb.forEach((item, index) => {
+						let bit = {
+							he_tong_bian_hao_: this.form.heTongId,
+							jiao_fei_fang_shi: this.form.fuKuanFangShi,
+							shen_qing_id_: this.form.zhanShiBiaoId,
+							wei_tuo_bian_hao_: this.form.weiTuoBianHao,
+							wei_tuo_lai_yuan_: this.form.weiTuoDanLaiYuan,
+							wei_tuo_lei_xing_: this.form.weiTuoLeiXing,
+							wei_tuo_ren_: this.form.weiTuoFangLianXiR,
+							wei_tuo_ri_qi_: this.form.weiTuoRiQi,
+							yang_pin_bian_hao: item.yangPinBianHao,
+							yang_pin_ming_che: item.yangPinMingCheng,
+							zhuang_tai_: "委托进行中"
+						}
+						lhwt.push(bit)
+					})
+				}
 
 
 				this.$refs.form.validate(valid => {
 					if (valid) {
-						this.$http.post("ibps/business/v3/bpm/instance/start", para).then(res => {
-							if (res.data.state == 200) {
-								this.$tip.success('提交成功!')
-								uni.hideLoading();
-								this.$Router.replaceAll({
-									name: 'index'
-								})
-							} else {
-								this.$tip.success('提交异常!')
-								this.$Router.replaceAll({
-									name: 'index'
-								})
-							}
-						});
+						if(this.type == 'edit'){
+							this.getArgee(editData)
+						}else{
+							this.getSave(para,lhwt)
+						}
+						
+						
 					} else {
 						uni.showToast({
 							title: '必选项没有填写',
@@ -619,12 +813,65 @@
 					}
 				});
 			},
+			getSave(data,params){
+				let pp = {
+					paramWhere: [],
+					tableName: "t_lhwtzsb"
+				}
+				pp.paramWhere = params
+				let dataPP = this.$sig(pp)
+				this.$http.post("/ibps/business/v3/sys/universal/addDataContextTable", dataPP).then(res => {
+					if (res.data.state == 200) {
+				
+					}
+				});
+				
+				
+				this.$http.post("ibps/business/v3/bpm/instance/start", data).then(res => {
+					if (res.data.state == 200) {
+						this.$tip.success('提交成功!')
+						uni.hideLoading();
+						this.$Router.replaceAll({
+							name: 'index'
+						})
+					} else {
+						this.$tip.success('提交异常!')
+						this.$Router.replaceAll({
+							name: 'index'
+						})
+					}
+				});
+			},
+			getArgee(data){
+				this.$http.post("/ibps/business/v3/bpm/task/agree", data).then(res => {
+					if (res.data.state == 200) {
+						this.$tip.success('提交成功!')
+						uni.hideLoading();
+						this.$Router.replaceAll({
+							name: 'index'
+						})
+					} else {
+						this.$tip.success('提交异常!')
+						this.$Router.replaceAll({
+							name: 'index'
+						})
+					}
+				});
+			},
 
 
 			//添加样品记录
 			getSing() {
+				if (this.form.heTongId == '') {
+					return uni.showToast({
+						title: '请选择合同',
+						icon: 'none',
+						duration: 2000
+					})
+				}
 				this.getLhypbh(res => {
 					let obj = {
+						id: '',
 						jianCeXiangMu: '',
 						jianCeXiangMu2: [], //不传到后台
 						yangPinMingCheng: '',
@@ -632,34 +879,37 @@
 						xingMing: '',
 						xingBie: '',
 						nianLing: '',
-						songJianPiHaoBian: '',
+						songJianPiHao: '',
 						yangBenZhuangTai: '',
 						songJianShiJian: '',
-						
+
 						yangPinLeiXing: '',
 						yangBenYunShuTiao: '',
 						shuLiang: 0,
 						yangPinGuiGe: '',
-						
+
 						yangPinLeiXingEr: '',
 						yangPinYunShuTiao: '',
 						yangPinGuiGeEr: '',
 						shuLiangEr: 0,
-						
+
 						yangPinLeiXingSan: '',
 						yangPinGuiGeSan: '',
 						shuLiangSan: 0,
 						yangPinYunShuSan: '',
-						
+
 						yangPinLeiXingSi: '',
 						yangPinGuiGeSi: '',
 						yangPinYunShuSi: '',
-						shuLiangSi: 0
-						
+						shuLiangSi: 0,
+						jianCeList: JSON.parse(JSON.stringify(this.jianCeList)),
+						jianCeType: this.jianCeTypeList[0].text,
+
+						xiangMuMingCheng: ''
 					}
 					this.form.lhypb.push(obj)
 				})
-				
+
 			},
 			deletSing(index) {
 				this.form.lhypb.splice(index, 1)
@@ -696,6 +946,34 @@
 			close() {
 				this.$refs.centers.hide()
 			},
+			/**
+			 * @param {Object} data
+			 * @param {Object} list
+			 * 过滤,只要判断数据在数组中text字段
+			 */
+			getButtChange(data, list) {
+				if (data && list) {
+					let itemData = list.find(item => item.value == data)
+					if (itemData) {
+						return itemData.text
+					} else {
+						return data
+					}
+				}
+			
+			},
+			/**
+			 * 生成唯一id
+			 */
+			generateUUID() {
+				var d = new Date().getTime();
+				var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+					var r = (d + Math.random() * 16) % 16 | 0;
+					d = Math.floor(d / 16);
+					return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
+				});
+				return uuid;
+			},
 		}
 	}
 </script>
@@ -716,4 +994,12 @@
 		text-align: center;
 		display: inline-block;
 	}
+
+	/deep/ .uni-checkbox-input::before {
+		display: block;
+	}
+
+	/deep/ .u-form-item--right__content__slot {
+		display: block;
+	}
 </style>

+ 80 - 0
pages/jiance/order/meth.js

@@ -0,0 +1,80 @@
+export default {
+	getForm(item) {
+		let form = {
+			weiTuoLeiXing: item.wei_tuo_lei_xing_,
+			weiTuoDanLaiYuan: item.wei_tuo_lei_xing_,
+			weiTuoBianHao: item.wei_tuo_bian_hao_,
+			heTongId: item.he_tong_id_,
+			weiTuoHeTong: item.wei_tuo_he_tong_,
+			weiTuoDanWei: item.wei_tuo_dan_wei_,
+			songJianDanWei: item.wei_tuo_dan_wei_,
+			qiWangWanChengShi: item.qiWangWanChengShi,
+			lhypb: [],
+			fuKuanFangShi: item.fu_kuan_fang_shi_,
+			baoGaoLeiXing: item.bao_gao_lei_xing_,
+			chuJuBaoGaoYaoQiu: item.chu_ju_bao_gao_ya,
+			chuBaoGaoShiJian: item.chu_bao_gao_shi_j,
+			yangBenChuLi: item.yang_ben_chu_li_,
+			weiTuoFangMingChe: item.wei_tuo_fang_ming,
+			weiTuoFangLianXiR: item.wei_tuo_fang_lian,
+			weiTuoFangLianXiD: item.wei_tuo_lian,
+			weiTuoRiQi: item.wei_tuo_fang_lian,
+			weiTuoFangQueRen: item.wei_tuo_fang_que_,
+			zongJia: item.zong_jia_
+		}
+		return form
+	},
+	getListForm(list,jianCeList){
+		let TList = []
+		list.forEach((item,index)=>{
+			let jian_ce_xiang_mu2_ = item.jian_ce_xiang_mu_.split(",")
+			let jiancLis = JSON.parse(JSON.stringify(jianCeList))
+			
+			jiancLis.forEach(it =>{
+				let jianSin = jian_ce_xiang_mu2_.findIndex(itg => itg == it.id_)
+				if(jianSin >= 0){
+					it.checked = true
+				}
+			})
+			let obj = {
+				id: item.id_,
+				jianCeXiangMu: item.jian_ce_xiang_mu_,
+				jianCeXiangMu2: jian_ce_xiang_mu2_, //不传到后台
+				yangPinMingCheng: item.yang_pin_ming_che,
+				yangPinBianHao: item.yang_pin_bian_hao,
+				xingMing: item.xing_ming_,
+				xingBie: item.xing_bie_,
+				nianLing: item.nian_ling_,
+				songJianPiHao: item.song_jian_shi_jia,
+				yangBenZhuangTai: item.song_jian_pi_hao_,
+				songJianShiJian: item.song_jian_shi_jia,
+			
+				yangPinLeiXing: item.yang_pin_lei_xing,
+				yangBenYunShuTiao: item.yang_ben_yun_shu_,
+				shuLiang: parseInt(item.shu_liang_),
+				yangPinGuiGe: item.yang_pin_gui_ge_,
+			
+				yangPinLeiXingEr: item.yang_pin_lei_er_,
+				yangPinYunShuTiao: item.yang_pin_yun_shu_,
+				yangPinGuiGeEr: item.yang_pin_gui_ge_e,
+				shuLiangEr: parseInt(item.shu_liang_er_),
+			
+				yangPinLeiXingSan: item.yang_pin_lei_san_,
+				yangPinGuiGeSan: item.yang_pin_gui_ge_s,
+				shuLiangSan: parseInt(item.shu_liang_san_),
+				yangPinYunShuSan: item.yang_pin_yun_san,
+			
+				yangPinLeiXingSi: item.yang_pin_lei_si_,
+				yangPinGuiGeSi: item.yang_pin_gui_si_,
+				yangPinYunShuSi:item.yang_pin_yun_si_,
+				shuLiangSi:  parseInt(item.shu_liang_si_),
+				jianCeList: jiancLis,
+				jianCeType: '',
+			
+				xiangMuMingCheng: item.xiang_mu_ming_che
+			}
+			TList.push(obj)
+		})
+		return TList
+	}
+}

+ 8 - 3
pages/login/login.vue

@@ -137,7 +137,8 @@
 		},
 		onLoad: function() {
 			//检测需要开启验证码
-			this.isCaptcha();
+			// this.isCaptcha();
+			this.Captcha()
 
 			// #ifdef APP-PLUS
 			var that = this
@@ -240,14 +241,18 @@
 			Captcha() {
 				this.$http.get("ibps/oauth2/v3/user/captcha?requestId=" + this.requestId + "&_t=0xxsb87").then(
 					res => {
+						this.iscaptcha = true
+						this.requestId = res.data.variables.requestId;
 						console.log(res)
 						if (res.data.state == 200) {
 							this.image = res.data.data;
-							this.requestId = res.data.variables.requestId;
+							this.iscaptcha = true
+						}else if(res.data.state == 501){
+							this.iscaptcha = false
 						}
 					})
 			},
-			//是否开启验证码 ibps/oauth2/v3/user/captcha/open
+			//是否开启验证码 ibps/oauth2/v3/user/captcha/open  是否开始注册
 			isCaptcha() {
 				console.log(11111)
 				this.$http.get(`ibps/oauth2/v3/user/open?_t=${Ids([32, 36, 1]).next()}`).then(res => {

+ 266 - 0
pages/tag/sampleTag.vue

@@ -0,0 +1,266 @@
+<template>
+	<view class="bg">
+		<cu-custom bgColor="bg-gradual-pink" :isBack="true">
+			<block slot="backview">返回</block>
+			<block slot="content">样品标签</block>
+		</cu-custom>
+
+		<view ref="qrcode" id="box">
+			<view v-for="(item1,index1) in list" :key="index1">
+				<view v-for="(item2,index2) in parseInt(item1.num)" :key="index2">
+					<view class="tagBox">
+						<view class="lh">
+							<view>样品名称:</view>
+							<view>{{item1.name}}</view>
+						</view>
+						<view class="la">
+							<view class="lh">
+								<view>样品编号:</view>
+								<view>{{item1.serial}}</view>
+							</view>
+							<view class="lh" style="margin-left: 15rpx">
+								<view>收样时间:</view>
+								<view></view>
+							</view>
+						</view>
+						<view class="lh">
+							<view>存储条件:</view>
+							<view>{{item1.condition}}</view>
+						</view>
+
+						<view class="lh">
+							<view>流转状态:</view>
+							<view>▢待检,▢已检,▢留样</view>
+						</view>
+						<view class="lh">
+							<view>样品数量:</view>
+							<view>{{index2+1}}/{{item1.num}}支</view>
+						</view>
+						<view>
+							<vue-barcode :value="item1.serial" :width="2" :height="45"></vue-barcode>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<u-button type="primary" class="btn" @click="getAction()" style="margin: 20rpx;" v-if="imgSrc != ''">操作</u-button>
+
+	</view>
+</template>
+
+<script>
+	import html2canvas from "html2canvas";
+	import VueBarcode from 'vue-barcode';
+	import {
+		ACCESS_TOKEN,
+		USER_NAME,
+		USER_INFO
+	} from "@/common/util/constants"
+	export default {
+		components: {
+			VueBarcode
+		},
+		data() {
+			return {
+				value: '',
+				id: '',
+				list: [],
+				imgSrc: '',
+				userid: '',
+				time: ''
+			}
+		},
+		created() {
+			this.getInit()
+		},
+		onLoad(options) {
+			if (options.id) {
+				this.id = options.id
+				this.getLook(options.id)
+			}
+		},
+		methods: {
+			getInit() {
+				let info = uni.getStorageSync(USER_INFO);
+				if (info.employee.id) {
+					this.userid = info.employee.id || ''
+				}
+				var nowDate = new Date((new Date).getTime() + 8 * 60 * 60 * 1000)
+				var time = nowDate.toJSON().split('T').join(' ').substr(0, 19)
+				this.time = time
+			},
+			getLook(id) {
+				let sql =
+					`select * from t_lhypb where parent_id_ = '${id}'`
+				let requestData = this.$sig(sql)
+
+
+				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
+					if (res.data.state == 200) {
+						const data = res.data.variables.data
+						let list = []
+						data.forEach(item => {
+							if (item.yang_pin_lei_xing != '' && parseInt(item.shu_liang_) > 0) {
+								let obj = {
+									name: item.yang_pin_ming_che,
+									serial: item.yang_pin_bian_hao,
+									type: item.yang_pin_lei_xing,
+									num: item.shu_liang_,
+									condition: item.yang_ben_yun_shu_
+								}
+								list.push(obj)
+							}
+							if (item.yang_pin_lei_er_ != '' && parseInt(item.shu_liang_er_) > 0) {
+								let obj = {
+									name: item.yang_pin_ming_che,
+									serial: item.yang_pin_bian_hao,
+									type: item.yang_pin_lei_er_,
+									num: item.shu_liang_er_,
+									condition: item.yang_pin_yun_shu_
+								}
+								list.push(obj)
+							}
+							if (item.yang_pin_lei_san_ != '' && parseInt(item.shu_liang_san_) > 0) {
+								let obj = {
+									name: item.yang_pin_ming_che,
+									serial: item.yang_pin_bian_hao,
+									type: item.yang_pin_lei_san_,
+									num: item.shu_liang_san_,
+									condition: item.yang_pin_gui_ge_s
+								}
+								list.push(obj)
+							}
+							if (item.yang_pin_lei_si_ != '' && parseInt(item.shu_liang_si_) > 0) {
+								let obj = {
+									name: item.yang_pin_ming_che,
+									serial: item.yang_pin_bian_hao,
+									type: item.yang_pin_lei_si_,
+									num: item.shu_liang_si_,
+									condition: item.yang_pin_gui_si_
+								}
+								list.push(obj)
+							}
+
+						})
+						this.list = list
+
+						this.$nextTick(() => {
+
+							this.getBtn()
+						})
+					}
+				})
+			},
+			getBtn() {
+				// document.getElementById("qrcode").appendChild(canvas);
+				//点击生成canvas转换成base64的图片
+				var width = document.getElementById('box').offsetWidth,
+					height = document.getElementById('box').offsetHeight,
+					scale = window.devicePixelRatio; //放大倍数
+				html2canvas(document.getElementById('box'), {}).then(canvas => {
+					const dataURL = canvas.toDataURL()
+					this.imgSrc = dataURL
+					uni.showToast({
+						title:'标签图片已生成,可以保存或者下载',
+						icon: 'none',
+						duration: 2000
+					})
+
+				});
+			},
+			getAction() {
+				let data = ['下载', '保存']
+				uni.showActionSheet({
+					itemList: data,
+					success: (res) => {
+						switch (res.tapIndex) {
+							case 0:
+								this.downloadImage()
+								break;
+							case 1:
+								this.getSave()
+								break;
+						}
+					},
+					fail: function(res) {
+					}
+				});
+			},
+			downloadImage() {
+				// const dataURL = canvas.toDataURL('image/png')
+				const creatDom = document.createElement('a')
+				document.body.appendChild(creatDom)
+				creatDom.href = this.imgSrc
+				creatDom.download = this.time + '样品标签图片'
+				creatDom.click()
+			},
+			getSave() {
+				let pp = {
+					paramWhere: [{
+						id_: this.id
+					}],
+					tableName: "t_lhwtsqb",
+					paramCond: {
+						biao_qian_tu_pian: this.imgSrc,
+						update_time_: this.time,
+						update_by_: this.userid
+					}
+				}
+				let data = this.$sig(pp)
+
+				this.$http.post("ibps/business/v3/sys/universal/updateDatasContextTable", data).then(res => {
+					if (res.data.state == 200) {
+						uni.showToast({
+							title: '提交成功',
+							icon: 'none',
+							duration: 2000
+						})
+						this.$emit('saveSuccees')
+
+					} else {
+						uni.showToast({
+							title: '提交失败',
+							icon: 'none',
+							duration: 2000
+						})
+					}
+				});
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.bg {
+
+		// height: auto;
+	}
+
+	.tagBox {
+		width: 700rpx;
+		height: 420rpx;
+		border: 1rpx solid #000000;
+		padding: 20rpx;
+		display: flex;
+		justify-content: space-around;
+		flex-direction: column;
+		margin: 20rpx auto;
+		border-radius: 15rpx;
+		background-color: #fff;
+	}
+
+	.la {
+		display: flex;
+		align-items: center;
+	}
+
+	.lh {
+		// line-height: auto;
+		font-size: 28rpx;
+		display: flex;
+		align-items: center;
+
+	}
+</style>

+ 18 - 0
pages/tag/tag.js

@@ -0,0 +1,18 @@
+{
+	"transportType": [{
+		"text": "常温",
+		"value": "常温"
+	}, {
+		"text": "冰袋(2-8℃)",
+		"value": "冰袋(2-8℃)"
+	}, {
+		"text": "干冰",
+		"value": "干冰"
+	}, {
+		"text": "液氮",
+		"value": "液氮"
+	}, {
+		"text": "其他",
+		"value": "其他"
+	}]
+}

+ 2 - 1
pages/user/people.vue

@@ -6,7 +6,7 @@
 				<uni-file-picker readonly :value="fileLists" :imageStyles="imageStyles" file-mediatype="image">
 				</uni-file-picker>
 
-				<!-- 				<image :src="personalList.avatar" class="png round animation-slide-right margin-bottom-sm"
+<!-- 								<image :src="personalList.avatar" class="png round animation-slide-right margin-bottom-sm"
 					mode="scaleToFill" :style="[{animationDelay: '0.1s'}]"></image> -->
 				<image src="https://static.jeecg.com/upload/test/wave_1595818053612.gif" mode="scaleToFill"
 					class="gif-wave"></image>
@@ -87,6 +87,7 @@
 		USER_INFO
 	} from "@/common/util/constants"
 	import api from '@/api/api'
+	import http from '@/common/service/http.js'
 	export default {
 		name: "people",
 		data() {