<template>
	<view class="container">
		<cu-custom bgColor="bg-gradual-pink" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">历史委托单</block>
		</cu-custom>
		
	 <view v-for="(item,i) in resdata" :key="i" style="margin-bottom: 20rpx;margin-left: 25rpx;">
		 
			<uni-section :title="'委托单号:'+item.wei_tuo_dan_hao_"  :subTitle="'姓名:'+item.lian_xi_ren_" type="line" padding>
				<view style=" display: flex; width: 100%; justify-content: space-between; ">
					<view style="display: flex;" >状态: <view style="color: #5E00FF;"> {{item.wei_tuo_zhuang_ta}} </view></view>
					<view style="display: flex;" >金额:{{item.zong_jin_e_}} 付款状态: <view style="color: #7349ff;"> 已付款 </view></view>               
				</view>
				<view style=" width: 100%; text-align: right; padding-top: 5rpx;padding-bottom: 0rpx;">
					<button style="margin-right: 15rpx; height: 50rpx;"   size="mini" @click="editOrder(item.id_)">修改</button>
					 <button style="margin-right: 15rpx; height: 50rpx;"  @click="goto(item.id_)" size="mini">查看报告</button>	
				</view>
			</uni-section>
	   </view> 
      
	  
	  <view v-if="resdata.length==0">    <uni-card is-full :is-shadow="false">
      <text class="">暂无数据</text>
    </uni-card></view>



	</view>
</template>

<script>
	import { ACCESS_TOKEN,USER_NAME,USER_INFO } from "@/common/util/constants"
	export default {
		components: {},
		data() {
			return {
               url:'https://www.szjyxt.com/demo/reportJsp/pdfReport.jsp?rpx=%E4%B8%AD%E6%B1%87%E7%91%9E%E5%BE%B7%E6%A3%80%E6%B5%8B%E4%B8%AD%E5%BF%83/39%E6%A0%B7%E5%93%81%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/GDYR-CX11-R01A%20%E6%A3%80%E6%B5%8B%E5%A7%94%E6%89%98%E5%8D%95.rpx&id_=',
			   resdata:[]
			}
		},
		onLoad:function(){
			
			let info= uni.getStorageSync(USER_INFO);
			console.info(info)
			
			let para={
    "parameters": [
        {
            "key": "Q^shou_ji_ke_hu_id_^SL",
            "value": info.id
        },
        {
            "key": "response_data",
            "value": "{\"template_id\":\"976138902182035456\",\"template_type\":\"\",\"attrs\":{\"init_query\":\"Y\",\"need_page\":\"Y\",\"page_size\":20,\"display_field\":\"订单发起列表\"},\"query_columns\":[{\"label\":\"手机客户id\",\"name\":\"shou_ji_ke_hu_id_\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"}],\"display_columns\":[{\"label\":\"订单号\",\"name\":\"ding_dan_hao_\",\"rights\":[{\"type\":\"all\"}],\"noRightStyle\":\"\",\"align\":\"left\",\"sortable\":false,\"width\":\"120\",\"same\":\"Y\",\"field_type\":\"autoNumber\",\"field_options\":{\"placeholder\":\"自动生成无需填写\",\"default_value_type\":\"fixed\",\"init\":false,\"hide_label\":false,\"is_width\":false,\"width\":100,\"width_unit\":\"%\",\"is_label_width\":true,\"label_width\":180,\"label_width_unit\":\"px\",\"mobile\":true,\"display\":true,\"clearable\":true,\"identity\":\"ddh\"},\"data_type\":\"varchar\"},{\"label\":\"渠道\",\"name\":\"qu_dao_\",\"rights\":[{\"type\":\"all\"}],\"noRightStyle\":\"\",\"align\":\"left\",\"sortable\":false,\"width\":\"120\",\"same\":\"Y\",\"field_type\":\"linkdata\",\"field_options\":{\"default_value_type\":\"fixed\",\"placeholder\":\"请选择\",\"multiple\":\"N\",\"linkdata\":\"qdzly\",\"required\":false,\"hide_rights\":false,\"read_rights\":false,\"hide_label\":false,\"is_width\":false,\"width\":100,\"width_unit\":\"%\",\"is_label_width\":false,\"label_width\":100,\"label_width_unit\":\"px\",\"clearable\":true,\"mobile\":true,\"display\":true,\"default_value\":\"\",\"link_linkage\":null,\"link_config\":{\"id\":\"id_\",\"text\":\"qu_dao_ming_cheng\",\"type\":\"first\",\"structure\":\"list\"},\"link_condition\":null,\"link_attr\":null},\"data_type\":\"varchar\"},{\"label\":\"客户名称\",\"name\":\"wei_tuo_dan_wei_\",\"rights\":[{\"type\":\"all\"}],\"noRightStyle\":\"\",\"align\":\"left\",\"sortable\":false,\"width\":\"100\",\"same\":\"Y\",\"field_type\":\"customDialog\",\"field_options\":{\"default_value_type\":\"fixed\",\"placeholder\":\"请选择\",\"multiple\":\"N\",\"store\":\"id\",\"dialog_type\":\"dialog\",\"icon\":\"search-plus\",\"required\":false,\"hide_rights\":false,\"read_rights\":true,\"hide_label\":false,\"is_width\":false,\"width\":100,\"width_unit\":\"%\",\"is_label_width\":false,\"label_width\":100,\"label_width_unit\":\"px\",\"clearable\":true,\"mobile\":true,\"options\":[{\"val\":\"1\",\"label\":\"质量部\",\"checked\":false},{\"val\":\"2\",\"label\":\"零件一车间\",\"checked\":false}],\"display\":true,\"dialog\":\"yxkhdhk\",\"default_value\":\"\",\"link_linkage\":null,\"link_config\":null,\"link_condition\":null,\"link_attr\":null},\"data_type\":\"varchar\"},{\"label\":\"委托单号\",\"name\":\"wei_tuo_dan_hao_\",\"rights\":[{\"type\":\"all\"}],\"noRightStyle\":\"\",\"align\":\"left\",\"sortable\":false,\"width\":\"160\",\"same\":\"Y\",\"field_type\":\"autoNumber\",\"field_options\":{\"placeholder\":\"\",\"default_value_type\":\"fixed\",\"init\":true,\"hide_label\":false,\"is_width\":false,\"width\":100,\"width_unit\":\"%\",\"is_label_width\":true,\"label_width\":180,\"label_width_unit\":\"px\",\"mobile\":true,\"display\":true,\"clearable\":true,\"identity\":\"gzyrwtbh\"},\"data_type\":\"varchar\"},{\"label\":\"状态\",\"name\":\"wei_tuo_zhuang_ta\",\"rights\":[{\"type\":\"all\"}],\"noRightStyle\":\"\",\"align\":\"left\",\"sortable\":false,\"width\":\"100\",\"same\":\"Y\",\"field_type\":\"text\",\"field_options\":{\"default_value_type\":\"fixed\",\"placeholder\":\"请输入\",\"required\":false,\"is_min_length\":false,\"is_max_length\":false,\"hide_rights\":true,\"read_rights\":false,\"hide_label\":false,\"is_width\":false,\"width\":100,\"width_unit\":\"%\",\"is_label_width\":false,\"label_width\":100,\"label_width_unit\":\"px\",\"clearable\":true,\"mobile\":true,\"display\":true},\"data_type\":\"varchar\"},{\"label\":\"下单时间\",\"name\":\"create_time_\",\"rights\":[{\"type\":\"all\"}],\"noRightStyle\":\"\",\"align\":\"left\",\"sortable\":false,\"width\":\"100\",\"same\":\"Y\",\"field_type\":\"datePicker\",\"field_options\":{\"datefmt\":\"yyyy-MM-dd\"},\"data_type\":\"date\"},{\"label\":\"期望完成时间\",\"name\":\"qi_wang_wan_cheng\",\"rights\":[{\"type\":\"all\"}],\"noRightStyle\":\"\",\"align\":\"left\",\"sortable\":false,\"width\":\"120\",\"same\":\"Y\",\"field_type\":\"datePicker\",\"field_options\":{\"default_value_type\":\"fixed\",\"placeholder\":\"请选择\",\"datefmt_type\":\"date\",\"datefmt\":\"yyyy-MM-dd\",\"required\":true,\"is_start_date\":true,\"is_end_date\":false,\"hide_rights\":false,\"read_rights\":false,\"hide_label\":false,\"is_width\":false,\"width\":100,\"width_unit\":\"%\",\"is_label_width\":true,\"label_width\":140,\"label_width_unit\":\"px\",\"clearable\":true,\"mobile\":true,\"display\":true,\"start_date\":1,\"start_date_type\":\"after\",\"start_date_interval\":\"d\"},\"data_type\":\"varchar\"},{\"label\":\"总金额\",\"name\":\"zong_jin_e_\",\"rights\":[{\"type\":\"all\"}],\"noRightStyle\":\"\",\"align\":\"left\",\"sortable\":false,\"width\":\"80\",\"same\":\"Y\",\"field_type\":\"text\",\"field_options\":{\"default_value_type\":\"fixed\",\"placeholder\":\"请输入\",\"required\":false,\"is_min_length\":false,\"is_max_length\":false,\"hide_rights\":false,\"read_rights\":true,\"hide_label\":false,\"is_width\":false,\"width\":100,\"width_unit\":\"%\",\"is_label_width\":false,\"label_width\":0,\"label_width_unit\":null,\"clearable\":true,\"mobile\":true,\"display\":true},\"data_type\":\"varchar\"},{\"label\":\"委托人\",\"name\":\"lian_xi_ren_\",\"rights\":[{\"type\":\"all\"}],\"noRightStyle\":\"\",\"align\":\"left\",\"sortable\":false,\"width\":\"100\",\"same\":\"Y\",\"field_type\":\"text\",\"field_options\":{\"default_value_type\":\"fixed\",\"required\":false,\"placeholder\":\"请输入\",\"mobile\":true,\"display\":true,\"clearable\":true,\"label_width\":180,\"width\":100,\"is_width\":false,\"width_unit\":\"%\",\"is_label_width\":true,\"label_width_unit\":\"px\"},\"data_type\":\"varchar\"},{\"label\":\"报告发放时间\",\"name\":\"bao_gao_fa_fang_s\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"发报告人\",\"name\":\"fa_bao_gao_ren_\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"检测完成时间\",\"name\":\"jian_ce_wan_cheng\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"样品状态\",\"name\":\"yang_pin_zhuang_t\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"样品具体说明\",\"name\":\"yang_pin_ju_ti_sh\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"提供工装夹具\",\"name\":\"ti_gong_gong_zhua\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"设备编号\",\"name\":\"she_bei_bian_hao_\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"完成时间\",\"name\":\"wan_cheng_shi_jia\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"检测开始时间\",\"name\":\"jian_ce_kai_shi_s\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"盖章报告附件\",\"name\":\"gai_zhang_bao_gao\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"clob\"},{\"label\":\"能力范围类型\",\"name\":\"neng_li_fan_wei_l\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"},{\"label\":\"委托类型\",\"name\":\"wei_tuo_lei_xing_\",\"field_type\":\"text\",\"field_options\":{},\"data_type\":\"varchar\"}],\"orig_display_columns\":\"\",\"filter_conditions\":[{\"label\":\"默认条件\",\"key\":\"c061bec4-332a-4c48-9555-ed4ca22b53bc\",\"type\":\"condition\",\"rights\":[{\"type\":\"all\"}],\"filter\":{\"condition\":\"AND\",\"rules\":[{\"id\":\"crm_zhuang_tai_\",\"field\":\"crm_zhuang_tai_\",\"label\":\"crm状态\",\"type\":\"string\",\"input\":\"text\",\"operator\":\"equal\",\"source\":\"fixed\",\"value\":\"crm\"}]}}],\"result_columns\":\"\",\"sort_columns\":\"\",\"buttons\":{\"function_buttons\":[{\"button_type\":\"search\",\"label\":\"查询\",\"position\":\"toolbar\"},{\"label\":\"发起订单\",\"button_type\":\"add\",\"rights\":[{\"type\":\"all\"}],\"position\":\"toolbar\",\"style\":\"success\"},{\"label\":\"编辑\",\"button_type\":\"edit\",\"rights\":[{\"type\":\"all\"}],\"position\":\"manage\",\"style\":\"primary\"},{\"button_type\":\"remove\",\"label\":\"删除\",\"rights\":[{\"type\":\"all\"}],\"position\":\"toolbar\",\"style\":\"danger\"}],\"edit_buttons\":[{\"button_type\":\"close\",\"label\":\"关闭\"},{\"button_type\":\"save\",\"label\":\"保存\"}]},\"export_columns\":\"\",\"ext_columns\":\"\",\"datasetKey\":\"gzyrqcwtd\",\"unique\":\"id_\",\"dynamic_params\":{}}"
        },
        {
            "key": "filter_condition_key",
            "value": ""
        }
    ],
    "requestPage": {
        "pageNo": 1,
        "limit": 200,
        "totalCount": 1
    },
    "sorts": []
}
			let this_=this;
			this.$http.post("ibps/business/v3/data/template/queryDataTable",para).then(res=>{
			   if(res.data.state==200){
				   console.log(res.data.data.dataResult)
				   this_.resdata=res.data.data.dataResult;
				   console.log(this_.resdata) 
				   }
			})
		},
		methods:{
			editOrder(option){
				console.log(option)
				uni.navigateTo({
					url:"/pages/jiance/editOrder?id="+option
				}) 
				
				
			},
			goto(option){
				
				uni.navigateTo({
					url:"/pages/fileView/fileView?id="+option
				}) 
				
				
/* 				uni.downloadFile({
				  url: 'https://www.szjyxt.com/group1/M00/00/0C/rBKdLGHuElCAVpUEAAY6VxViWJE056.pdf',
				  success: function (res) {
				    var filePath = res.tempFilePath;
				    uni.openDocument({
				      filePath: filePath,
				      showMenu: true,
				      success: function (res) {
				        console.log('打开文档成功');
				      }
				    });
				  }
				}); */
				
				
			}
			
		}
		
		
		
		
		
	}
	
	
</script>

<style>
	
	.chat-custom-right {
		flex: 1;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		justify-content: space-between;
		align-items: flex-end;
	}
	
	.chat-custom-text {
		font-size: 12px;
		color: #999;
	}

</style>
