dataDetail.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <el-dialog
  3. title="基础信息"
  4. :visible.sync="dialogVisible"
  5. :close-on-click-modal="false"
  6. :close-on-press-escape="false"
  7. @close="handleClose"
  8. width="1200px"
  9. >
  10. <el-row>
  11. <el-col :span="5">
  12. <span class="label"><span>IC卡卡号:</span>654155444</span>
  13. </el-col>
  14. <el-col :span="5">
  15. <span class="label"><span>农户姓名:</span>张三</span></el-col>
  16. <el-col :span="5">
  17. <span class="label"><span>卡状态:</span>正常</span></el-col>
  18. <el-col :span="4">
  19. <span class="label"><span>办卡时间:</span>2022-02-15</span></el-col>
  20. <el-col :span="5">
  21. <span class="label"><span>所属区域:</span>2022-02-15 </span></el-col>
  22. </el-row>
  23. <el-row style="margin: 20px 0">
  24. <el-col :span="5">
  25. <span class="label"><span>总用水量:</span>65444 m³</span>
  26. </el-col>
  27. <el-col :span="5">
  28. <span class="label"><span>总用电量:</span>65444 m³</span></el-col>
  29. </el-row>
  30. <div style="text-align:right;position:relative">
  31. <el-date-picker
  32. v-model="value1"
  33. type="daterange"
  34. range-separator="至"
  35. start-placeholder="开始日期"
  36. end-placeholder="结束日期">
  37. </el-date-picker>
  38. <el-button type="primary" style="margin-left:10px;">查询</el-button>
  39. </div>
  40. <el-tabs @tab-click="handleClick" style="margin-top:-30px;">
  41. <el-tab-pane label="灌溉记录">
  42. <b-table
  43. ref="tableRef"
  44. :args="{ 'highlight-current-row': true }"
  45. :data="loadData"
  46. :columns="columns"
  47. isShowIndex
  48. >
  49. <template #styleImg="scope">
  50. <el-image
  51. :src="scope.row.imgPreview"
  52. :preview-src-list="[scope.row.imgPreview]"
  53. slot="error"
  54. class="image-slot"
  55. style="width: 100px; height: 50px"
  56. >
  57. <div slot="error" class="image-slot"></div>
  58. </el-image>
  59. </template>
  60. <template #codeNo="scope">
  61. <el-link
  62. type="primary"
  63. :underline="false"
  64. @click="goDetail(scope.row)"
  65. >{{ scope.row.traceCodeApplyConcat }}</el-link
  66. >
  67. </template>
  68. <template #status="scope">
  69. <span style="display:flex;align-items:center;justify-content:center">
  70. {{ scope.row.name }}
  71. </span>
  72. </template>
  73. <template #useNumber="scope">
  74. {{ scope.row.useNumber + '/' + scope.row.totalNumber }}
  75. </template>
  76. <template #finishGoodName="scope">
  77. {{ scope.row.finishGoodName&&scope.row.finishgoodNo?scope.row.finishGoodName + '-' + scope.row.finishgoodNo:'' }}
  78. </template>
  79. </b-table>
  80. </el-tab-pane>
  81. <el-tab-pane label="充值记录">
  82. <b-table
  83. ref="tableRef"
  84. :args="{ 'highlight-current-row': true }"
  85. :data="loadData"
  86. :columns="columns"
  87. isShowIndex
  88. >
  89. <template #styleImg="scope">
  90. <el-image
  91. :src="scope.row.imgPreview"
  92. :preview-src-list="[scope.row.imgPreview]"
  93. slot="error"
  94. class="image-slot"
  95. style="width: 100px; height: 50px"
  96. >
  97. <div slot="error" class="image-slot"></div>
  98. </el-image>
  99. </template>
  100. <template #codeNo="scope">
  101. <el-link
  102. type="primary"
  103. :underline="false"
  104. @click="goDetail(scope.row)"
  105. >{{ scope.row.traceCodeApplyConcat }}</el-link
  106. >
  107. </template>
  108. <template #status="scope">
  109. <span style="display:flex;align-items:center;justify-content:center">
  110. {{ scope.row.name }}
  111. </span>
  112. </template>
  113. <template #useNumber="scope">
  114. {{ scope.row.useNumber + '/' + scope.row.totalNumber }}
  115. </template>
  116. <template #finishGoodName="scope">
  117. {{ scope.row.finishGoodName&&scope.row.finishgoodNo?scope.row.finishGoodName + '-' + scope.row.finishgoodNo:'' }}
  118. </template>
  119. </b-table>
  120. </el-tab-pane>
  121. </el-tabs>
  122. </el-dialog>
  123. </template>
  124. <script>
  125. import BTable from '@/components/Table/index.vue';
  126. import { assign } from 'lodash-es';
  127. import { UPLOAD_TYPE_MAP } from '@/utils/constants';
  128. export default {
  129. props: {
  130. data: {
  131. default() {
  132. return {};
  133. }
  134. },
  135. visible: {
  136. type: Boolean,
  137. default: false
  138. }
  139. },
  140. components:{
  141. BTable
  142. },
  143. data() {
  144. return {
  145. imageUploadType: UPLOAD_TYPE_MAP.FARMING_RECORD,
  146. dialogSubmitLoading: false,
  147. dialogVisible: false,
  148. baseForm: {
  149. productValue: '',
  150. productName: '',
  151. stockAmount: '',
  152. goodsUnit: '',
  153. goodsSpecValue: '',
  154. imageArr1: [],
  155. supplierId: '',
  156. imageArr2: []
  157. },
  158. productList: [],
  159. syinfoList: [],
  160. processList: [],
  161. hasFetched: false,
  162. landList: [], //基地列表
  163. columns: [
  164. {
  165. label: 'IC卡号',
  166. prop: 'person',
  167. customRender: '',
  168. align: 'center'
  169. },
  170. {
  171. label: '充值金额(元)',
  172. prop: 'area',
  173. customRender: '',
  174. align: 'center'
  175. },
  176. {
  177. label: '充值后金额(元)',
  178. prop: 'name',
  179. customRender: '',
  180. align: 'center'
  181. },
  182. {
  183. label: '充值时间',
  184. prop: 'phone',
  185. customRender: 'status',
  186. align: 'center'
  187. }
  188. ]
  189. };
  190. },
  191. computed: {
  192. goodsUnitLable: function () {
  193. }
  194. },
  195. watch: {
  196. visible(val) {
  197. if (val !== this.dialogVisible) {
  198. this.dialogVisible = val;
  199. if (val) {
  200. assign(this.baseForm, this.data);
  201. if (!this.hasFetched) {
  202. this.getProductList();
  203. this.getSyinfoList();
  204. this.getProcessList();
  205. this.hasFetched = true;
  206. }
  207. }
  208. }
  209. },
  210. data: {
  211. deep: true,
  212. handler(val) {
  213. // console.log(val)
  214. assign(this.baseForm, val);
  215. // console.log(this.baseForm)
  216. }
  217. }
  218. },
  219. created() {},
  220. mounted() {},
  221. methods: {
  222. getProductList() {
  223. },
  224. getSyinfoList() {
  225. },
  226. getProcessList() {
  227. },
  228. goProductsPage() {
  229. this.handleClose();
  230. this.$router.push({
  231. path: '/Products',
  232. query: {}
  233. });
  234. },
  235. goSourceInfoPage() {
  236. this.handleClose();
  237. this.$router.push({
  238. path: '/sourceInfo',
  239. query: {
  240. type: 'add'
  241. }
  242. });
  243. },
  244. goProcessPage() {
  245. this.handleClose();
  246. this.$router.push({
  247. path: '/basicsettings/process',
  248. query: {}
  249. });
  250. },
  251. resetForm(formName) {
  252. this.$refs[formName].resetFields();
  253. this.resetFormData();
  254. this.dialogVisible = false;
  255. },
  256. resetFormData() {
  257. this.baseForm = {};
  258. },
  259. submitForm(formName) {
  260. this.$refs[formName].validate((valid) => {
  261. console.log(valid)
  262. })
  263. },
  264. handleClose() {
  265. this.$emit('update:visible', false);
  266. this.resetForm('baseForm');
  267. },
  268. handleSuccess() {
  269. this.resetForm('baseForm');
  270. this.$emit('update:visible', false);
  271. this.$emit('success');
  272. },
  273. handleKeyUp(target, key) {
  274. target[key] = target[key].match(/\d+(\.\d{0,2})?/)
  275. ? target[key].match(/\d+(\.\d{0,2})?/)[0]
  276. : '';
  277. }
  278. }
  279. };
  280. </script>
  281. <style lang="scss" scoped>
  282. ::v-deep.el-dialog__title{
  283. color: #333333;
  284. font-size: 16px;
  285. font-weight: 700;
  286. }
  287. .input-number {
  288. width: 100%;
  289. }
  290. .base-form {
  291. max-height: 70vh;
  292. overflow-y: auto;
  293. overflow-x: hidden;
  294. padding: 0 20px;
  295. }
  296. .label{
  297. color: #333;
  298. span{
  299. color: #999;
  300. font-size: 14px;
  301. font-style: normal;
  302. }
  303. }
  304. </style>
  305. <style lang="css" scoped>
  306. ::v-deep .el-dialog__header {
  307. border-bottom: 1px solid #ebeef5;
  308. }
  309. </style>