detail.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095
  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 @change="onChangeWeightRatioFactor"/>
  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="formData.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 || bodyData.__index)"
  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. >
  376. <template #bodyCell="{ column, record, index }">
  377. <template v-if="column.dataIndex === 'declareUnit'">
  378. {{ $TOOL.dictTypeData('measurement unit', record.declareUnit) }}
  379. </template>
  380. <template v-if="column.dataIndex === 'originCountry'">
  381. {{ $TOOL.dictTypeData('address', record.originCountry) }}
  382. </template>
  383. <template v-if="column.dataIndex === 'legalUnit'">
  384. {{ $TOOL.dictTypeData('measurement unit', record.legalUnit) }}
  385. </template>
  386. <template v-if="column.dataIndex === 'legalSecondUnit'">
  387. {{ $TOOL.dictTypeData('measurement unit', record.legalSecondUnit) }}
  388. </template>
  389. <template v-if="column.dataIndex === 'zmMethod'">
  390. {{ $TOOL.dictTypeData('zm_type', record.zmMethod) }}
  391. </template>
  392. <template v-if="column.dataIndex === 'zzmdg'">
  393. {{ $TOOL.dictTypeData('address', record.zzmdg) }}
  394. </template>
  395. <template v-if="column.dataIndex === 'action'">
  396. <template v-if="isView">
  397. <a-button type="link" primary size="small"
  398. @click="onBodyReset(), bodyData = cloneDeep(record)">查看
  399. </a-button>
  400. </template>
  401. <template v-else>
  402. <a-button type="link" primary size="small"
  403. @click="onBodyReset(), bodyData = cloneDeep(record)">编辑
  404. </a-button>
  405. <a-button type="link" danger size="small" @click="onBodyDel(index)">删除</a-button>
  406. </template>
  407. </template>
  408. </template>
  409. </a-table>
  410. </a-collapse-panel>
  411. <a-collapse-panel key="3" header="附件信息">
  412. <template v-if="!isView">
  413. <div class="file-tips">
  414. <InfoCircleFilled style="margin-right: 4px;"/>
  415. 友情提示<br/>
  416. 1、附件大小要求不超过4M,如果文件过大,建议拆分多个上传;<br/>
  417. 2、附件格式要求:PDF文件;<br/>
  418. 3、同一附件类型可以上传多个附件;<br/>
  419. 4、附件传输过程中会出现传输失败的情况,请随时关注附件传输状态;<br/>
  420. 5、要求上传复印件的可上传原件的扫描件。
  421. </div>
  422. <xn-upload ref="ref_upload" v-model:value="fileData.fileUrl" @onChange="fileChange" accept=".pdf"
  423. v-if="showFileUpload"/>
  424. <div style="margin-top: 10px;">
  425. <xn-batch-delete
  426. :selectedRowKeys="fileSelectedRowKeys"
  427. @batchDelete="deleteBatchFile"
  428. />
  429. </div>
  430. </template>
  431. <a-table
  432. style="margin-top: 10px"
  433. bordered
  434. :dataSource="fileList"
  435. :columns="fileColumns"
  436. :pagination="false"
  437. :row-selection="fileOptions.rowSelection"
  438. >
  439. <template #bodyCell="{ column, record, index, text }">
  440. <template
  441. v-if="['attachmentName', 'attachmentFormat', 'attachmentContent'].includes(column.dataIndex)">
  442. <div>
  443. <a-input
  444. v-if="!isView"
  445. v-model:value="record[column.dataIndex]"
  446. style="margin: -5px 0"
  447. />
  448. <template v-else>
  449. {{ text }}
  450. </template>
  451. </div>
  452. </template>
  453. <template v-if="column.dataIndex === 'action'">
  454. <template v-if="isView">
  455. </template>
  456. <template v-else>
  457. <a-button type="link" danger size="small" @click="onFileDel(index)" v-if="!isView">
  458. 删除
  459. </a-button>
  460. </template>
  461. </template>
  462. </template>
  463. </a-table>
  464. </a-collapse-panel>
  465. </a-collapse>
  466. </a-card>
  467. </template>
  468. <script setup name="qySecondlineHzdTzDetail">
  469. import tool from '@/utils/tool'
  470. import {cloneDeep} from 'lodash-es'
  471. import {required} from '@/utils/formRules'
  472. import qySecondlineHzdTzApi from '@/api/yqyc/qySecondLineHzdTzApi'
  473. import {message, Modal} from "ant-design-vue";
  474. import {createVNode} from "vue";
  475. import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
  476. import qySecondlineHfdApi from "@/api/yqyc/qySecondlineHfdApi";
  477. // 抽屉状态
  478. const {proxy} = getCurrentInstance()
  479. const emit = defineEmits({successful: null, onClose: null})
  480. const formRef = ref()
  481. // 表单数据
  482. const formData = ref({})
  483. const submitLoading = ref(false)
  484. const isView = ref(false)
  485. const tzTypeOptions = ref([])
  486. const jgfsOptions = ref([])
  487. const statusOptions = ref([])
  488. const glqdbhOptions = ref([])
  489. const ysfsOptions = ref([])
  490. const declareUnitOptions = ref([])
  491. const originCountryOptions = ref([])
  492. const legalUnitOptions = ref([])
  493. const legalSecondUnitOptions = ref([])
  494. const zmMethodOptions = ref([])
  495. const zzmdgOptions = ref([])
  496. const currencyOptions = ref([])
  497. const tzOptions = ref([])
  498. const activeKey = ref('1')
  499. const userInfo = tool.data.get('USER_INFO')
  500. // 打开抽屉
  501. const onOpen = (record, view = false, copy) => {
  502. isView.value = view
  503. if (record) {
  504. qySecondlineHzdTzApi.qySecondlineHzdTzDetail({id: record.id}).then(res => {
  505. formData.value = res.baseInfo
  506. bodyList.value = res.productList
  507. fileList.value = res.attachmentList
  508. if (copy) {
  509. delete formData.value.id
  510. }
  511. })
  512. } else {
  513. formData.value.tzType = '二线出区'
  514. formData.value.useDept = userInfo.companyName
  515. }
  516. qySecondlineHzdTzApi.qySecondlineHzdTzQyRecordInfo().then(res => {
  517. tzOptions.value = res.map(v => Object.assign(v, {label: v.tzCode, value: v.tzCode}))
  518. if (formData.value.tzCode) {
  519. const obj = tzOptions.value.filter(v => v.tzCode === formData.value.tzCode)[0]
  520. qySecondlineHzdTzApi.qySecondlineHzdTzQyProductById({id: obj.id}).then(res2 => {
  521. bodyListOptions.value = res2.map(v => Object.assign(v, {label: v.productNumber, value: v.productNumber}))
  522. })
  523. }
  524. })
  525. qySecondlineHzdTzApi.qySecondlineHzdTzHzdQdList().then(res => {
  526. glqdbhOptions.value = res.map(v => Object.assign(v, {label: v.glqdCode, value: v.glqdCode}))
  527. })
  528. tzTypeOptions.value = tool.dictList('tzlx')
  529. statusOptions.value = tool.dictList('djzt')
  530. ysfsOptions.value = tool.dictList('trans_type')
  531. declareUnitOptions.value = tool.dictList('measurement unit')
  532. originCountryOptions.value = tool.dictList('address')
  533. legalUnitOptions.value = tool.dictList('measurement unit')
  534. legalSecondUnitOptions.value = tool.dictList('measurement unit')
  535. zmMethodOptions.value = tool.dictList('zm_type')
  536. zzmdgOptions.value = tool.dictList('address')
  537. jgfsOptions.value = tool.dictList('jgfs')
  538. currencyOptions.value = tool.dictList('hbdm')
  539. }
  540. // 关闭抽屉
  541. const onClose = () => {
  542. formRef.value?.resetFields()
  543. formData.value = {}
  544. isView.value = true
  545. emit('onClose')
  546. }
  547. // 默认要校验的
  548. const formRules = {
  549. dybgDept: [required('请输入对应报关单申报单位名称')],
  550. glqdCode: [required('请输入关联清单编号')],
  551. }
  552. // 验证并提交数据
  553. const onSubmit = () => {
  554. formRef.value
  555. .validate()
  556. .then(() => {
  557. submitLoading.value = true
  558. const params = {
  559. baseInfo: Object.assign(formData.value, {status: '3'}),
  560. productList: bodyList.value,
  561. attachmentList: fileList.value,
  562. }
  563. qySecondlineHzdTzApi.qySecondlineHzdTzSubmitForm(params, formData.value.id).then(() => {
  564. onClose()
  565. emit('successful')
  566. }).finally(() => {
  567. submitLoading.value = false
  568. })
  569. })
  570. .catch(() => {
  571. })
  572. }
  573. const onTemp = () => {
  574. formRef.value
  575. .validate()
  576. .then(() => {
  577. submitLoading.value = true
  578. const params = {
  579. baseInfo: Object.assign(formData.value, {status: '1'}),
  580. productList: bodyList.value,
  581. attachmentList: fileList.value,
  582. }
  583. qySecondlineHzdTzApi.qySecondlineHzdTzSubmitForm(params, formData.value.id).then(() => {
  584. onClose()
  585. emit('successful')
  586. })
  587. .finally(() => {
  588. submitLoading.value = false
  589. })
  590. })
  591. .catch(() => {
  592. })
  593. }
  594. const bodyFormRef = ref()
  595. const bodyData = ref({})
  596. const bodySelectedRowKeys = ref([])
  597. const bodyList = ref([])
  598. const bodyListOptions = ref([])
  599. // 列表选择配置
  600. const bodyOptions = {
  601. rowSelection: {
  602. onChange: (selectedRowKey, selectedRows) => {
  603. bodySelectedRowKeys.value = selectedRows
  604. }
  605. }
  606. }
  607. // 默认要校验的
  608. const bodyRules = {
  609. productOrderCode: [required('请输入商品序号')],
  610. bgdProductOrderCode: [required('请输入报关单商品序号')],
  611. recordCode: [required('请输入备案序号')],
  612. noticeCode: [required('请输入通知书序号')],
  613. productCode: [required('请输入商品编码')],
  614. productName: [required('请输入商品名称')],
  615. specModel: [required('请输入规格型号')],
  616. sbNum: [required('请输入申报数量')],
  617. declareUnit: [required('请输入申报计量单位')],
  618. companySbPrice: [required('请输入企业申报单价')],
  619. companySbCount: [required('请输入企业申报总价')],
  620. recordPrice: [required('请输入备案单价')],
  621. recordTotalPrice: [required('请输入备案总价')],
  622. currency: [required('请输入币制')],
  623. originCountry: [required('请输入原产国(地区)')],
  624. legalQuantity: [required('请输入法定数量')],
  625. legalUnit: [required('请输入法定计量单位')],
  626. grossWeight: [required('请输入毛重')],
  627. netWeight: [required('请输入净重')],
  628. zmMethod: [required('请输入征免性质')],
  629. jgnxDqr: [required('请输入监管年限到期日')],
  630. jgnxQsr: [required('请输入监管年限起始日')],
  631. jzkcNum: [required('请输入进账库存数量')],
  632. }
  633. const bodyColumns = [
  634. {
  635. title: '商品序号',
  636. dataIndex: 'productOrderCode',
  637. width: 100
  638. },
  639. {
  640. title: '报关单商品序号',
  641. dataIndex: 'bgdProductOrderCode',
  642. width: 160
  643. },
  644. {
  645. title: '备案序号',
  646. dataIndex: 'recordCode',
  647. width: 100
  648. },
  649. {
  650. title: '通知书序号',
  651. dataIndex: 'noticeCode',
  652. width: 120
  653. },
  654. {
  655. title: '商品编码',
  656. dataIndex: 'productCode',
  657. width: 100
  658. },
  659. {
  660. title: '商品名称',
  661. dataIndex: 'productName',
  662. width: 100
  663. },
  664. {
  665. title: '规格型号',
  666. dataIndex: 'specModel',
  667. width: 100
  668. },
  669. {
  670. title: '申报数量',
  671. dataIndex: 'sbNum',
  672. width: 100
  673. },
  674. {
  675. title: '申报计量单位',
  676. dataIndex: 'declareUnit',
  677. width: 160
  678. },
  679. {
  680. title: '企业申报单价',
  681. dataIndex: 'companySbPrice',
  682. width: 160
  683. },
  684. {
  685. title: '企业申报总价',
  686. dataIndex: 'companySbCount',
  687. width: 160
  688. },
  689. {
  690. title: '备案单价',
  691. dataIndex: 'recordPrice',
  692. width: 100
  693. },
  694. {
  695. title: '备案总价',
  696. dataIndex: 'recordTotalPrice',
  697. width: 100
  698. },
  699. {
  700. title: '币制',
  701. dataIndex: 'currency',
  702. width: 100
  703. },
  704. {
  705. title: '原产国(地区)',
  706. dataIndex: 'originCountry',
  707. width: 160
  708. },
  709. {
  710. title: '法定数量',
  711. dataIndex: 'legalQuantity',
  712. width: 100
  713. },
  714. {
  715. title: '法定计量单位',
  716. dataIndex: 'legalUnit',
  717. width: 160
  718. },
  719. {
  720. title: '第二法定数量',
  721. dataIndex: 'secondLegalQuantity',
  722. width: 160
  723. },
  724. {
  725. title: '法定第二计量',
  726. dataIndex: 'legalSecondUnit',
  727. width: 160
  728. },
  729. {
  730. title: '美元统计总金额',
  731. dataIndex: 'myCount',
  732. width: 160
  733. },
  734. {
  735. title: '重量比例因子',
  736. dataIndex: 'weightRatioFactor',
  737. width: 160
  738. },
  739. {
  740. title: '第一比例因子',
  741. dataIndex: 'firstRatioFactor',
  742. width: 160
  743. },
  744. {
  745. title: '第二比例因子',
  746. dataIndex: 'secondRatioFactor',
  747. width: 160
  748. },
  749. {
  750. title: '毛重',
  751. dataIndex: 'grossWeight',
  752. width: 100
  753. },
  754. {
  755. title: '净重',
  756. dataIndex: 'netWeight',
  757. width: 100
  758. },
  759. {
  760. title: '征免方式',
  761. dataIndex: 'zmMethod',
  762. width: 160
  763. },
  764. {
  765. title: '最终目的国(地区)',
  766. dataIndex: 'zzmdg',
  767. width: 160
  768. },
  769. {
  770. title: '监管年限到期日',
  771. dataIndex: 'jgnxDqr',
  772. width: 160
  773. },
  774. {
  775. title: '监管年限起始日',
  776. dataIndex: 'jgnxQsr',
  777. width: 160
  778. },
  779. {
  780. title: '进账库存数量',
  781. dataIndex: 'jzkcNum',
  782. width: 160
  783. },
  784. {
  785. title: '监管年限自用数量',
  786. dataIndex: 'jgnxZysl',
  787. width: 160
  788. },
  789. {
  790. title: '解除年限数量(已解除监管/总数)',
  791. dataIndex: 'jcjgslYjc',
  792. width: 240
  793. },
  794. {
  795. title: '到期解除监管数量',
  796. dataIndex: 'dqjcjgsl',
  797. width: 160
  798. },
  799. {
  800. title: '解除年限数量(二线出区)',
  801. dataIndex: 'jcjgslSecondline',
  802. width: 200
  803. },
  804. {
  805. title: '解除监管数量(补税)',
  806. dataIndex: 'jcjgslBs',
  807. width: 200
  808. },
  809. {
  810. title: '解除监管数量(区内转让)',
  811. dataIndex: 'jcjgslQnzr',
  812. width: 200
  813. },
  814. {
  815. title: '解除监管数量(转至区外)',
  816. dataIndex: 'jcjgslZzqw',
  817. width: 200
  818. },
  819. {
  820. title: '解除监管数量(基建物资核销)',
  821. dataIndex: 'jcjgslJjwzhx',
  822. width: 220
  823. },
  824. {
  825. title: '监管年限内区内转移数量',
  826. dataIndex: 'jgnxnQnzysl',
  827. width: 200
  828. },
  829. {
  830. title: '监管年限内抵押贷款数量',
  831. dataIndex: 'jgnxnDydksl',
  832. width: 200
  833. },
  834. {
  835. title: '监管年限起始日',
  836. dataIndex: 'jgnxQsy',
  837. width: 160
  838. },
  839. {
  840. title: '监管年限内临时移作他用数量',
  841. dataIndex: 'jgnxnLszztysl',
  842. width: 220
  843. },
  844. {
  845. title: '修改标志',
  846. dataIndex: 'xgbz',
  847. width: 100
  848. },
  849. {
  850. title: '操作',
  851. dataIndex: 'action',
  852. width: 200,
  853. fixed: 'right'
  854. },
  855. ]
  856. const onBodyReset = () => {
  857. bodyFormRef.value?.resetFields()
  858. bodyData.value = {
  859. recordCode: formData.value.tzCode,
  860. specModel: 0
  861. }
  862. }
  863. const onBodyAdd = () => {
  864. bodyFormRef.value
  865. .validate()
  866. .then(() => {
  867. bodyList.value.push(Object.assign({__index: new Date().getTime()}, bodyData.value))
  868. onBodyReset()
  869. message.success('插入表体信息成功!')
  870. })
  871. .catch(() => {
  872. })
  873. }
  874. const onBodyEdit = () => {
  875. bodyFormRef.value
  876. .validate()
  877. .then(() => {
  878. let k = ''
  879. if (bodyData.value.id) {
  880. k = 'id'
  881. } else if (bodyData.value.__index) {
  882. k = '__index'
  883. }
  884. if (k) {
  885. bodyList.value.forEach(v => {
  886. if (v[k] === bodyData.value[k]) {
  887. Object.assign(v, bodyData.value)
  888. }
  889. })
  890. }
  891. onBodyReset()
  892. message.success('编辑表体信息成功!')
  893. })
  894. .catch(() => {
  895. })
  896. }
  897. const onBodyDel = (recode, index) => {
  898. Modal.confirm({
  899. title: '提示',
  900. icon: createVNode(ExclamationCircleOutlined),
  901. content: createVNode('div', {style: 'color:red;'}, `是否要删除${record.productName}?`),
  902. centered: true,
  903. onOk() {
  904. bodyList.value.splice(index, 1)
  905. },
  906. onCancel() {
  907. },
  908. });
  909. }
  910. const deleteBatchBody = () => {
  911. bodyList.value = bodyList.value.filter(v => {
  912. let flag = true
  913. bodySelectedRowKeys.value.forEach(s => {
  914. if ((v.id && (v.id === s.id)) || (v.__index && (v.__index === s.__index))) {
  915. flag = false
  916. }
  917. })
  918. return flag
  919. })
  920. }
  921. const ref_upload = ref()
  922. const fileData = ref({})
  923. const showFileUpload = ref(true)
  924. const fileSelectedRowKeys = ref([])
  925. const fileList = ref([])
  926. // 列表选择配置
  927. const fileOptions = {
  928. rowSelection: {
  929. onChange: (selectedRowKey, selectedRows) => {
  930. fileSelectedRowKeys.value = selectedRows
  931. }
  932. }
  933. }
  934. const fileColumns = [
  935. {
  936. title: '附件名称',
  937. dataIndex: 'attachmentName',
  938. },
  939. {
  940. title: '附件格式',
  941. dataIndex: 'attachmentFormat',
  942. },
  943. {
  944. title: '附件内容',
  945. dataIndex: 'attachmentContent',
  946. },
  947. {
  948. title: '上传时间',
  949. dataIndex: 'uploadTime',
  950. },
  951. {
  952. title: '操作',
  953. dataIndex: 'action',
  954. },
  955. ]
  956. const getFileExtension = (filename) => {
  957. // 使用lastIndexOf查找最后一个"."的位置
  958. var dotIndex = filename.lastIndexOf(".");
  959. // 如果找到了".",则提取从"."之后的子串作为后缀名
  960. if (dotIndex !== -1 && dotIndex < filename.length - 1) { // 确保"."不是字符串的最后一个字符
  961. return filename.slice(dotIndex + 1); // slice从dotIndex+1开始到字符串结束
  962. } else {
  963. // 如果没有找到".",返回空字符串表示没有后缀
  964. return "";
  965. }
  966. }
  967. const fileChange = (file) => {
  968. if (file) {
  969. const f = ref_upload.value.uploadFileList()[0]
  970. fileList.value.push({
  971. __index: new Date().getTime(),
  972. attachmentUrl: f.url,
  973. attachmentName: f.name,
  974. attachmentFormat: getFileExtension(f.name),
  975. attachmentContent: '',
  976. uploadTime: proxy.$util.YMDHms(new Date()),
  977. })
  978. fileData.value.fileUrl = ''
  979. showFileUpload.value = false
  980. setTimeout(() => {
  981. showFileUpload.value = true
  982. }, 0)
  983. }
  984. }
  985. const onFileDel = (recode, index) => {
  986. Modal.confirm({
  987. title: '提示',
  988. icon: createVNode(ExclamationCircleOutlined),
  989. content: createVNode('div', {style: 'color:red;'}, `是否要删除?`),
  990. centered: true,
  991. onOk() {
  992. fileList.value.splice(index, 1)
  993. },
  994. onCancel() {
  995. },
  996. });
  997. }
  998. const deleteBatchFile = () => {
  999. fileList.value = fileList.value.filter(v => {
  1000. let flag = true
  1001. fileSelectedRowKeys.value.forEach(s => {
  1002. if ((v.id && (v.id === s.id)) || (v.__index && (v.__index === s.__index))) {
  1003. flag = false
  1004. }
  1005. })
  1006. return flag
  1007. })
  1008. }
  1009. const onChangTz = (val) => {
  1010. if (val) {
  1011. const obj = tzOptions.value.filter(v => v.tzCode === val)[0]
  1012. formData.value.tzNature = obj.tzType
  1013. formData.value.companyCode = obj.companyCode
  1014. formData.value.companyMainHgCode = obj.companyMainHgCode
  1015. qySecondlineHzdTzApi.qySecondlineHzdTzQyProductById({id: obj.id}).then(res => {
  1016. bodyListOptions.value = res.map(v => Object.assign(v, {label: v.productNumber, value: v.productNumber}))
  1017. bodyList.value = []
  1018. onBodyReset()
  1019. })
  1020. } else {
  1021. formData.value.tzNature = ''
  1022. formData.value.companyCode = ''
  1023. formData.value.companyMainHgCode = ''
  1024. bodyList.value = []
  1025. bodyListOptions.value = []
  1026. onBodyReset()
  1027. }
  1028. }
  1029. const onChangGlqdbh = (val) => {
  1030. if (val) {
  1031. const obj = glqdbhOptions.value.filter(v => v.value === val)[0]
  1032. formData.value.dybgCode = obj.dybgCode
  1033. formData.value.dybgDept = obj.dybgDept
  1034. } else {
  1035. formData.value.dybgCode = ''
  1036. formData.value.dybgDept = ''
  1037. }
  1038. }
  1039. const onChangProductOrderCode = (val) => {
  1040. if (val) {
  1041. const obj = bodyListOptions.value.filter(v => v.value === val)[0]
  1042. bodyData.value.bgdProductOrderCode = obj.productNumber
  1043. bodyData.value.productCode = obj.productCode
  1044. bodyData.value.productName = obj.productName
  1045. console.log(obj)
  1046. } else {
  1047. }
  1048. }
  1049. const onChangeSbNum = () => {
  1050. setTimeout(() => {
  1051. if (proxy.$util.isValue(bodyData.value.sbNum) && proxy.$util.isValue(bodyData.value.legalQuantity) && (Number(bodyData.value.legalQuantity) > 0)) {
  1052. bodyData.value.weightRatioFactor = Number(bodyData.value.sbNum) / Number(bodyData.value.legalQuantity)
  1053. } else {
  1054. bodyData.value.weightRatioFactor = ''
  1055. }
  1056. }, 100)
  1057. }
  1058. const onChangeLegalQuantity = () => {
  1059. setTimeout(() => {
  1060. if (proxy.$util.isValue(bodyData.value.sbNum) && proxy.$util.isValue(bodyData.value.legalQuantity) && (Number(bodyData.value.legalQuantity) > 0)) {
  1061. bodyData.value.weightRatioFactor = Number(bodyData.value.sbNum) / Number(bodyData.value.legalQuantity)
  1062. } else {
  1063. bodyData.value.weightRatioFactor = ''
  1064. }
  1065. }, 100)
  1066. }
  1067. const onChangeWeightRatioFactor = () => {
  1068. setTimeout(() => {
  1069. bodyData.value.firstRatioFactor = bodyData.value.weightRatioFactor
  1070. }, 100)
  1071. }
  1072. const onChangeJgnxQsr = (val) => {
  1073. bodyData.value.jgnxDqr = proxy.$util.YMDHms(new Date(val).getTime() + 1000 * 60 * 60 * 24 * 365 * 3)
  1074. }
  1075. // 抛出函数
  1076. defineExpose({
  1077. onOpen
  1078. })
  1079. </script>
  1080. <style lang="less" scoped>
  1081. .file-tips {
  1082. background-color: rgb(235, 245, 255);
  1083. border: 1px solid rgb(214, 235, 255);
  1084. border-radius: 5px;
  1085. color: rgb(153, 153, 153);
  1086. padding: 10px 20px;
  1087. margin-bottom: 10px;
  1088. }
  1089. </style>