123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726 |
- <template>
- <view>
- <cu-custom bgColor="bg-gradual-pink" :isBack="true">
- <block slot="backText">返回</block>
- <block slot="content">委托修改</block>
- </cu-custom>
- <form>
- <uni-group mode="card">
- <view class="cu-form-group" style="justify-content: flex-start;">
- <view class="title">委托单号</view>
- <view style="text-align: left;" >{{weituodanhao}}</view>
- </view>
- <!-- <view class="cu-form-group">
- <view class="title">类型</view>
- <input placeholder="常规" name="input" v-model="myFormData.username" disabled></input>
- </view> -->
- <view class="cu-form-group">
- <my-date style="padding: 0rpx;" v-model="beginTime" placeholder="请选择" fields="day"
- label="期望完成时间"></my-date>
- </view>
- </uni-group>
-
- <uni-group mode="card" title="样品信息">
- <view class="cu-form-group margin-top">
- <view class="title" style="color: #888888">样品名称</view>
- <input placeholder="请输入样品名称" v-model="ypname" name="input"></input>
- </view>
- <view class="cu-form-group ">
- <view class="title" style="color: #888888">规格型号</view>
- <input placeholder="请输入规格型号" v-model="ypguige" name="input"></input>
- </view>
- <view class="cu-form-group ">
- <view class="title" style="color: #888888">数量</view>
- <input placeholder="请输入数量" v-model="ypshuliang" name="input" type="number"></input>
- </view>
- <view class="cu-form-group ">
- <view class="title" style="color: #888888">生产日期/批号</view>
- <input placeholder="请输入" v-model="yppihao" name="input"></input>
- </view>
- <view class="cu-form-group ">
- <view class="title" style="color: #888888">样品处置</view>
- <app-select v-model="type2" placeholder="请选择处置方式" :dict="plan_type" space></app-select>
- </view>
- <view class="cu-form-group">
- <view class="title" style="color: #888888">检测类别</view>
- <app-select v-model="type1" placeholder="请选择检测类别" :dict="plan_type1" space ></app-select>
- </view>
- </uni-group>
- <uni-group mode="card" >
- <uni-section v-bind:title="'检测对象/'+sex[radio1].leixing" type="line">
- <view class="example-body2 uni-px-5 uni-pb-5">
- <uni-data-checkbox :multiple="false" v-model="radio1" :localdata="sex" @change="change(sex[radio1].text)">
- </uni-data-checkbox>
- </view>
- <view class="uni-px-5 uni-pb-5">
- <uni-data-checkbox multiple v-model="checkbox2"
- :localdata="sex[radio1].canshu" icon="right" @change="calc" ></uni-data-checkbox>
- </view>
- <view>
- <!-- 检测方法:{{sex[radio1].fangfa}} -->
- <view style="margin-bottom: 25rpx; float: right;">总价:{{total}}¥</view>
- </view>
- </uni-section>
-
- </uni-group>
- <view class="">
- <uni-section title="" type="line" padding>
- <view class="cu-form-group">
- <view class="title">报告份数</view>
- <uni-number-box v-model="vModelValue" @blur="blur" @focus="focus" @change="changeValue" />
- </view>
- <view class="cu-form-group">
- <view class="title">是否出具意见和解释</view>
- <uni-data-checkbox v-model="radio2" :localdata="yijian" @change="change(yijian[radio2].text)">
- </uni-data-checkbox>
- </view>
- <view class="cu-form-group">
- <view class="title">检测结论</view>
- <uni-data-checkbox v-model="radio3" :localdata="jielun" @change="change(jielun[radio3].text)">
- </uni-data-checkbox>
- </view>
- <view class="cu-form-group">
- <view class="title">取报告方式</view>
- <uni-data-checkbox style="flex-wrap: nowrap;" v-model="radio4" :localdata="baogao"
- @change="change(baogao[radio4].text)"></uni-data-checkbox>
- </view>
- <uni-collapse-item title="声明" :open="open">
- <uni-card :is-shadow="false">
- <text class="uni-body" style="color: #DD514C;">1.送样单位须保证样品的真实性、代表性.
- 2.本检验中心保证检测结果的公正性,对来样的检测数据负责;并对其样品及相关资料保密。
- 3.委托方需对送检样品的安全性和缺陷负责,一旦因样品自身问题发生事故损失的,委托方需承担相应责任。</text>
- </uni-card>
- </uni-collapse-item>
-
- </uni-section>
- </view>
- <view class="padding flex flex-direction" style="margin-bottom: 400rpx;">
- <button class="cu-btn bg-blue lg" @click="onSubmit">提交</button>
- </view>
- </form>
-
-
- </view>
- </template>
- <script>
- const plan_type = [{
- text: '返回给委托人',
- value: '1'
- }, {
- text: '自取',
- value: '2'
- }, {
- text: '不取回',
- value: '3'
- }];
- const plan_type1 = [{
- text: '委托检测',
- value: '1'
- }, {
- text: '抽样检测',
- value: '2'
- }];
- import myDate from '@/components/my-componets/my-date.vue'
- import appSelect from '@/components/my-componets/appSelect.vue'
- import md5 from "@/common/util/md5.js"
- import { ACCESS_TOKEN,USER_NAME,USER_INFO } from "@/common/util/constants"
- export default {
- components: {
- myDate,
- appSelect
- },
- data() {
- return {
- order:'',
- ypname:'',
- ypguige:'',
- ypshuliang:'',
- yppihao:'',
- ypchuzhi:'',
- ypleibie:'',
-
- fangfa:'',
- total:0,
- open:true,
- rateValue: 0,
- vModelValue: 1,
- radio1: 0,
- radio2: 1,
- radio3: 1,
- radio4: 0,
- checkbox2: [],
- sex: [{
- text: '碳素钢和中低合金钢',
- value: 0,
- canshu:[]
- }, {
- text: '金属零件',
- value: 1,
- canshu:[]
- }],
- yijian: [{
- text: '要',
- value: 0
- }, {
- text: '不要',
- value: 1
- }],
- jielun: [{
- text: '要',
- value: 0
- }, {
- text: '不要',
- value: 1
- }],
- baogao: [{
- text: '自取',
- value: 0
- }, {
- text: '邮件',
- value: 1
- }, {
- text: '其它',
- value: 2
- }],
- value: 0,
- type: "default",
- inverted: false,
- leibie: "",
- weituodanhao: '',
- plan_type1,
- plan_type,
- type2: '',
- type1: '',
- beginTime: '',
- index: -1,
- leixing: '',
- switchC: true,
- imgList: [],
- uploadUrl: "/sys/common/upload",
- myFormData: {
- weituodanhao: '',
- avatar: '',
- realname: '',
- username: '',
- sex: 1,
- birthday: '',
- orgCode: '',
- workNo: '',
- phone: '',
- email: '',
- id: '',
- },
- };
- },
- onLoad: function(option) {
- if(option=={} || option.id==undefined){
- uni.navigateTo({
- url:"/pages/jiance/jindu"
- })
- return;
- }
-
-
- //委托单号
- //this.weituodanhao=option.id;
- this.$tip.loading();
- //查询原有订单数据
- let url="ibps/business/v3/form/def/getFormData?templateKey=ddfqlb&formKey=ddfq&pk=#orderId&rightsScope=data";
- url=url.replace("#orderId",option.id)
-
- this.$http.post(url).then(res => {
- if (res.data.state == 200) {
- this.$tip.loaded()
-
- let data = res.data.data.boData;
- let entity=JSON.parse(data);
- this.order=entity;
- console.log(this.order)
- this.weituodanhao=entity.weiTuoDanHao;
- this.beginTime=entity.qiWangWanChengShi;
- this.total=entity.zongJinE;
-
- //取报告方式
- let text=entity.quBaoGaoFangShiJi;
- if(text=="自取"){
- this.radio4=0;
- }else if(text=="邮件"){
- this.radio4=1;
- }else if(text=="其它"){
- this.radio4=2;
- }
-
-
- text=entity.yangPinChuZhi;
- if(text=="返回给委托人"){
- this.type2="1";
- }else if(text=="自取"){
- this.type2="2";
- }else if(text=="不取回"){
- this.type2="3";
- }
-
-
- text=entity.yangPinChuZhi;
-
- if(text=="返回给委托人"){
- this.type2="1";
- }else if(text=="自取"){
- this.type2="2";
- }else if(text=="不取回"){
- this.type2="3";
- }
-
- text=entity.yangPinChuZhi;
-
- if(text=="返回给委托人"){
- this.type2="1";
- }else if(text=="自取"){
- this.type2="2";
- }else if(text=="不取回"){
- this.type2="3";
- }
-
- text=entity.jianCeLeiBie;
- if(text=="委托检测"){
- this.type1="1";
- }else if(text=="抽样检测"){
- this.type1="2";
- }
- this.ypname=entity.gdyrqcyp[0].yangPinMingCheng;
- this.ypguige=entity.gdyrqcyp[0].guiGeXingHao;
- this.ypshuliang=entity.gdyrqcyp[0].shuLiang;
- this.yppihao=entity.gdyrqcyp[0].shengChanRiQiPiHa;
- }
- });
-
- let pagepara={
- "parameters": [],
- "requestPage": {
- "pageNo": 1,
- "limit": 100,
- "offset": 0,
- "totalCount": 12
- }
- }
- let this_=this;
- //"ibps/business/v3/entrust/sysjtsjpz/query"
- this.$http.post("/ibps/business/v3/entrust/sysjtsjpz/query", pagepara).then(res => {
- if (res.data.state == 200) {
- console.log(res.data.variables.data)
- let data=res.data.variables.data;
- console.log(filterJson(data,"jianCeDuiXiang"))
- let jianceduix=filterJson(data,"jianCeDuiXiang")
- let datajiance=[]
- for(let i in jianceduix){
- let yy={};
- yy.jianceduix=jianceduix[i].jianCeDuiXiang;
- yy.jianCeLeiBie=jianceduix[i].jianCeLeiBie;
- yy.jianCeFangFa=jianceduix[i].jianCeFangFa;
- yy.canshu=data.filter(function(item){
- return item.jianCeDuiXiang==jianceduix[i].jianCeDuiXiang
- })
- datajiance.push(yy);
-
- }
- //let jiance=[];
- for(let i in datajiance){
- let entity={};
- entity.value=i;
- entity.text=datajiance[i].jianceduix;
- entity.leixing=datajiance[i].jianCeLeiBie;
- entity.canshu=datajiance[i].canshu;
- entity.fangfa=datajiance[i].jianCeFangFa;
- for(let j in datajiance[i].canshu){
- datajiance[i].canshu[j].text=datajiance[i].canshu[j].xiangMuCanShu+" 单价:"+datajiance[i].canshu[j].price +"¥"
- datajiance[i].canshu[j].value=j;
- // datajiance[i].canshu[j].selected=true;
- }
- if(i<2){
- this_.sex[i]=entity;//
- }else{
- this_.sex.push(entity)
- }
-
-
- //jiance.push(entity)
- }
-
-
-
- this_.radio1=0;
- console.log(this_.sex)
- //this_.radio1=0;
- }
- });
- //检测对象 https://www.szjyxt.com/ibps/business/v3/data/template/queryDataTable
- let param1 = {
- "parameters": [{
- "key": "response_data",
- "value": "{\"template_id\":\"958692267806162944\",\"template_type\":\"\",\"attrs\":\"\",\"result_columns\":[{\"label\":\"检测对象\",\"name\":\"jian_ce_dui_xiang\"}],\"sort_columns\":\"\",\"buttons\":\"\",\"export_columns\":\"\",\"datasetKey\":\"jianceduixiangv\",\"unique\":\"jian_ce_dui_xiang\",\"key\":\"jcdxzly\",\"dynamic_params\":{}}"
- },
- {
- "key": "filter_condition_key",
- "value": ""
- }
- ]
- }
- this.$http.post("ibps/business/v3/data/template/queryDataTable", param1).then(res => {
- if (res.data.state == 200) {
- console.log(res.data.data)
- let data = res.data.data.dataResult
- console.log(data)
- }
- });
- //检测类型、检测
- //请求系统接口demo
- let query = this.$Route.query
-
-
-
- },
- methods: {
- calc(e){
- let total=0;
- let data=e.detail.data;
- let canshu=[];
- for(let i in data){
- total=total+data[i].price;
- canshu.push(data[i].xiangMuCanShu)
- }
- this.canshu=canshu;
- this.total=total
- },
- onChange(e) {
- //console.log('rate发生改变:' + JSON.stringify(e))
- console.log(e)
- // console.log(this.rateValue);
- },
- onSubmit() {
-
- let data={
- crmZhuangTai: "crm",
- weiTuoZhuangTai: "待审核",
- id: this.order.id,
- weiTuoDanHaoZhuan: "",
- yangPinBianHaoZhu: "",
- shouLiBuMen: "检测室",
- weiTuoFang: "外部委托",
- jianCeWeiZhi: "",
- shouLiShiJian: "2022-06-07",
- dingDanHao: "",
- dingDanLaiYuan: "业务人员下单",
- baoJiaDan: "",
- quDao: "",
- xiaoShouRenYuan: "",
- zongJinE: this.total,
- weiTuoDanHao: "",
- lianXiRen: "邓进源",
- weiTuoDanWei: "975038272398950400",
- lianXiFangShi: "",
- qiWangWanChengShi: "",
- tongXunDiZhi: "质量部",
- gdyrqcyp: [],
- yangPinChuZhi: "返回给委托人",
- jianCeLeiBie: "委托检测",
- keHuYaoQiu: "无特殊要求",
- jcxmcrm: [],
- quBaoGaoFangShiJi: "自取",
- baoGaoFenShu: 1,
- qiTaYaoQiu: "无特殊要求",
- jianCeJieGuoZuoCh: "不要",
- jianCeJieLun: "不要",
- jianCeBaoGaoZhong: "不要",
- hkfab: [],
- dingDanShenHeYiJi: "",
- dingDanShenPiYiJi: "",
- bianZhiRen: "",
- yangPinMingCheng: "样品名称",
- guiGeXingHao: "45541212",
- shengChanRiQiPiHa: "212313130.0.",
- shouJiKeHuId:""
- };
-
-
-
-
-
- //组装数据
-
- //获取下单用户信息
- let info= uni.getStorageSync(USER_INFO);
- console.log(info)
-
- if(info==undefined){
- return;
- }
-
- data.lianXiRen=info.username;
- data.weiTuoDanWei=info.companyname;
- data.lianXiFangShi=info.number;
- data.dingDanLaiYuan="手机下单";
- data.shouLiBuMen="检测室";
- data.shouJiKeHuId=info.id;
-
- data.weiTuoDanHao=this.weituodanhao;
- data.qiWangWanChengShi=this.beginTime;
-
-
- //样品处置
-
-
- if(this.type2==""||this.type1==""){
- this.$tip.alert("请选择检测类别或处置方式");
- return false;
- }
- data.yangPinChuZhi=this.plan_type[this.type2-1].text;
- //检测类别
- data.jianCeLeiBie=this.plan_type1[this.type1-1].text;
- //样品名称、规格、数量、批号
- let yangpin= {
- yangPinMingCheng: this.ypname,
- guiGeXingHao:this.ypguige,
- shuLiang: this.ypshuliang,
- shengChanRiQiPiHa: this.yppihao
- }
-
- data.gdyrqcyp.push(yangpin);
- //报告份数
- data.baoGaoFenShu=this.vModelValue;
-
-
-
- //检测结论
- data.jianCeJieLun=this.jielun[this.radio3].text;
-
- data.quBaoGaoFangShiJi=this.baogao[this.radio4].text
-
-
-
-
-
-
- let para={boCode: "gdyrqcwt",
- version: 0,
- formKey: "ddfq",
- pk: "",
- data:JSON.stringify(data)}
- // console.log(para)
-
- let that=this;
- this.$http.post("ibps/business/v3/data/template/saveFormData/vo",para).then(res =>{
- if (res.data.state == 200) {
- this.$tip.success("下单成功!")
- this.$Router.replace({name:'index'})
- }else{
- this.$tip.error("请求错误: "+res.data.message)
- }
- }).catch((err) => {
- let msg = ((err.response || {}).data || {}).message || err.data.message || "请求出现错误,请稍后再试"
- this.$tip.error(msg);
- });
-
-
- },
- DateChange(e) {
- this.myFormData.birthday = e.detail.value
- },
- SwitchC(e) {
- this.switchC = e.detail.value
- },
- sig(sql) {
- let rul = (sql.length + 9) * 12 * 3 + 168
- let salt = "JinYuanXinTong"
- return md5(rul + '' + salt)
- },
- ChooseImage() {
- var that = this;
- uni.chooseImage({
- count: 4, //默认9
- sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album'], //从相册选择
- success: (res) => {
- that.$http.upload(that.$config.apiUrl + that.uploadUrl, {
- filePath: res.tempFilePaths[0],
- name: 'file'
- })
- .then(res => {
- that.myFormData.avatar = res.data.message;
- })
- .catch(err => {
- that.$tip.error(err.data.message)
- });
- this.imgList = res.tempFilePaths
- }
- });
- },
- ViewImage(e) {
- uni.previewImage({
- urls: this.imgList,
- current: e.currentTarget.dataset.url
- });
- },
- DelImg(e) {
- uni.showModal({
- title: '召唤师',
- content: '确定要删除这段回忆吗?',
- cancelText: '再看看',
- confirmText: '再见',
- success: res => {
- if (res.confirm) {
- this.imgList.splice(e.currentTarget.dataset.index, 1)
- }
- }
- })
- },
- change(text) {
- this.checkbox2=[]; //检测项目重新选择
- },
- changeValue(value) {
- console.log('返回数值:', value);
- },
- focus(e) {
- console.log('focus:', e);
- },
- blur(e) {
- console.log('blur:', e);
- },
- setType() {
- let types = ["default", "primary", "success", "warning", "error"];
- let index = types.indexOf(this.type);
- types.splice(index, 1);
- let randomIndex = Math.floor(Math.random() * 4);
- this.type = types[randomIndex];
- },
- setInverted(index) {
- this.canshu[index].show = !this.canshu[index].show;
- },
- }
- }
- //过滤数据
- function filterJson(data, Name) { //data是json对象,Name是根据什么字段去重
- var map = {},
- dest = [];
- for (var i = 0; i < data.length; i++) {
- var ai = data[i];
- if (i == 0) {
- dest.push(ai);
- } else {
- var filterData = dest.filter(function (e) {
- return e[Name] == ai[Name];
- })
- if (filterData.length == 0) {
- dest.push(ai);
- }
- }
- }
- return dest;
- }
-
-
- </script>
- <style>
- .cu-form-group .title {
- min-width: calc(4em + 15px);
- }
- .example-body {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- justify-content: flex-start;
- align-items: flex-end;
- flex-wrap: wrap;
- }
- .tag-view {
- margin-right: 10px;
- }
- .example-body2 {
- padding: 12px;
- background-color: #FFFFFF;
- }
- .result-box {
- text-align: center;
- padding: 20px 0px;
- font-size: 16px;
- }
- .uni-list-item {
- border-bottom-style: solid;
- border-bottom-width: 1px;
- border-bottom-color: #eee;
- font-size: 14px;
- }
-
- .uni-list-item__container {
- /* #ifndef APP-NVUE */
- display: flex;
- width: 100%;
- box-sizing: border-box;
- /* #endif */
- padding: 12px 15px;
- flex: 1;
- position: relative;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
-
- .uni-list-item__content-title {
- font-size: 14px;
- color: #666;
- }
- </style>
|