lhypbMessage.vue 28 KB

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