detail.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  1. <template>
  2. <a-card :bordered="false">
  3. <a-page-header
  4. :title="formData.id ? '二线核注单台账信息' : '新增二线核注单台账信息'"
  5. @back="onClose"
  6. >
  7. <template #extra>
  8. <a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
  9. <a-popconfirm title="请确认是否保存?" @confirm="onTemp" v-if="!isView">
  10. <a-button style="margin-right: 8px" :loading="submitLoading">保存</a-button>
  11. </a-popconfirm>
  12. <a-popconfirm title="请确认是否申报?" @confirm="onSubmit" v-if="!isView">
  13. <a-button type="primary" :loading="submitLoading">申报</a-button>
  14. </a-popconfirm>
  15. </template>
  16. </a-page-header>
  17. <a-collapse v-model:activeKey="activeKey" expand-icon-position="end">
  18. <a-collapse-panel key="1" header="基本信息">
  19. <a-form ref="formRef" :model="formData" :rules="formRules">
  20. <a-row :gutter="16">
  21. <a-col :span="8">
  22. <a-form-item label="台账编号:" name="tzCode">
  23. <a-select v-model:value="formData.tzCode" :disabled="isView" placeholder="请选择台账编号" :options="tzOptions" show-search allow-clear option-filter-prop="label" @change="onChangTz"/>
  24. </a-form-item>
  25. </a-col>
  26. <a-col :span="8">
  27. <a-form-item label="台账性质:" name="tzNature">
  28. <a-select v-model:value="formData.tzNature" :disabled="true" placeholder="请选择台账性质" :options="tzTypeOptions" show-search allow-clear option-filter-prop="label"/>
  29. </a-form-item>
  30. </a-col>
  31. <a-col :span="8">
  32. <a-form-item label="使用单位:" name="useDept">
  33. <a-input v-model:value="formData.useDept" :disabled="isView" placeholder="请输入使用单位" allow-clear />
  34. </a-form-item>
  35. </a-col>
  36. <a-col :span="8">
  37. <a-form-item label="统一社会信用代码:" name="companyCode">
  38. <a-input v-model:value="formData.companyCode" :disabled="true" placeholder="请输入统一社会信用代码" allow-clear />
  39. </a-form-item>
  40. </a-col>
  41. <a-col :span="8">
  42. <a-form-item label="海关备案编号:" name="companyMainHgCode">
  43. <a-input v-model:value="formData.companyMainHgCode" :disabled="true" placeholder="请输入海关备案编号" allow-clear />
  44. </a-form-item>
  45. </a-col>
  46. <a-col :span="8">
  47. <a-form-item label="监管方式:" name="regulaMethod">
  48. <a-input v-model:value="formData.regulaMethod" :disabled="isView" placeholder="请输入监管方式" allow-clear />
  49. </a-form-item>
  50. </a-col>
  51. <a-col :span="8">
  52. <a-form-item label="运输方式:" name="ysfs">
  53. <a-select v-model:value="formData.ysfs" :disabled="isView" placeholder="请输入运输方式" :options="ysfsOptions" show-search allow-clear option-filter-prop="label"/>
  54. </a-form-item>
  55. </a-col>
  56. <a-col :span="8">
  57. <a-form-item label="关联清单编号:" name="glqdCode">
  58. <a-input v-model:value="formData.glqdCode" :disabled="isView" placeholder="请输入关联清单编号" allow-clear />
  59. </a-form-item>
  60. </a-col>
  61. <a-col :span="8">
  62. <a-form-item label="对应报关申报编号:" name="dybgCode">
  63. <a-input v-model:value="formData.dybgCode" :disabled="isView" placeholder="请输入对应报关申报编号" allow-clear />
  64. </a-form-item>
  65. </a-col>
  66. <a-col :span="8">
  67. <a-form-item label="对应报关单申报单位名称:" name="dybgDept">
  68. <a-input v-model:value="formData.dybgDept" :disabled="isView" placeholder="请输入对应报关单申报单位名称" allow-clear />
  69. </a-form-item>
  70. </a-col>
  71. <a-col :span="8">
  72. <a-form-item label="核注单预录入号:" name="hzdrCode">
  73. <a-input v-model:value="formData.hzdrCode" :disabled="isView" placeholder="请输入核注单预录入号" allow-clear />
  74. </a-form-item>
  75. </a-col>
  76. <a-col :span="8">
  77. <a-form-item label="核注单号:" name="hgHzdCode">
  78. <a-input v-model:value="formData.hgHzdCode" :disabled="true" allow-clear />
  79. </a-form-item>
  80. </a-col>
  81. <a-col :span="24">
  82. <a-form-item label="备注:" name="remark">
  83. <a-textarea v-model:value="formData.remark" :disabled="isView" placeholder="请输入备注" :rows="4" />
  84. </a-form-item>
  85. </a-col>
  86. <a-col :span="8">
  87. <a-form-item label="台账类型:" name="tzType">
  88. <a-input v-model:value="formData.tzType" :disabled="true" allow-clear />
  89. </a-form-item>
  90. </a-col>
  91. </a-row>
  92. </a-form>
  93. </a-collapse-panel>
  94. <a-collapse-panel key="2" header="表体信息">
  95. <a-button type="primary" @click="onBodyReset" v-if="!isView" style="margin-bottom: 20px;">重置</a-button>
  96. <a-form ref="bodyFormRef" :model="bodyData" :rules="bodyRules" style="margin-bottom: 20px;">
  97. <a-row :gutter="16">
  98. <a-col :span="8">
  99. <a-form-item label="商品序号:" name="productOrderCode">
  100. <a-input v-model:value="bodyData.productOrderCode" :disabled="isView" placeholder="请输入商品序号" allow-clear />
  101. </a-form-item>
  102. </a-col>
  103. <a-col :span="8">
  104. <a-form-item label="报关单商品序号:" name="bgdProductOrderCode">
  105. <a-input v-model:value="bodyData.bgdProductOrderCode" :disabled="isView" placeholder="请输入报关单商品序号" allow-clear />
  106. </a-form-item>
  107. </a-col>
  108. <a-col :span="8">
  109. <a-form-item label="备案序号:" name="recordCode">
  110. <a-input v-model:value="bodyData.recordCode" :disabled="isView" placeholder="请输入备案序号" allow-clear />
  111. </a-form-item>
  112. </a-col>
  113. <a-col :span="8">
  114. <a-form-item label="通知书序号:" name="noticeCode">
  115. <a-input v-model:value="bodyData.noticeCode" :disabled="isView" placeholder="请输入通知书序号" allow-clear />
  116. </a-form-item>
  117. </a-col>
  118. <a-col :span="8">
  119. <a-form-item label="商品编码:" name="productCode">
  120. <a-input v-model:value="bodyData.productCode" :disabled="isView" placeholder="请输入商品编码" allow-clear />
  121. </a-form-item>
  122. </a-col>
  123. <a-col :span="8">
  124. <a-form-item label="商品名称:" name="productName">
  125. <a-input v-model:value="bodyData.productName" :disabled="isView" placeholder="请输入商品名称" allow-clear />
  126. </a-form-item>
  127. </a-col>
  128. <a-col :span="8">
  129. <a-form-item label="规格型号:" name="specModel">
  130. <a-input v-model:value="bodyData.specModel" :disabled="isView" placeholder="请输入规格型号" allow-clear />
  131. </a-form-item>
  132. </a-col>
  133. <a-col :span="8">
  134. <a-form-item label="申报数量:" name="sbNum">
  135. <a-input v-model:value="bodyData.sbNum" :disabled="isView" placeholder="请输入申报数量" allow-clear />
  136. </a-form-item>
  137. </a-col>
  138. <a-col :span="8">
  139. <a-form-item label="申报计量单位:" name="declareUnit">
  140. <a-select v-model:value="bodyData.declareUnit" :disabled="isView" placeholder="请选择申报计量单位" :options="declareUnitOptions" show-search allow-clear option-filter-prop="label"/>
  141. </a-form-item>
  142. </a-col>
  143. <a-col :span="8">
  144. <a-form-item label="企业申报单价:" name="companySbPrice">
  145. <a-input v-model:value="bodyData.companySbPrice" :disabled="isView" placeholder="请输入企业申报单价" allow-clear />
  146. </a-form-item>
  147. </a-col>
  148. <a-col :span="8">
  149. <a-form-item label="企业申报总价:" name="companySbCount">
  150. <a-input v-model:value="bodyData.companySbCount" :disabled="isView" placeholder="请输入企业申报总价" allow-clear />
  151. </a-form-item>
  152. </a-col>
  153. <a-col :span="8">
  154. <a-form-item label="备案单价:" name="recordPrice">
  155. <a-input v-model:value="bodyData.recordPrice" :disabled="isView" placeholder="请输入备案单价" allow-clear />
  156. </a-form-item>
  157. </a-col>
  158. <a-col :span="8">
  159. <a-form-item label="备案总价:" name="recordTotalPrice">
  160. <a-input v-model:value="bodyData.recordTotalPrice" :disabled="isView" placeholder="请输入备案总价" allow-clear />
  161. </a-form-item>
  162. </a-col>
  163. <a-col :span="8">
  164. <a-form-item label="币制:" name="currency">
  165. <a-input v-model:value="bodyData.currency" :disabled="isView" placeholder="请输入币制" allow-clear />
  166. </a-form-item>
  167. </a-col>
  168. <a-col :span="8">
  169. <a-form-item label="原产国(地区):" name="originCountry">
  170. <a-select v-model:value="bodyData.originCountry" :disabled="isView" placeholder="请选择原产国(地区)" :options="originCountryOptions" show-search allow-clear option-filter-prop="label"/>
  171. </a-form-item>
  172. </a-col>
  173. <a-col :span="8">
  174. <a-form-item label="法定数量:" name="legalQuantity">
  175. <a-input-number v-model:value="bodyData.legalQuantity" :disabled="isView" :min="1" :max="10000" style="width: 100%" />
  176. </a-form-item>
  177. </a-col>
  178. <a-col :span="8">
  179. <a-form-item label="法定计量单位:" name="legalUnit">
  180. <a-select v-model:value="bodyData.legalUnit" :disabled="isView" placeholder="请选择法定计量单位" :options="legalUnitOptions" show-search allow-clear option-filter-prop="label"/>
  181. </a-form-item>
  182. </a-col>
  183. <a-col :span="8">
  184. <a-form-item label="第二法定数量:" name="secondLegalQuantity">
  185. <a-input v-model:value="bodyData.secondLegalQuantity" :disabled="isView" placeholder="请输入第二法定数量" allow-clear />
  186. </a-form-item>
  187. </a-col>
  188. <a-col :span="8">
  189. <a-form-item label="法定第二计量:" name="legalSecondUnit">
  190. <a-select v-model:value="bodyData.legalSecondUnit" :disabled="isView" placeholder="请选择法定第二计量" :options="legalSecondUnitOptions" show-search allow-clear option-filter-prop="label"/>
  191. </a-form-item>
  192. </a-col>
  193. <a-col :span="8">
  194. <a-form-item label="美元统计总金额:" name="myCount">
  195. <a-input v-model:value="bodyData.myCount" :disabled="isView" placeholder="请输入美元统计总金额" allow-clear />
  196. </a-form-item>
  197. </a-col>
  198. <a-col :span="8">
  199. <a-form-item label="重量比例因子:" name="weightRatioFactor">
  200. <a-input v-model:value="bodyData.weightRatioFactor" :disabled="isView" placeholder="请输入重量比例因子" allow-clear />
  201. </a-form-item>
  202. </a-col>
  203. <a-col :span="8">
  204. <a-form-item label="第一比例因子:" name="firstRatioFactor">
  205. <a-input v-model:value="bodyData.firstRatioFactor" :disabled="isView" placeholder="请输入第一比例因子" allow-clear />
  206. </a-form-item>
  207. </a-col>
  208. <a-col :span="8">
  209. <a-form-item label="第二比例因子:" name="secondRatioFactor">
  210. <a-input v-model:value="bodyData.secondRatioFactor" :disabled="isView" placeholder="请输入第二比例因子" allow-clear />
  211. </a-form-item>
  212. </a-col>
  213. <a-col :span="8">
  214. <a-form-item label="毛重:" name="grossWeight">
  215. <a-input v-model:value="bodyData.grossWeight" :disabled="isView" placeholder="请输入毛重" allow-clear />
  216. </a-form-item>
  217. </a-col>
  218. <a-col :span="8">
  219. <a-form-item label="净重:" name="netWeight">
  220. <a-input v-model:value="bodyData.netWeight" :disabled="isView" placeholder="请输入净重" allow-clear />
  221. </a-form-item>
  222. </a-col>
  223. <a-col :span="8">
  224. <a-form-item label="征免方式:" name="zmMethod">
  225. <a-select v-model:value="bodyData.zmMethod" :disabled="isView" placeholder="请选择征免方式" :options="zmMethodOptions" show-search allow-clear option-filter-prop="label"/>
  226. </a-form-item>
  227. </a-col>
  228. <a-col :span="8">
  229. <a-form-item label="最终目的国(地区):" name="zzmdg">
  230. <a-select v-model:value="bodyData.zzmdg" :disabled="isView" placeholder="请选择最终目的国(地区)" :options="zzmdgOptions" show-search allow-clear option-filter-prop="label"/>
  231. </a-form-item>
  232. </a-col>
  233. <a-col :span="8">
  234. <a-form-item label="监管年限到期日:" name="jgnxDqr">
  235. <a-date-picker v-model:value="bodyData.jgnxDqr" :disabled="isView" value-format="YYYY-MM-DD HH:mm:ss" show-time placeholder="请选择监管年限到期日" style="width: 100%" allow-clear/>
  236. </a-form-item>
  237. </a-col>
  238. <a-col :span="8">
  239. <a-form-item label="监管年限起始日:" name="jgnxQsr">
  240. <a-date-picker v-model:value="bodyData.jgnxQsr" :disabled="isView" value-format="YYYY-MM-DD HH:mm:ss" show-time placeholder="请选择监管年限起始日" style="width: 100%" allow-clear/>
  241. </a-form-item>
  242. </a-col>
  243. <a-col :span="8">
  244. <a-form-item label="进账库存数量:" name="jzkcNum">
  245. <a-input v-model:value="bodyData.jzkcNum" :disabled="isView" placeholder="请输入进账库存数量" allow-clear />
  246. </a-form-item>
  247. </a-col>
  248. <a-col :span="8">
  249. <a-form-item label="监管年限自用数量:" name="jgnxZysl">
  250. <a-input v-model:value="bodyData.jgnxZysl" :disabled="isView" placeholder="请输入监管年限自用数量" allow-clear />
  251. </a-form-item>
  252. </a-col>
  253. <a-col :span="8">
  254. <a-form-item label="解除年限数量(已解除监管/总数):" name="jcjgslYjc">
  255. <a-input v-model:value="bodyData.jcjgslYjc" :disabled="isView" placeholder="请输入解除年限数量(已解除监管/总数)" allow-clear />
  256. </a-form-item>
  257. </a-col>
  258. <a-col :span="8">
  259. <a-form-item label="到期解除监管数量:" name="dqjcjgsl">
  260. <a-input v-model:value="bodyData.dqjcjgsl" :disabled="isView" placeholder="请输入到期解除监管数量" allow-clear />
  261. </a-form-item>
  262. </a-col>
  263. <a-col :span="8">
  264. <a-form-item label="解除年限数量(二线出区):" name="jcjgslSecondline">
  265. <a-input v-model:value="bodyData.jcjgslSecondline" :disabled="isView" placeholder="请输入解除年限数量(二线出区)" allow-clear />
  266. </a-form-item>
  267. </a-col>
  268. <a-col :span="8">
  269. <a-form-item label="解除监管数量(补税):" name="jcjgslBs">
  270. <a-input v-model:value="bodyData.jcjgslBs" :disabled="isView" placeholder="请输入解除监管数量(补税)" allow-clear />
  271. </a-form-item>
  272. </a-col>
  273. <a-col :span="8">
  274. <a-form-item label="解除监管数量(区内转让):" name="jcjgslQnzr">
  275. <a-input v-model:value="bodyData.jcjgslQnzr" :disabled="isView" placeholder="请输入解除监管数量(区内转让)" allow-clear />
  276. </a-form-item>
  277. </a-col>
  278. <a-col :span="8">
  279. <a-form-item label="解除监管数量(转至区外):" name="jcjgslZzqw">
  280. <a-input v-model:value="bodyData.jcjgslZzqw" :disabled="isView" placeholder="请输入解除监管数量(转至区外)" allow-clear />
  281. </a-form-item>
  282. </a-col>
  283. <a-col :span="8">
  284. <a-form-item label="解除监管数量(基建物资核销):" name="jcjgslJjwzhx">
  285. <a-input v-model:value="bodyData.jcjgslJjwzhx" :disabled="isView" placeholder="请输入解除监管数量(基建物资核销)" allow-clear />
  286. </a-form-item>
  287. </a-col>
  288. <a-col :span="8">
  289. <a-form-item label="监管年限内区内转移数量:" name="jgnxnQnzysl">
  290. <a-input v-model:value="bodyData.jgnxnQnzysl" :disabled="isView" placeholder="请输入监管年限内区内转移数量" allow-clear />
  291. </a-form-item>
  292. </a-col>
  293. <a-col :span="8">
  294. <a-form-item label="监管年限内抵押贷款数量:" name="jgnxnDydksl">
  295. <a-input v-model:value="bodyData.jgnxnDydksl" :disabled="isView" placeholder="请输入监管年限内抵押贷款数量" allow-clear />
  296. </a-form-item>
  297. </a-col>
  298. <a-col :span="8">
  299. <a-form-item label="监管年限内临时移作他用数量:" name="jgnxnLszztysl">
  300. <a-input v-model:value="bodyData.jgnxnLszztysl" :disabled="isView" placeholder="请输入监管年限内临时移作他用数量" allow-clear />
  301. </a-form-item>
  302. </a-col>
  303. <a-col :span="8">
  304. <a-form-item label="修改标志:" name="xgbz">
  305. <a-input v-model:value="formData.xgbz" :disabled="isView" placeholder="请输入修改标志" allow-clear />
  306. </a-form-item>
  307. </a-col>
  308. </a-row>
  309. </a-form>
  310. <template v-if="!isView">
  311. <a-button type="primary" style="margin-right: 8px;" v-if="!(bodyData.id || bodyData.__index)" @click="onBodyAdd">插入</a-button>
  312. <a-button type="primary" style="margin-right: 8px;" v-else @click="onBodyEdit">保存</a-button>
  313. <xn-batch-delete
  314. :selectedRowKeys="bodySelectedRowKeys"
  315. @batchDelete="deleteBatchBody"
  316. />
  317. </template>
  318. <a-table
  319. style="margin-top: 10px"
  320. bordered
  321. :dataSource="bodyList"
  322. :columns="bodyColumns"
  323. :pagination="false"
  324. :scroll="{ x: 2000 }"
  325. :row-selection="bodyOptions.rowSelection"
  326. >
  327. <template #bodyCell="{ column, record, index }">
  328. <template v-if="column.dataIndex === 'declareUnit'">
  329. {{ $TOOL.dictTypeData('measurement unit', record.declareUnit) }}
  330. </template>
  331. <template v-if="column.dataIndex === 'originCountry'">
  332. {{ $TOOL.dictTypeData('address', record.originCountry) }}
  333. </template>
  334. <template v-if="column.dataIndex === 'legalUnit'">
  335. {{ $TOOL.dictTypeData('measurement unit', record.legalUnit) }}
  336. </template>
  337. <template v-if="column.dataIndex === 'legalSecondUnit'">
  338. {{ $TOOL.dictTypeData('measurement unit', record.legalSecondUnit) }}
  339. </template>
  340. <template v-if="column.dataIndex === 'zmMethod'">
  341. {{ $TOOL.dictTypeData('zm_type', record.zmMethod) }}
  342. </template>
  343. <template v-if="column.dataIndex === 'zzmdg'">
  344. {{ $TOOL.dictTypeData('address', record.zzmdg) }}
  345. </template>
  346. <template v-if="column.dataIndex === 'action'">
  347. <template v-if="isView">
  348. <a-button type="link" primary size="small" @click="onBodyReset(), bodyData = cloneDeep(record)">查看</a-button>
  349. </template>
  350. <template v-else>
  351. <a-button type="link" primary size="small" @click="onBodyReset(), bodyData = cloneDeep(record)">编辑</a-button>
  352. <a-button type="link" danger size="small" @click="onBodyDel(index)">删除</a-button>
  353. </template>
  354. </template>
  355. </template>
  356. </a-table>
  357. </a-collapse-panel>
  358. <a-collapse-panel key="3" header="附件信息">
  359. <template v-if="!isView">
  360. <div class="file-tips">
  361. <InfoCircleFilled style="margin-right: 4px;"/>友情提示<br/>
  362. 1、附件大小要求不超过4M,如果文件过大,建议拆分多个上传;<br/>
  363. 2、附件格式要求:PDF文件;<br/>
  364. 3、同一附件类型可以上传多个附件;<br/>
  365. 4、附件传输过程中会出现传输失败的情况,请随时关注附件传输状态;<br/>
  366. 5、要求上传复印件的可上传原件的扫描件。
  367. </div>
  368. <xn-upload ref="ref_upload" v-model:value="fileData.fileUrl" @onChange="fileChange" accept=".pdf" v-if="showFileUpload"/>
  369. <div style="margin-top: 10px;">
  370. <xn-batch-delete
  371. :selectedRowKeys="fileSelectedRowKeys"
  372. @batchDelete="deleteBatchFile"
  373. />
  374. </div>
  375. </template>
  376. <a-table
  377. style="margin-top: 10px"
  378. bordered
  379. :dataSource="fileList"
  380. :columns="fileColumns"
  381. :pagination="false"
  382. :row-selection="fileOptions.rowSelection"
  383. >
  384. <template #bodyCell="{ column, record, index, text }">
  385. <template v-if="['attachmentName', 'attachmentFormat', 'attachmentContent'].includes(column.dataIndex)">
  386. <div>
  387. <a-input
  388. v-if="!isView"
  389. v-model:value="record[column.dataIndex]"
  390. style="margin: -5px 0"
  391. />
  392. <template v-else>
  393. {{ text }}
  394. </template>
  395. </div>
  396. </template>
  397. <template v-if="column.dataIndex === 'action'">
  398. <template v-if="isView">
  399. </template>
  400. <template v-else>
  401. <a-button type="link" danger size="small" @click="onFileDel(index)" v-if="!isView">删除</a-button>
  402. </template>
  403. </template>
  404. </template>
  405. </a-table>
  406. </a-collapse-panel>
  407. </a-collapse>
  408. </a-card>
  409. </template>
  410. <script setup name="qySecondlineHzdTzDetail">
  411. import tool from '@/utils/tool'
  412. import { cloneDeep } from 'lodash-es'
  413. import { required } from '@/utils/formRules'
  414. import qySecondlineHzdTzApi from '@/api/yqyc/qySecondLineHzdTzApi'
  415. import {message, Modal} from "ant-design-vue";
  416. import {createVNode} from "vue";
  417. import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
  418. import qySecondlineHfdApi from "@/api/yqyc/qySecondlineHfdApi";
  419. // 抽屉状态
  420. const { proxy } = getCurrentInstance()
  421. const emit = defineEmits({ successful: null, onClose: null })
  422. const formRef = ref()
  423. // 表单数据
  424. const formData = ref({})
  425. const submitLoading = ref(false)
  426. const isView = ref(false)
  427. const tzTypeOptions = ref([])
  428. const statusOptions = ref([])
  429. const ysfsOptions = ref([])
  430. const declareUnitOptions = ref([])
  431. const originCountryOptions = ref([])
  432. const legalUnitOptions = ref([])
  433. const legalSecondUnitOptions = ref([])
  434. const zmMethodOptions = ref([])
  435. const zzmdgOptions = ref([])
  436. const tzOptions = ref([])
  437. const activeKey = ref('1')
  438. // 打开抽屉
  439. const onOpen = (record, view = false, copy) => {
  440. isView.value = view
  441. if (record) {
  442. qySecondlineHzdTzApi.qySecondlineHzdTzDetail({id: record.id}).then(res => {
  443. formData.value = res.baseInfo
  444. bodyList.value = res.productList
  445. fileList.value = res.attachmentList
  446. if (copy) {
  447. delete formData.value.id
  448. }
  449. })
  450. } else {
  451. formData.value.tzType = '二线出区'
  452. }
  453. qySecondlineHzdTzApi.qySecondlineHzdTzQyRecordInfo().then(res => {
  454. tzOptions.value = res.map(v => Object.assign(v, {label: v.tzCode, value: v.tzCode}))
  455. })
  456. tzTypeOptions.value = tool.dictList('tzlx')
  457. statusOptions.value = tool.dictList('djzt')
  458. ysfsOptions.value = tool.dictList('trans_type')
  459. declareUnitOptions.value = tool.dictList('measurement unit')
  460. originCountryOptions.value = tool.dictList('address')
  461. legalUnitOptions.value = tool.dictList('measurement unit')
  462. legalSecondUnitOptions.value = tool.dictList('measurement unit')
  463. zmMethodOptions.value = tool.dictList('zm_type')
  464. zzmdgOptions.value = tool.dictList('address')
  465. }
  466. // 关闭抽屉
  467. const onClose = () => {
  468. formRef.value.resetFields()
  469. formData.value = {}
  470. isView.value = true
  471. emit('onClose')
  472. }
  473. // 默认要校验的
  474. const formRules = {
  475. dybgDept: [required('请输入对应报关单申报单位名称')],
  476. }
  477. // 验证并提交数据
  478. const onSubmit = () => {
  479. formRef.value
  480. .validate()
  481. .then(() => {
  482. submitLoading.value = true
  483. const params = {
  484. baseInfo: Object.assign(formData.value, {status: '2'}),
  485. productList: bodyList.value,
  486. attachmentList: fileList.value,
  487. }
  488. qySecondlineHzdTzApi.qySecondlineHzdTzSubmitForm(params, formData.value.id).then(() => {
  489. onClose()
  490. emit('successful')
  491. }).finally(() => {
  492. submitLoading.value = false
  493. })
  494. })
  495. .catch(() => {})
  496. }
  497. const onTemp = () => {
  498. formRef.value
  499. .validate()
  500. .then(() => {
  501. submitLoading.value = true
  502. const params = {
  503. baseInfo: Object.assign(formData.value, {status: '1'}),
  504. productList: bodyList.value,
  505. attachmentList: fileList.value,
  506. }
  507. qySecondlineHzdTzApi.qySecondlineHzdTzSubmitForm(params, formData.value.id).then(() => {
  508. onClose()
  509. emit('successful')
  510. })
  511. .finally(() => {
  512. submitLoading.value = false
  513. })
  514. })
  515. .catch(() => {
  516. })
  517. }
  518. const bodyFormRef = ref()
  519. const bodyData = ref({})
  520. const bodySelectedRowKeys = ref([])
  521. const bodyList = ref([])
  522. // 列表选择配置
  523. const bodyOptions = {
  524. rowSelection: {
  525. onChange: (selectedRowKey, selectedRows) => {
  526. bodySelectedRowKeys.value = selectedRows
  527. }
  528. }
  529. }
  530. // 默认要校验的
  531. const bodyRules = {
  532. productOrderCode: [required('请输入商品序号')],
  533. bgdProductOrderCode: [required('请输入报关单商品序号')],
  534. recordCode: [required('请输入备案序号')],
  535. noticeCode: [required('请输入通知书序号')],
  536. productCode: [required('请输入商品编码')],
  537. productName: [required('请输入商品名称')],
  538. specModel: [required('请输入规格型号')],
  539. sbNum: [required('请输入申报数量')],
  540. declareUnit: [required('请输入申报计量单位')],
  541. companySbPrice: [required('请输入企业申报单价')],
  542. companySbCount: [required('请输入企业申报总价')],
  543. recordPrice: [required('请输入备案单价')],
  544. recordTotalPrice: [required('请输入备案总价')],
  545. currency: [required('请输入币制')],
  546. originCountry: [required('请输入原产国(地区)')],
  547. legalQuantity: [required('请输入法定数量')],
  548. legalUnit: [required('请输入法定计量单位')],
  549. grossWeight: [required('请输入毛重')],
  550. netWeight: [required('请输入净重')],
  551. zmMethod: [required('请输入征免方式')],
  552. jgnxDqr: [required('请输入监管年限到期日')],
  553. jgnxQsr: [required('请输入监管年限起始日')],
  554. jzkcNum: [required('请输入进账库存数量')],
  555. }
  556. const bodyColumns = [
  557. {
  558. title: '商品序号',
  559. dataIndex: 'productOrderCode',
  560. width: 100
  561. },
  562. {
  563. title: '报关单商品序号',
  564. dataIndex: 'bgdProductOrderCode',
  565. width: 160
  566. },
  567. {
  568. title: '备案序号',
  569. dataIndex: 'recordCode',
  570. width: 100
  571. },
  572. {
  573. title: '通知书序号',
  574. dataIndex: 'noticeCode',
  575. width: 120
  576. },
  577. {
  578. title: '商品编码',
  579. dataIndex: 'productCode',
  580. width: 100
  581. },
  582. {
  583. title: '商品名称',
  584. dataIndex: 'productName',
  585. width: 100
  586. },
  587. {
  588. title: '规格型号',
  589. dataIndex: 'specModel',
  590. width: 100
  591. },
  592. {
  593. title: '申报数量',
  594. dataIndex: 'sbNum',
  595. width: 100
  596. },
  597. {
  598. title: '申报计量单位',
  599. dataIndex: 'declareUnit',
  600. width: 160
  601. },
  602. {
  603. title: '企业申报单价',
  604. dataIndex: 'companySbPrice',
  605. width: 160
  606. },
  607. {
  608. title: '企业申报总价',
  609. dataIndex: 'companySbCount',
  610. width: 160
  611. },
  612. {
  613. title: '备案单价',
  614. dataIndex: 'recordPrice',
  615. width: 100
  616. },
  617. {
  618. title: '备案总价',
  619. dataIndex: 'recordTotalPrice',
  620. width: 100
  621. },
  622. {
  623. title: '币制',
  624. dataIndex: 'currency',
  625. width: 100
  626. },
  627. {
  628. title: '原产国(地区)',
  629. dataIndex: 'originCountry',
  630. width: 160
  631. },
  632. {
  633. title: '法定数量',
  634. dataIndex: 'legalQuantity',
  635. width: 100
  636. },
  637. {
  638. title: '法定计量单位',
  639. dataIndex: 'legalUnit',
  640. width: 160
  641. },
  642. {
  643. title: '第二法定数量',
  644. dataIndex: 'secondLegalQuantity',
  645. width: 160
  646. },
  647. {
  648. title: '法定第二计量',
  649. dataIndex: 'legalSecondUnit',
  650. width: 160
  651. },
  652. {
  653. title: '美元统计总金额',
  654. dataIndex: 'myCount',
  655. width: 160
  656. },
  657. {
  658. title: '重量比例因子',
  659. dataIndex: 'weightRatioFactor',
  660. width: 160
  661. },
  662. {
  663. title: '第一比例因子',
  664. dataIndex: 'firstRatioFactor',
  665. width: 160
  666. },
  667. {
  668. title: '第二比例因子',
  669. dataIndex: 'secondRatioFactor',
  670. width: 160
  671. },
  672. {
  673. title: '毛重',
  674. dataIndex: 'grossWeight',
  675. width: 100
  676. },
  677. {
  678. title: '净重',
  679. dataIndex: 'netWeight',
  680. width: 100
  681. },
  682. {
  683. title: '征免方式',
  684. dataIndex: 'zmMethod',
  685. width: 160
  686. },
  687. {
  688. title: '最终目的国(地区)',
  689. dataIndex: 'zzmdg',
  690. width: 160
  691. },
  692. {
  693. title: '监管年限到期日',
  694. dataIndex: 'jgnxDqr',
  695. width: 160
  696. },
  697. {
  698. title: '监管年限起始日',
  699. dataIndex: 'jgnxQsr',
  700. width: 160
  701. },
  702. {
  703. title: '进账库存数量',
  704. dataIndex: 'jzkcNum',
  705. width: 160
  706. },
  707. {
  708. title: '监管年限自用数量',
  709. dataIndex: 'jgnxZysl',
  710. width: 160
  711. },
  712. {
  713. title: '解除年限数量(已解除监管/总数)',
  714. dataIndex: 'jcjgslYjc',
  715. width: 240
  716. },
  717. {
  718. title: '到期解除监管数量',
  719. dataIndex: 'dqjcjgsl',
  720. width: 160
  721. },
  722. {
  723. title: '解除年限数量(二线出区)',
  724. dataIndex: 'jcjgslSecondline',
  725. width: 200
  726. },
  727. {
  728. title: '解除监管数量(补税)',
  729. dataIndex: 'jcjgslBs',
  730. width: 200
  731. },
  732. {
  733. title: '解除监管数量(区内转让)',
  734. dataIndex: 'jcjgslQnzr',
  735. width: 200
  736. },
  737. {
  738. title: '解除监管数量(转至区外)',
  739. dataIndex: 'jcjgslZzqw',
  740. width: 200
  741. },
  742. {
  743. title: '解除监管数量(基建物资核销)',
  744. dataIndex: 'jcjgslJjwzhx',
  745. width: 220
  746. },
  747. {
  748. title: '监管年限内区内转移数量',
  749. dataIndex: 'jgnxnQnzysl',
  750. width: 200
  751. },
  752. {
  753. title: '监管年限内抵押贷款数量',
  754. dataIndex: 'jgnxnDydksl',
  755. width: 200
  756. },
  757. {
  758. title: '监管年限起始日',
  759. dataIndex: 'jgnxQsy',
  760. width: 160
  761. },
  762. {
  763. title: '监管年限内临时移作他用数量',
  764. dataIndex: 'jgnxnLszztysl',
  765. width: 220
  766. },
  767. {
  768. title: '修改标志',
  769. dataIndex: 'xgbz',
  770. width: 100
  771. },
  772. {
  773. title: '操作',
  774. dataIndex: 'action',
  775. width: 200,
  776. fixed: 'right'
  777. },
  778. ]
  779. const onBodyReset = () => {
  780. bodyFormRef.value?.resetFields()
  781. bodyData.value = {}
  782. }
  783. const onBodyAdd = () => {
  784. bodyFormRef.value
  785. .validate()
  786. .then(() => {
  787. bodyList.value.push(Object.assign({__index: new Date().getTime()}, bodyData.value))
  788. onBodyReset()
  789. message.success('插入表体信息成功!')
  790. })
  791. .catch(() => {
  792. })
  793. }
  794. const onBodyEdit = () => {
  795. bodyFormRef.value
  796. .validate()
  797. .then(() => {
  798. let k = ''
  799. if (bodyData.value.id) {
  800. k = 'id'
  801. } else if (bodyData.value.__index) {
  802. k = '__index'
  803. }
  804. if (k) {
  805. bodyList.value.forEach(v => {
  806. if (v[k] === bodyData.value[k]) {
  807. Object.assign(v, bodyData.value)
  808. }
  809. })
  810. }
  811. onBodyReset()
  812. message.success('编辑表体信息成功!')
  813. })
  814. .catch(() => {
  815. })
  816. }
  817. const onBodyDel = (recode, index) => {
  818. Modal.confirm({
  819. title: '提示',
  820. icon: createVNode(ExclamationCircleOutlined),
  821. content: createVNode('div', { style: 'color:red;' }, `是否要删除${record.productName}?`),
  822. centered: true,
  823. onOk() {
  824. bodyList.value.splice(index, 1)
  825. },
  826. onCancel() {
  827. },
  828. });
  829. }
  830. const deleteBatchBody = () => {
  831. bodyList.value = bodyList.value.filter(v => {
  832. let flag = true
  833. bodySelectedRowKeys.value.forEach(s => {
  834. if ((v.id && (v.id === s.id)) || (v.__index && (v.__index === s.__index))) {
  835. flag = false
  836. }
  837. })
  838. return flag
  839. })
  840. }
  841. const ref_upload = ref()
  842. const fileData = ref({})
  843. const showFileUpload = ref(true)
  844. const fileSelectedRowKeys = ref([])
  845. const fileList = ref([])
  846. // 列表选择配置
  847. const fileOptions = {
  848. rowSelection: {
  849. onChange: (selectedRowKey, selectedRows) => {
  850. fileSelectedRowKeys.value = selectedRows
  851. }
  852. }
  853. }
  854. const fileColumns = [
  855. {
  856. title: '附件名称',
  857. dataIndex: 'attachmentName',
  858. },
  859. {
  860. title: '附件格式',
  861. dataIndex: 'attachmentFormat',
  862. },
  863. {
  864. title: '附件内容',
  865. dataIndex: 'attachmentContent',
  866. },
  867. {
  868. title: '上传时间',
  869. dataIndex: 'uploadTime',
  870. },
  871. {
  872. title: '操作',
  873. dataIndex: 'action',
  874. },
  875. ]
  876. const getFileExtension = (filename) => {
  877. // 使用lastIndexOf查找最后一个"."的位置
  878. var dotIndex = filename.lastIndexOf(".");
  879. // 如果找到了".",则提取从"."之后的子串作为后缀名
  880. if (dotIndex !== -1 && dotIndex < filename.length - 1) { // 确保"."不是字符串的最后一个字符
  881. return filename.slice(dotIndex + 1); // slice从dotIndex+1开始到字符串结束
  882. } else {
  883. // 如果没有找到".",返回空字符串表示没有后缀
  884. return "";
  885. }
  886. }
  887. const fileChange = (file) => {
  888. if (file) {
  889. const f = ref_upload.value.uploadFileList()[0]
  890. fileList.value.push({
  891. __index: new Date().getTime(),
  892. attachmentUrl: f.url,
  893. attachmentName: f.name,
  894. attachmentFormat: getFileExtension(f.name),
  895. attachmentContent: '',
  896. uploadTime: proxy.$util.YMDHms(new Date()),
  897. })
  898. fileData.value.fileUrl = ''
  899. showFileUpload.value = false
  900. setTimeout(() => {
  901. showFileUpload.value = true
  902. }, 0)
  903. }
  904. }
  905. const onFileDel = (recode, index) => {
  906. Modal.confirm({
  907. title: '提示',
  908. icon: createVNode(ExclamationCircleOutlined),
  909. content: createVNode('div', { style: 'color:red;' }, `是否要删除?`),
  910. centered: true,
  911. onOk() {
  912. fileList.value.splice(index, 1)
  913. },
  914. onCancel() {
  915. },
  916. });
  917. }
  918. const deleteBatchFile = () => {
  919. fileList.value = fileList.value.filter(v => {
  920. let flag = true
  921. fileSelectedRowKeys.value.forEach(s => {
  922. if ((v.id && (v.id === s.id)) || (v.__index && (v.__index === s.__index))) {
  923. flag = false
  924. }
  925. })
  926. return flag
  927. })
  928. }
  929. const onChangTz = (val) => {
  930. if (val) {
  931. const obj = tzOptions.value.filter(v => v.tzCode === val)[0]
  932. formData.value.tzNature = obj.tzType
  933. formData.value.companyCode = obj.companyCode
  934. formData.value.companyMainHgCode = obj.companyMainHgCode
  935. qySecondlineHzdTzApi.qySecondlineHzdTzQyProductById({id: obj.id}).then(res => {
  936. bodyList.value = res
  937. onBodyReset()
  938. })
  939. } else {
  940. formData.value.tzNature = ''
  941. formData.value.companyCode = ''
  942. formData.value.companyMainHgCode = ''
  943. bodyList.value = []
  944. onBodyReset()
  945. }
  946. }
  947. // 抛出函数
  948. defineExpose({
  949. onOpen
  950. })
  951. </script>
  952. <style lang="less" scoped>
  953. .file-tips {
  954. background-color: rgb(235, 245, 255);
  955. border: 1px solid rgb(214, 235, 255);
  956. border-radius: 5px;
  957. color: rgb(153, 153, 153);
  958. padding: 10px 20px;
  959. margin-bottom: 10px;
  960. }
  961. </style>