index.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429
  1. <template>
  2. <div>
  3. <el-breadcrumb class="heading">
  4. <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
  5. <el-breadcrumb-item :to="{ path: '/oilsupplier/goodsaptitude' }">物资类项目与资质对照表</el-breadcrumb-item>
  6. </el-breadcrumb>
  7. <el-card class="box-card" style="height: calc(100vh - 115px);" v-loading="loading">
  8. <div slot="header">
  9. <span>
  10. <i class="icon icon-table2"></i> 物资类项目与资质对照表
  11. </span>
  12. <span style="float: right;">
  13. <router-link :to="'/oilsupplier/goodsaptitude/add/operation'">
  14. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">添加</el-button>
  15. </router-link>
  16. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出
  17. </el-button>
  18. <el-button type="warning" plain size="mini" style="margin-left:20px; margin-top: -4px;" @click="showimport">更新物资编码
  19. </el-button>
  20. <!-- <router-link :to="'/oilsupplier/goodsaptitude/_opera/showdelcertsub'">-->
  21. <!-- <el-button type="warning" plain size="mini" style="margin-left:10px; margin-top: -4px;">查看待删除准入项</el-button>-->
  22. <!-- </router-link>-->
  23. </span>
  24. <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
  25. <el-form-item label="时间">
  26. <el-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
  27. start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
  28. </el-form-item>
  29. <el-form-item label="编码">
  30. <el-input size="mini" v-model="searchForm.Code" style="width:100%" placeholder="请输入" clearable></el-input>
  31. </el-form-item>
  32. <el-form-item label="名称">
  33. <el-input size="mini" v-model="searchForm.Name" style="width:100%" placeholder="请输入" clearable></el-input>
  34. </el-form-item>
  35. <el-form-item>
  36. <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
  37. 查询
  38. <el-dropdown-menu slot="dropdown">
  39. <el-dropdown-item command="search">高级查询</el-dropdown-item>
  40. <el-dropdown-item command="clear">查询重置</el-dropdown-item>
  41. </el-dropdown-menu>
  42. </el-dropdown>
  43. </el-form-item>
  44. </el-form>
  45. </div>
  46. <el-table stripe highlight-current-row :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
  47. style="width: 100%" @sort-change="orderby" v-loading="loading1">
  48. <el-table-column label="操作" min-width="200" align="center" fixed="right">
  49. <template slot-scope="scope">
  50. <router-link :to="'/oilsupplier/goodsaptitude/' + scope.row.Id + '/operation'">
  51. <el-button type="primary" plain title="编辑" size="mini">编辑</el-button>
  52. </router-link>
  53. <el-dropdown @command="MoreCmdClick">
  54. <el-button size="mini" type="primary" plain>
  55. 更多<i class="el-icon-arrow-down el-icon--right"></i>
  56. </el-button>
  57. <el-dropdown-menu slot="dropdown">
  58. <!-- <el-dropdown-item :command="GetCommand('Set', scope.row)">审核部门</el-dropdown-item> -->
  59. <el-dropdown-item :command="GetCommand('CodeEdit', scope.row)">编码名称修改</el-dropdown-item>
  60. </el-dropdown-menu>
  61. </el-dropdown>
  62. </template>
  63. </el-table-column>
  64. <el-table-column v-for="column in tableColumns" :prop="column.prop" sortable :width="column.width"
  65. :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
  66. <template slot-scope="scope">
  67. <span v-if="(column.prop != 'GoodsLevel' && column.prop != 'GoodsDesc' && column.prop != 'Standard' && column.prop != 'CompanyType')">{{ transferStr(scope.row[column.prop]) }}</span>
  68. <span v-else>{{ (scope.row[column.prop]) }}</span>
  69. </template>
  70. </el-table-column>
  71. <!--动态显示的表头-->
  72. <template v-for="column in dynamicTableColumns">
  73. <el-table-column :prop="column.prop" sortable :width="80"
  74. :key="column.Id" :label="column.label" align="center" v-if="column.IsManuf=='0'" show-overflow-tooltip>
  75. <template slot-scope="scope">
  76. {{ transferStr(scope.row[column.prop]) }}
  77. </template>
  78. </el-table-column>
  79. </template>
  80. <el-table-column label="贸易产品">
  81. <template v-for="column in dynamicTableColumns">
  82. <el-table-column :prop="column.prop" sortable :width="80"
  83. :key="column.Id" :label="column.label" align="center" v-if="column.IsManuf=='2'" show-overflow-tooltip>
  84. <template slot-scope="scope">
  85. {{ transferStr(scope.row[column.prop]) }}
  86. </template>
  87. </el-table-column>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="制造产品">
  91. <template v-for="column in dynamicTableColumns">
  92. <el-table-column :prop="column.prop" sortable :width="80"
  93. :key="column.Id" :label="column.label" align="center" v-if="column.IsManuf=='1'" show-overflow-tooltip>
  94. <template slot-scope="scope">
  95. {{ transferStr(scope.row[column.prop]) }}
  96. </template>
  97. </el-table-column>
  98. </template>
  99. </el-table-column>
  100. <!--<el-table-column prop="CreateOn" sortable min-width="150" label="生成时间" align="center" show-overflow-tooltip>
  101. <template slot-scope="scope">
  102. {{ jstimehandle(scope.row.CreateOn+'') }}
  103. </template>
  104. </el-table-column>-->
  105. </el-table>
  106. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  107. :page-sizes="[10, 50, 100, 200, 400]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
  108. :total="currentItemCount">
  109. </el-pagination>
  110. </el-card>
  111. <el-dialog title="高级查询" :visible.sync="dialogVisible" width="720px">
  112. <el-form ref="advancedsearchForm" label-width="110px">
  113. <el-row>
  114. <el-col :span="12">
  115. <el-form-item label="时间">
  116. <el-date-picker size="mini" v-model="CreateOn" type="daterange" style="width:100%" range-separator="至"
  117. start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="12">
  121. <el-form-item label="编码">
  122. <el-input size="mini" v-model="searchForm.Code" style="width:100%" placeholder="请输入"></el-input>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="12">
  126. <el-form-item label="名称">
  127. <el-input size="mini" v-model="searchForm.Name" style="width:100%" placeholder="请输入"></el-input>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="12">
  131. <el-form-item label="大类名称">
  132. <el-input size="mini" v-model="searchForm.BigClassName" style="width:100%" placeholder="请输入"></el-input>
  133. </el-form-item>
  134. </el-col>
  135. <el-col :span="12">
  136. <el-form-item label="大类编码">
  137. <el-input size="mini" v-model="searchForm.BigClassCode" style="width:100%" placeholder="请输入"></el-input>
  138. </el-form-item>
  139. </el-col>
  140. <el-col :span="12">
  141. <el-form-item label="中类名称">
  142. <el-input size="mini" v-model="searchForm.MiddleClassName" style="width:100%" placeholder="请输入">
  143. </el-input>
  144. </el-form-item>
  145. </el-col>
  146. <el-col :span="12">
  147. <el-form-item label="小类名称">
  148. <el-input size="mini" v-model="searchForm.SmallClassName" style="width:100%" placeholder="请输入"></el-input>
  149. </el-form-item>
  150. </el-col>
  151. <el-col :span="12">
  152. <el-form-item label="品名">
  153. <el-input size="mini" v-model="searchForm.GoodsName" style="width:100%" placeholder="请输入"></el-input>
  154. </el-form-item>
  155. </el-col>
  156. <el-col :span="12">
  157. <el-form-item label="物资级别">
  158. <el-input size="mini" v-model="searchForm.GoodsLevel" style="width:100%" placeholder="请输入"></el-input>
  159. </el-form-item>
  160. </el-col>
  161. <el-col :span="12">
  162. <el-form-item label="产品说明">
  163. <el-input size="mini" v-model="searchForm.GoodsDesc" style="width:100%" placeholder="请输入"></el-input>
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="12">
  167. <el-form-item label="标准备案">
  168. <el-input size="mini" v-model="searchForm.Standard" style="width:100%" placeholder="请输入"></el-input>
  169. </el-form-item>
  170. </el-col>
  171. <el-col :span="12">
  172. <el-form-item label="供应商类型">
  173. <el-input size="mini" v-model="searchForm.CompanyType" style="width:100%" placeholder="请输入"></el-input>
  174. </el-form-item>
  175. </el-col>
  176. </el-row>
  177. </el-form>
  178. <span slot="footer" class="dialog-footer">
  179. <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
  180. <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
  181. </span>
  182. </el-dialog>
  183. <el-dialog title="设置审批部门" :visible.sync="deptsetVisible">
  184. <el-row>
  185. <el-col :span="12">
  186. 审批步骤:
  187. <el-select v-model="setForm.AuditStepCode" ref="selectAuditStep" placeholder="请选择" size="small">
  188. <el-option v-for="item in AuditStepOptions" :key="item.Id" :label="item.Key" :value="item.Value">
  189. </el-option>
  190. </el-select>
  191. </el-col>
  192. <el-col :span="12">
  193. 审批部门:
  194. <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps"
  195. ref="operationOriganizeTree">
  196. </el-tree>
  197. </el-col>
  198. </el-row>
  199. <div slot="footer">
  200. <el-button @click="deptsetVisible = false">取消</el-button>
  201. <el-button type="primary" @click="saveApprovalDept()">确定</el-button>
  202. </div>
  203. </el-dialog>
  204. <el-dialog title="名称编码修改" :visible.sync="codeeditshow" width="720px">
  205. <el-form label-width="110px">
  206. <el-row>
  207. <el-col :span="12">
  208. <el-form-item label="大类名称">
  209. <el-input size="mini" v-model="formData.Name1" style="width:100%" placeholder="请输入"></el-input>
  210. </el-form-item>
  211. </el-col>
  212. <el-col :span="12">
  213. <el-form-item label="大类编码">
  214. <el-input size="mini" v-model="formData.Code1" @change="Name1Change" style="width:100%" placeholder="请输入">
  215. </el-input>
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="12">
  219. <el-form-item label="中类名称">
  220. <el-input size="mini" v-model="formData.Name2" style="width:100%" placeholder="请输入">
  221. </el-input>
  222. </el-form-item>
  223. </el-col>
  224. <el-col :span="12">
  225. <el-form-item label="中类编码">
  226. <el-input size="mini" v-model="formData.Code2" @change="Name2Change" style="width:100%" placeholder="请输入">
  227. </el-input>
  228. </el-form-item>
  229. </el-col>
  230. <el-col :span="12">
  231. <el-form-item label="小类名称">
  232. <el-input size="mini" v-model="formData.Name3" style="width:100%" placeholder="请输入"></el-input>
  233. </el-form-item>
  234. </el-col>
  235. <el-col :span="12">
  236. <el-form-item label="小类编码">
  237. <el-input size="mini" v-model="formData.Code3" @change="Name3Change" style="width:100%" placeholder="请输入">
  238. </el-input>
  239. </el-form-item>
  240. </el-col>
  241. <el-col :span="12">
  242. <el-form-item label="品名">
  243. <el-input size="mini" v-model="formData.Name4" style="width:100%" placeholder="请输入"></el-input>
  244. </el-form-item>
  245. </el-col>
  246. <el-col :span="12">
  247. <el-form-item label="品名编码">
  248. <el-input size="mini" v-model="formData.Code4" style="width:100%" placeholder="请输入"></el-input>
  249. </el-form-item>
  250. </el-col>
  251. </el-row>
  252. </el-form>
  253. <span slot="footer" class="dialog-footer">
  254. <el-button size="mini" @click="codeeditshow = false">取 消</el-button>
  255. <el-button size="mini" type="primary" @click="codeedit">修 改</el-button>
  256. </span>
  257. </el-dialog>
  258. <el-dialog title="上传文件" width="600px" :visible.sync="uploadshow">
  259. <el-form label-width="100px">
  260. <el-row>
  261. <el-col :span="24">
  262. <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
  263. :http-request="uploadrequest" :before-upload="beforeAvatarUpload">
  264. <el-button size="small" type="primary">点击上传</el-button>
  265. </el-upload>
  266. </el-col>
  267. <el-col :span="24">
  268. <el-button style="float: right;" size="mini" type="primary" @click="uploadExcel()">确定</el-button>
  269. </el-col>
  270. </el-row>
  271. </el-form>
  272. </el-dialog>
  273. <el-dialog title="新导入" width="95%" top="5vh" :visible.sync="showimportvisible">
  274. <el-card class="box-card" v-loading="importloading">
  275. <div slot="header">
  276. <span>
  277. <i class="icon icon-table2"></i> 对照表(新导入)
  278. </span>
  279. <span style="float: right;">
  280. <el-button type="primary" size="mini" style="margin-left:20px; margin-top: -4px;" @click="importExcel">导入
  281. </el-button>
  282. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="contrastList()">查看企业对比
  283. </el-button>
  284. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="qualificaList()">查看资质对比
  285. </el-button>
  286. <el-button type="warning" size="mini" style="margin-left:10px; margin-top: -4px;" @click="truncateimport()">清空所有导入
  287. </el-button>
  288. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="confirmImport()" :loading="confirmLoading">确认更新
  289. </el-button>
  290. </span>
  291. <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
  292. <el-form-item label="编码">
  293. <el-input size="mini" v-model="searchImportForm.Code" style="width:100%" placeholder="请输入"></el-input>
  294. </el-form-item>
  295. <el-form-item label="名称">
  296. <el-input size="mini" v-model="searchImportForm.Name" style="width:100%" placeholder="请输入"></el-input>
  297. </el-form-item>
  298. <el-form-item>
  299. <el-dropdown split-button type="primary" size="mini" @click="importhandleSearch" @command="importsearchCommand">
  300. 查询
  301. <el-dropdown-menu slot="dropdown">
  302. <el-dropdown-item command="search">高级查询</el-dropdown-item>
  303. <el-dropdown-item command="clear">查询重置</el-dropdown-item>
  304. </el-dropdown-menu>
  305. </el-dropdown>
  306. </el-form-item>
  307. </el-form>
  308. </div>
  309. <el-table :data="importentityList" id="rebateSetTableimport" size="mini" border height="calc(100vh - 350px)"
  310. style="width: 100%" @sort-change="importorderby" v-loading="loading2">
  311. <el-table-column v-for="column in tableColumns" :prop="column.prop" sortable :width="column.width"
  312. :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
  313. <template slot-scope="scope">
  314. <span v-if="column.prop != 'GoodsLevel'">{{ transferStr(scope.row[column.prop], column.prop) }}</span>
  315. <span v-else>{{ (scope.row[column.prop]) }}</span>
  316. </template>
  317. </el-table-column>
  318. <!--动态显示的表头-->
  319. <template v-for="column in dynamicTableColumns">
  320. <el-table-column :prop="column.prop" sortable :width="80"
  321. :key="column.Id" :label="column.label" align="center" v-if="column.IsManuf=='0'" show-overflow-tooltip>
  322. <template slot-scope="scope">
  323. {{ transferStr(scope.row[column.prop]) }}
  324. </template>
  325. </el-table-column>
  326. </template>
  327. <el-table-column label="贸易产品">
  328. <template v-for="column in dynamicTableColumns">
  329. <el-table-column :prop="column.prop" sortable :width="80"
  330. :key="column.Id" :label="column.label" align="center" v-if="column.IsManuf=='2'" show-overflow-tooltip>
  331. <template slot-scope="scope">
  332. {{ transferStr(scope.row[column.prop]) }}
  333. </template>
  334. </el-table-column>
  335. </template>
  336. </el-table-column>
  337. <el-table-column label="制造产品">
  338. <template v-for="column in dynamicTableColumns">
  339. <el-table-column :prop="column.prop" sortable :width="80"
  340. :key="column.Id" :label="column.label" align="center" v-if="column.IsManuf=='1'" show-overflow-tooltip>
  341. <template slot-scope="scope">
  342. {{ transferStr(scope.row[column.prop]) }}
  343. </template>
  344. </el-table-column>
  345. </template>
  346. </el-table-column>
  347. <!--<el-table-column prop="CreateOn" sortable min-width="150" label="生成时间" align="center" show-overflow-tooltip>
  348. <template slot-scope="scope">
  349. {{ jstimehandle(scope.row.CreateOn+'') }}
  350. </template>
  351. </el-table-column>-->
  352. </el-table>
  353. <el-pagination @size-change="importhandleSizeChange" @current-change="importhandleCurrentChange" :current-page="importcurrentPage"
  354. :page-sizes="[10, 50, 100, 200, 500]" :page-size="importsize" layout="total, sizes, prev, pager, next, jumper"
  355. :total="importcurrentItemCount">
  356. </el-pagination>
  357. </el-card>
  358. </el-dialog>
  359. <el-dialog title="企业对比列表" width="95%" top="5vh" :visible.sync="contrastListvisible">
  360. <tmp-supplier-check v-if="contrastListvisible"></tmp-supplier-check>
  361. </el-dialog>
  362. <el-dialog title="资质对比列表" width="95%" top="5vh" :visible.sync="qualificaListvisible">
  363. <tmp-class-check v-if="qualificaListvisible"></tmp-class-check>
  364. </el-dialog>
  365. <el-dialog title="高级查询" :visible.sync="importDialogVisible" width="720px">
  366. <el-form ref="advancedsearchForm" label-width="110px">
  367. <el-row>
  368. <el-col :span="12">
  369. <el-form-item label="编码">
  370. <el-input size="mini" v-model="searchImportForm.Code" style="width:100%" placeholder="请输入"></el-input>
  371. </el-form-item>
  372. </el-col>
  373. <el-col :span="12">
  374. <el-form-item label="名称">
  375. <el-input size="mini" v-model="searchImportForm.Name" style="width:100%" placeholder="请输入"></el-input>
  376. </el-form-item>
  377. </el-col>
  378. <el-col :span="12">
  379. <el-form-item label="大类名称">
  380. <el-input size="mini" v-model="searchImportForm.BigClassName" style="width:100%" placeholder="请输入"></el-input>
  381. </el-form-item>
  382. </el-col>
  383. <el-col :span="12">
  384. <el-form-item label="大类编码">
  385. <el-input size="mini" v-model="searchImportForm.BigClassCode" style="width:100%" placeholder="请输入"></el-input>
  386. </el-form-item>
  387. </el-col>
  388. <el-col :span="12">
  389. <el-form-item label="中类名称">
  390. <el-input size="mini" v-model="searchImportForm.MiddleClassName" style="width:100%" placeholder="请输入">
  391. </el-input>
  392. </el-form-item>
  393. </el-col>
  394. <el-col :span="12">
  395. <el-form-item label="小类名称">
  396. <el-input size="mini" v-model="searchImportForm.SmallClassName" style="width:100%" placeholder="请输入"></el-input>
  397. </el-form-item>
  398. </el-col>
  399. <el-col :span="12">
  400. <el-form-item label="品名">
  401. <el-input size="mini" v-model="searchImportForm.GoodsName" style="width:100%" placeholder="请输入"></el-input>
  402. </el-form-item>
  403. </el-col>
  404. <el-col :span="12">
  405. <el-form-item label="物资级别">
  406. <el-input size="mini" v-model="searchImportForm.GoodsLevel" style="width:100%" placeholder="请输入"></el-input>
  407. </el-form-item>
  408. </el-col>
  409. <el-col :span="12">
  410. <el-form-item label="产品说明">
  411. <el-input size="mini" v-model="searchImportForm.GoodsDesc" style="width:100%" placeholder="请输入"></el-input>
  412. </el-form-item>
  413. </el-col>
  414. <el-col :span="12">
  415. <el-form-item label="标准备案">
  416. <el-input size="mini" v-model="searchImportForm.Standard" style="width:100%" placeholder="请输入"></el-input>
  417. </el-form-item>
  418. </el-col>
  419. <el-col :span="12">
  420. <el-form-item label="供应商类型">
  421. <el-input size="mini" v-model="searchImportForm.CompanyType" style="width:100%" placeholder="请输入"></el-input>
  422. </el-form-item>
  423. </el-col>
  424. </el-row>
  425. </el-form>
  426. <span slot="footer" class="dialog-footer">
  427. <el-button size="mini" @click="importDialogVisible = false">取 消</el-button>
  428. <el-button size="mini" type="primary" @click="importhandleSearch">查 询</el-button>
  429. </span>
  430. </el-dialog>
  431. <el-dialog title="导入失败" :visible.sync="errorDialogVisible" :close-on-click-modal = "false" width="720px">
  432. <el-input type="textarea" autosize placeholder="请输入内容" v-model="textarea"></el-input>
  433. </el-dialog>
  434. </div>
  435. </template>
  436. <script>
  437. import {
  438. mapGetters
  439. } from 'vuex'
  440. import api from '@/api/oilsupplier/goodsaptitude'
  441. import setapi from '@/api/oilsupplier/oilclassorgset'
  442. import axios from 'axios'
  443. import uploadajax from '@/assets/js/uploadajax.js'
  444. import tmpSupplierCheck from './tmpsuppliercheck'
  445. import tmpClassCheck from './tmpclasscheck'
  446. export default {
  447. components: {
  448. tmpSupplierCheck,
  449. tmpClassCheck
  450. },
  451. computed: {
  452. ...mapGetters({
  453. authUser: 'authUser'
  454. })
  455. },
  456. name: 'oilgoodsaptitude',
  457. data () {
  458. return {
  459. deleteDialogVisible: false,
  460. loading1: false,
  461. loading2: false,
  462. importloading: false,
  463. confirmLoading: false,
  464. textarea: '',
  465. showimportvisible: false,
  466. Excelurl: '',
  467. uploadshow: false,
  468. loading: false,
  469. codeeditshow: false,
  470. classid: '',
  471. myclassid: '',
  472. deptsetVisible: false,
  473. dialogVisible: false,
  474. importDialogVisible: false,
  475. errorDialogVisible: false,
  476. // 列表数据
  477. entityList: [],
  478. // 分页参数
  479. size: 10,
  480. currentPage: 1,
  481. currentItemCount: 0,
  482. // 列表排序
  483. Column: {
  484. Order: '',
  485. Prop: ''
  486. },
  487. // 列表数据
  488. importentityList: [],
  489. // 分页参数
  490. importsize: 10,
  491. importcurrentPage: 1,
  492. importcurrentItemCount: 0,
  493. // 列表排序
  494. importColumn: {
  495. Order: '',
  496. Prop: ''
  497. },
  498. formData: {
  499. Id: '',
  500. Id1: '',
  501. Id2: '',
  502. Id3: '',
  503. Id4: '',
  504. Code: '',
  505. Name: '',
  506. Code1: '',
  507. Name1: '',
  508. Code2: '',
  509. Name2: '',
  510. Code3: '',
  511. Name3: '',
  512. Code4: '',
  513. Name4: ''
  514. },
  515. // 查询时间
  516. CreateOn: [],
  517. conList: [],
  518. importCreateOn: [],
  519. // 查询项
  520. searchFormReset: {},
  521. searchForm: {
  522. Id: '',
  523. Code: '',
  524. Name: '',
  525. BigClassName: '',
  526. BigClassCode: '',
  527. MiddleClassName: '',
  528. SmallClassName: '',
  529. GoodsName: '',
  530. GoodsLevel: '',
  531. GoodsDesc: '',
  532. Standard: '',
  533. CompanyType: '',
  534. F01: '',
  535. F02: '',
  536. F03: '',
  537. F04: '',
  538. F05: '',
  539. F06: '',
  540. F07: '',
  541. F08: '',
  542. F09: '',
  543. F10: '',
  544. F11: '',
  545. F12: '',
  546. F13: '',
  547. F14: '',
  548. F15: '',
  549. F16: '',
  550. F17: '',
  551. F18: '',
  552. F19: '',
  553. F20: '',
  554. F21: '',
  555. F22: '',
  556. F23: '',
  557. F24: '',
  558. F25: '',
  559. F26: '',
  560. F27: '',
  561. F28: '',
  562. F29: '',
  563. F30: '',
  564. F31: '',
  565. F32: '',
  566. F33: '',
  567. F34: '',
  568. F35: '',
  569. F36: '',
  570. F37: '',
  571. F38: '',
  572. F39: '',
  573. F40: '',
  574. F41: '',
  575. F42: '',
  576. F43: '',
  577. F44: '',
  578. F45: '',
  579. F46: '',
  580. Remark: '',
  581. DeletionStateCode: '',
  582. CreateOn: '',
  583. CreateUserId: '',
  584. CreateBy: '',
  585. ModifiedOn: '',
  586. ModifiedUserId: '',
  587. ModifiedBy: ''
  588. },
  589. searchImportForm: {
  590. Id: '',
  591. Code: '',
  592. Name: '',
  593. BigClassName: '',
  594. BigClassCode: '',
  595. MiddleClassName: '',
  596. SmallClassName: '',
  597. GoodsName: '',
  598. GoodsLevel: '',
  599. GoodsDesc: '',
  600. Standard: '',
  601. CompanyType: '',
  602. F01: '',
  603. F02: '',
  604. F03: '',
  605. F04: '',
  606. F05: '',
  607. F06: '',
  608. F07: '',
  609. F08: '',
  610. F09: '',
  611. F10: '',
  612. F11: '',
  613. F12: '',
  614. F13: '',
  615. F14: '',
  616. F15: '',
  617. F16: '',
  618. F17: '',
  619. F18: '',
  620. F19: '',
  621. F20: '',
  622. F21: '',
  623. F22: '',
  624. F23: '',
  625. F24: '',
  626. F25: '',
  627. F26: '',
  628. F27: '',
  629. F28: '',
  630. F29: '',
  631. F30: '',
  632. F31: '',
  633. F32: '',
  634. F33: '',
  635. F34: '',
  636. F35: '',
  637. F36: '',
  638. F37: '',
  639. F38: '',
  640. F39: '',
  641. F40: '',
  642. F41: '',
  643. F42: '',
  644. F43: '',
  645. F44: '',
  646. F45: '',
  647. F46: '',
  648. Remark: '',
  649. DeletionStateCode: '',
  650. CreateOn: '',
  651. CreateUserId: '',
  652. CreateBy: '',
  653. ModifiedOn: '',
  654. ModifiedUserId: '',
  655. ModifiedBy: ''
  656. },
  657. setForm: {
  658. SupplierTypeCode: '01',
  659. SupplierTypeName: '物资类',
  660. AuditStepCode: '',
  661. AuditStepName: ''
  662. },
  663. tableColumns: [
  664. {
  665. prop: 'Code1',
  666. label: '大类编码',
  667. width: 120,
  668. sort: true
  669. },
  670. {
  671. prop: 'Name1',
  672. label: '大类名称',
  673. width: 150,
  674. sort: true
  675. },
  676. {
  677. prop: 'Code2',
  678. label: '中类编码',
  679. width: 120,
  680. sort: true
  681. },
  682. {
  683. prop: 'Name2',
  684. label: '中类名称',
  685. width: 150,
  686. sort: true
  687. },
  688. {
  689. prop: 'Code3',
  690. label: '小类编码',
  691. width: 120,
  692. sort: true
  693. },
  694. {
  695. prop: 'Name3',
  696. label: '小类名称',
  697. width: 150,
  698. sort: true
  699. },
  700. {
  701. prop: 'Code4',
  702. label: '品名编码',
  703. width: 120,
  704. sort: true
  705. },
  706. {
  707. prop: 'Name4',
  708. label: '品名名称',
  709. width: 150,
  710. sort: true
  711. },
  712. {
  713. prop: 'GoodsLevel',
  714. label: '物资级别',
  715. width: 110,
  716. sort: true
  717. },
  718. {
  719. prop: 'GoodsDesc',
  720. label: '产品说明',
  721. width: 110,
  722. sort: true
  723. },
  724. {
  725. prop: 'Standard',
  726. label: '标准备案',
  727. width: 110,
  728. sort: true
  729. },
  730. {
  731. prop: 'CompanyType',
  732. label: '供应商类型',
  733. width: 130,
  734. sort: true
  735. }
  736. ],
  737. dynamicTableColumns: [],
  738. organizeProps: {
  739. value: 'id',
  740. label: 'name',
  741. children: 'children'
  742. },
  743. operationOrganizeData: [],
  744. AuditStepOptions: [],
  745. showcolumn: [],
  746. contrastListvisible: false,
  747. qualificaListvisible: false,
  748. ContrastLoading: false,
  749. contrastsize: 10,
  750. contrastcurrentPage: 1,
  751. contrastimportCount: 0,
  752. }
  753. },
  754. created () {
  755. // 查询条件初始值备份
  756. Object.assign(this.searchFormReset, this.searchForm)
  757. // 初始化部分表头
  758. this.initTableHeader()
  759. // 查询列表
  760. this.initDatas()
  761. this.getDictOptions()
  762. },
  763. methods: {
  764. initContrastDatas (event) {
  765. this.ContrastLoading = true
  766. let myCreateOn = []
  767. // 解析时间
  768. if (this.CreateOn != null && this.CreateOn.length === 2) {
  769. this.CreateOn[1].setHours(23)
  770. this.CreateOn[1].setMinutes(59)
  771. this.CreateOn[1].setSeconds(59)
  772. myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
  773. myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
  774. }
  775. let params = {
  776. _size: this.contrastsize,
  777. _currentPage: this.contrastcurrentPage,
  778. Order: this.Column.Order,
  779. Prop: this.Column.Prop,
  780. SetupTime: this.SetupTime,
  781. CreateOn: myCreateOn.join(','),
  782. CheckUId: this.auditorg,
  783. FullId: this.selectDept
  784. }
  785. api.getCompanyList(params, this.searchForm, this.$axios)
  786. .then(res => {
  787. this.entityList = res.data.items
  788. this.contrastimportCount = res.data.currentItemCount
  789. this.ContrastLoading = false
  790. })
  791. .catch(err => {
  792. console.error(err)
  793. })
  794. },
  795. showDelSupplierCertSub () {
  796. this.deleteDialogVisible = true
  797. this.initContrastDatas()
  798. },
  799. contrastList () {
  800. this.contrastListvisible = true
  801. this.showimportvisible = false
  802. },
  803. qualificaList () {
  804. this.qualificaListvisible = true
  805. this.showimportvisible = false
  806. },
  807. deleteSuspend () {
  808. // this.$confirm('此操作将更新企业资质, 是否继续?', '提示', {
  809. // confirmButtonText: '确定',
  810. // cancelButtonText: '取消',
  811. // type: 'warning'
  812. // }).then(() => {
  813. // this.importloading = true
  814. api.deleteSuspend(this.$axios).then(res => {
  815. // this.importloading = false
  816. if (res.data.code === 0) {
  817. // this.$message({
  818. // type: 'success',
  819. // message: res.data.message
  820. // })
  821. }
  822. })
  823. // })
  824. },
  825. suspend () {
  826. api.suspend(this.$axios).then(res => {
  827. if (res.data.code === 0) {
  828. }
  829. })
  830. },
  831. truncateimport () {
  832. this.$confirm('此操作将清空导入的数据, 是否继续?', '提示', {
  833. confirmButtonText: '确定',
  834. cancelButtonText: '取消',
  835. type: 'warning'
  836. }).then(() => {
  837. api.truncateImport(this.$axios).then(res => {
  838. this.initImportDatas()
  839. if (res.data.code === 0) {
  840. this.$message({
  841. type: 'success',
  842. message: res.data.message
  843. })
  844. } else {
  845. this.$message({
  846. type: 'warning',
  847. message: res.data.message
  848. })
  849. }
  850. })
  851. })
  852. },
  853. confirmImport () {
  854. this.confirmLoading = true
  855. this.$confirm('此操作将更新原有数据, 是否继续?', '提示', {
  856. confirmButtonText: '确定',
  857. cancelButtonText: '取消',
  858. type: 'warning'
  859. }).then(() => {
  860. api.insertGoodsAptitude(this.$axios).then(res => {
  861. this.showimportvisible = false
  862. if (res.data.code === 0) {
  863. this.$message({
  864. type: 'success',
  865. message: res.data.message
  866. })
  867. this.initDatas()
  868. this.deleteSuspend()
  869. // this.suspend()
  870. } else {
  871. this.$message({
  872. type: 'warning',
  873. message: res.data.message
  874. })
  875. }
  876. this.confirmLoading = false
  877. })
  878. })
  879. },
  880. showimport () {
  881. this.importcurrentPage = 1
  882. this.initImportDatas()
  883. this.showimportvisible = true
  884. },
  885. uploadExcel () {
  886. this.importloading = true
  887. this.uploadshow = false
  888. let params = {
  889. ExcelUrl: this.Excelurl
  890. }
  891. api.importExcel(params, this.$axios).then(res => {
  892. if (res.data.code === 0) {
  893. this.$message({
  894. type: 'success',
  895. message: res.data.message + " 即将生成对比列表"
  896. })
  897. this.importloading = false
  898. this.initImportDatas()
  899. // this.createContrast()
  900. } else if (res.data.code === -1) {
  901. this.errorDialogVisible = true
  902. this.textarea = res.data.message
  903. } else if (res.data.code === -2) {
  904. this.$message({
  905. type: 'warning',
  906. message: res.data.message
  907. })
  908. }
  909. })
  910. },
  911. createContrast () {
  912. api.createContrast(this.$axios).then(res => {
  913. }).catch(err => {
  914. console.error(err)
  915. })
  916. },
  917. uploadrequest (option) {
  918. let _this = this
  919. if (process.client) {
  920. const myDomain = window.location.host
  921. axios.post(process.env.upfilehost, {})
  922. .then(function (res) {
  923. if (res.data && res.data.fid && res.data.fid !== '') {
  924. if (res.data.publicUrl.indexOf('/upfile') === 0) {
  925. option.action = `http://${myDomain}/${res.data.publicUrl}/${res.data.fid}`
  926. } else {
  927. option.action = `http://${res.data.publicUrl}/${res.data.fid}`
  928. }
  929. uploadajax(option)
  930. _this.Excelurl = option.action
  931. } else {
  932. _this.$message({
  933. type: 'warning',
  934. message: '未上传成功!请刷新界面重新上传!'
  935. })
  936. }
  937. })
  938. .catch(res => {
  939. _this.$message({
  940. type: 'warning',
  941. message: '未上传成功!请重新上传!'
  942. })
  943. })
  944. }
  945. },
  946. beforeAvatarUpload (file) {
  947. if (file.name.indexOf('.xlsx') < 0) {
  948. this.$message.error('文件格式必须为.xlsx')
  949. return false
  950. }
  951. return true
  952. },
  953. Name1Change (val) {
  954. this.formData.Code2 = this.formData.Code2.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
  955. this.formData.Code3 = this.formData.Code3.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
  956. this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{2}(.*)$/, '$1' + val + '$2')
  957. },
  958. Name2Change (val) {
  959. this.formData.Code3 = this.formData.Code3.replace(/^(\w{0})\w{4}(.*)$/, '$1' + val + '$2')
  960. this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{4}(.*)$/, '$1' + val + '$2')
  961. },
  962. Name3Change (val) {
  963. this.formData.Code4 = this.formData.Code4.replace(/^(\w{0})\w{6}(.*)$/, '$1' + val + '$2')
  964. },
  965. CodeNameEdit (val) {
  966. this.myclassid = val.ClassId
  967. this.$axios.get('goodsaptitudeclass/getcodename/' + val.Code, {})
  968. .then(res => {
  969. // response
  970. this.formData = res.data
  971. this.codeeditshow = true
  972. })
  973. .catch(err => {
  974. console.log(err)
  975. })
  976. },
  977. codeedit () {
  978. api.updateCodeEntity(this.myclassid, this.formData, this.$axios).then(res => {
  979. if (res.data.code === 0) {
  980. // 保存成功后,初始化数据,变成修改
  981. this.codeeditshow = false
  982. this.initDatas()
  983. this.$message({
  984. type: 'success',
  985. message: res.data.message
  986. })
  987. } else {
  988. this.$message({
  989. type: 'warning',
  990. message: res.data.message
  991. })
  992. }
  993. }).catch(err => {
  994. console.error(err)
  995. })
  996. },
  997. // exportExcel () {
  998. // /* generate workbook object from table */
  999. // let table = document.querySelector('#rebateSetTable').cloneNode(true) // 克隆备份(原table不动)
  1000. // // 因为element-ui的表格的fixed属性导致多出一个table,会下载重复内容,这里删除掉
  1001. // table.removeChild(table.querySelector('.el-table__fixed-right')) // 删掉备份的子节点
  1002. // let wb = XLSX.utils.table_to_book(table, {
  1003. // raw: true
  1004. // })
  1005. // /* get binary string as output */
  1006. // let wbout = XLSX.write(wb, {
  1007. // bookType: 'xlsx',
  1008. // bookSST: true,
  1009. // type: 'array'
  1010. // })
  1011. // try {
  1012. // FileSaver.saveAs(
  1013. // new Blob([wbout], {
  1014. // type: 'application/octet-stream'
  1015. // }),
  1016. // 'Goods.xlsx'
  1017. // )
  1018. // } catch (e) {
  1019. // if (typeof console !== 'undefined') console.log(e, wbout)
  1020. // }
  1021. // return wbout
  1022. // },
  1023. importExcel () {
  1024. this.uploadshow = true
  1025. },
  1026. exportExcel () {
  1027. this.loading = true
  1028. // 显示列
  1029. Object.assign(this.showcolumn, this.tableColumns)
  1030. Object.assign(this.showcolumn, this.dynamicTableColumns)
  1031. let showcolumn = this.tableColumns.concat(this.dynamicTableColumns)
  1032. let showcolumnarr = []
  1033. let showcolumnnamearr = []
  1034. for (var i = 0; i < showcolumn.length; i++) {
  1035. showcolumnarr.push(showcolumn[i].label)
  1036. showcolumnnamearr.push(showcolumn[i].prop.replace(/,/g, ','))
  1037. }
  1038. let params = {
  1039. _currentPage: this.currentPage,
  1040. _size: this.size,
  1041. Order: this.Column.Order,
  1042. Prop: this.Column.Prop,
  1043. Edition: '1',
  1044. showcolumnarr: showcolumnarr + '',
  1045. showcolumnnamearr: showcolumnnamearr + ''
  1046. }
  1047. api.exportExcelAll(params, this.$axios).then(res => {
  1048. this.loading = false
  1049. let docurl = res.data
  1050. // 内网服务器专用
  1051. if (process.client && docurl.indexOf('upfile') === 0) {
  1052. const myDomain = window.location.host
  1053. location.href = 'http://' + myDomain + '/' + docurl
  1054. } else {
  1055. location.href = 'http://' + docurl
  1056. }
  1057. })
  1058. },
  1059. initTableHeader () {
  1060. setapi.initGoodTableHeader(this.$axios).then(res => {
  1061. this.dynamicTableColumns = res.data.items
  1062. })
  1063. },
  1064. saveApprovalDept () {
  1065. let organizeids = []
  1066. let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
  1067. organize.forEach(row => {
  1068. organizeids.push(row.id)
  1069. })
  1070. this.setForm.AuditStepName = this.$refs.selectAuditStep.selectedLabel + ''
  1071. setapi.addOrganize(this.classid, organizeids, this.setForm, this.$axios).then(res => {
  1072. if (res.data.code === 0) {
  1073. this.$message({
  1074. type: 'success',
  1075. message: res.data.message
  1076. })
  1077. this.deptsetVisible = false
  1078. } else {
  1079. this.$message({
  1080. type: 'warning',
  1081. message: res.data.message
  1082. })
  1083. }
  1084. }).catch(err => {
  1085. console.log(err)
  1086. })
  1087. },
  1088. deptSet (val) {
  1089. let stcode = this.setForm.SupplierTypeCode
  1090. this.deptsetVisible = true
  1091. this.selecteclassid = val.Id
  1092. this.classid = val.ClassId
  1093. // request
  1094. this.$axios.get('classorgsetting/getdepartment?id=' + this.selecteclassid + '&stcode=' + stcode, {})
  1095. .then(res => {
  1096. // response
  1097. this.setForm.AuditStepCode = res.data.AuditStepCode
  1098. this.operationOrganizeData = window.toolfun_gettreejson(res.data.Organize, 'id', 'pId', 'id,name,scope')
  1099. if (!res.data.SelectedOrganize) {
  1100. res.data.SelectedOrganize = []
  1101. }
  1102. this.$refs.operationOriganizeTree.setCheckedKeys(res.data.SelectedOrganize, true)
  1103. })
  1104. .catch(err => {
  1105. console.log(err)
  1106. })
  1107. },
  1108. initDatas () {
  1109. this.loading1 = true
  1110. // 分页及列表条件
  1111. let params = {
  1112. _currentPage: this.currentPage,
  1113. _size: this.size,
  1114. Order: this.Column.Order,
  1115. Prop: this.Column.Prop,
  1116. Edition: '1'
  1117. }
  1118. let myCreateOn = []
  1119. // 解析时间
  1120. if (this.CreateOn != null && this.CreateOn.length === 2) {
  1121. this.CreateOn[1].setHours(23)
  1122. this.CreateOn[1].setMinutes(59)
  1123. this.CreateOn[1].setSeconds(59)
  1124. myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
  1125. myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
  1126. }
  1127. // 查询条件
  1128. Object.assign(params, this.searchForm)
  1129. // 访问接口
  1130. api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
  1131. this.entityList = res.data.items
  1132. this.currentItemCount = res.data.currentItemCount
  1133. this.loading1 = false
  1134. }).catch(err => {
  1135. console.error(err)
  1136. })
  1137. },
  1138. initImportDatas () {
  1139. this.loading2 = true
  1140. // 分页及列表条件
  1141. let params = {
  1142. _currentPage: this.importcurrentPage,
  1143. _size: this.importsize,
  1144. Order: this.initImportDatas.Order,
  1145. Prop: this.initImportDatas.Prop,
  1146. Edition: '1'
  1147. }
  1148. let myCreateOn = []
  1149. // 解析时间
  1150. if (this.importCreateOn != null && this.importCreateOn.length === 2) {
  1151. this.importCreateOn[1].setHours(23)
  1152. this.importCreateOn[1].setMinutes(59)
  1153. this.importCreateOn[1].setSeconds(59)
  1154. myCreateOn.push(this.formatDateTime(this.importCreateOn[0]))
  1155. myCreateOn.push(this.formatDateTime(this.importCreateOn[1]))
  1156. }
  1157. // 查询条件
  1158. Object.assign(params, this.searchImportForm)
  1159. // 访问接口
  1160. api.getImportList(myCreateOn.join(','), params, this.$axios).then(res => {
  1161. this.importentityList = res.data.items
  1162. this.importcurrentItemCount = res.data.currentItemCount
  1163. this.loading2 = false
  1164. }).catch(err => {
  1165. console.error(err)
  1166. })
  1167. },
  1168. getDictOptions () {
  1169. api.getDictList(this.$axios).then(res => {
  1170. this.AuditStepOptions = res.data.items['AuditStep']
  1171. // this.dictOptions.customerList = res.data.items['customerList']
  1172. // this.dictOptions.projectList = res.data.items['projectList']
  1173. }).catch(err => {
  1174. console.error(err)
  1175. })
  1176. },
  1177. MoreCmdClick (cmd) {
  1178. if (cmd.Command === 'Set') {
  1179. this.deptSet(cmd.row)
  1180. } else if (cmd.Command === 'Delete') {
  1181. this.deleteEntity(cmd.row)
  1182. } else if (cmd.Command === 'CodeEdit') {
  1183. this.CodeNameEdit(cmd.row)
  1184. }
  1185. },
  1186. GetCommand (cmdType, row) {
  1187. let cmd = {}
  1188. cmd.Command = cmdType
  1189. cmd.row = row
  1190. return cmd
  1191. },
  1192. searchCommand (command) {
  1193. if (command === 'search') {
  1194. this.dialogVisible = true
  1195. } else if (command === 'clear') {
  1196. this.clearSearch()
  1197. }
  1198. },
  1199. // 列表排序功能
  1200. orderby (column) {
  1201. if (column.order === 'ascending') {
  1202. this.Column.Order = 'asc'
  1203. } else if (column.order === 'descending') {
  1204. this.Column.Order = 'desc'
  1205. }
  1206. this.Column.Prop = column.prop
  1207. this.initDatas()
  1208. },
  1209. clearSearch () {
  1210. Object.assign(this.searchForm, this.searchFormReset)
  1211. // this.searchForm = this.searchFormReset;
  1212. this.CreateOn = ''
  1213. this.initDatas()
  1214. },
  1215. handleSearch () {
  1216. this.currentPage = 1
  1217. this.dialogVisible = false
  1218. this.initDatas()
  1219. },
  1220. handleCurrentChange (value) {
  1221. this.currentPage = value
  1222. this.initDatas()
  1223. },
  1224. handleSizeChange (value) {
  1225. this.size = value
  1226. this.currentPage = 1
  1227. this.initDatas()
  1228. },
  1229. importsearchCommand (command) {
  1230. if (command === 'search') {
  1231. this.importDialogVisible = true
  1232. } else if (command === 'clear') {
  1233. this.importclearSearch()
  1234. }
  1235. },
  1236. // 列表排序功能
  1237. importorderby (column) {
  1238. if (column.order === 'ascending') {
  1239. this.importColumn.Order = 'asc'
  1240. } else if (column.order === 'descending') {
  1241. this.importColumn.Order = 'desc'
  1242. }
  1243. this.importColumn.Prop = column.prop
  1244. this.initImportDatas()
  1245. },
  1246. importclearSearch () {
  1247. Object.assign(this.searchImportForm, this.searchFormReset)
  1248. // this.searchForm = this.searchFormReset;
  1249. this.importCreateOn = ''
  1250. this.initImportDatas()
  1251. },
  1252. importhandleSearch () {
  1253. this.importcurrentPage = 1
  1254. this.importDialogVisible = false
  1255. this.initImportDatas()
  1256. },
  1257. importhandleCurrentChange (value) {
  1258. this.importcurrentPage = value
  1259. this.initImportDatas()
  1260. },
  1261. importhandleSizeChange (value) {
  1262. this.importsize = value
  1263. this.importcurrentPage = 1
  1264. this.initImportDatas()
  1265. },
  1266. deleteEntity (row) {
  1267. // row.deleteConfirmFlag = false
  1268. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  1269. confirmButtonText: '确定',
  1270. cancelButtonText: '取消',
  1271. type: 'warning'
  1272. }).then(() => {
  1273. api.deleteEntity(row.Id, this.$axios).then(res => {
  1274. if (res.data.code === 0) {
  1275. this.initDatas()
  1276. this.$message({
  1277. type: 'success',
  1278. message: res.data.message
  1279. })
  1280. } else {
  1281. this.$message({
  1282. type: 'warning',
  1283. message: res.data.message
  1284. })
  1285. }
  1286. }).catch(err => {
  1287. console.error(err)
  1288. })
  1289. }).catch(err => {
  1290. console.error(err)
  1291. })
  1292. },
  1293. transferStr (val) {
  1294. if (val === '1') {
  1295. return '是'
  1296. }
  1297. if (val === '0') {
  1298. return ''
  1299. } else {
  1300. return val
  1301. }
  1302. },
  1303. jstimehandle (val) {
  1304. if (val === '') {
  1305. return '----'
  1306. } else if (val === '0001-01-01T08:00:00+08:00') {
  1307. return '----'
  1308. } else if (val === '5000-01-01T23:59:59+08:00') {
  1309. return '永久'
  1310. } else {
  1311. val = val.replace('T', ' ')
  1312. return val.substring(0, 10)
  1313. }
  1314. },
  1315. formatDateTime (date) {
  1316. var y = date.getFullYear()
  1317. var m = date.getMonth() + 1
  1318. m = m < 10 ? ('0' + m) : m
  1319. var d = date.getDate()
  1320. d = d < 10 ? ('0' + d) : d
  1321. var h = date.getHours()
  1322. var minute = date.getMinutes()
  1323. minute = minute < 10 ? ('0' + minute) : minute
  1324. return y + '-' + m + '-' + d + ' ' + h + ':' + minute
  1325. }
  1326. }
  1327. }
  1328. </script>
  1329. <style>
  1330. .el-col {
  1331. margin-bottom: 5px;
  1332. }
  1333. .attach-uploader {
  1334. border: 1px dashed #63B8FF;
  1335. cursor: pointer;
  1336. position: relative;
  1337. overflow: hidden;
  1338. // margin-bottom: -17px;
  1339. margin-top: -15px;
  1340. margin-left: 20px
  1341. }
  1342. .attach-uploader :hover {
  1343. border-color: #228B22;
  1344. }
  1345. .attach-uploader-icon {
  1346. font-size: 25px;
  1347. color: #63B8FF;
  1348. width: 50px;
  1349. height: 50px;
  1350. line-height: 50px;
  1351. text-align: center;
  1352. }
  1353. .attach-uploader-icon:hover {
  1354. color: #228B22;
  1355. }
  1356. </style>