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