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