index.vue 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <!-- <el-form-item label="业务编号" prop="fBillno">-->
  5. <!-- <el-input-->
  6. <!-- v-model="queryParams.fBillno"-->
  7. <!-- placeholder="请输入业务编号"-->
  8. <!-- clearable-->
  9. <!-- size="small"-->
  10. <!-- @keyup.enter.native="handleQuery"-->
  11. <!-- />-->
  12. <!-- </el-form-item>-->
  13. <el-form-item label="客户名称" prop="fCorpid">
  14. <el-select
  15. v-model="queryParams.fCorpid"
  16. filterable
  17. remote
  18. clearable
  19. style="width: 200px"
  20. @keyup.enter.native="handleQuery"
  21. :remote-method="corpsRemoteMethod"
  22. placeholder="请输入客户名称"
  23. >
  24. <el-option
  25. v-for="(dict, index) in fMblnoOptions"
  26. :key="index.fId"
  27. :label="dict.fName"
  28. :value="dict.fId"
  29. ></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <!-- <el-form-item label="货物品名" prop="fGoodsid">-->
  33. <!-- <el-select-->
  34. <!-- v-model="queryParams.fGoodsid"-->
  35. <!-- filterable-->
  36. <!-- remote-->
  37. <!-- clearable-->
  38. <!-- style="width: 200px"-->
  39. <!-- :remote-method="goodsRemoteMethod"-->
  40. <!-- @keyup.enter.native="handleQuery"-->
  41. <!-- placeholder="请输入货物品名"-->
  42. <!-- >-->
  43. <!-- <el-option-->
  44. <!-- v-for="(dict, index) in goodsOptions"-->
  45. <!-- :key="index.fId"-->
  46. <!-- :label="dict.fName"-->
  47. <!-- :value="dict.fId"-->
  48. <!-- ></el-option>-->
  49. <!-- </el-select>-->
  50. <!-- </el-form-item>-->
  51. <el-form-item label="制单部门" prop="fDeptid">
  52. <el-input
  53. v-model="queryParams.fDeptid"
  54. placeholder="请输入制单部门"
  55. clearable
  56. size="small"
  57. @keyup.enter.native="handleQuery"
  58. />
  59. </el-form-item>
  60. <el-form-item label="有效期起" prop="fBegindate">
  61. <el-date-picker clearable size="small" style="width: 200px"
  62. v-model="queryParams.fBegindate"
  63. type="date"
  64. value-format="yyyy-MM-dd"
  65. placeholder="选择有效期起"
  66. >
  67. </el-date-picker>
  68. </el-form-item>
  69. <el-form-item label="有效期至" prop="fEnddate">
  70. <el-date-picker clearable size="small" style="width: 200px"
  71. v-model="queryParams.fEnddate"
  72. type="date"
  73. value-format="yyyy-MM-dd"
  74. placeholder="选择有效期至"
  75. >
  76. </el-date-picker>
  77. </el-form-item>
  78. <el-form-item label="协议编号" prop="fContractno">
  79. <el-input
  80. v-model="queryParams.fContractno"
  81. placeholder="请输入协议编号"
  82. clearable
  83. size="small"
  84. @keyup.enter.native="handleQuery"
  85. />
  86. </el-form-item>
  87. <el-row>
  88. <el-form-item style="float: right;padding: 5px">
  89. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  90. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  91. </el-form-item>
  92. </el-row>
  93. </el-form>
  94. <el-row :gutter="10" class="mb8">
  95. <el-col :span="1.5">
  96. <el-button
  97. type="primary"
  98. icon="el-icon-plus"
  99. size="mini"
  100. @click="handleAdd()"
  101. v-hasPermi="['agreement:agreementStorage:add']"
  102. >新增
  103. </el-button>
  104. </el-col>
  105. <el-col :span="1.5">
  106. <el-button
  107. type="warning"
  108. icon="el-icon-download"
  109. size="mini"
  110. @click="handleExport"
  111. v-hasPermi="['agreement:agreementStorage:export']"
  112. >导出
  113. </el-button>
  114. </el-col>
  115. <el-col :span="1.5">
  116. <el-button
  117. type="info"
  118. icon="el-icon-download"
  119. size="mini"
  120. :disabled="single"
  121. @click="handleUpdate(null,2)"
  122. v-hasPermi="['agreement:agreementStorage:export']"
  123. >复制新增
  124. </el-button>
  125. </el-col>
  126. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  127. </el-row>
  128. <el-table v-loading="loading" border :data="agreementList" @selection-change="handleSelectionChange">
  129. <el-table-column type="selection" width="55" align="center"/>
  130. <el-table-column label="合同编号" sortable align="center" prop="fContractno" show-overflow-tooltip/>
  131. <el-table-column label="客户名称" sortable align="center" width="220" prop="fCorpid"/>
  132. <!-- <el-table-column label="货物品名" align="center" prop="fGoodsid"/>-->
  133. <el-table-column label="有效期起" sortable align="center" prop="fBegindate" width="180">
  134. <template slot-scope="scope">
  135. <span>{{ parseTime(scope.row.fBegindate, '{y}-{m}-{d}') }}</span>
  136. </template>
  137. </el-table-column>
  138. <el-table-column label="有效期至" sortable align="center" prop="fEnddate" width="180">
  139. <template slot-scope="scope">
  140. <span>{{ parseTime(scope.row.fEnddate, '{y}-{m}-{d}') }}</span>
  141. </template>
  142. </el-table-column>
  143. <!-- <el-table-column label="状态" align="center" prop="fId" />-->
  144. <el-table-column label="是否启用" align="center" prop="fStatus">
  145. <template slot-scope="scope">
  146. <el-switch
  147. v-model="scope.row.fStatus"
  148. active-value="0"
  149. inactive-value="1"
  150. @change="handleStatusChange(scope.row)"
  151. ></el-switch>
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="状态" align="center" prop="fBillstatus">
  155. <template slot-scope="scope">
  156. <span v-if="scope.row.fBillstatus === '1'">保存</span>
  157. <span v-else-if="scope.row.fBillstatus === '2'">暂存</span>
  158. <span v-else-if="scope.row.fBillstatus === '3'">审批驳回</span>
  159. <span v-else-if="scope.row.fBillstatus === '4'">提交审核</span>
  160. <span v-else-if="scope.row.fBillstatus === '5'">审核中</span>
  161. <span v-else-if="scope.row.fBillstatus === '6'">审核完成</span>
  162. </template>
  163. </el-table-column>
  164. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  165. <template slot-scope="scope">
  166. <el-button
  167. size="mini"
  168. type="text"
  169. icon="el-icon-view"
  170. @click="check_s(scope.row,0)"
  171. v-hasPermi="['agreement:agreementStorage:edit']"
  172. >查看
  173. </el-button>
  174. <el-button
  175. size="mini"
  176. type="text"
  177. icon="el-icon-view"
  178. @click="check(scope.row,1)"
  179. v-hasPermi="['agreement:agreementStorage:edit']"
  180. v-if="scope.row.fBillstatus === '4' || scope.row.fBillstatus === '5'"
  181. >审批进度
  182. </el-button>
  183. <el-button
  184. size="mini"
  185. type="text"
  186. icon="el-icon-edit"
  187. @click="handleUpdate(scope.row,1)"
  188. v-hasPermi="['agreement:agreementStorage:edit']"
  189. v-if="scope.row.fBillstatus < 4"
  190. >修改
  191. </el-button>
  192. <el-button
  193. size="mini"
  194. type="text"
  195. icon="el-icon-delete"
  196. @click="handleDelete(scope.row)"
  197. v-if="scope.row.fBillstatus < 4"
  198. v-hasPermi="['agreement:agreementStorage:remove']"
  199. >删除
  200. </el-button>
  201. </template>
  202. </el-table-column>
  203. </el-table>
  204. <pagination
  205. v-show="total>0"
  206. :total="total"
  207. :page.sync="queryParams.pageNum"
  208. :limit.sync="queryParams.pageSize"
  209. @pagination="getList"
  210. />
  211. <!-- 添加或修改仓储费对话框 -->
  212. <el-dialog
  213. v-dialogDrag
  214. :fullscreen="dialogFull"
  215. :title="title"
  216. :visible.sync="open" width="65%"
  217. append-to-body
  218. :show-close="colseButton"
  219. >
  220. <template slot="title">
  221. <div class="avue-crud__dialog__header">
  222. <span class="el-dialog__title">
  223. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  224. 添加仓储费
  225. </span>
  226. <div class="avue-crud__dialog__menu enlarge" @click="full">
  227. <i style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
  228. </div>
  229. </div>
  230. </template>
  231. <el-form ref="form" :model="form" :rules="rules" label-width="80px"
  232. style="display: flex;flex-wrap: wrap;"
  233. >
  234. <el-form-item label="客户名称" prop="fCorpid">
  235. <el-select
  236. :disabled="notChange"
  237. v-model="form.fCorpid"
  238. filterable
  239. clearable
  240. style="width: 200px"
  241. @keyup.enter.native="handleQuery"
  242. placeholder="请输入客户名称"
  243. remote
  244. :remote-method="corpsRemoteMethod"
  245. >
  246. <el-option
  247. v-for="(dict, index) in fMblnoOptions"
  248. :key="index.fId"
  249. :label="dict.fName"
  250. :value="dict.fId"
  251. ></el-option>
  252. </el-select>
  253. </el-form-item>
  254. <el-form-item label="制单部门">
  255. <el-input v-model="deptName" :disabled="true" placeholder="请输入制单部门" style="width: 200px"/>
  256. </el-form-item>
  257. <el-form-item label="有效期起" prop="fBegindate">
  258. <el-date-picker clearable size="small" style="width: 200px"
  259. v-model="form.fBegindate"
  260. type="date"
  261. :disabled="notChange"
  262. value-format="yyyy-MM-dd"
  263. placeholder="选择有效期起"
  264. >
  265. </el-date-picker>
  266. </el-form-item>
  267. <el-form-item label="有效期至" prop="fEnddate">
  268. <el-date-picker clearable size="small" style="width: 200px"
  269. v-model="form.fEnddate"
  270. :disabled="notChange"
  271. type="date"
  272. value-format="yyyy-MM-dd"
  273. placeholder="选择有效期至"
  274. >
  275. </el-date-picker>
  276. </el-form-item>
  277. <el-form-item label="合同编号" prop="fContractno">
  278. <el-input v-model="form.fContractno" :disabled="notChange" placeholder="请输入合同编号" style="width: 200px"/>
  279. </el-form-item>
  280. <el-form-item label="商品类别" prop="tPackages">
  281. <el-select v-model="form.tPackages" :disabled="notChange" placeholder="请选择商品类别" multiple>
  282. <el-option
  283. v-for="(dict, index) in fTypeidOptions"
  284. :key="index.dictValue"
  285. :label="dict.dictLabel"
  286. :value="dict.dictValue"
  287. style="width: 210px;"
  288. ></el-option>
  289. </el-select>
  290. </el-form-item>
  291. <el-form-item label="仓库" prop="fWarehouseid" v-if="showWarehouse == '0'">
  292. <el-select v-model="form.fWarehouseid" :disabled="notChange" placeholder="请选择仓库库区" multiple>
  293. <el-option
  294. v-for="(item, index) in warehouseOptions"
  295. :key="index.fId"
  296. :label="item.fName"
  297. :value="item.fId"
  298. style="width: 210px;"
  299. ></el-option>
  300. </el-select>
  301. </el-form-item>
  302. </el-form>
  303. <el-button type="primary" @click="submit" :disabled="notChange">请 核</el-button>
  304. <div class="dialogTableTitle flex a-center jlr">
  305. <h2>收款</h2>
  306. <el-button @click="getList_s('C')" :disabled="notChange">新增</el-button>
  307. </div>
  308. <el-table v-loading="loading_s" border :data="agreementitemsList" @selection-change="handleSelectionChange">
  309. <!-- <el-table-column type="selection" width="55" align="center"/>-->
  310. <el-table-column label="行号" align="center" type="index" fixed="left"/>
  311. <el-table-column
  312. prop="fFeeunitid"
  313. header-align="center"
  314. align="center"
  315. width="125px"
  316. label="计价单位"
  317. >
  318. <template slot-scope="scope">
  319. <el-select
  320. v-model="scope.row.fFeeunitid"
  321. placeholder="请选择计价单位"
  322. @change="changeFeeUnit(scope.row)"
  323. clearable
  324. :disabled="browseStatus"
  325. >
  326. <el-option
  327. v-for="(dict, index) in jFeetunitOptions"
  328. :key="index.dictValue"
  329. :label="dict.dictLabel"
  330. :value="dict.dictValue"
  331. />
  332. </el-select>
  333. </template>
  334. </el-table-column>
  335. <el-table-column label="开始天数" align="center" width="90">
  336. <template slot-scope="scope">
  337. <el-input
  338. v-model="scope.row.fFromdays"
  339. placeholder="请输入开始天数"
  340. oninput='value = value.replace(/[^\d.]/g,"")'
  341. clearable
  342. size="small"
  343. :disabled="notChange"
  344. />
  345. </template>
  346. </el-table-column>
  347. <el-table-column label="结束天数" align="center" width="90">
  348. <template slot-scope="scope">
  349. <el-input
  350. v-model="scope.row.fEndays"
  351. placeholder="请输入结束天数"
  352. oninput='value = value.replace(/[^\d.]/g,"")'
  353. clearable
  354. size="small"
  355. :disabled="notChange"
  356. />
  357. </template>
  358. </el-table-column>
  359. <el-table-column label="单价" align="center" width="90">
  360. <el-input
  361. slot-scope="scope"
  362. v-model="scope.row.fPrice"
  363. placeholder="请输入单价"
  364. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  365. clearable
  366. size="small"
  367. :disabled="notChange"
  368. />
  369. </el-table-column>
  370. <el-table-column label="录入人" align="center" width="120">
  371. <el-input
  372. slot-scope="scope"
  373. v-model="scope.row.createBy"
  374. :disabled="true"
  375. placeholder="默认录入人"
  376. clearable
  377. size="small"
  378. />
  379. </el-table-column>
  380. <el-table-column label="录入时间" align="center" width="150">
  381. <el-input
  382. slot-scope="scope"
  383. v-model="scope.row.createTime"
  384. placeholder="默认录入时间"
  385. :disabled="true"
  386. clearable
  387. size="small"
  388. />
  389. </el-table-column>
  390. <el-table-column
  391. prop="fFeeid"
  392. header-align="center"
  393. align="center"
  394. width="180px"
  395. label="费用名称"
  396. >
  397. <template slot-scope="scope">
  398. <el-select
  399. v-model="scope.row.fFeeid"
  400. filterable
  401. remote
  402. :disabled="browseStatus"
  403. :remote-method="fWRemoteMethod"
  404. placeholder="费用名称"
  405. >
  406. <el-option
  407. v-for="(dict, index) in fWbuOptions"
  408. :key="index.fId"
  409. :label="dict.fName"
  410. :value="dict.fId"
  411. ></el-option>
  412. </el-select>
  413. </template>
  414. </el-table-column>
  415. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
  416. <template slot-scope="scope">
  417. <el-button
  418. size="mini"
  419. type="text"
  420. icon="el-icon-delete"
  421. :disabled="browseStatus"
  422. @click.native.prevent="deleteRow(scope.$index, agreementitemsList)"
  423. >删除
  424. </el-button>
  425. </template>
  426. </el-table-column>
  427. </el-table>
  428. <!-- 付款-->
  429. <!-- <div class="dialogTableTitle flex a-center jlr">-->
  430. <!-- <h2>付款</h2>-->
  431. <!-- <el-button @click="getList_s('D')" :disabled="notChange">新增</el-button>-->
  432. <!-- </div>-->
  433. <!-- <el-table v-loading="loading_f" :data="agreementitemsListD" @selection-change="handleSelectionChange">-->
  434. <!-- &lt;!&ndash; <el-table-column type="selection" width="55" align="center"/>&ndash;&gt;-->
  435. <!-- <el-table-column label="行号" align="center" type="index"/>-->
  436. <!-- <el-table-column-->
  437. <!-- prop="fFeeunitid"-->
  438. <!-- header-align="center"-->
  439. <!-- align="center"-->
  440. <!-- width="180px"-->
  441. <!-- label="计价单位"-->
  442. <!-- >-->
  443. <!-- <template slot-scope="scope">-->
  444. <!-- <el-select-->
  445. <!-- v-model="scope.row.fFeeunitid"-->
  446. <!-- placeholder="请选择计价单位"-->
  447. <!-- @change="changeFeeUnit(scope.row)"-->
  448. <!-- clearable-->
  449. <!-- :disabled="browseStatus"-->
  450. <!-- >-->
  451. <!-- <el-option-->
  452. <!-- v-for="(dict, index) in jFeetunitOptions"-->
  453. <!-- :key="index.dictValue"-->
  454. <!-- :label="dict.dictLabel"-->
  455. <!-- :value="dict.dictValue"-->
  456. <!-- />-->
  457. <!-- </el-select>-->
  458. <!-- </template>-->
  459. <!-- </el-table-column>-->
  460. <!-- <el-table-column label="开始天数" align="center">-->
  461. <!-- <template slot-scope="scope">-->
  462. <!-- <el-input-->
  463. <!-- v-model="scope.row.fFromdays"-->
  464. <!-- placeholder="请输入开始天数"-->
  465. <!-- oninput='value = value.replace(/[^\d.]/g,"")'-->
  466. <!-- clearable-->
  467. <!-- size="small"-->
  468. <!-- :disabled="notChange"-->
  469. <!-- />-->
  470. <!-- </template>-->
  471. <!-- </el-table-column>-->
  472. <!-- <el-table-column label="结束天数" align="center">-->
  473. <!-- <template slot-scope="scope">-->
  474. <!-- <el-input-->
  475. <!-- v-model="scope.row.fEndays"-->
  476. <!-- placeholder="请输入结束天数"-->
  477. <!-- oninput='value = value.replace(/[^\d.]/g,"")'-->
  478. <!-- clearable-->
  479. <!-- size="small"-->
  480. <!-- :disabled="notChange"-->
  481. <!-- />-->
  482. <!-- </template>-->
  483. <!-- </el-table-column>-->
  484. <!-- <el-table-column label="单价" align="center">-->
  485. <!-- <el-input-->
  486. <!-- slot-scope="scope"-->
  487. <!-- v-model="scope.row.fPrice"-->
  488. <!-- placeholder="请输入单价"-->
  489. <!-- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'-->
  490. <!-- clearable-->
  491. <!-- size="small"-->
  492. <!-- :disabled="notChange"-->
  493. <!-- />-->
  494. <!-- </el-table-column>-->
  495. <!-- <el-table-column label="录入人" align="center">-->
  496. <!-- <el-input-->
  497. <!-- slot-scope="scope"-->
  498. <!-- v-model="scope.row.createBy"-->
  499. <!-- :disabled="true"-->
  500. <!-- placeholder="默认录入人"-->
  501. <!-- clearable-->
  502. <!-- size="small"-->
  503. <!-- />-->
  504. <!-- </el-table-column>-->
  505. <!-- <el-table-column label="录入时间" align="center">-->
  506. <!-- <el-input-->
  507. <!-- slot-scope="scope"-->
  508. <!-- v-model="scope.row.createTime"-->
  509. <!-- placeholder="默认录入时间"-->
  510. <!-- :disabled="true"-->
  511. <!-- clearable-->
  512. <!-- size="small"-->
  513. <!-- />-->
  514. <!-- </el-table-column>-->
  515. <!-- <el-table-column-->
  516. <!-- prop="fFeeid"-->
  517. <!-- header-align="center"-->
  518. <!-- align="center"-->
  519. <!-- width="180px"-->
  520. <!-- label="费用名称"-->
  521. <!-- >-->
  522. <!-- <template slot-scope="scope">-->
  523. <!-- <el-select-->
  524. <!-- v-model="scope.row.fFeeid"-->
  525. <!-- filterable-->
  526. <!-- remote-->
  527. <!-- :disabled="browseStatus"-->
  528. <!-- :remote-method="fWRemoteMethod"-->
  529. <!-- placeholder="费用名称"-->
  530. <!-- >-->
  531. <!-- <el-option-->
  532. <!-- v-for="(dict, index) in fWbuOptions"-->
  533. <!-- :key="index.fId"-->
  534. <!-- :label="dict.fName"-->
  535. <!-- :value="dict.fId"-->
  536. <!-- ></el-option>-->
  537. <!-- </el-select>-->
  538. <!-- </template>-->
  539. <!-- </el-table-column>-->
  540. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
  541. <!-- <template slot-scope="scope">-->
  542. <!-- <el-button-->
  543. <!-- size="mini"-->
  544. <!-- type="text"-->
  545. <!-- icon="el-icon-delete"-->
  546. <!-- :disabled="browseStatus"-->
  547. <!-- @click.native.prevent="deleteRow(scope.$index, agreementitemsListD)"-->
  548. <!-- >删除-->
  549. <!-- </el-button>-->
  550. <!-- </template>-->
  551. <!-- </el-table-column>-->
  552. <!-- </el-table>-->
  553. <!-- 附件明细-->
  554. <div class="dialogTableTitle flex a-center jlr">
  555. <h2>附件明细</h2>
  556. <el-button @click="addRelevt" :disabled="notChange">新增</el-button>
  557. </div>
  558. <el-table
  559. :data="relevantAttachments"
  560. ref="table"
  561. tooltip-effect="dark"
  562. stripe
  563. style="width: 100%"
  564. >
  565. <el-table-column label="序号" type="index" width="80"></el-table-column>
  566. <el-table-column
  567. prop="fName"
  568. header-align="center"
  569. align="center"
  570. label="附件名称"
  571. >
  572. <template slot-scope="scope">
  573. <el-input
  574. v-model="scope.row.fName"
  575. :disabled="browseStatus"
  576. placeholder="附件名称"
  577. show-word-limit
  578. />
  579. </template>
  580. </el-table-column>
  581. <el-table-column
  582. prop="fDesc"
  583. header-align="center"
  584. align="center"
  585. label="附件描述"
  586. >
  587. <template slot-scope="scope">
  588. <el-input
  589. v-model="scope.row.fDesc"
  590. :disabled="browseStatus"
  591. placeholder="附件描述"
  592. show-word-limit
  593. />
  594. </template>
  595. </el-table-column>
  596. <el-table-column
  597. prop="fUrl"
  598. header-align="center"
  599. align="center"
  600. label="上传附件"
  601. >
  602. <template slot-scope="scope">
  603. <div style="display: flex; justify-content: center">
  604. <el-upload
  605. class="upload-demo"
  606. :action="uploadImgUrl"
  607. :on-success="
  608. (res, file) => {
  609. handleSucces(scope, res, file);
  610. }
  611. "
  612. :headers="headers"
  613. :disabled="browseStatus"
  614. :show-file-list="false"
  615. :limit="1"
  616. >
  617. <el-button size="small" type="text" :disabled="browseStatus"
  618. >点击上传</el-button
  619. >
  620. </el-upload>
  621. <el-button size="small" type="text" @click="checkFile(scope)"
  622. >查看</el-button
  623. >
  624. </div>
  625. </template>
  626. </el-table-column>
  627. <el-table-column
  628. header-align="center"
  629. align="center"
  630. label="操作"
  631. width="130PX"
  632. fixed="right"
  633. >
  634. <template slot-scope="scope">
  635. <el-button
  636. @click.native.prevent="deleteUploadRow(scope.$index, relevantAttachments)"
  637. :disabled="browseStatus"
  638. size="small"
  639. type="text"
  640. >删除
  641. </el-button>
  642. </template>
  643. </el-table-column>
  644. </el-table>
  645. <div slot="footer" class="dialog-footer">
  646. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  647. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
  648. <el-button v-if="approve === true" @click="goApproval('f_billstatus')">审批</el-button>
  649. <el-button type="danger" @click="backApproval('f_billstatus')" v-if="form.fBillstatus === '4' && operator === lander">撤销审批</el-button>
  650. <el-button type="info" v-if="form.fBillstatus >= 3" @click="addOrUpdateHandle('f_billstatus')">查看审批流</el-button>
  651. <el-button type="success" @click="backrRconciliation" v-if="form.fBillstatus === '6'">撤销请核</el-button>
  652. <el-button type="primary" @click="submitForm" :disabled="notChange">保 存</el-button>
  653. <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
  654. <el-button v-if="cancelButton === false" @click="homePage">取消</el-button>
  655. </div>
  656. </el-dialog>
  657. </div>
  658. </template>
  659. <script>
  660. import moment from 'moment'
  661. import {
  662. RevocationApproval,
  663. backFee,
  664. PleaseCheck,
  665. listAgreements,
  666. getAgreement,
  667. delAgreement,
  668. addAgreement,
  669. updateAgreement_s,
  670. exportAgreement,
  671. listAgreementitems,
  672. queryUserVal
  673. } from '@/api/warehouseBusiness/agreement'
  674. import { listCorps } from '@/api/basicdata/corps'
  675. import { listGoods } from '@/api/basicdata/goods'
  676. import { delWarehousebills } from '@/api/warehouseBusiness/warehouseInStock'
  677. import { listGoodsTransfer } from '@/api/warehouseBusiness/goodsTransfer'
  678. import { listFees } from '@/api/basicdata/fees'
  679. import { changeUserStatus } from '@/api/system/user'
  680. import AddOrUpdate from '@/views/viewApproval'
  681. import ApprovalComments from '@/views/startApproval'
  682. import Global from '@/layout/components/global'
  683. import Vue from 'vue'
  684. // import { listUser, queryUserVal } from '@/api/system/user'
  685. import { getToken } from "@/utils/auth";
  686. import {
  687. listWarehousesss,
  688. } from "@/api/basicdata/warehouse";
  689. Vue.directive('dialogDrag', {
  690. bind(el, binding, vnode, oldVnode) {
  691. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  692. const dragDom = el.querySelector('.el-dialog')
  693. const enlarge = el.querySelector('.enlarge')
  694. dialogHeaderEl.style.cursor = 'move'
  695. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  696. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  697. if(enlarge){
  698. enlarge.onclick = (e) => {
  699. dragDom.style.top = '0px'
  700. dragDom.style.left = '0px'
  701. }
  702. }
  703. dialogHeaderEl.onmousedown = (e) => {
  704. // 鼠标按下,计算当前元素距离可视区的距离
  705. const disX = e.clientX - dialogHeaderEl.offsetLeft
  706. const disY = e.clientY - dialogHeaderEl.offsetTop
  707. // 获取到的值带px 正则匹配替换
  708. let styL, styT
  709. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  710. if (sty.left.includes('%')) {
  711. styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  712. styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  713. } else {
  714. styL = +sty.left.replace(/\px/g, '')
  715. styT = +sty.top.replace(/\px/g, '')
  716. }
  717. document.onmousemove = function(e) {
  718. // 通过事件委托,计算移动的距离
  719. const l = e.clientX - disX
  720. const t = e.clientY - disY
  721. // 移动当前元素
  722. if ((t + styT) >= 0){
  723. dragDom.style.top = `${t + styT}px`
  724. }
  725. dragDom.style.left = `${l + styL}px`
  726. // 将此时的位置传出去
  727. // binding.value({x:e.pageX,y:e.pageY})
  728. }
  729. document.onmouseup = function(e) {
  730. document.onmousemove = null
  731. document.onmouseup = null
  732. }
  733. }
  734. }
  735. })
  736. export default {
  737. name: 'Agreement',
  738. components: {
  739. AddOrUpdate,
  740. ApprovalComments
  741. },
  742. data() {
  743. return {
  744. dialogFull:false,
  745. addOrEdid:1,
  746. idCopy:'',
  747. colseButton:true,
  748. cancelButton:true,
  749. // 审批状态
  750. approve:false,
  751. addOrUpdateVisible: false,
  752. addOrUpdateVisib:false,
  753. notChange: false,
  754. dataList: '',
  755. value_s: [],
  756. // 遮罩层
  757. loading: true,
  758. loading_s: false,
  759. loading_f: false,
  760. browseStatus: false,
  761. // 计价单位
  762. jFeetunitOptions: [],
  763. agreementId: 310,
  764. goodsOptions: [],
  765. fTypeidOptions: [],
  766. // 选中数组
  767. ids: [],
  768. deptName: '',
  769. // 客户(客户数据)
  770. fMblnoOptions: [],
  771. fFeeunitidOptions: [],
  772. fWbuOptions: [],
  773. // 非单个禁用
  774. single: true,
  775. // 非多个禁用
  776. multiple: true,
  777. // 显示搜索条件
  778. showSearch: true,
  779. // 总条数
  780. total: 0,
  781. // 仓储费表格数据
  782. agreementList: [],
  783. // 仓库
  784. warehouseOptions: [],
  785. showWarehouse: null,
  786. // 弹出层标题
  787. title: '',
  788. add: '',
  789. // 是否显示弹出层
  790. open: false,
  791. // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典
  792. fStltypeidOptions: [],
  793. // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典
  794. tPackagesOptions: [],
  795. // 贸易方式,对应t_trademodels 字典
  796. fTrademodeidOptions: [],
  797. // 仓储费收款明细表表格数据
  798. agreementitemsList: [],
  799. //仓储费付款明细表表格数据
  800. agreementitemsListD: [],
  801. // 操作人
  802. operator: '',
  803. lander: '',
  804. // 查询参数
  805. queryParams: {
  806. pageNum: 1,
  807. pageSize: 10,
  808. fBillno: null,
  809. fDeptid: null,
  810. fContractno: null,
  811. fCorpid: null,
  812. fStltypeid: null,
  813. fGoodsid: null,
  814. fFeetypeid: null,
  815. tPackages: null,
  816. fTrademodeid: null,
  817. fFreedays: null,
  818. fBegindate: null,
  819. fEnddate: null,
  820. fBillstatus: null,
  821. fStatus: null
  822. },
  823. // 表单参数
  824. form: {},
  825. // 表单校验
  826. rules: {
  827. fBillno: [
  828. {
  829. required: true,
  830. message: ' ',
  831. trigger: 'blur'
  832. }
  833. ],
  834. fCorpid: [
  835. { required: true, message: ' ', trigger: 'blur' }
  836. ],
  837. tPackages:[
  838. { required: true, message: ' ', trigger: 'blur' }
  839. ],
  840. fBegindate:[
  841. { required: true, message: ' ', trigger: 'blur' }
  842. ],
  843. fEnddate:[
  844. { required: true, message: ' ', trigger: 'blur' }
  845. ],
  846. fWarehouseid: [
  847. { required: true, message: ' ', trigger: 'blur' }
  848. ],
  849. },
  850. // 附件上传数组
  851. relevantAttachments: [],
  852. headers: {
  853. Authorization: "Bearer " + getToken(),
  854. },
  855. uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
  856. }
  857. },
  858. created() {
  859. this.getList()
  860. // console.log(fMblnoOptions)
  861. listCorps().then(response => {
  862. this.fMblnoOptions = response.rows
  863. })
  864. listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
  865. this.warehouseOptions = response.rows;
  866. });
  867. this.getDicts('data_settlement_method').then(response => {
  868. this.fStltypeidOptions = response.data
  869. })
  870. this.getDicts('data_package_unit').then(response => {
  871. this.tPackagesOptions = response.data
  872. })
  873. this.getDicts('data_trademodes').then(response => {
  874. this.fTrademodeidOptions = response.data
  875. })
  876. this.getDicts('data_goods_category').then(response => {
  877. this.fTypeidOptions = response.data
  878. })
  879. this.getDicts("data_unitfees").then(response => {
  880. this.jFeetunitOptions = response.data;
  881. });
  882. this.getConfigKey("agreement.warehouse").then((response) => {
  883. this.showWarehouse = response.msg;
  884. });
  885. this.register()
  886. },
  887. activated(){
  888. this.Jump()
  889. },
  890. methods: {
  891. full(){
  892. this.dialogFull = !this.dialogFull
  893. },
  894. //复制新增按钮
  895. handleCopy(){
  896. getAgreement().then(response => {
  897. })
  898. },
  899. homepaGe(){
  900. let view = {
  901. fullPath: "/agreement/agreementStorage",
  902. hash: "",
  903. matched: Array(2),
  904. meta: Object,
  905. name: "AgreementStorage",
  906. params: Object,
  907. path: "/agreement/agreementStorage",
  908. query: Object,
  909. title: "仓储费协议"
  910. }
  911. this.$router.push({ path: '/index'})
  912. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  913. if (this.isActive(view)) {
  914. this.toLastView(visitedViews, view)
  915. }
  916. })
  917. Global.$emit("removeCache", "closeSelectedTag", view);
  918. },
  919. homePage() {
  920. this.open = false
  921. let view = {
  922. fullPath: "/agreement/agreementStorage",
  923. hash: "",
  924. matched: Array(2),
  925. meta: Object,
  926. name: "AgreementStorage",
  927. params: Object,
  928. path: "/agreement/agreementStorage",
  929. query: Object,
  930. title: "仓储费协议"
  931. }
  932. this.$router.push({ path: '/index' })
  933. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  934. if (this.isActive(view)) {
  935. this.toLastView(visitedViews, view)
  936. }
  937. })
  938. Global.$emit("removeCache", "closeSelectedTag", view);
  939. },
  940. Jump(){
  941. this.approval = this.$route.query.data
  942. if(this.approval) {
  943. this.approval = JSON.parse(this.approval)
  944. this.colseButton = false
  945. this.hide = false
  946. this.open = true
  947. this.notChange = true
  948. this.approve = true
  949. this.cancelButton = false
  950. this.reset()
  951. getAgreement(this.approval.billId).then(response => {
  952. this.deptName = response.data.dept?response.data.dept.deptName: ''
  953. this.form = response.data.tWarehouseAgreement
  954. //--
  955. // this.fMblnoOptions = response.data.corps
  956. this.agreementitemsList = response.data.tWarehouseAgreementitems
  957. for (let item in this.agreementitemsList) {
  958. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  959. // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
  960. }
  961. this.fWbuOptions = response.data.feesList
  962. // this.add = row
  963. this.open = true
  964. this.browseStatus = true
  965. })
  966. }
  967. },
  968. goApproval(status){
  969. this.addOrUpdateVisib = true
  970. this.$nextTick(() => {
  971. this.$refs.ApprovalComments.init(this.form.fId,status,this.agreementId)
  972. })
  973. },
  974. returnData(){
  975. this.addOrUpdateVisib = false
  976. this.open = false
  977. this.homepaGe()
  978. },
  979. getDataList(){
  980. this.addOrUpdateVisible = false
  981. },
  982. // 查看审批流
  983. addOrUpdateHandle(status) {
  984. this.addOrUpdateVisible = true
  985. this.addOrUpdateVisib = false
  986. let id = '448'
  987. let actId = '110'
  988. this.$nextTick(() => {
  989. this.$refs.addOrUpdate.init(this.form.fId, this.agreementId,status)
  990. })
  991. },
  992. register() {
  993. queryUserVal().then((response) => {
  994. this.lander = response.user.userName
  995. })
  996. },
  997. check_s(row, res) {
  998. this.notChange = true
  999. this.browseStatus = true
  1000. this.relevantAttachments = []
  1001. this.register()
  1002. getAgreement(row.fId).then(response => {
  1003. // this.$set(this,'fMblnoOptions',response.data.corps)
  1004. if (response.data.dept) {
  1005. this.deptName = response.data.dept.deptName
  1006. }
  1007. this.form = response.data.tWarehouseAgreement
  1008. if (response.data.attachList) {
  1009. this.relevantAttachments = response.data.attachList
  1010. } else {
  1011. this.relevantAttachments = []
  1012. }
  1013. if (response.data.tWarehouseAgreement.tPackages) {
  1014. // this.form.tPackages = this.form.tPackages
  1015. // .replace(/\[|]/g, "")
  1016. // .replace(/\"/g, "")
  1017. // .split(",");
  1018. this.form.tPackages = JSON.parse(this.form.tPackages)
  1019. }
  1020. if (response.data.tWarehouseAgreement.fWarehouseid) {
  1021. this.form.fWarehouseid = JSON.parse(this.form.fWarehouseid)
  1022. }
  1023. this.operator = this.form.createBy
  1024. this.agreementitemsList = response.data.tWarehouseAgreementitems
  1025. for (let item in this.agreementitemsList) {
  1026. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  1027. }
  1028. this.fWbuOptions = response.data.feesList
  1029. this.add = row
  1030. this.title = '修改仓储费'
  1031. this.open = true
  1032. })
  1033. },
  1034. // 查看按钮
  1035. check(row, res) {
  1036. this.notChange = true
  1037. this.browseStatus = true
  1038. this.register()
  1039. getAgreement(row.fId).then(response => {
  1040. // this.fMblnoOptions = response.data.corps
  1041. // this.deptName = response.data.dept.deptName
  1042. this.deptName = response.data.dept?response.data.dept.deptName: ''
  1043. this.form = response.data.tWarehouseAgreement
  1044. this.operator = this.form.createBy
  1045. this.agreementitemsList = response.data.tWarehouseAgreementitems
  1046. for (let item in this.agreementitemsList) {
  1047. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  1048. }
  1049. this.fWbuOptions = response.data.feesList
  1050. this.add = row
  1051. this.title = '修改仓储费'
  1052. this.open = true
  1053. })
  1054. },
  1055. //撤销审批
  1056. backApproval(status) {
  1057. let data = {
  1058. id: this.form.fId,
  1059. actId: this.agreementId,
  1060. billId: this.form.fId,
  1061. fidStatus: status,
  1062. }
  1063. RevocationApproval(data).then(data => {
  1064. if (data.code === 200) {
  1065. this.$message.success('撤销成功')
  1066. this.open = false
  1067. this.getList()
  1068. }
  1069. })
  1070. },
  1071. // 撤销请核
  1072. backrRconciliation() {
  1073. let formData = new window.FormData()
  1074. // 附件数据
  1075. formData.append('agreement', JSON.stringify(this.form))
  1076. formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
  1077. backFee(formData).then(response => {
  1078. this.msgSuccess('撤销成功')
  1079. this.open = false
  1080. this.getList()
  1081. })
  1082. },
  1083. // 请核按钮
  1084. submit() {
  1085. if (this.agreementitemsList.length <= 0) {
  1086. this.$message.error('仓储费协议明细为空,无法操作')
  1087. return false
  1088. }
  1089. for (let agr = 0; agr < this.agreementitemsList.length; agr ++) {
  1090. if (!this.agreementitemsList[agr].fFeeunitid) {
  1091. this.$message.error('请维护仓储费明细计价单位')
  1092. return false
  1093. }
  1094. if (!this.agreementitemsList[agr].fFromdays) {
  1095. this.$message.error('请维护仓储费明细开始天数')
  1096. return false
  1097. }
  1098. if (!this.agreementitemsList[agr].fEndays) {
  1099. this.$message.error('请维护仓储费明细结束天数')
  1100. return false
  1101. }
  1102. if (this.agreementitemsList[agr].fPrice.length === 0) {
  1103. this.$message.error('请维护仓储费明细单价')
  1104. return false
  1105. }
  1106. if (!this.agreementitemsList[agr].fFeeid) {
  1107. this.$message.error('请维护仓储费明细费用名称')
  1108. return false
  1109. }
  1110. }
  1111. this.$refs['form'].validate(valid => {
  1112. if (valid) {
  1113. let formData = new window.FormData()
  1114. formData.append('agreement', JSON.stringify(this.form))
  1115. formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
  1116. formData.append('attachments', JSON.stringify(this.relevantAttachments))
  1117. PleaseCheck(formData).then(response => {
  1118. this.msgSuccess('请核成功')
  1119. this.open = false
  1120. this.getList()
  1121. })
  1122. }
  1123. })
  1124. },
  1125. // 仓储费状态修改
  1126. handleStatusChange(row) {
  1127. if(row.fBillstatus == '6'){
  1128. let text = row.fStatus === '0' ? '启用' : '停用'
  1129. this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', '警告', {
  1130. confirmButtonText: '确定',
  1131. cancelButtonText: '取消',
  1132. type: 'warning'
  1133. }).then(function() {
  1134. return updateAgreement_s(row.fId, row.fStatus)
  1135. }).then(() => {
  1136. this.msgSuccess(text + '成功')
  1137. }).catch(function() {
  1138. row.fStatus = row.fStatus === '0' ? '1' : '0'
  1139. })
  1140. }else{
  1141. row.fStatus = 0
  1142. this.$message.error('审核完成时才能启用');
  1143. }
  1144. },
  1145. /** 创建仓储费明细表列表 */
  1146. getList_s(payment) {
  1147. queryUserVal().then((response) => {
  1148. if (payment === 'C') {
  1149. this.agreementitemsList.push({
  1150. //行号
  1151. fLineno: '',
  1152. //计价单位
  1153. fFeeunitid: '',
  1154. //费用名称
  1155. fFeeid: '',
  1156. //开始天数
  1157. fFromdays: '',
  1158. //结束天数
  1159. fEndays: '',
  1160. //单价
  1161. fPrice: '',
  1162. //录入人
  1163. createBy: response.user.userName,
  1164. //创建时间
  1165. createTime: moment(Date.parse(new Date())).format('YYYY-MM-DD HH:mm:ss')
  1166. })
  1167. } else {
  1168. this.agreementitemsListD.push({
  1169. //行号
  1170. fLineno: '',
  1171. //计价单位
  1172. fFeeunitid: '',
  1173. //费用名称
  1174. fFeeid: '',
  1175. //开始天数
  1176. fFromdays: '',
  1177. //结束天数
  1178. fEndays: '',
  1179. //单价
  1180. fPrice: '',
  1181. //录入人
  1182. createBy: response.user.userName,
  1183. //创建时间
  1184. createTime: moment(Date.parse(new Date())).format('YYYY-MM-DD HH:mm:ss')
  1185. })
  1186. }
  1187. // this.$set("deptName", response.dept.deptName);
  1188. this.deptName = response.dept?response.dept.deptName: ''
  1189. this.form.fDeptid = response.dept? response.dept.deptId: ''
  1190. this.agreementitemsList.createBy = response.user.userName
  1191. // this.$set(this.agreementitemsList, "createBy", response.user.userName);
  1192. //格式化时间戳
  1193. // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
  1194. })
  1195. listAgreementitems(this.queryParams).then(response => {
  1196. })
  1197. },
  1198. /* 远程模糊查询商品 */
  1199. goodsRemoteMethod(name) {
  1200. if (name == null || name === '') {
  1201. return false
  1202. }
  1203. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  1204. listGoods(queryParams).then((response) => {
  1205. this.goodsOptions = response.rows
  1206. })
  1207. },
  1208. // 计价单位
  1209. fFeeunitidFormat(row, column) {
  1210. return this.selectDictLabel(this.fFeeunitidOptions, row.fFeeunitid)
  1211. },
  1212. /** 查询仓储费列表 */
  1213. getList() {
  1214. this.loading = true
  1215. listAgreements(this.queryParams).then(response => {
  1216. this.agreementList = response.rows
  1217. this.total = response.total
  1218. this.loading = false
  1219. })
  1220. },
  1221. // 远程模糊查询费用名称
  1222. fWRemoteMethod(name) {
  1223. this.fWbuOptions = []
  1224. if (name == null || name === '') {
  1225. return false
  1226. }
  1227. let queryParams = { fName: name }
  1228. listFees(queryParams).then((response) => {
  1229. this.fWbuOptions = response.rows
  1230. })
  1231. },
  1232. // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典翻译
  1233. fStltypeidFormat(row, column) {
  1234. return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid)
  1235. },
  1236. // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典翻译
  1237. tPackagesFormat(row, column) {
  1238. return this.selectDictLabel(this.tPackagesOptions, row.tPackages)
  1239. },
  1240. // 贸易方式,对应t_trademodels 字典翻译
  1241. fTrademodeidFormat(row, column) {
  1242. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
  1243. },
  1244. // 取消按钮
  1245. cancel() {
  1246. this.open = false
  1247. this.reset()
  1248. this.getList()
  1249. this.agreementitemsList = []
  1250. },
  1251. handleClose() {
  1252. this.open = false
  1253. this.reset()
  1254. this.getList()
  1255. this.agreementitemsList = []
  1256. },
  1257. // 表单重置
  1258. reset() {
  1259. this.form = {
  1260. fId: null,
  1261. fBillno: null,
  1262. fDeptid: null,
  1263. fContractno: null,
  1264. fCorpid: null,
  1265. fStltypeid: null,
  1266. fGoodsid: null,
  1267. fFeetypeid: null,
  1268. tPackages: null,
  1269. fTrademodeid: null,
  1270. fFreedays: null,
  1271. fBegindate: null,
  1272. fEnddate: null,
  1273. fBillstatus: null,
  1274. delFlag: null,
  1275. createBy: null,
  1276. createTime: null,
  1277. updateBy: null,
  1278. updateTime: null,
  1279. remark: null
  1280. }
  1281. this.resetForm('form')
  1282. },
  1283. /** 搜索按钮操作 */
  1284. handleQuery() {
  1285. this.queryParams.pageNum = 1
  1286. this.getList()
  1287. },
  1288. // 变更计价单位
  1289. changeFeeUnit(row) {
  1290. if (!row.fFeeUnitid) {
  1291. return false
  1292. }
  1293. if (row.fFeeUnitid === '0') {
  1294. this.$set(row, 'fQty', this.fCntqty)
  1295. } else if (row.fFeeUnitid === '1') {
  1296. this.$set(row, 'fQty', this.fGrossweight)
  1297. }
  1298. if (row.fUnitprice) {
  1299. this.$set(
  1300. row,
  1301. 'fAmount',
  1302. parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2)
  1303. )
  1304. }
  1305. },
  1306. /** 重置按钮操作 */
  1307. resetQuery() {
  1308. this.resetForm('queryForm')
  1309. this.handleQuery()
  1310. },
  1311. // 多选框选中数据
  1312. handleSelectionChange(selection) {
  1313. this.ids = selection.map(item => item.fId)
  1314. this.idCopy = this.ids[0]
  1315. this.single = selection.length !== 1
  1316. this.multiple = !selection.length
  1317. },
  1318. /** 新增按钮操作 */
  1319. handleAdd() {
  1320. this.form = {}
  1321. this.agreementitemsList = []
  1322. this.agreementitemsListD = []
  1323. this.reset()
  1324. // this.agreementitemsList = {
  1325. // fFeeunitid:'',
  1326. // fFromdays:'',
  1327. // fEndays:'',
  1328. // fPrice:'',
  1329. // fFeeid:''
  1330. // }
  1331. this.open = true
  1332. this.browseStatus = false
  1333. this.notChange = false
  1334. this.title = '添加仓储费'
  1335. queryUserVal().then((response) => {
  1336. // this.$set("deptName", response.dept.deptName);
  1337. this.deptName = response.dept?response.dept.deptName: ''
  1338. this.form.fDeptid = response.dept? response.dept.deptId: ''
  1339. // this.agreementitemsList.createBy = response.user.userName
  1340. // this.$set(this.agreementitemsList, "createBy", response.user.userName);
  1341. //格式化时间戳
  1342. // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
  1343. })
  1344. },
  1345. /** 修改按钮操作 */
  1346. handleUpdate(row,num) {
  1347. this.relevantAttachments = []
  1348. if (num === 2){
  1349. this.notChange = false
  1350. getAgreement(this.idCopy).then(response => {
  1351. // this.deptName = response.data.dept.deptName
  1352. this.deptName = response.data.dept?response.data.dept.deptName: ''
  1353. this.form = response.data.tWarehouseAgreement
  1354. this.form.fId = null
  1355. this.form.fBillstatus = ''
  1356. if (response.data.tWarehouseAgreement.tPackages) {
  1357. this.form.tPackages = this.form.tPackages
  1358. .replace(/\[|]/g, "")
  1359. .replace(/\"/g, "")
  1360. .split(",");
  1361. }
  1362. if (response.data.tWarehouseAgreement.fWarehouseid) {
  1363. this.form.fWarehouseid = JSON.parse(this.form.fWarehouseid)
  1364. }
  1365. // this.fMblnoOptions = response.data.corps
  1366. this.agreementitemsList = response.data.tWarehouseAgreementitems
  1367. for (let item in this.agreementitemsList) {
  1368. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  1369. // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
  1370. }
  1371. this.fWbuOptions = response.data.feesList
  1372. this.add = row
  1373. this.open = true
  1374. this.title = '新增仓储费'
  1375. })
  1376. }else {
  1377. this.notChange = false
  1378. this.browseStatus = false
  1379. const fId = row.fId || this.ids
  1380. getAgreement(fId).then(response => {
  1381. // this.deptName = response.data.dept.deptName
  1382. this.deptName = response.data.dept?response.data.dept.deptName: ''
  1383. this.form = response.data.tWarehouseAgreement
  1384. if (response.data.tWarehouseAgreement.tPackages) {
  1385. this.form.tPackages = this.form.tPackages
  1386. .replace(/\[|]/g, "")
  1387. .replace(/\"/g, "")
  1388. .split(",");
  1389. }
  1390. if (response.data.tWarehouseAgreement.fWarehouseid) {
  1391. this.form.fWarehouseid = JSON.parse(this.form.fWarehouseid)
  1392. }
  1393. // this.fMblnoOptions = response.data.corps
  1394. this.agreementitemsList = response.data.tWarehouseAgreementitems
  1395. if (response.data.attachList) {
  1396. this.relevantAttachments = response.data.attachList
  1397. } else {
  1398. this.relevantAttachments = []
  1399. }
  1400. for (let item in this.agreementitemsList) {
  1401. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  1402. // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
  1403. }
  1404. this.fWbuOptions = response.data.feesList
  1405. let queryParams = { fName: name }
  1406. listFees(queryParams).then((response) => {
  1407. this.fWbuOptions = response.rows
  1408. })
  1409. this.add = row
  1410. this.open = true
  1411. this.title = '修改仓储费'
  1412. })
  1413. }
  1414. },
  1415. /** 远程模糊查询用户 */
  1416. corpsRemoteMethod(name) {
  1417. if (name == null || name === '') {
  1418. return false
  1419. }
  1420. let queryParams = { pageNum: 1, fName: name, type: 1 }
  1421. listCorps(queryParams).then((response) => {
  1422. this.fMblnoOptions = response.rows
  1423. this.KHblnoOptions = response.rows
  1424. })
  1425. },
  1426. debounce(fn, delay) {
  1427. let timerId = null;
  1428. return function () {
  1429. let self = this;
  1430. let args = arguments;
  1431. timerId && clearTimeout(timerId);
  1432. timerId = setTimeout(function () {
  1433. fn.apply(self, args);
  1434. }, delay || 1000);
  1435. }
  1436. },
  1437. /** 保存按钮 */
  1438. submitForm() {
  1439. if(this.addOrEdid == 2){
  1440. this.$set(this.form, 'fId', null)
  1441. }
  1442. this.$refs['form'].validate(valid => {
  1443. if (valid) {
  1444. let formData = new window.FormData()
  1445. formData.append('agreement', JSON.stringify(this.form))
  1446. formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
  1447. formData.append('attachments', JSON.stringify(this.relevantAttachments))
  1448. addAgreement(formData).then(response => {
  1449. this.msgSuccess('操作成功')
  1450. this.$set(this.form, 'fId', response.data.tWarehouseAgreement.fId)
  1451. this.$set(this.form, 'fBillsStatus', response.data.tWarehouseAgreement.fBillsStatus)
  1452. })
  1453. }
  1454. })
  1455. },
  1456. /** 删除按钮操作 */
  1457. handleDelete(row) {
  1458. const fIds = row.fId || this.ids
  1459. this.$confirm('是否确认删除仓储费编号为"' + fIds + '"的数据项?', '警告', {
  1460. confirmButtonText: '确定',
  1461. cancelButtonText: '取消',
  1462. type: 'warning'
  1463. }).then(function() {
  1464. return delAgreement(fIds)
  1465. }).then(() => {
  1466. this.getList()
  1467. this.msgSuccess('删除成功')
  1468. })
  1469. },
  1470. /** 导出按钮操作 */
  1471. handleExport() {
  1472. const queryParams = this.queryParams
  1473. this.$confirm('是否确认导出所有仓储费数据项?', '警告', {
  1474. confirmButtonText: '确定',
  1475. cancelButtonText: '取消',
  1476. type: 'warning'
  1477. }).then(function() {
  1478. return exportAgreement(queryParams)
  1479. }).then(response => {
  1480. this.download(response.msg)
  1481. })
  1482. },
  1483. deleteRow(index, rows) {
  1484. rows.splice(index, 1)
  1485. },
  1486. // 新增附件明细数据
  1487. addRelevt() {
  1488. this.relevantAttachments.push({
  1489. fUrl: null,
  1490. fName: null,
  1491. createBy: this.createBy,
  1492. createTime: Date.parse(new Date()),
  1493. });
  1494. console.log(this.relevantAttachments)
  1495. },
  1496. //附件上传
  1497. handleSucces(scope, res, file) {
  1498. this.relevantAttachments[scope.$index].fName = res.fileName;
  1499. this.relevantAttachments[scope.$index].fUrl = res.url;
  1500. if (!this.relevantAttachments[scope.$index].fUrl) {
  1501. this.$message.error("上传失败");
  1502. } else {
  1503. this.$message.success("上传成功");
  1504. }
  1505. },
  1506. //附件查看
  1507. checkFile(scope) {
  1508. if (this.relevantAttachments[scope.$index].fUrl) {
  1509. console.log(this.relevantAttachments[scope.$index].fUrl)
  1510. window.open(this.relevantAttachments[scope.$index].fUrl);
  1511. } else {
  1512. this.$message.error("请上传附件");
  1513. }
  1514. },
  1515. deleteUploadRow(index, rows) {
  1516. rows.splice(index, 1);
  1517. },
  1518. }
  1519. }
  1520. </script>
  1521. <style lang="scss">
  1522. .avue-crud__dialog__header {
  1523. display: -webkit-box;
  1524. display: -ms-flexbox;
  1525. display: flex;
  1526. -webkit-box-align: center;
  1527. -ms-flex-align: center;
  1528. align-items: center;
  1529. -webkit-box-pack: justify;
  1530. -ms-flex-pack: justify;
  1531. justify-content: space-between;
  1532. }
  1533. .el-dialog__title {
  1534. color: rgba(0,0,0,.85);
  1535. font-weight: 500;
  1536. word-wrap: break-word;
  1537. }
  1538. .avue-crud__dialog__menu {
  1539. padding-right: 20px;
  1540. float: left;
  1541. }
  1542. .avue-crud__dialog__menu i {
  1543. color: #909399;
  1544. font-size: 15px;
  1545. }
  1546. .el-icon-full-screen{
  1547. cursor: pointer;
  1548. }
  1549. .el-icon-full-screen:before {
  1550. content: "\e719";
  1551. }
  1552. </style>