lhypbMessage.vue 28 KB

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