detail.vue 37 KB

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