lhypbMessage.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964
  1. <template>
  2. <view>
  3. <view class="u-m-20">
  4. <u-form :model="form" ref="uForm" label-width="220" :error-type="errorType">
  5. <u-form-item label="样品名称" prop="yangPinMingCheng" required>
  6. <u-input placeholder="请输入样品名称" v-model="form.yangPinMingCheng" :disabled="type == 'detail'?true :false" />
  7. </u-form-item>
  8. <u-form-item label="样品编号">
  9. <u-input placeholder="请输入样品编号" v-model="form.yangPinBianHao" disabled />
  10. </u-form-item>
  11. <u-form-item label="姓名">
  12. <u-input placeholder="请输入姓名" v-model="form.xingMing" :disabled="type == 'detail'?true :false" />
  13. </u-form-item>
  14. <u-form-item label="性别">
  15. <uni-data-select placeholder="请选择性别" v-model="form.xingBie" :localdata="sexList" v-if="type != 'detail'">
  16. </uni-data-select>
  17. <text v-else>{{form.xingBie}}</text>
  18. </u-form-item>
  19. <u-form-item label="年龄">
  20. <u-input placeholder="请输入年龄" v-model="form.nianLing" type="number" :disabled="type == 'detail'?true :false" />
  21. </u-form-item>
  22. <u-form-item label="送检批号/编号" prop="songJianPiHao" required>
  23. <u-input placeholder="请输入送检批号/编号" v-model="form.songJianPiHao" :disabled="type == 'detail'?true :false" />
  24. </u-form-item>
  25. <u-form-item label="样本状态" prop="yangPinZhuangTai" required>
  26. <u-input placeholder="请选择样本状态" v-model="form.yangPinZhuangTai" :disabled="type == 'detail'?true :false" />
  27. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('state')" v-if="type != 'detail'">选择
  28. </u-button>
  29. </u-form-item>
  30. <u-form-item label="送检时间" prop="songJianShiJian" required>
  31. <u-input placeholder="请选择送检时间" v-model="form.songJianShiJian" disabled />
  32. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="dateClick('inspect')" v-if="type != 'detail'">选择
  33. </u-button>
  34. </u-form-item>
  35. <view class="qingshe">
  36. <view class="qingTitle">
  37. 若需做培养基灵敏度检测请在此备注
  38. </view>
  39. </view>
  40. <u-form-item label="备注">
  41. <u-input placeholder="请输入备注" v-model="form.beiZhu1" :disabled="type == 'detail'?true :false" />
  42. </u-form-item>
  43. <view class="qingshe">
  44. <view class="qingTitle">
  45. 常规项目选择
  46. </view>
  47. </view>
  48. <!-- <u-form-item label="项目编号搜索" v-if="type != 'detail'">
  49. <u-input placeholder="请输入项目编号搜索" v-model="form.search" />
  50. </u-form-item> -->
  51. <u-form-item label="检测类型" v-if="type != 'detail'">
  52. <u-input placeholder="" disabled />
  53. <u-button type="success" class="btn-back-color" slot="right" size="mini" @click="sheetClick('jianCeType','检测类型')">选择
  54. </u-button>
  55. </u-form-item>
  56. <view v-if="false">
  57. <uni-data-checkbox v-model="form.jianCeType" multiple :localdata="jianCeTypeList" @change="checkBoxChange">
  58. </uni-data-checkbox>
  59. </view>
  60. <u-form-item label="检测项目" prop="name">
  61. <div style="display: flex;justify-content: flex-end;" @click="jianCeShow = !jianCeShow">
  62. <!-- <checkbox :checked="checked" style="margin-right: 15rpx;" @click="checkedChange" />全选 -->
  63. <u-icon name="arrow-up" color="#999" v-if="jianCeShow">
  64. </u-icon>
  65. <u-icon name="arrow-down" color="#999" v-else></u-icon>
  66. </div>
  67. </u-form-item>
  68. <view v-if="jianCeShow">
  69. <scroll-view scroll-y="true" class="scroll" :style="{borderRadius: `${mode == 'ios' ? '10px 10px 0 0' : '0'}`}">
  70. <view class="l-action-sheet-box">
  71. <view class="l-address-list" v-for="(item, index) in form.jianCeList" :key="index" v-if="item.checked">
  72. <view class="l-item">
  73. <view class="l-radio" v-if="type != 'detail'" @click="changeIndex(item,index)">
  74. <text class="l-radio-outer" :class="{'l-radio-checked': item.checked}"></text>
  75. <text class="l-radio-inner"></text>
  76. </view>
  77. <view class="l-info" @click.stop="getSty(item)">
  78. <view class="l-address-desc">
  79. {{item.xiang_mu_bian_hao || ''}}-{{item.jian_ce_xiang_mu_ || ''}}
  80. <text style="color: red;">[{{item.zhe_hou_jia_ge_ || '0'}}元]</text>
  81. </view>
  82. <view class="l-userinfo">
  83. 检测类别:
  84. <text class="l-user-name">{{item.jian_ce_lei_bie_}}</text>
  85. </view>
  86. <view class="l-userinfo">
  87. 报告周期(工作日):
  88. <text class="l-user-name">{{item.bao_gao_zhou_qi_g || '当'}}天</text>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </scroll-view>
  95. </view>
  96. <view class="qingshe" v-if="taoCanShow ||( form.taoCanXiangMuList && form.taoCanXiangMuList.length > 0)">
  97. <view class="qingTitle">
  98. 套餐选择
  99. </view>
  100. </view>
  101. <u-form-item label="选择套餐" prop="name" label-position="top" v-if="taoCanShow">
  102. <view class="btnBox" v-if="type != 'detail'">
  103. <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)">
  104. {{it.tao_can_ming_chen}}
  105. </u-button>
  106. </view>
  107. <view class="btnBox" v-else>
  108. <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" />
  109. </view>
  110. </u-form-item>
  111. <u-form-item label="套餐项目" prop="name" v-if="taoCanShow">
  112. <div style="display: flex;justify-content: flex-end;" @click="taoCanXiangMuShow = !taoCanXiangMuShow">
  113. <u-icon name="arrow-up" v-if="taoCanXiangMuShow"></u-icon>
  114. <u-icon name="arrow-down" v-else></u-icon>
  115. </div>
  116. </u-form-item>
  117. <view v-if="taoCanXiangMuShow && form.taoCanXiangMuList && form.taoCanXiangMuList.length > 0">
  118. <view style="padding: 0 20rpx;">
  119. <view v-for="(it, x) in form.taoCanXiangMuList" :key="x" @click.stop="getSty(it)">
  120. <view class="jiancexiangm">
  121. <view>
  122. {{it.jian_ce_lei_bie_ || ''}}-{{it.jian_ce_xiang_mu_ || ''}}
  123. <text style="color: red;">[{{it.zhe_hou_jia_ge_ || '0'}}元]</text>
  124. </view>
  125. <view>{{it.yi_ju_de_biao_zhu || ''}}</view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- <view class="qingshe">(样品类型、样品运输条件、样品数量、样品规格)组,请填写的必须展开,并且请按顺序填写,不填写的可以隐藏</view> -->
  131. <view class="qingshe">
  132. <view>
  133. ①
  134. </view>
  135. <!-- <view>
  136. @click="form.showBoolean1 = !form.showBoolean1"
  137. <u-icon name="arrow-up" v-if="form.showBoolean1"></u-icon>
  138. <u-icon name="arrow-down" v-else></u-icon>
  139. </view> -->
  140. </view>
  141. <block v-if="form.showBoolean1">
  142. <u-form-item label="样品类型①" required>
  143. <u-input placeholder="请选择样品类型①" v-model="form.yangPinLeiXing" :disabled="type == 'detail'?true :false" />
  144. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('yangpinType1','样品类型')" v-if="type != 'detail'">选择
  145. </u-button>
  146. </u-form-item>
  147. <u-form-item label="样品运输条件①" required>
  148. <u-input placeholder="请选择样品运输条件①" v-model="form.yangBenYunShuTiao" :disabled="type == 'detail'?true :false" />
  149. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('transportType1')" v-if="type != 'detail'">选择
  150. </u-button>
  151. </u-form-item>
  152. <u-form-item label="样品数量①" required>
  153. <uni-number-box v-model="form.shuLiang" v-if="type != 'detail'"></uni-number-box>
  154. <text v-else>{{form.shuLiang}}</text>
  155. </u-form-item>
  156. <u-form-item label="样品规格①" required>
  157. <u-input placeholder="请输入样品规格①(例:1ml/支*10ml离心管 请按照此格式进行填写)" v-model="form.yangPinGuiGe" :disabled="type == 'detail'?true :false" />
  158. <u-button slot="right" type="success" class="btn-back-color" size="mini" @click="sheetClick('specification1','样品规格')" v-if="type != 'detail'">规格
  159. </u-button>
  160. </u-form-item>
  161. </block>
  162. <view v-if="(type == 'detail' && (form.yangPinLeiXingEr || form.yangPinYunShuTiao || form.shuLiangEr > 0 || form.yangPinGuiGeEr)) || type != 'detail'">
  163. <view class="qingshe" @click="form.showBoolean2 = !form.showBoolean2">
  164. <view>
  165. ②
  166. </view>
  167. <view>
  168. <u-icon name="arrow-up" v-if="form.showBoolean2"></u-icon>
  169. <u-icon name="arrow-down" v-else></u-icon>
  170. </view>
  171. </view>
  172. <block v-if="form.showBoolean2">
  173. <u-form-item label="样品类型②" required>
  174. <u-input placeholder="请选择样品类型②" v-model="form.yangPinLeiXingEr" :disabled="type == 'detail'?true :false" />
  175. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('yangpinType2','样品类型')" v-if="type != 'detail'">选择
  176. </u-button>
  177. </u-form-item>
  178. <u-form-item label="样品运输条件②" required>
  179. <u-input placeholder="请选择样品运输条件②" v-model="form.yangPinYunShuTiao" :disabled="type == 'detail'?true :false" />
  180. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('transportType2')" v-if="type != 'detail'">选择
  181. </u-button>
  182. </u-form-item>
  183. <u-form-item label="样品数量②" required>
  184. <uni-number-box v-model="form.shuLiangEr" v-if="type != 'detail'"></uni-number-box>
  185. <text v-else>{{form.shuLiangEr}}</text>
  186. </u-form-item>
  187. <u-form-item label="样品规格②" required>
  188. <u-input placeholder="请输入样品规格②(例:1ml/支*10ml离心管 请按照此格式进行填写)" v-model="form.yangPinGuiGeEr" :disabled="type == 'detail'?true :false" />
  189. <u-button slot="right" type="success" class="btn-back-color" size="mini" @click="sheetClick('specification2','样品规格')" v-if="type != 'detail'">规格
  190. </u-button>
  191. </u-form-item>
  192. </block>
  193. </view>
  194. <view v-if="(type == 'detail' && (form.yangPinLeiXingSan || form.yangPinYunShuSan || form.shuLiangSan > 0 || form.yangPinGuiGeSan)) || type != 'detail'">
  195. <view class="qingshe" @click="form.showBoolean3 = !form.showBoolean3">
  196. <view>
  197. ③
  198. </view>
  199. <view>
  200. <u-icon name="arrow-up" v-if="form.showBoolean3"></u-icon>
  201. <u-icon name="arrow-down" v-else></u-icon>
  202. </view>
  203. </view>
  204. <block v-if="form.showBoolean3">
  205. <u-form-item label="样品类型③" required>
  206. <u-input placeholder="请选择样品类型③" v-model="form.yangPinLeiXingSan" :disabled="type == 'detail'?true :false" />
  207. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('yangpinType3','样品类型')" v-if="type != 'detail'">选择
  208. </u-button>
  209. </u-form-item>
  210. <u-form-item label="样品运输条件③" required>
  211. <u-input placeholder="请选择样品运输条件③" v-model="form.yangPinYunShuSan" :disabled="type == 'detail'?true :false" />
  212. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('transportType3')" v-if="type != 'detail'">选择
  213. </u-button>
  214. </u-form-item>
  215. <u-form-item label="样品数量③" required>
  216. <uni-number-box v-model="form.shuLiangSan" v-if="type != 'detail'"></uni-number-box>
  217. <text v-else>{{form.shuLiangSan}}</text>
  218. </u-form-item>
  219. <u-form-item label="样品规格③" required>
  220. <u-input placeholder="请输入样品规格③(例:1ml/支*10ml离心管 请按照此格式进行填写)" v-model="form.yangPinGuiGeSan" :disabled="type == 'detail'?true :false" />
  221. <u-button slot="right" type="success" class="btn-back-color" size="mini" @click="sheetClick('specification3','样品规格')" v-if="type != 'detail'">规格
  222. </u-button>
  223. </u-form-item>
  224. </block>
  225. </view>
  226. <view v-if="(type == 'detail' && (form.yangPinLeiXingSi || form.yangPinYunShuSi || form.shuLiangSi > 0 || form.yangPinGuiGeSi)) || type != 'detail'">
  227. <view class="qingshe" @click="form.showBoolean4 = !form.showBoolean4">
  228. <view>
  229. ④
  230. </view>
  231. <view>
  232. <u-icon name="arrow-up" v-if="form.showBoolean4"></u-icon>
  233. <u-icon name="arrow-down" v-else></u-icon>
  234. </view>
  235. </view>
  236. <block v-if="form.showBoolean4">
  237. <u-form-item label="样品类型④" required>
  238. <u-input placeholder="请选择样品类型④" v-model="form.yangPinLeiXingSi" :disabled="type == 'detail'?true :false" />
  239. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('yangpinType4','样品类型')" v-if="type != 'detail'">选择
  240. </u-button>
  241. </u-form-item>
  242. <u-form-item label="样品运输条件④" required>
  243. <u-input placeholder="请选择样品运输条件④(例:1ml/支*10ml离心管 请按照此格式进行填写)" v-model="form.yangPinYunShuSi" :disabled="type == 'detail'?true :false" />
  244. <u-button type="success" slot="right" class="btn-back-color" size="mini" @click="sheetClick('transportType4')" v-if="type != 'detail'">选择
  245. </u-button>
  246. </u-form-item>
  247. <u-form-item label="样品数量④" required>
  248. <uni-number-box v-model="form.shuLiangSi" v-if="type != 'detail'"></uni-number-box>
  249. <text v-else>{{form.shuLiangSi}}</text>
  250. </u-form-item>
  251. <u-form-item label="样品规格④" required>
  252. <u-input placeholder="请输入样品规格④" v-model="form.yangPinGuiGeSi" :disabled="type == 'detail'?true :false" />
  253. <u-button slot="right" type="success" class="btn-back-color" size="mini" @click="sheetClick('specification4','样品规格')" v-if="type != 'detail'">规格
  254. </u-button>
  255. </u-form-item>
  256. </block>
  257. </view>
  258. <u-form-item label="项目名称" prop="xiangMuMingCheng" v-if="form.mingChengShow">
  259. <u-input placeholder="请输入项目名称" v-model="form.xiangMuMingCheng" :disabled="type == 'detail'?true :false" />
  260. </u-form-item>
  261. <u-form-item label="样品总价" prop="yangPinZongJia">
  262. <u-input v-model="form.yangPinZongJia" disabled />
  263. </u-form-item>
  264. </u-form>
  265. <view style="height: 110rpx;" v-if="itemType"></view>
  266. <view class="btnBottom" v-if="itemType">
  267. <u-row>
  268. <u-col span="6">
  269. <u-button type="success" class="btn green-back-color" @click="deletSing">取消
  270. </u-button>
  271. </u-col>
  272. <u-col span="6">
  273. <u-button type="success" class="btn btn-back-color" @click="sumbitSing">保存
  274. </u-button>
  275. </u-col>
  276. </u-row>
  277. </view>
  278. </view>
  279. <u-action-sheet :list="list" v-model="sheetShow" @click="actionSheetCallback" z-index="2000">
  280. </u-action-sheet>
  281. <u-select v-model="selectShow" :list="list" @confirm="selectConfirm"></u-select>
  282. <u-calendar v-model="dateShow" :mode="mode" max-date="2050-01-01" @change="dateChange"></u-calendar>
  283. <lin-popup ref="picker" :title="title" :list="list" @onConfirm="onConfirm"></lin-popup>
  284. <u-popup v-model="show" height="800" mode="bottom">
  285. <view>
  286. <view class="jianCeTypeTop u-p-20">
  287. <view class="jianCeTypeLeft" @click.stop="jianCeClick()">
  288. 检测类型选择
  289. </view>
  290. <view class="jianceCenter">
  291. {{form.jianCeType}}
  292. </view>
  293. <view class="closeClass" @click.stop="show = false">
  294. 关闭
  295. </view>
  296. </view>
  297. <view class="jianCeTypeContent u-p-20">
  298. <scroll-view scroll-y="true" class="scroll" :style="{borderRadius: `${mode == 'ios' ? '10px 10px 0 0' : '0'}`}">
  299. <view class="l-action-sheet-box">
  300. <view class="l-address-list" v-for="(item, index) in form.jianCeList" :key="index" v-if="item.jian_ce_lei_bie_ == form.jianCeType">
  301. <view class="l-item">
  302. <view class="l-radio" v-if="type != 'detail'" @click="changeIndex(item,index)">
  303. <text class="l-radio-outer" :class="{'l-radio-checked': item.checked}"></text>
  304. <text class="l-radio-inner"></text>
  305. </view>
  306. <view class="l-info" @click.stop="getSty(item)">
  307. <view class="l-address-desc">
  308. {{item.xiang_mu_bian_hao || ''}}-{{item.jian_ce_xiang_mu_ || ''}}
  309. <text style="color: red;">[{{item.zhe_hou_jia_ge_ || '0'}}元]</text>
  310. </view>
  311. <view class="l-userinfo">
  312. 检测类别:
  313. <text class="l-user-name">{{item.jian_ce_lei_bie_}}</text>
  314. </view>
  315. <view class="l-userinfo">
  316. 报告周期(工作日):
  317. <text class="l-user-name">{{item.bao_gao_zhou_qi_g || '当'}}天</text>
  318. </view>
  319. </view>
  320. </view>
  321. </view>
  322. </view>
  323. </scroll-view>
  324. </view>
  325. </view>
  326. </u-popup>
  327. </view>
  328. </template>
  329. <script>
  330. import order from './test.json'
  331. import linSelect from '@/components/lin-select/lin-select.vue'
  332. import meth from './meth.js'
  333. export default {
  334. components: {
  335. linSelect
  336. },
  337. props: {
  338. jianCeTypeList: {
  339. type: Array,
  340. default: () => {
  341. return []
  342. }
  343. },
  344. taoCanShow: {
  345. type: Boolean,
  346. default: true
  347. },
  348. heTongId: {
  349. type: String,
  350. default: ''
  351. },
  352. item: {
  353. type: Object,
  354. default: function() {
  355. return {};
  356. }
  357. },
  358. itemType: {
  359. type: Boolean,
  360. default: true
  361. },
  362. type: {
  363. type: String,
  364. default: 'add'
  365. },
  366. chuJuBaoGaoYaoQiu: {
  367. type: String,
  368. default: '常规'
  369. },
  370. },
  371. data() {
  372. return {
  373. jianCeShow: true,
  374. taoCanXiangMuShow: true,
  375. checked: false,
  376. errorType: ['toast'],
  377. form: this.item,
  378. //样本状态
  379. sampleStateList: order.sampleState,
  380. sexList: order.sex,
  381. //样本类型
  382. sampleTypeList: [],
  383. //样本运输条件
  384. transportTypeList: order.transportType,
  385. //样本规格
  386. // specificationList: order.specification,
  387. specificationList: [],
  388. validList: order.validList,
  389. list: [],
  390. listType: '',
  391. sheetShow: false,
  392. selectShow: false,
  393. dateShow: false,
  394. mode: 'date',
  395. rules: {
  396. yangPinMingCheng: [{
  397. required: true,
  398. message: '请输入样品名称',
  399. trigger: 'blur',
  400. }],
  401. songJianPiHao: [{
  402. required: true,
  403. message: '请输入送检批号/编号',
  404. trigger: 'blur',
  405. }],
  406. yangPinZhuangTai: [{
  407. required: true,
  408. message: '请输入样本状态',
  409. trigger: 'blur',
  410. }],
  411. songJianShiJian: [{
  412. required: true,
  413. message: '请输入送检时间',
  414. trigger: 'blur',
  415. }],
  416. },
  417. title: '',
  418. show: false
  419. }
  420. },
  421. created() {
  422. this.getYpbzggb()
  423. this.getYplxb()
  424. },
  425. methods: {
  426. //获取初始化数据,在添加使用
  427. getInit(data) {
  428. this.form = JSON.parse(JSON.stringify(data))
  429. },
  430. //样品类型
  431. getYplxb() {
  432. let sql =
  433. `select lei_xing_ from t_yplxb order by create_time_ desc`
  434. let requestData = this.$sig(sql)
  435. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  436. if (res.data.state == 200) {
  437. const datas = res.data.variables.data
  438. if (datas.length > 0) {
  439. datas.forEach(item => {
  440. this.$set(item, 'name', item.lei_xing_)
  441. })
  442. this.sampleTypeList = datas
  443. }
  444. }
  445. })
  446. },
  447. //样品规格
  448. getYpbzggb() {
  449. let sql =
  450. `select yang_pin_gui_ge_ from t_ypbzggb order by create_time_ desc`
  451. let requestData = this.$sig(sql)
  452. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  453. if (res.data.state == 200) {
  454. const datas = res.data.variables.data
  455. if (datas.length > 0) {
  456. datas.forEach(item => {
  457. this.$set(item, 'name', item.yang_pin_gui_ge_)
  458. })
  459. this.specificationList = datas
  460. }
  461. }
  462. })
  463. },
  464. //委托项目 点击事件
  465. changeIndex(it, x) {
  466. let taoCanXiangMuList = this.form.taoCanXiangMuList
  467. if (taoCanXiangMuList.length > 0 && !it.checked) {
  468. //判断是否与套餐项目相同
  469. let showData = taoCanXiangMuList.findIndex(item => item.id_ == it.id_)
  470. if (showData >= 0) {
  471. uni.showToast({
  472. title: it.xiang_mu_bian_hao + '项目与套餐项目相同',
  473. icon: 'none',
  474. duration: 1000
  475. })
  476. }
  477. }
  478. let itemData = this.form
  479. this.form.jianCeList[x].checked = !this.form.jianCeList[x].checked
  480. let show = itemData.jianCeList.some(item => (item.id_ == '1039826037036285952' || item.id_ ==
  481. '1040205909151711232') && item.checked)
  482. if (show) {
  483. itemData.mingChengShow = true
  484. } else {
  485. itemData.xiangMuMingCheng = ''
  486. itemData.mingChengShow = false
  487. }
  488. this.getTotal()
  489. },
  490. //套餐添加事件
  491. changeTaoCanIndex(it, x, checked) {
  492. let itemData = this.form
  493. //checked 判断套餐是否被选中
  494. if (!checked) {
  495. let itList = it.xuan_ze_jian_ce_x.split(',')
  496. let arr = itemData.taoCanXiangMuList.map(item => item.id_)
  497. //判断现选的套餐跟已选套餐是否有相同的
  498. var cList = itList.filter((item) => arr.some((ite) => ite === item))
  499. if (cList.length > 0) {
  500. uni.showToast({
  501. title: it.tao_can_ming_chen + '与其他套餐的检测项目相同,请选择其他套餐',
  502. icon: 'none',
  503. duration: 2000
  504. })
  505. return
  506. }
  507. } else {
  508. itemData.taoCanXiangMuList = itemData.taoCanXiangMuList.filter(item => item.tao_can_zhu_jian_ !== it
  509. .id_)
  510. }
  511. this.form.taoCanList[x].checked = !this.form.taoCanList[x].checked
  512. if (!checked) {
  513. this.taoCanChange(it.id_)
  514. } else {
  515. this.getTotal()
  516. }
  517. },
  518. //计算检测项目和套餐价格
  519. getTotal() {
  520. var itemTotal = 0
  521. this.form.jianCeList.forEach((it, x) => {
  522. if (it.checked) {
  523. itemTotal += parseFloat(it.zhe_hou_jia_ge_ || 0)
  524. }
  525. })
  526. this.form.taoCanXiangMuList.forEach((it, x) => {
  527. itemTotal += parseFloat(it.zhe_hou_jia_ge_ || 0)
  528. })
  529. if (this.chuJuBaoGaoYaoQiu == '加急') {
  530. itemTotal = itemTotal * 1.2
  531. } else if (this.chuJuBaoGaoYaoQiu == '特急') {
  532. itemTotal = itemTotal * 1.5
  533. } else {
  534. itemTotal = itemTotal
  535. }
  536. this.form.yangPinZongJia = (itemTotal).toFixed(2)
  537. if (!this.itemType) {
  538. this.$emit("countTotal")
  539. }
  540. },
  541. //弹出框初始化
  542. selectClick(type) {
  543. this.listType = type
  544. this.selectShow = true
  545. if (type == 'jianCeType') {
  546. this.list = this.jianCeTypeList
  547. }
  548. },
  549. //弹出框初始化
  550. sheetClick(type, title = '') {
  551. this.listType = type
  552. this.title = title
  553. if (type == 'state') {
  554. this.list = this.sampleStateList
  555. }
  556. //1
  557. if (type.includes('yangpinType')) {
  558. this.list = this.sampleTypeList
  559. }
  560. if (type.includes('transportType')) {
  561. this.list = this.transportTypeList
  562. }
  563. if (type.includes('specification')) {
  564. this.list = this.specificationList
  565. }
  566. if (type == 'disposition') {
  567. this.list = this.dispositionList
  568. }
  569. if (type == 'jianCeType') {
  570. this.list = this.jianCeTypeList
  571. }
  572. if (type.includes('specification') || type.includes('yangpinType') || type == 'jianCeType') {
  573. this.$refs['picker'].show();
  574. } else {
  575. this.sheetShow = true
  576. }
  577. },
  578. //弹出框初始化
  579. selectConfirm(e) {
  580. let that = this
  581. let lists = that.form
  582. if (this.listType == 'jianCeType') {
  583. lists.jianCeType = e[0].value
  584. }
  585. },
  586. //下拉框回调
  587. actionSheetCallback(e) {
  588. let that = this
  589. let lists = that.form
  590. switch (this.listType) {
  591. case 'state':
  592. lists.yangPinZhuangTai = this.list[e].text
  593. break
  594. case 'transportType1':
  595. lists.yangBenYunShuTiao = that.list[e].text
  596. break
  597. case 'transportType2':
  598. lists.yangPinYunShuTiao = that.list[e].text
  599. break
  600. case 'transportType3':
  601. lists.yangPinYunShuSan = that.list[e].text
  602. break
  603. case 'transportType4':
  604. lists.yangPinYunShuSi = that.list[e].text
  605. break
  606. case 'disposition':
  607. this.form.yangBenChuLi = this.list[e].text
  608. break
  609. }
  610. },
  611. //调用日期组件
  612. dateClick(type) {
  613. if (type == 'inspect') {
  614. this.listType = type
  615. this.mode = 'date'
  616. this.dateShow = true
  617. }
  618. },
  619. //日期回调
  620. dateChange(e) {
  621. if (this.listType == 'inspect') {
  622. this.form.songJianShiJian = e.result
  623. }
  624. },
  625. //根据套餐查询套餐项目
  626. taoCanChange(i) {
  627. let sql =
  628. `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}'`
  629. let requestData = this.$sig(sql)
  630. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  631. if (res.data.state == 200) {
  632. const datas = res.data.variables.data
  633. let list = []
  634. datas.forEach(item => {
  635. this.form.taoCanXiangMuList.push(item)
  636. //判断与常规项目是否相同
  637. let ypglOne = this.form.jianCeList
  638. ypglOne.forEach(it => {
  639. if ((item.id_ == it.id_) && it.checked) {
  640. list.push(it.xiang_mu_bian_hao)
  641. }
  642. })
  643. })
  644. if (list.length > 0) {
  645. uni.showToast({
  646. title: list.join(",") + '项目与已常规项目相同',
  647. icon: 'none',
  648. duration: 1000
  649. })
  650. }
  651. this.getTotal()
  652. }
  653. })
  654. },
  655. //取消事件
  656. deletSing() {
  657. this.$emit("deletClick")
  658. },
  659. //保存事件
  660. sumbitSing() {
  661. if (this.form.yangPinZongJia == '') {
  662. this.form.yangPinZongJia = 0
  663. }
  664. for (let item of this.validList) {
  665. if (this.form[item.value] == '') {
  666. this.$showToast.getShowToast(item.toast, item.num)
  667. return
  668. }
  669. }
  670. if (!meth.getJudge(this.form)) {
  671. return
  672. }
  673. this.$refs.uForm.validate(valid => {
  674. if (valid) {
  675. this.$emit("sumbitSingClick", this.form)
  676. } else {
  677. uni.showToast({
  678. title: '必填项未填写',
  679. icon: 'none',
  680. duration: 2000
  681. })
  682. }
  683. });
  684. },
  685. //检测项目详情
  686. getSty(item) {
  687. this.$emit('getParentContent', item)
  688. },
  689. checkBoxChange(e) {
  690. this.form.jianCeTypeString = e
  691. },
  692. checkedChange() {
  693. this.checked = !this.checked
  694. if (this.form.jianCeList && this.form.jianCeList.length > 0) {
  695. this.form.jianCeList.forEach(item => {
  696. if (this.form.jianCeTypeString.indexOf(item.jian_ce_lei_bie_) !== -1) {
  697. item.checked = this.checked
  698. }
  699. })
  700. }
  701. },
  702. onConfirm(e) {
  703. let that = this
  704. let lists = that.form
  705. switch (this.listType) {
  706. case 'yangpinType1':
  707. lists.yangPinLeiXing = that.list[e].name
  708. break
  709. case 'yangpinType2':
  710. lists.yangPinLeiXingEr = that.list[e].name
  711. break
  712. case 'yangpinType3':
  713. lists.yangPinLeiXingSan = that.list[e].name
  714. break
  715. case 'yangpinType4':
  716. lists.yangPinLeiXingSi = that.list[e].name
  717. break
  718. case 'specification1':
  719. lists.yangPinGuiGe = that.list[e].name
  720. break
  721. case 'specification2':
  722. lists.yangPinGuiGeEr = that.list[e].name
  723. break
  724. case 'specification3':
  725. lists.yangPinGuiGeSan = that.list[e].name
  726. break
  727. case 'specification4':
  728. lists.yangPinGuiGeSi = that.list[e].name
  729. break
  730. case 'jianCeType':
  731. lists.jianCeType = that.list[e].name
  732. this.$refs['picker'].hide();
  733. this.show = true
  734. break
  735. }
  736. },
  737. jianCeClick() {
  738. this.show = false
  739. this.sheetClick('jianCeType', '检测类型')
  740. }
  741. },
  742. onReady() {
  743. this.$refs.uForm.setRules(this.rules);
  744. }
  745. }
  746. </script>
  747. <style lang="scss" scoped>
  748. .qingshe {
  749. background-color: #f0f9eb;
  750. color: #67c23a;
  751. padding: 15rpx 20rpx;
  752. border-radius: 8rpx;
  753. display: flex;
  754. justify-content: space-between;
  755. align-items: center;
  756. margin-top: 25rpx;
  757. }
  758. .btnBottom {
  759. z-index: 1500;
  760. // height: 220rpx;
  761. background-color: #FFFFFF;
  762. position: fixed;
  763. bottom: 0;
  764. left: 0;
  765. right: 0;
  766. .btn {
  767. margin: 20rpx;
  768. }
  769. }
  770. .jiancexiangm {
  771. padding: 10rpx 30rpx;
  772. // width: 100%;
  773. padding: 20rpx;
  774. margin-bottom: 20rpx;
  775. background-color: #f1f1f1;
  776. border-radius: 8rpx;
  777. font-size: 26rpx;
  778. color: $u-content-color;
  779. line-height: 1.7;
  780. view {
  781. line-height: 30rpx;
  782. }
  783. }
  784. .btnBox {
  785. display: flex;
  786. flex-wrap: wrap;
  787. .btnSin {
  788. margin: 10rpx 5rpx;
  789. }
  790. }
  791. // .ellipsis {
  792. // width: 100%;
  793. // display: inline-block;
  794. // white-space: nowrap;
  795. // overflow: hidden;
  796. // text-overflow: ellipsis;
  797. // }
  798. .scroll {
  799. width: 100%;
  800. height: calc(100% - 35px);
  801. margin: 5px 0;
  802. }
  803. .l-address-list {
  804. width: 100%;
  805. height: auto;
  806. }
  807. .l-item {
  808. margin: 0px auto 10px;
  809. background-color: #f1f1f1;
  810. border-radius: 5px;
  811. padding: 5px 0;
  812. display: flex;
  813. align-items: center;
  814. }
  815. .l-radio {
  816. display: inline-block;
  817. width: 16px;
  818. height: 16px;
  819. position: relative;
  820. margin: 10px;
  821. }
  822. .l-radio .l-radio-outer {
  823. position: absolute;
  824. display: block;
  825. width: 20px;
  826. height: 20px;
  827. border: 1px solid #e5e5e5;
  828. border-radius: 50%;
  829. background-color: #ffffff;
  830. box-sizing: border-box;
  831. }
  832. .l-radio .l-radio-checked {
  833. background-color: #ffbb1b;
  834. }
  835. .l-radio .l-radio-inner {
  836. position: absolute;
  837. top: 7px;
  838. left: 7px;
  839. width: 6px;
  840. height: 6px;
  841. background-color: #ffffff;
  842. border-radius: 50%;
  843. }
  844. .l-info {
  845. display: inline-block;
  846. }
  847. .l-address-desc {
  848. font-size: 14px;
  849. display: block;
  850. padding: 2px 10px;
  851. }
  852. .l-userinfo {
  853. padding: 2px 10px;
  854. }
  855. .l-userinfo text {
  856. font-size: 12px;
  857. color: #666666;
  858. }
  859. .l-user-tel {
  860. padding: 0 10px;
  861. }
  862. .jianCeTypeTop {
  863. position: fixed;
  864. left: 0;
  865. right: 0;
  866. background-color: #FFFFFF;
  867. z-index: 1300;
  868. width: 100%;
  869. display: flex;
  870. justify-content: space-between;
  871. align-items: center;
  872. .closeClass {
  873. color: rgb(41, 121, 255);
  874. width: 170rpx;
  875. text-align: right;
  876. }
  877. .jianCeTypeLeft {
  878. color: #01a39e;
  879. width: 170rpx;
  880. }
  881. .jianceCenter {
  882. display: inline-block;
  883. white-space: nowrap;
  884. overflow: hidden;
  885. text-overflow: ellipsis;
  886. font-weight: bold;
  887. }
  888. }
  889. .jianCeTypeContent {
  890. position: relative;
  891. top: 50rpx;
  892. }
  893. </style>