index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <view class="page">
  3. <view class="DrawerPage" :class="modalName=='DrawerModalL'?'show':''">
  4. <scroll-view scroll-y style="height: 100vh;z-index: 3">
  5. <cu-custom class="home-custom" bgColor=".bg-sancolor"
  6. bgImage="https://ahwgh.oss-cn-hangzhou.aliyuncs.com/enterprise/6525f808df760.png"
  7. :isBack="true">
  8. <block slot="content">抽样单详情</block>
  9. </cu-custom>
  10. <view :style="'z-index:2;position: sticky;top:calc('+CustomBar+'px - 80rpx)' ">
  11. <view class="cu-list menu">
  12. <view class="cu-item" style="min-height: 80rpx">
  13. <view class="content">
  14. <text class="cuIcon-formfill text-black lg"></text>
  15. <text class="text-black">编号:{{ sampleDetailInfo.samplingNumber }}</text>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="bg-white nav solid-bottom">
  20. <view class="flex text-center">
  21. <view class="cu-item flex-sub" :class="pageIndex === 0?'text-blue cur':''"
  22. @tap="pageIndex = 0">
  23. 抽样基本信息
  24. </view>
  25. <view class="cu-item flex-sub" :class="pageIndex === 1?'text-blue cur':''"
  26. @tap="pageIndex = 1">
  27. 抽样样品信息
  28. </view>
  29. <view class="cu-item flex-sub" :class="pageIndex === 2?'text-blue cur':''"
  30. @tap="pageIndex = 2">
  31. 现场照片
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view style="margin-bottom: 130rpx">
  37. <!--基本信息-->
  38. <view v-show="pageIndex === 0">
  39. <view class="cu-list menu">
  40. <view class="cu-bar bg-white margin-top-sm solid-bottom">
  41. <view class="action">
  42. <text class="cuIcon-titles text-green"></text>
  43. <text>被抽查单位信息</text>
  44. </view>
  45. </view>
  46. <form>
  47. <view class="cu-form-group">
  48. <view class="title">单位名称</view>
  49. <view>
  50. {{ sampleDetailInfo.bySampleUnitName}}
  51. </view>
  52. <!-- <input :disabled="input_diabled" placeholder="请输入单位名称" name="input"
  53. v-model="sampleDetailInfo.bySampleUnitName"></input>-->
  54. </view>
  55. <view class="cu-form-group ">
  56. <view class="title">单位地址</view>
  57. <input placeholder="请输入单位地址"
  58. name="input"
  59. v-model="sampleDetailInfo.bySampleAddress" disabled></input>
  60. </view>
  61. <view class="cu-form-group ">
  62. <view class="title">联系人</view>
  63. <input placeholder="请输入联系人" name="input"
  64. v-model="sampleDetailInfo.bySampleContactName" disabled></input>
  65. </view>
  66. <view class="cu-form-group ">
  67. <view class="title">电话</view>
  68. <input placeholder="请输入电话" name="input"
  69. v-model="sampleDetailInfo.bySampleContactPhone" disabled></input>
  70. </view>
  71. </form>
  72. <view class="cu-bar bg-white margin-top-sm solid-bottom">
  73. <view class="action">
  74. <text class="cuIcon-titles text-green"></text>
  75. <text>抽样单位信息</text>
  76. </view>
  77. </view>
  78. <form>
  79. <view class="cu-form-group">
  80. <view class="title">单位名称</view>
  81. <input placeholder="请输入单位名称" name="input"
  82. v-model="sampleDetailInfo.sampleUnitName" disabled></input>
  83. </view>
  84. <view class="cu-form-group ">
  85. <view class="title">单位地址</view>
  86. <input placeholder="请输入单位地址" name="input"
  87. v-model="sampleDetailInfo.sampleAddress" disabled></input>
  88. </view>
  89. <view class="cu-form-group ">
  90. <view class="title">联系人</view>
  91. <input placeholder="请输入联系人" name="input"
  92. v-model="sampleDetailInfo.sampleContactName" disabled></input>
  93. </view>
  94. <view class="cu-form-group">
  95. <view class="title">电话</view>
  96. <input placeholder="请输入电话" name="input"
  97. v-model="sampleDetailInfo.sampleContactPhone" disabled></input>
  98. </view>
  99. <view class="cu-form-group align-start">
  100. <view class="title">备注</view>
  101. <textarea placeholder="抽样备注" name="input"
  102. v-model="sampleDetailInfo.samplingMask" disabled></textarea>
  103. </view>
  104. </form>
  105. <!-- <view class="padding flex flex-direction">
  106. <button class="cu-btn bg-green lg" @tap="toSampleInfoList(sampleDetailInfo.id)">管理样品
  107. </button>
  108. </view>-->
  109. </view>
  110. </view>
  111. <view v-show="pageIndex === 1">
  112. <view class="cu-bar bg-white margin-top-sm solid-bottom">
  113. <view class="action">
  114. <text class="cuIcon-titles text-green"></text>
  115. <text>抽样基地信息</text>
  116. </view>
  117. </view>
  118. <form>
  119. <view class="cu-form-group">
  120. <view class="title">抽样地点</view>
  121. <input placeholder="请选择抽样地点" name="input"
  122. v-model="sampleDetailInfo.samplingAddress" disabled>
  123. </view>
  124. </form>
  125. <view class="cu-bar bg-white margin-top-sm solid-bottom">
  126. <view class="action">
  127. <text class="cuIcon-titles text-green"></text>
  128. <text>抽样信息</text>
  129. </view>
  130. </view>
  131. <view class="padding-sm" style="padding-bottom: 180upx">
  132. <view class="cu-list menu bg-white"
  133. v-for="(item, index) in ahSampleDetailList" :key="index">
  134. <view class="cu-item">
  135. <view class="title text-black text-bold text-lg">
  136. <text class="cuIcon-titles text-green"></text>
  137. {{ index + 1 }}.{{ item.name }}
  138. </view>
  139. <view class="action">
  140. {{ item.samplingDate }}
  141. </view>
  142. </view>
  143. <view class="content detail padding-sm solid-bottom">
  144. <view class="text-gray">样品来源:{{ item.source }}</view>
  145. <view class="text-gray">抽样数量:{{ item.samplingNumber }}{{ item.samplingType }}</view>
  146. <view class="text-gray">抽样基数:{{ item.samplingBase }}{{ item.samplingType }}</view>
  147. <view class="text-gray">生产日期:{{ item.manufactureDate }}</view>
  148. </view>
  149. </view>
  150. <view class="radius shadow-warp bg-white text-lg" v-if="ahSampleDetailList.length === 0">
  151. <view class="cu-list menu-avatar">
  152. <view class="cu-item">
  153. <view class="content">
  154. <view class="text-sm text-center" style="justify-content: center;">
  155. <text class="text-cut text-lg">
  156. <text class="cuIcon-warn text-yellow margin-right-xs text-xl"></text>
  157. 未查询到样本数据
  158. </text>
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. </view>
  164. </view>
  165. <view class="padding flex flex-direction padding-bottom-xl fixedFootBtn bg-white padding-top-xs" v-if="!sampleDetailInfo.commitPeopleId">
  166. <button class="cu-btn bg-blue lg margin-top-sm shadow-blur" type="" v-if="input_diabled"
  167. @tap="submitSampleSheet">确认抽样单
  168. </button>
  169. </view>
  170. </view>
  171. <view v-show="pageIndex === 2">
  172. <view class="cu-list menu">
  173. <view class="cu-bar bg-white margin-top-sm solid-bottom">
  174. <view class="action">
  175. <text class="cuIcon-titles text-green"></text>
  176. <text>抽样单照片</text>
  177. </view>
  178. </view>
  179. <view class="cu-form-group">
  180. <view class="grid col-3 grid-square flex-sub">
  181. <view class="bg-img" @tap="ViewImage(sampleDetailInfo.sampleSheetPhoto)" v-if="sampleDetailInfo.sampleSheetPhoto">
  182. <image :src='sampleDetailInfo.sampleSheetPhoto' mode='aspectFill'></image>
  183. </view>
  184. <view class="solids" v-if="!sampleDetailInfo.sampleSheetPhoto">
  185. <text>未上传</text>
  186. </view>
  187. </view>
  188. </view>
  189. <view class="cu-bar bg-white margin-top-sm solid-bottom">
  190. <view class="action">
  191. <text class="cuIcon-titles text-green"></text>
  192. <text>封样照片</text>
  193. </view>
  194. </view>
  195. <view class="cu-form-group">
  196. <view class="grid col-3 grid-square flex-sub">
  197. <view class="bg-img" @tap="ViewImage(sampleDetailInfo.sealingPhoto)" v-if="sampleDetailInfo.sealingPhoto">
  198. <image :src='sampleDetailInfo.sealingPhoto' mode='aspectFill'></image>
  199. </view>
  200. <view class="solids" v-if="!sampleDetailInfo.sealingPhoto">
  201. <text>未上传</text>
  202. </view>
  203. </view>
  204. </view>
  205. <view class="cu-bar bg-white margin-top-sm solid-bottom">
  206. <view class="action">
  207. <text class="cuIcon-titles text-green"></text>
  208. <text>抽样人员合影照片</text>
  209. </view>
  210. </view>
  211. <view class="cu-form-group">
  212. <view class="grid col-3 grid-square flex-sub">
  213. <view class="bg-img" @tap="ViewImage(sampleDetailInfo.groupPhoto)" v-if="sampleDetailInfo.groupPhoto">
  214. <image :src='sampleDetailInfo.groupPhoto' mode='aspectFill'></image>
  215. </view>
  216. <view class="solids" v-if="!sampleDetailInfo.groupPhoto">
  217. <text>未上传</text>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. </view>
  223. </view>
  224. <view class="padding flex flex-direction padding-bottom-xl fixedFootBtn bg-white padding-top">
  225. <button class="cu-btn bg-blue lg shadow-blur" type="" @tap="submitSampleSheet">确认抽样单</button>
  226. </view>
  227. </scroll-view>
  228. </view>
  229. </view>
  230. </template>
  231. <script>
  232. import { _checkModel } from "../check-model";
  233. export default {
  234. data() {
  235. return {
  236. CustomBar: this.CustomBar,
  237. pageIndex: 0,
  238. sampleDetailInfo: {},
  239. ahSampleDetailList: [],
  240. };
  241. },
  242. onLoad(options) {
  243. this.getSampleInfoDetail(options.id);
  244. },
  245. methods: {
  246. getSubXzqList(xzqdm) {
  247. return new Promise(resolve => {
  248. _checkModel.getSubXzqList(xzqdm, res => {
  249. resolve(res);
  250. });
  251. });
  252. },
  253. getSampleInfoDetail(id) {
  254. _checkModel.getAhSampleSheetDetail(id, res => {
  255. const {code,data,message} = res;
  256. if(code === 200){
  257. console.log("getAhSampleSheetDetail",data);
  258. this.sampleDetailInfo = data.ahSampleSheet;
  259. //查询抽样样品信息
  260. this.getSampleSheetDetailData();
  261. }else{
  262. this.$msg(message);
  263. this.input_diabled = true;
  264. }
  265. });
  266. },
  267. submitSampleSheet(){
  268. uni.showModal({
  269. title: "提示",
  270. content: "确认完成当前抽样单",
  271. cancelText: "取消",
  272. confirmText: "确认",
  273. success: res => {
  274. if (res.confirm) {
  275. _checkModel.submitSampleSheetNJB(this.sampleDetailInfo.id,res=>{
  276. const {code,message} = res;
  277. if(code === 200){
  278. this.$msg("确认成功");
  279. setTimeout(() => {
  280. uni.navigateTo({
  281. url: '/pages/sample-check-list/index'
  282. })
  283. }, 1500)
  284. } else {
  285. this.$msg(message);
  286. }
  287. })
  288. }
  289. }})
  290. },
  291. getSampleSheetDetailData() {
  292. _checkModel.getSampleSheetDetailData({
  293. sampleSheetId: this.sampleDetailInfo.id,
  294. pageNum: 1,
  295. pageSize: 100
  296. }, res => {
  297. const { code, message, data: { records } } = res;
  298. if (code === 200) {
  299. this.ahSampleDetailList = records;
  300. } else {
  301. this.$msg(message);
  302. }
  303. });
  304. },
  305. ViewImage(url) {
  306. uni.previewImage({
  307. urls: [url],
  308. current: url
  309. });
  310. },
  311. }
  312. };
  313. </script>
  314. <style scoped>
  315. .page {
  316. /*background-image: var(--gradualBlue);*/
  317. background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
  318. width: 100vw;
  319. overflow: hidden;
  320. }
  321. .DrawerPage .nav .cu-item.cur {
  322. border-bottom: 4rpx solid;
  323. }
  324. .DrawerPage .nav .cu-item.cur::after {
  325. content: none;
  326. }
  327. /*.nav .cu-item{
  328. height: 70rpx;
  329. line-height: 70rpx;
  330. }*/
  331. .cu-modal.drawer-modal .cu-dialog {
  332. min-width: 85vw;
  333. }
  334. .btDialog {
  335. min-height: 80vh;
  336. }
  337. .detail view {
  338. height: 1.8em;
  339. line-height: 1.8em !important;
  340. border: none;
  341. color: gray;
  342. }
  343. .tools {
  344. display: flex;
  345. align-items: center;
  346. justify-content: space-between;
  347. padding: 20upx;
  348. }
  349. .fixedFootBtn {
  350. border-top: 1px solid #ddd;
  351. position: fixed;
  352. width: 100vw;
  353. bottom: 0;
  354. z-index: 1000;
  355. }
  356. </style>