inspectDtlNew.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <view>
  3. <view class="uni-form-item uni-column">
  4. <view class="uni-flex uni-row">
  5. <view class="title" style="width: 190rpx;">交验单号:</view>
  6. <input class="uni-input" style="font-size: 40rpx;font-weight: bold;color: black;" disabled="true" v-model="deliverNo"/>
  7. </view>
  8. <view class="uni-flex uni-row" style="margin-top: 3px;margin-bottom: 3px;">
  9. <view class="title" style="width: 190rpx;">规格型号\图号:</view>
  10. <input class="uni-input" style="margin-right: 5px;" :focus="foucusIndex === 0" v-model="materialSpecCode" placeholder="请输入规格型号\图号" @confirm="confirmFun"/>
  11. </view>
  12. <!-- 2024 孙亚龙新增的注释。 由于不确定是哪个业务要加状态过滤查询条件,所以暂时注释掉代码 -->
  13. <view class="uni-flex uni-row" style="margin-top: 5px;margin-bottom: 8px;">
  14. <view class="title">质检状态:</view>
  15. <view style="padding-top: 10rpx;padding-bottom: 10rpx;">
  16. <uni-data-checkbox v-model="CheckStatus" :localdata="CheckStatusData"></uni-data-checkbox>
  17. </view>
  18. </view>
  19. <view class="uni-flex uni-row">
  20. <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;" @click="queryFun">查 询</button>
  21. <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;margin-right: 5px;" @click="resetCondition">重 置</button>
  22. </view>
  23. </view>
  24. <button type="primary" style="margin-left: 5px;margin-right: 5px;" @click="submitInspectResult">提 交 质 检 结 果</button>
  25. <uni-section title="待质检的交验单明细:" type="line" style="margin-bottom: 3px;padding: 3px;">
  26. <view class="my-tips-view" v-if="isShowTips">没有查询到交验单明细数据......</view>
  27. <uni-pagination :total="total" :current="current" :pageSize="pageSize" @change="pageChange" title="标题文字" v-if="!isShowTips" style="margin: 4px;"/>
  28. <view v-if="!isShowTips" style="text-align: center;">
  29. <text class="example-info">数据总量:{{ total }}条,每页数据:{{ pageSize }}</text>
  30. </view>
  31. <view v-for="(newsitem,key) in sapDeliverDtlList" :key="key">
  32. <view class="myDeliverDetail" @click="myDeliverDetailClick(newsitem)">
  33. <view style="flex-direction: row;flex-direction: row;height: 25px;display: flex;padding: 2px;border-radius: 5px 5px;">
  34. <text style="align-self: center;">物料编号:</text>
  35. <text style="align-self: center;font-size: 30rpx;font-weight: bold;">{{newsitem.materialCode}}</text>
  36. <text :class="newsitem.keyFlag ? 'keyFlagRed' : 'keyFlagGray'" style="align-self: center;margin-left: 20px;">{{newsitem.keyFlag ? '★' : '■'}}</text>
  37. </view>
  38. <view class="line-h"></view>
  39. <view style="flex-direction: row;flex-direction: row;display: flex;-webkit-justify-content: space-between;justify-content: space-between;">
  40. <view>
  41. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  42. <text style="align-self: center;color: #555;font-size: 25rpx;">物料名称:</text>
  43. <text style="align-self: center;font-size: 25rpx;word-wrap: break-word;width: 200px;">{{newsitem.materialName}}</text>
  44. </view>
  45. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  46. <text style="align-self: center;color: #555;font-size: 25rpx;">规格型号/图号:</text>
  47. <text style="align-self: center;font-size: 30rpx;font-weight: bold;word-wrap: break-word;width: 200px;">{{newsitem.materialSpec}}</text>
  48. </view>
  49. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  50. <text style="align-self: center;color: #555;font-size: 25rpx;">交验单数量:</text>
  51. <text style="align-self: center;font-size: 35rpx;font-weight: bold;color: blue;">{{newsitem.sumQty}}</text>
  52. </view>
  53. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  54. <text style="align-self: center;color: #555;font-size: 25rpx;">已质检数量:</text>
  55. <text style="align-self: center;font-size: 35rpx;font-weight: bold;color: blue;">{{newsitem.sumCheckQty}}</text>
  56. </view>
  57. </view>
  58. <view v-if="newsitem.sumCheckQty < newsitem.sumQty" style="border-radius: 35px;width: 35px; background-color: lime;height: 35px;align-self: center;margin-right: 5px;"></view>
  59. <view v-else style="border-radius: 35px;width: 35px; background-color: lightgray;height: 35px;align-self: center;margin-right: 5px;"></view>
  60. </view>
  61. </view>
  62. </view>
  63. </uni-section>
  64. </view>
  65. </template>
  66. <script>
  67. export default {
  68. data() {
  69. return {
  70. deliverNo: '',
  71. foucusIndex: 0,
  72. materialSpecCode: '',
  73. isShowTips: true,
  74. sapDeliverDtlList:[],
  75. current: 1,
  76. total: 0,
  77. pageSize: 10,
  78. //2024 孙亚龙新增的注释。 由于不确定是哪个业务要加状态过滤查询条件,所以暂时注释掉代码
  79. CheckStatus: -1,
  80. CheckStatusData: [{
  81. value: -1,
  82. text: '全部'
  83. },{
  84. value: 0,
  85. text: '已质检'
  86. },{
  87. value: 1,
  88. text: '未质检'
  89. }
  90. ]
  91. }
  92. },
  93. onLoad(option) {
  94. this.deliverNo = option.deliverNo;
  95. this.queryFun()
  96. uni.$on('CallSapDeliverDtlQueryFunc', this.CallSapDeliverDtlQueryFunc)
  97. },
  98. onUnload() {
  99. uni.$off('CallSapDeliverDtlQueryFunc', this.CallSapDeliverDtlQueryFunc)
  100. },
  101. methods: {
  102. async queryFun() {
  103. uni.showLoading({
  104. title: "正在查询...",
  105. mask: true,
  106. })
  107. this.sapDeliverDtlList = []
  108. let parm = {
  109. url : '/business/SapDeliverRecord/GetSapDeliverRecordSumList',
  110. data: {
  111. DeliverNo: this.deliverNo,
  112. MaterialSpec: this.materialSpecCode,
  113. CheckStatus: this.CheckStatus,
  114. PageNum: this.current,
  115. PageSize: this.pageSize
  116. },
  117. method: 'GET',
  118. isHaveToken : true
  119. }
  120. let retData = await getApp().RequestData(parm)
  121. if(retData.isSuccess) {
  122. if(retData.data.code == 200) {
  123. let len = retData.data.data.result.length
  124. this.total = retData.data.data.totalNum
  125. if(len > 0) {
  126. this.isShowTips = false
  127. }
  128. else {
  129. this.isShowTips = true
  130. }
  131. this.sapDeliverDtlList = retData.data.data.result
  132. }
  133. else {
  134. this.isShowTips = true
  135. }
  136. }
  137. else {
  138. this.isShowTips = true
  139. }
  140. uni.hideLoading()
  141. },
  142. resetCondition() {
  143. this.materialSpecCode = ""
  144. this.sapDeliverDtlList = []
  145. this.CheckStatus = -1
  146. this.isShowTips = true
  147. this.foucusIndex = 1
  148. setTimeout(() => {
  149. this.foucusIndex = 0;
  150. }, 150)
  151. },
  152. confirmFun() {
  153. this.queryFun()
  154. },
  155. myDeliverDetailClick(model) {
  156. model.deliverNo = this.deliverNo;
  157. if(model.sumCheckQty >= model.sumQty) {
  158. uni.showToast({
  159. title: '已全部质检',
  160. icon: 'error',
  161. mask: true,
  162. duration: 1500
  163. })
  164. } else {
  165. uni.navigateTo({
  166. url: '/pages/Inspect/inspectOperate',
  167. success() {
  168. uni.$emit('sendDeliverDtlData',model)
  169. }
  170. });
  171. }
  172. },
  173. async submitInspectResult() {
  174. uni.showLoading({
  175. title: "正在提交数据...",
  176. mask: true,
  177. })
  178. this.sapDeliverDtlList = []
  179. let parm = {
  180. url : '/business/SapDeliverRecord/SubmitInspectResult?deliverNo=' + this.deliverNo,
  181. data: {},
  182. method: 'GET',
  183. isHaveToken : true
  184. }
  185. let retData = await getApp().RequestData(parm)
  186. console.log(retData)
  187. if(retData.isSuccess) {
  188. if(retData.data.code == 200) {
  189. if(retData.data.data) {
  190. uni.hideLoading()
  191. uni.navigateBack({
  192. url: '/pages/Inspect/inspect01',
  193. success: () => {
  194. uni.$emit('QueryInspect01',null);
  195. }
  196. });
  197. }
  198. else {
  199. uni.hideLoading()
  200. uni.showToast({
  201. title: '质检结果提交失败!请检查是否存在未质检完成的数据!!',
  202. icon: 'none',
  203. duration: 2000,
  204. mask:true,
  205. })
  206. }
  207. }
  208. else {
  209. uni.hideLoading()
  210. uni.showToast({
  211. title: '服务器发生错误!' + retData.data.msg,
  212. icon: 'none',
  213. duration: 2000,
  214. mask:true,
  215. })
  216. }
  217. }
  218. else {
  219. uni.hideLoading()
  220. uni.showToast({
  221. title: '服务器发生错误!' + retData.retMsg,
  222. icon: 'none',
  223. duration: 2000,
  224. mask:true,
  225. })
  226. }
  227. },
  228. pageChange(e) {
  229. this.current = e.current
  230. this.queryFun()
  231. },
  232. CallSapDeliverDtlQueryFunc() {
  233. this.materialSpecCode = ""
  234. this.queryFun()
  235. this.foucusIndex = 1
  236. setTimeout(() => {
  237. this.foucusIndex = 0;
  238. }, 150)
  239. }
  240. }
  241. }
  242. </script>
  243. <style lang="scss">
  244. .my-tips-view {
  245. /* margin-top: 50px; */
  246. text-align: center;
  247. color: #999999;
  248. font-size: 20px;
  249. font-weight: normal;
  250. }
  251. .myDeliverDetail {
  252. border: 1px solid #cccccc;
  253. border-radius: 5px;
  254. margin-top: 1px;
  255. }
  256. .myDeliverDetail:active {
  257. background-color: aliceblue;
  258. }
  259. .line-h {
  260. height: 1rpx;
  261. background-color: #cccccc;
  262. }
  263. .keyFlagRed {
  264. color: red;
  265. }
  266. .keyFlagGray {
  267. color: lightgray;
  268. }
  269. </style>