lhypbMessage.vue 28 KB

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