You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

308 lines
11 KiB

5 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="供应商名称">
  9. <a-input placeholder="请输入供应商名称" v-model="queryParam.companyName"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="客户电话">
  14. <a-input placeholder="请输入客户电话" v-model="queryParam.phone"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19. <a-form-item label="审核状态">
  20. <j-dict-select-tag placeholder="请选择审核状态" v-model="queryParam.auditStatus" dictCode="audit_status"/>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  24. <a-form-item label="挂单状态">
  25. <j-dict-select-tag placeholder="请选择挂单状态" v-model="queryParam.showStatus" dictCode="show_status"/>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  29. <a-form-item label="期货现货">
  30. <j-dict-select-tag placeholder="请选择期货现货" v-model="queryParam.productType" dictCode="product_type"/>
  31. </a-form-item>
  32. </a-col>
  33. </template>
  34. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  35. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  36. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  37. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  38. <a @click="handleToggleSearch" style="margin-left: 8px">
  39. {{ toggleSearchStatus ? '收起' : '展开' }}
  40. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  41. </a>
  42. </span>
  43. </a-col>
  44. </a-row>
  45. </a-form>
  46. </div>
  47. <!-- 查询区域-END -->
  48. <!-- 操作按钮区域 -->
  49. <div class="table-operator">
  50. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  51. <a-button type="primary" icon="download" @click="handleExportXls('产品报价表')">导出</a-button>
  52. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  53. <a-button type="primary" icon="import">导入</a-button>
  54. </a-upload>
  55. <!-- 高级查询区域 -->
  56. <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  57. <a-dropdown v-if="selectedRowKeys.length > 0">
  58. <a-menu slot="overlay">
  59. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  60. </a-menu>
  61. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  62. </a-dropdown>
  63. </div>
  64. <!-- table区域-begin -->
  65. <div>
  66. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  67. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
  68. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  69. </div>
  70. <a-table
  71. ref="table"
  72. size="middle"
  73. :scroll="{x:true}"
  74. bordered
  75. rowKey="id"
  76. :columns="columns"
  77. :dataSource="dataSource"
  78. :pagination="ipagination"
  79. :loading="loading"
  80. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  81. class="j-table-force-nowrap"
  82. @change="handleTableChange">
  83. <template slot="htmlSlot" slot-scope="text">
  84. <div v-html="text"></div>
  85. </template>
  86. <template slot="imgSlot" slot-scope="text,record">
  87. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  88. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  89. </template>
  90. <template slot="fileSlot" slot-scope="text">
  91. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  92. <a-button
  93. v-else
  94. :ghost="true"
  95. type="primary"
  96. icon="download"
  97. size="small"
  98. @click="downloadFile(text)">
  99. 下载
  100. </a-button>
  101. </template>
  102. <span slot="action" slot-scope="text, record">
  103. <a @click="handleEdit(record)">编辑</a>
  104. <a-divider type="vertical" />
  105. <a-dropdown>
  106. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  107. <a-menu slot="overlay">
  108. <a-menu-item>
  109. <a @click="handleDetail(record)">详情</a>
  110. </a-menu-item>
  111. <a-menu-item>
  112. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  113. <a>删除</a>
  114. </a-popconfirm>
  115. </a-menu-item>
  116. </a-menu>
  117. </a-dropdown>
  118. </span>
  119. </a-table>
  120. </div>
  121. <tb-product-modal ref="modalForm" @ok="modalFormOk"></tb-product-modal>
  122. </a-card>
  123. </template>
  124. <script>
  125. import '@/assets/less/TableExpand.less'
  126. import { mixinDevice } from '@/utils/mixin'
  127. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  128. import TbProductModal from './modules/TbProductModal'
  129. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  130. export default {
  131. name: 'TbProductList',
  132. mixins:[JeecgListMixin, mixinDevice],
  133. components: {
  134. TbProductModal
  135. },
  136. data () {
  137. return {
  138. description: '产品报价表管理页面',
  139. // 表头
  140. columns: [
  141. {
  142. title: '#',
  143. dataIndex: '',
  144. key:'rowIndex',
  145. width:60,
  146. align:"center",
  147. customRender:function (t,r,index) {
  148. return parseInt(index)+1;
  149. }
  150. },
  151. {
  152. title:'供应商名称',
  153. align:"center",
  154. dataIndex: 'companyName'
  155. },
  156. {
  157. title:'提货地址',
  158. align:"center",
  159. dataIndex: 'address'
  160. },
  161. {
  162. title:'商品规格',
  163. align:"center",
  164. dataIndex: 'specsName'
  165. },
  166. {
  167. title:'报价照片',
  168. align:"center",
  169. dataIndex: 'pic',
  170. scopedSlots: {customRender: 'imgSlot'}
  171. },
  172. {
  173. title:'商品内容图片',
  174. align:"center",
  175. dataIndex: 'picDetail',
  176. scopedSlots: {customRender: 'imgSlot'}
  177. },
  178. {
  179. title:'商品视频',
  180. align:"center",
  181. dataIndex: 'video',
  182. scopedSlots: {customRender: 'fileSlot'}
  183. },
  184. {
  185. title:'检测报告图片',
  186. align:"center",
  187. dataIndex: 'report',
  188. scopedSlots: {customRender: 'imgSlot'}
  189. },
  190. {
  191. title:'检测视频',
  192. align:"center",
  193. dataIndex: 'reportVideo',
  194. scopedSlots: {customRender: 'fileSlot'}
  195. },
  196. {
  197. title:'单价',
  198. align:"center",
  199. dataIndex: 'price'
  200. },
  201. {
  202. title:'暂定数量',
  203. align:"center",
  204. dataIndex: 'num'
  205. },
  206. {
  207. title:'审核状态',
  208. align:"center",
  209. dataIndex: 'auditStatus_dictText'
  210. },
  211. {
  212. title:'挂单状态',
  213. align:"center",
  214. dataIndex: 'showStatus_dictText'
  215. },
  216. {
  217. title:'期货现货',
  218. align:"center",
  219. dataIndex: 'productType_dictText'
  220. },
  221. {
  222. title:'排序',
  223. align:"center",
  224. dataIndex: 'sortNum'
  225. },
  226. {
  227. title:'提货时间',
  228. align:"center",
  229. dataIndex: 'transactionTime',
  230. customRender:function (text) {
  231. return !text?"":(text.length>10?text.substr(0,10):text)
  232. }
  233. },
  234. {
  235. title: '操作',
  236. dataIndex: 'action',
  237. align:"center",
  238. fixed:"right",
  239. width:147,
  240. scopedSlots: { customRender: 'action' }
  241. }
  242. ],
  243. url: {
  244. list: "/product/tbProduct/list",
  245. delete: "/product/tbProduct/delete",
  246. deleteBatch: "/product/tbProduct/deleteBatch",
  247. exportXlsUrl: "/product/tbProduct/exportXls",
  248. importExcelUrl: "product/tbProduct/importExcel",
  249. },
  250. dictOptions:{},
  251. superFieldList:[],
  252. }
  253. },
  254. created() {
  255. this.getSuperFieldList();
  256. },
  257. computed: {
  258. importExcelUrl: function(){
  259. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  260. },
  261. },
  262. methods: {
  263. initDictConfig(){
  264. },
  265. getSuperFieldList(){
  266. let fieldList=[];
  267. fieldList.push({type:'string',value:'companyName',text:'供应商名称',dictCode:''})
  268. fieldList.push({type:'string',value:'phone',text:'客户电话',dictCode:''})
  269. fieldList.push({type:'string',value:'address',text:'提货地址',dictCode:''})
  270. fieldList.push({type:'Text',value:'pic',text:'报价照片',dictCode:''})
  271. fieldList.push({type:'Text',value:'picDetail',text:'商品内容图片',dictCode:''})
  272. fieldList.push({type:'Text',value:'report',text:'检测报告图片',dictCode:''})
  273. fieldList.push({type:'Text',value:'reportVideo',text:'检测视频',dictCode:''})
  274. fieldList.push({type:'Text',value:'video',text:'商品视频',dictCode:''})
  275. fieldList.push({type:'string',value:'specsName',text:'商品规格',dictCode:''})
  276. fieldList.push({type:'BigDecimal',value:'price',text:'单价',dictCode:''})
  277. fieldList.push({type:'int',value:'num',text:'暂定数量、',dictCode:''})
  278. fieldList.push({type:'popup',value:'sortNum',text:'排序', popup:{code:'',field:'',orgFields:'',destFields:''}})
  279. fieldList.push({type:'int',value:'auditStatus',text:'审核状态 0审核中 1 审核通过 2审核未通过',dictCode:'audit_status'})
  280. fieldList.push({type:'int',value:'showStatus',text:'挂单状态 0挂单 1 已撤单',dictCode:'show_status'})
  281. fieldList.push({type:'int',value:'productType',text:'期货现货 0期货 1 现货',dictCode:'product_type'})
  282. fieldList.push({type:'date',value:'transactionTime',text:'交货时间'})
  283. this.superFieldList = fieldList
  284. }
  285. }
  286. }
  287. </script>
  288. <style scoped>
  289. @import '~@assets/less/common.less';
  290. </style>