lhypbMessage.vue 27 KB

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