| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964 |
- <template>
- <view>
- <view class="u-m-20">
- <u-form :model="form" ref="uForm" label-width="220" :error-type="errorType">
- <u-form-item label="样品名称" prop="yangPinMingCheng" required>
- <u-input placeholder="请输入样品名称" v-model="form.yangPinMingCheng" :disabled="type == 'detail'?true :false" />
- </u-form-item>
- <u-form-item label="样品编号">
- <u-input placeholder="请输入样品编号" v-model="form.yangPinBianHao" disabled />
- </u-form-item>
- <u-form-item label="姓名">
- <u-input placeholder="请输入姓名" v-model="form.xingMing" :disabled="type == 'detail'?true :false" />
- </u-form-item>
- <u-form-item label="性别">
- <uni-data-select placeholder="请选择性别" v-model="form.xingBie" :localdata="sexList" v-if="type != 'detail'">
- </uni-data-select>
- <text v-else>{{form.xingBie}}</text>
- </u-form-item>
- <u-form-item label="年龄">
- <u-input placeholder="请输入年龄" v-model="form.nianLing" type="number" :disabled="type == 'detail'?true :false" />
- </u-form-item>
- <u-form-item label="送检批号/编号" prop="songJianPiHao" required>
- <u-input placeholder="请输入送检批号/编号" v-model="form.songJianPiHao" :disabled="type == 'detail'?true :false" />
- </u-form-item>
- <u-form-item label="样本状态" prop="yangPinZhuangTai" required>
- <u-input placeholder="请选择样本状态" v-model="form.yangPinZhuangTai" :disabled="type == 'detail'?true :false" />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('state')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <u-form-item label="送检时间" prop="songJianShiJian" required>
- <u-input placeholder="请选择送检时间" v-model="form.songJianShiJian" disabled />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="dateClick('inspect')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <view class="qingshe">
- <view class="qingTitle">
- 若需做培养基灵敏度检测请在此备注
- </view>
- </view>
- <u-form-item label="备注">
- <u-input placeholder="请输入备注" v-model="form.beiZhu1" :disabled="type == 'detail'?true :false" />
- </u-form-item>
- <view class="qingshe">
- <view class="qingTitle">
- 常规项目选择
- </view>
- </view>
- <!-- <u-form-item label="项目编号搜索" v-if="type != 'detail'">
- <u-input placeholder="请输入项目编号搜索" v-model="form.search" />
- </u-form-item> -->
- <u-form-item label="检测类型" v-if="type != 'detail'">
- <u-input placeholder="" disabled />
- <u-button type="success" class="btn-back-color" slot="right" size="mini" @click="sheetClick('jianCeType','检测类型')">选择
- </u-button>
- </u-form-item>
- <view v-if="false">
- <uni-data-checkbox v-model="form.jianCeType" multiple :localdata="jianCeTypeList" @change="checkBoxChange">
- </uni-data-checkbox>
- </view>
- <u-form-item label="检测项目" prop="name">
- <div style="display: flex;justify-content: flex-end;" @click="jianCeShow = !jianCeShow">
- <!-- <checkbox :checked="checked" style="margin-right: 15rpx;" @click="checkedChange" />全选 -->
- <u-icon name="arrow-up" color="#999" v-if="jianCeShow">
- </u-icon>
- <u-icon name="arrow-down" color="#999" v-else></u-icon>
- </div>
- </u-form-item>
- <view v-if="jianCeShow">
- <scroll-view scroll-y="true" class="scroll" :style="{borderRadius: `${mode == 'ios' ? '10px 10px 0 0' : '0'}`}">
- <view class="l-action-sheet-box">
- <view class="l-address-list" v-for="(item, index) in form.jianCeList" :key="index" v-if="item.checked">
- <view class="l-item">
- <view class="l-radio" v-if="type != 'detail'" @click="changeIndex(item,index)">
- <text class="l-radio-outer" :class="{'l-radio-checked': item.checked}"></text>
- <text class="l-radio-inner"></text>
- </view>
- <view class="l-info" @click.stop="getSty(item)">
- <view class="l-address-desc">
- {{item.xiang_mu_bian_hao || ''}}-{{item.jian_ce_xiang_mu_ || ''}}
- <text style="color: red;">[{{item.zhe_hou_jia_ge_ || '0'}}元]</text>
- </view>
- <view class="l-userinfo">
- 检测类别:
- <text class="l-user-name">{{item.jian_ce_lei_bie_}}</text>
- </view>
- <view class="l-userinfo">
- 报告周期(工作日):
- <text class="l-user-name">{{item.bao_gao_zhou_qi_g || '当'}}天</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- <view class="qingshe" v-if="taoCanShow ||( form.taoCanXiangMuList && form.taoCanXiangMuList.length > 0)">
- <view class="qingTitle">
- 套餐选择
- </view>
- </view>
- <u-form-item label="选择套餐" prop="name" label-position="top" v-if="taoCanShow">
- <view class="btnBox" v-if="type != 'detail'">
- <u-button class="btnSin" size="mini" :type="it.checked ? 'success':''" v-for="(it, x) in form.taoCanList" :key="x" @click="changeTaoCanIndex(it,x,it.checked)">
- {{it.tao_can_ming_chen}}
- </u-button>
- </view>
- <view class="btnBox" v-else>
- <u-tag class="btnSin" size="default" v-for="(it, x) in form.taoCanList" v-if="it.checked" :text="it.tao_can_ming_chen" :key="x" />
- </view>
- </u-form-item>
- <u-form-item label="套餐项目" prop="name" v-if="taoCanShow">
- <div style="display: flex;justify-content: flex-end;" @click="taoCanXiangMuShow = !taoCanXiangMuShow">
- <u-icon name="arrow-up" v-if="taoCanXiangMuShow"></u-icon>
- <u-icon name="arrow-down" v-else></u-icon>
- </div>
- </u-form-item>
- <view v-if="taoCanXiangMuShow && form.taoCanXiangMuList && form.taoCanXiangMuList.length > 0">
- <view style="padding: 0 20rpx;">
- <view v-for="(it, x) in form.taoCanXiangMuList" :key="x" @click.stop="getSty(it)">
- <view class="jiancexiangm">
- <view>
- {{it.jian_ce_lei_bie_ || ''}}-{{it.jian_ce_xiang_mu_ || ''}}
- <text style="color: red;">[{{it.zhe_hou_jia_ge_ || '0'}}元]</text>
- </view>
- <view>{{it.yi_ju_de_biao_zhu || ''}}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- <view class="qingshe">(样品类型、样品运输条件、样品数量、样品规格)组,请填写的必须展开,并且请按顺序填写,不填写的可以隐藏</view> -->
- <view class="qingshe">
- <view>
- ①
- </view>
- <!-- <view>
- @click="form.showBoolean1 = !form.showBoolean1"
- <u-icon name="arrow-up" v-if="form.showBoolean1"></u-icon>
- <u-icon name="arrow-down" v-else></u-icon>
- </view> -->
- </view>
- <block v-if="form.showBoolean1">
- <u-form-item label="样品类型①" required>
- <u-input placeholder="请选择样品类型①" v-model="form.yangPinLeiXing" :disabled="type == 'detail'?true :false" />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('yangpinType1','样品类型')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <u-form-item label="样品运输条件①" required>
- <u-input placeholder="请选择样品运输条件①" v-model="form.yangBenYunShuTiao" :disabled="type == 'detail'?true :false" />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('transportType1')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <u-form-item label="样品数量①" required>
- <uni-number-box v-model="form.shuLiang" v-if="type != 'detail'"></uni-number-box>
- <text v-else>{{form.shuLiang}}</text>
- </u-form-item>
- <u-form-item label="样品规格①" required>
- <u-input placeholder="请输入样品规格①(例:1ml/支*10ml离心管 请按照此格式进行填写)" v-model="form.yangPinGuiGe" :disabled="type == 'detail'?true :false" />
- <u-button slot="right" type="success" class="btn-back-color" size="mini" @click="sheetClick('specification1','样品规格')" v-if="type != 'detail'">规格
- </u-button>
- </u-form-item>
- </block>
- <view v-if="(type == 'detail' && (form.yangPinLeiXingEr || form.yangPinYunShuTiao || form.shuLiangEr > 0 || form.yangPinGuiGeEr)) || type != 'detail'">
- <view class="qingshe" @click="form.showBoolean2 = !form.showBoolean2">
- <view>
- ②
- </view>
- <view>
- <u-icon name="arrow-up" v-if="form.showBoolean2"></u-icon>
- <u-icon name="arrow-down" v-else></u-icon>
- </view>
- </view>
- <block v-if="form.showBoolean2">
- <u-form-item label="样品类型②" required>
- <u-input placeholder="请选择样品类型②" v-model="form.yangPinLeiXingEr" :disabled="type == 'detail'?true :false" />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('yangpinType2','样品类型')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <u-form-item label="样品运输条件②" required>
- <u-input placeholder="请选择样品运输条件②" v-model="form.yangPinYunShuTiao" :disabled="type == 'detail'?true :false" />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('transportType2')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <u-form-item label="样品数量②" required>
- <uni-number-box v-model="form.shuLiangEr" v-if="type != 'detail'"></uni-number-box>
- <text v-else>{{form.shuLiangEr}}</text>
- </u-form-item>
- <u-form-item label="样品规格②" required>
- <u-input placeholder="请输入样品规格②(例:1ml/支*10ml离心管 请按照此格式进行填写)" v-model="form.yangPinGuiGeEr" :disabled="type == 'detail'?true :false" />
- <u-button slot="right" type="success" class="btn-back-color" size="mini" @click="sheetClick('specification2','样品规格')" v-if="type != 'detail'">规格
- </u-button>
- </u-form-item>
- </block>
- </view>
- <view v-if="(type == 'detail' && (form.yangPinLeiXingSan || form.yangPinYunShuSan || form.shuLiangSan > 0 || form.yangPinGuiGeSan)) || type != 'detail'">
- <view class="qingshe" @click="form.showBoolean3 = !form.showBoolean3">
- <view>
- ③
- </view>
- <view>
- <u-icon name="arrow-up" v-if="form.showBoolean3"></u-icon>
- <u-icon name="arrow-down" v-else></u-icon>
- </view>
- </view>
- <block v-if="form.showBoolean3">
- <u-form-item label="样品类型③" required>
- <u-input placeholder="请选择样品类型③" v-model="form.yangPinLeiXingSan" :disabled="type == 'detail'?true :false" />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('yangpinType3','样品类型')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <u-form-item label="样品运输条件③" required>
- <u-input placeholder="请选择样品运输条件③" v-model="form.yangPinYunShuSan" :disabled="type == 'detail'?true :false" />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('transportType3')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <u-form-item label="样品数量③" required>
- <uni-number-box v-model="form.shuLiangSan" v-if="type != 'detail'"></uni-number-box>
- <text v-else>{{form.shuLiangSan}}</text>
- </u-form-item>
- <u-form-item label="样品规格③" required>
- <u-input placeholder="请输入样品规格③(例:1ml/支*10ml离心管 请按照此格式进行填写)" v-model="form.yangPinGuiGeSan" :disabled="type == 'detail'?true :false" />
- <u-button slot="right" type="success" class="btn-back-color" size="mini" @click="sheetClick('specification3','样品规格')" v-if="type != 'detail'">规格
- </u-button>
- </u-form-item>
- </block>
- </view>
- <view v-if="(type == 'detail' && (form.yangPinLeiXingSi || form.yangPinYunShuSi || form.shuLiangSi > 0 || form.yangPinGuiGeSi)) || type != 'detail'">
- <view class="qingshe" @click="form.showBoolean4 = !form.showBoolean4">
- <view>
- ④
- </view>
- <view>
- <u-icon name="arrow-up" v-if="form.showBoolean4"></u-icon>
- <u-icon name="arrow-down" v-else></u-icon>
- </view>
- </view>
- <block v-if="form.showBoolean4">
- <u-form-item label="样品类型④" required>
- <u-input placeholder="请选择样品类型④" v-model="form.yangPinLeiXingSi" :disabled="type == 'detail'?true :false" />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('yangpinType4','样品类型')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <u-form-item label="样品运输条件④" required>
- <u-input placeholder="请选择样品运输条件④(例:1ml/支*10ml离心管 请按照此格式进行填写)" v-model="form.yangPinYunShuSi" :disabled="type == 'detail'?true :false" />
- <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('transportType4')" v-if="type != 'detail'">选择
- </u-button>
- </u-form-item>
- <u-form-item label="样品数量④" required>
- <uni-number-box v-model="form.shuLiangSi" v-if="type != 'detail'"></uni-number-box>
- <text v-else>{{form.shuLiangSi}}</text>
- </u-form-item>
- <u-form-item label="样品规格④" required>
- <u-input placeholder="请输入样品规格④" v-model="form.yangPinGuiGeSi" :disabled="type == 'detail'?true :false" />
- <u-button slot="right" type="success" class="btn-back-color" size="mini" @click="sheetClick('specification4','样品规格')" v-if="type != 'detail'">规格
- </u-button>
- </u-form-item>
- </block>
- </view>
- <u-form-item label="项目名称" prop="xiangMuMingCheng" v-if="form.mingChengShow">
- <u-input placeholder="请输入项目名称" v-model="form.xiangMuMingCheng" :disabled="type == 'detail'?true :false" />
- </u-form-item>
- <u-form-item label="样品总价" prop="yangPinZongJia">
- <u-input v-model="form.yangPinZongJia" disabled />
- </u-form-item>
- </u-form>
- <view style="height: 110rpx;" v-if="itemType"></view>
- <view class="btnBottom" v-if="itemType">
- <u-row>
- <u-col span="6">
- <u-button type="success" class="btn green-back-color" @click="deletSing">取消
- </u-button>
- </u-col>
- <u-col span="6">
- <u-button type="success" class="btn btn-back-color" @click="sumbitSing">保存
- </u-button>
- </u-col>
- </u-row>
- </view>
- </view>
- <u-action-sheet :list="list" v-model="sheetShow" @click="actionSheetCallback" z-index="2000">
- </u-action-sheet>
- <u-select v-model="selectShow" :list="list" @confirm="selectConfirm"></u-select>
- <u-calendar v-model="dateShow" :mode="mode" max-date="2050-01-01" @change="dateChange"></u-calendar>
- <lin-popup ref="picker" :title="title" :list="list" @onConfirm="onConfirm"></lin-popup>
- <u-popup v-model="show" height="800" mode="bottom">
- <view>
- <view class="jianCeTypeTop u-p-20">
- <view class="jianCeTypeLeft" @click.stop="jianCeClick()">
- 检测类型选择
- </view>
- <view class="jianceCenter">
- {{form.jianCeType}}
- </view>
- <view class="closeClass" @click.stop="show = false">
- 关闭
- </view>
- </view>
- <view class="jianCeTypeContent u-p-20">
- <scroll-view scroll-y="true" class="scroll" :style="{borderRadius: `${mode == 'ios' ? '10px 10px 0 0' : '0'}`}">
- <view class="l-action-sheet-box">
- <view class="l-address-list" v-for="(item, index) in form.jianCeList" :key="index" v-if="item.jian_ce_lei_bie_ == form.jianCeType">
- <view class="l-item">
- <view class="l-radio" v-if="type != 'detail'" @click="changeIndex(item,index)">
- <text class="l-radio-outer" :class="{'l-radio-checked': item.checked}"></text>
- <text class="l-radio-inner"></text>
- </view>
- <view class="l-info" @click.stop="getSty(item)">
- <view class="l-address-desc">
- {{item.xiang_mu_bian_hao || ''}}-{{item.jian_ce_xiang_mu_ || ''}}
- <text style="color: red;">[{{item.zhe_hou_jia_ge_ || '0'}}元]</text>
- </view>
- <view class="l-userinfo">
- 检测类别:
- <text class="l-user-name">{{item.jian_ce_lei_bie_}}</text>
- </view>
- <view class="l-userinfo">
- 报告周期(工作日):
- <text class="l-user-name">{{item.bao_gao_zhou_qi_g || '当'}}天</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import order from './test.json'
- import linSelect from '@/components/lin-select/lin-select.vue'
- import meth from './meth.js'
- export default {
- components: {
- linSelect
- },
- props: {
- jianCeTypeList: {
- type: Array,
- default: () => {
- return []
- }
- },
- taoCanShow: {
- type: Boolean,
- default: true
- },
- heTongId: {
- type: String,
- default: ''
- },
- item: {
- type: Object,
- default: function() {
- return {};
- }
- },
- itemType: {
- type: Boolean,
- default: true
- },
- type: {
- type: String,
- default: 'add'
- },
- chuJuBaoGaoYaoQiu: {
- type: String,
- default: '常规'
- },
- },
- data() {
- return {
- jianCeShow: true,
- taoCanXiangMuShow: true,
- checked: false,
- errorType: ['toast'],
- form: this.item,
- //样本状态
- sampleStateList: order.sampleState,
- sexList: order.sex,
- //样本类型
- sampleTypeList: [],
- //样本运输条件
- transportTypeList: order.transportType,
- //样本规格
- // specificationList: order.specification,
- specificationList: [],
- validList: order.validList,
- list: [],
- listType: '',
- sheetShow: false,
- selectShow: false,
- dateShow: false,
- mode: 'date',
- rules: {
- yangPinMingCheng: [{
- required: true,
- message: '请输入样品名称',
- trigger: 'blur',
- }],
- songJianPiHao: [{
- required: true,
- message: '请输入送检批号/编号',
- trigger: 'blur',
- }],
- yangPinZhuangTai: [{
- required: true,
- message: '请输入样本状态',
- trigger: 'blur',
- }],
- songJianShiJian: [{
- required: true,
- message: '请输入送检时间',
- trigger: 'blur',
- }],
- },
- title: '',
- show: false
- }
- },
- created() {
- this.getYpbzggb()
- this.getYplxb()
- },
- methods: {
- //获取初始化数据,在添加使用
- getInit(data) {
- this.form = JSON.parse(JSON.stringify(data))
- },
- //样品类型
- getYplxb() {
- let sql =
- `select lei_xing_ from t_yplxb 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) {
- const datas = res.data.variables.data
- if (datas.length > 0) {
- datas.forEach(item => {
- this.$set(item, 'name', item.lei_xing_)
- })
- this.sampleTypeList = datas
- }
- }
- })
- },
- //样品规格
- getYpbzggb() {
- let sql =
- `select yang_pin_gui_ge_ from t_ypbzggb 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) {
- const datas = res.data.variables.data
- if (datas.length > 0) {
- datas.forEach(item => {
- this.$set(item, 'name', item.yang_pin_gui_ge_)
- })
- this.specificationList = datas
- }
- }
- })
- },
- //委托项目 点击事件
- changeIndex(it, x) {
- let taoCanXiangMuList = this.form.taoCanXiangMuList
- if (taoCanXiangMuList.length > 0 && !it.checked) {
- //判断是否与套餐项目相同
- let showData = taoCanXiangMuList.findIndex(item => item.id_ == it.id_)
- if (showData >= 0) {
- uni.showToast({
- title: it.xiang_mu_bian_hao + '项目与套餐项目相同',
- icon: 'none',
- duration: 1000
- })
- }
- }
- let itemData = this.form
- this.form.jianCeList[x].checked = !this.form.jianCeList[x].checked
- let show = itemData.jianCeList.some(item => (item.id_ == '1039826037036285952' || item.id_ ==
- '1040205909151711232') && item.checked)
- if (show) {
- itemData.mingChengShow = true
- } else {
- itemData.xiangMuMingCheng = ''
- itemData.mingChengShow = false
- }
- this.getTotal()
- },
- //套餐添加事件
- changeTaoCanIndex(it, x, checked) {
- let itemData = this.form
- //checked 判断套餐是否被选中
- if (!checked) {
- let itList = it.xuan_ze_jian_ce_x.split(',')
- let arr = itemData.taoCanXiangMuList.map(item => item.id_)
- //判断现选的套餐跟已选套餐是否有相同的
- var cList = itList.filter((item) => arr.some((ite) => ite === item))
- if (cList.length > 0) {
- uni.showToast({
- title: it.tao_can_ming_chen + '与其他套餐的检测项目相同,请选择其他套餐',
- icon: 'none',
- duration: 2000
- })
- return
- }
- } else {
- itemData.taoCanXiangMuList = itemData.taoCanXiangMuList.filter(item => item.tao_can_zhu_jian_ !== it
- .id_)
- }
- this.form.taoCanList[x].checked = !this.form.taoCanList[x].checked
- if (!checked) {
- this.taoCanChange(it.id_)
- } else {
- this.getTotal()
- }
- },
- //计算检测项目和套餐价格
- getTotal() {
- var itemTotal = 0
- this.form.jianCeList.forEach((it, x) => {
- if (it.checked) {
- itemTotal += parseFloat(it.zhe_hou_jia_ge_ || 0)
- }
- })
- this.form.taoCanXiangMuList.forEach((it, x) => {
- itemTotal += parseFloat(it.zhe_hou_jia_ge_ || 0)
- })
- if (this.chuJuBaoGaoYaoQiu == '加急') {
- itemTotal = itemTotal * 1.2
- } else if (this.chuJuBaoGaoYaoQiu == '特急') {
- itemTotal = itemTotal * 1.5
- } else {
- itemTotal = itemTotal
- }
- this.form.yangPinZongJia = (itemTotal).toFixed(2)
- if (!this.itemType) {
- this.$emit("countTotal")
- }
- },
- //弹出框初始化
- selectClick(type) {
- this.listType = type
- this.selectShow = true
- if (type == 'jianCeType') {
- this.list = this.jianCeTypeList
- }
- },
- //弹出框初始化
- sheetClick(type, title = '') {
- this.listType = type
- this.title = title
- if (type == 'state') {
- this.list = this.sampleStateList
- }
- //1
- if (type.includes('yangpinType')) {
- this.list = this.sampleTypeList
- }
- if (type.includes('transportType')) {
- this.list = this.transportTypeList
- }
- if (type.includes('specification')) {
- this.list = this.specificationList
- }
- if (type == 'disposition') {
- this.list = this.dispositionList
- }
- if (type == 'jianCeType') {
- this.list = this.jianCeTypeList
- }
- if (type.includes('specification') || type.includes('yangpinType') || type == 'jianCeType') {
- this.$refs['picker'].show();
- } else {
- this.sheetShow = true
- }
- },
- //弹出框初始化
- selectConfirm(e) {
- let that = this
- let lists = that.form
- if (this.listType == 'jianCeType') {
- lists.jianCeType = e[0].value
- }
- },
- //下拉框回调
- actionSheetCallback(e) {
- let that = this
- let lists = that.form
- switch (this.listType) {
- case 'state':
- lists.yangPinZhuangTai = this.list[e].text
- break
- case 'transportType1':
- lists.yangBenYunShuTiao = that.list[e].text
- break
- case 'transportType2':
- lists.yangPinYunShuTiao = that.list[e].text
- break
- case 'transportType3':
- lists.yangPinYunShuSan = that.list[e].text
- break
- case 'transportType4':
- lists.yangPinYunShuSi = that.list[e].text
- break
- case 'disposition':
- this.form.yangBenChuLi = this.list[e].text
- break
- }
- },
- //调用日期组件
- dateClick(type) {
- if (type == 'inspect') {
- this.listType = type
- this.mode = 'date'
- this.dateShow = true
- }
- },
- //日期回调
- dateChange(e) {
- if (this.listType == 'inspect') {
- this.form.songJianShiJian = e.result
- }
- },
- //根据套餐查询套餐项目
- taoCanChange(i) {
- let sql =
- `select tm.*,tt.zhe_hou_jia_ge_,tt.tao_can_zhu_jian_,tt.id_ as tczbId from t_mjjcnlfw tm,t_httcb tt where tm.id_ = tt.jian_ce_xiang_mu_ and tt.tao_can_zhu_jian_ = '${i}' and parent_id_ = '${this.heTongId}'`
- let requestData = this.$sig(sql)
- this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
- if (res.data.state == 200) {
- const datas = res.data.variables.data
- let list = []
- datas.forEach(item => {
- this.form.taoCanXiangMuList.push(item)
- //判断与常规项目是否相同
- let ypglOne = this.form.jianCeList
- ypglOne.forEach(it => {
- if ((item.id_ == it.id_) && it.checked) {
- list.push(it.xiang_mu_bian_hao)
- }
- })
- })
- if (list.length > 0) {
- uni.showToast({
- title: list.join(",") + '项目与已常规项目相同',
- icon: 'none',
- duration: 1000
- })
- }
- this.getTotal()
- }
- })
- },
- //取消事件
- deletSing() {
- this.$emit("deletClick")
- },
- //保存事件
- sumbitSing() {
- if (this.form.yangPinZongJia == '') {
- this.form.yangPinZongJia = 0
- }
- for (let item of this.validList) {
- if (this.form[item.value] == '') {
- this.$showToast.getShowToast(item.toast, item.num)
- return
- }
- }
- if (!meth.getJudge(this.form)) {
- return
- }
- this.$refs.uForm.validate(valid => {
- if (valid) {
- this.$emit("sumbitSingClick", this.form)
- } else {
- uni.showToast({
- title: '必填项未填写',
- icon: 'none',
- duration: 2000
- })
- }
- });
- },
- //检测项目详情
- getSty(item) {
- this.$emit('getParentContent', item)
- },
- checkBoxChange(e) {
- this.form.jianCeTypeString = e
- },
- checkedChange() {
- this.checked = !this.checked
- if (this.form.jianCeList && this.form.jianCeList.length > 0) {
- this.form.jianCeList.forEach(item => {
- if (this.form.jianCeTypeString.indexOf(item.jian_ce_lei_bie_) !== -1) {
- item.checked = this.checked
- }
- })
- }
- },
- onConfirm(e) {
- let that = this
- let lists = that.form
- switch (this.listType) {
- case 'yangpinType1':
- lists.yangPinLeiXing = that.list[e].name
- break
- case 'yangpinType2':
- lists.yangPinLeiXingEr = that.list[e].name
- break
- case 'yangpinType3':
- lists.yangPinLeiXingSan = that.list[e].name
- break
- case 'yangpinType4':
- lists.yangPinLeiXingSi = that.list[e].name
- break
- case 'specification1':
- lists.yangPinGuiGe = that.list[e].name
- break
- case 'specification2':
- lists.yangPinGuiGeEr = that.list[e].name
- break
- case 'specification3':
- lists.yangPinGuiGeSan = that.list[e].name
- break
- case 'specification4':
- lists.yangPinGuiGeSi = that.list[e].name
- break
- case 'jianCeType':
- lists.jianCeType = that.list[e].name
- this.$refs['picker'].hide();
- this.show = true
- break
- }
- },
- jianCeClick() {
- this.show = false
- this.sheetClick('jianCeType', '检测类型')
- }
- },
- onReady() {
- this.$refs.uForm.setRules(this.rules);
- }
- }
- </script>
- <style lang="scss" scoped>
- .qingshe {
- background-color: #f0f9eb;
- color: #67c23a;
- padding: 15rpx 20rpx;
- border-radius: 8rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 25rpx;
- }
- .btnBottom {
- z-index: 1500;
- // height: 220rpx;
- background-color: #FFFFFF;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- .btn {
- margin: 20rpx;
- }
- }
- .jiancexiangm {
- padding: 10rpx 30rpx;
- // width: 100%;
- padding: 20rpx;
- margin-bottom: 20rpx;
- background-color: #f1f1f1;
- border-radius: 8rpx;
- font-size: 26rpx;
- color: $u-content-color;
- line-height: 1.7;
- view {
- line-height: 30rpx;
- }
- }
- .btnBox {
- display: flex;
- flex-wrap: wrap;
- .btnSin {
- margin: 10rpx 5rpx;
- }
- }
- // .ellipsis {
- // width: 100%;
- // display: inline-block;
- // white-space: nowrap;
- // overflow: hidden;
- // text-overflow: ellipsis;
- // }
- .scroll {
- width: 100%;
- height: calc(100% - 35px);
- margin: 5px 0;
- }
- .l-address-list {
- width: 100%;
- height: auto;
- }
- .l-item {
- margin: 0px auto 10px;
- background-color: #f1f1f1;
- border-radius: 5px;
- padding: 5px 0;
- display: flex;
- align-items: center;
- }
- .l-radio {
- display: inline-block;
- width: 16px;
- height: 16px;
- position: relative;
- margin: 10px;
- }
- .l-radio .l-radio-outer {
- position: absolute;
- display: block;
- width: 20px;
- height: 20px;
- border: 1px solid #e5e5e5;
- border-radius: 50%;
- background-color: #ffffff;
- box-sizing: border-box;
- }
- .l-radio .l-radio-checked {
- background-color: #ffbb1b;
- }
- .l-radio .l-radio-inner {
- position: absolute;
- top: 7px;
- left: 7px;
- width: 6px;
- height: 6px;
- background-color: #ffffff;
- border-radius: 50%;
- }
- .l-info {
- display: inline-block;
- }
- .l-address-desc {
- font-size: 14px;
- display: block;
- padding: 2px 10px;
- }
- .l-userinfo {
- padding: 2px 10px;
- }
- .l-userinfo text {
- font-size: 12px;
- color: #666666;
- }
- .l-user-tel {
- padding: 0 10px;
- }
- .jianCeTypeTop {
- position: fixed;
- left: 0;
- right: 0;
- background-color: #FFFFFF;
- z-index: 1300;
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .closeClass {
- color: rgb(41, 121, 255);
- width: 170rpx;
- text-align: right;
- }
- .jianCeTypeLeft {
- color: #01a39e;
- width: 170rpx;
- }
- .jianceCenter {
- display: inline-block;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- font-weight: bold;
- }
- }
- .jianCeTypeContent {
- position: relative;
- top: 50rpx;
- }
- </style>
|