IncidentTicketModalDetail.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. <template>
  2. <a-modal
  3. title="详情"
  4. width="85%"
  5. :visible="visible"
  6. :maskClosable="false"
  7. :confirmLoading="confirmLoading"
  8. @cancel="handleCancel"
  9. destroyOnClose
  10. >
  11. <template #footer>
  12. <a-button v-if="showFooter" @click="handleCancel" style="margin-left: 8px;">取消</a-button>
  13. <a-button v-if="showFooter" @click="handlePrint" style="margin-left: 8px;">打印</a-button>
  14. <a-button v-if="showFooter" type="primary" @click="addNotice" style="margin-left: 8px;" :disabled="!(formState.state=='1')">通知</a-button>
  15. <a-popconfirm title="确定反馈通知吗?" ok-text="是" cancel-text="否" @confirm="feedbackNotice" @cancel="handleCancelPop('visibleFk')" :visible="visibleFk">
  16. <a-button v-if="showFooter" type="primary" style="margin-left: 8px;" :disabled="!(formState.state=='2')" @click="()=>visibleFk = true">反馈通知</a-button>
  17. </a-popconfirm>
  18. <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push" @cancel="handleCancelPop('visibleTs')" :visible="visibleTs">
  19. <a-button v-if="showFooter" type="primary" style="margin-left: 8px;" :disabled="!(formState.state=='3'&&!confirmLoading)" @click="()=>visibleTs = true">推送</a-button>
  20. </a-popconfirm>
  21. <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="end" @cancel="handleCancelPop('visibleTj')" :visible="visibleTj">
  22. <a-button v-if="showFooter" type="primary" style="margin-left: 8px;" :disabled="!(formState.state=='3'|| formState.state=='4')" @click="()=>visibleTj = true">提交</a-button>
  23. </a-popconfirm>
  24. <a-popconfirm title="确定完结吗?" ok-text="是" cancel-text="否" @confirm="finish" @cancel="handleCancelPop('visibleWj')" :visible="visibleWj">
  25. <a-button v-if="showFooter" type="primary" style="margin-left: 8px;" :disabled="!(formState.state=='5')" @click="()=>visibleWj = true">完结</a-button>
  26. </a-popconfirm>
  27. </template>
  28. <a-spin :spinning="confirmLoading">
  29. <div class="table-page-search-wrapper" >
  30. <div>
  31. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules" labelAlign="right" class="kk">
  32. <a-row :gutter="24">
  33. <a-col :span="8" >
  34. <a-form-model-item label="日期" prop="accidentData" >
  35. <a-input v-model="formState.accidentData" placeholder="请输入" readOnly ></a-input>
  36. </a-form-model-item>
  37. </a-col>
  38. <a-col :span="8" >
  39. <a-form-model-item label="质量事故单主题" prop="accidentTheme">
  40. <a-input v-model="formState.accidentTheme" placeholder="请输入" readOnly ></a-input>
  41. </a-form-model-item>
  42. </a-col>
  43. <a-col :span="8">
  44. <a-form-model-item label="质量事故单号" prop="accidentNumber">
  45. <a-input v-model="formState.accidentNumber" placeholder="请输入" readOnly ></a-input>
  46. </a-form-model-item>
  47. </a-col>
  48. </a-row>
  49. <a-row :gutter="24">
  50. <a-col :span="8" >
  51. <a-form-model-item label="客户" prop="customer" >
  52. <a-input v-model="formState.customer" placeholder="请输入" readOnly ></a-input>
  53. </a-form-model-item>
  54. </a-col>
  55. <a-col :span="8" >
  56. <a-form-model-item label="工厂(事故发生地)" prop="factory">
  57. <a-input v-model="formState.factory" placeholder="请输入" readOnly ></a-input>
  58. </a-form-model-item>
  59. </a-col>
  60. <a-col :span="8" >
  61. <a-form-model-item label="责任单位" prop="responsibilityCompany">
  62. <a-input v-model="formState.responsibilityCompany" placeholder="请输入" readOnly ></a-input>
  63. </a-form-model-item>
  64. </a-col>
  65. </a-row>
  66. <a-divider />
  67. <a-row :gutter="24">
  68. <a-col :span="6" >
  69. <a-form-model-item label="责任人1" prop="responsibilityPerson1" >
  70. <j-search-select-tag v-model="formState.responsibilityPerson1" placeholder=""
  71. dict="sys_user,realname,username" @search="searchName" :disabled="true" />
  72. </a-form-model-item>
  73. </a-col>
  74. <a-col :span="6" >
  75. <a-form-model-item label="责任人2" prop="responsibilityPerson2" >
  76. <j-search-select-tag v-model="formState.responsibilityPerson2" placeholder=""
  77. dict="sys_user,realname,username" @search="searchName" :disabled="true" />
  78. </a-form-model-item>
  79. </a-col>
  80. <a-col :span="6" >
  81. <a-form-model-item label="责任人3" prop="responsibilityPerson3">
  82. <j-search-select-tag v-model="formState.responsibilityPerson3" placeholder=""
  83. dict="sys_user,realname,username" @search="searchName" :disabled="true" />
  84. </a-form-model-item>
  85. </a-col>
  86. <a-col :span="6">
  87. <a-form-model-item label="责任人4" prop="responsibilityPerson4">
  88. <j-search-select-tag v-model="formState.responsibilityPerson4" placeholder=""
  89. dict="sys_user,realname,username" @search="searchName" :disabled="true" />
  90. </a-form-model-item>
  91. </a-col>
  92. </a-row>
  93. <a-row :gutter="24">
  94. <a-col :span="6" >
  95. <a-form-model-item label="金额1" prop="sum1" >
  96. <a-input v-model="formState.sum1" placeholder="请输入" readOnly ></a-input>
  97. </a-form-model-item>
  98. </a-col>
  99. <a-col :span="6" >
  100. <a-form-model-item label="金额2" prop="sum2" >
  101. <a-input v-model="formState.sum2" placeholder="请输入" readOnly ></a-input>
  102. </a-form-model-item>
  103. </a-col>
  104. <a-col :span="6" >
  105. <a-form-model-item label="金额3" prop="sum3">
  106. <a-input v-model="formState.sum3" placeholder="请输入" readOnly ></a-input>
  107. </a-form-model-item>
  108. </a-col>
  109. <a-col :span="6">
  110. <a-form-model-item label="金额4" prop="sum4" >
  111. <a-input v-model="formState.sum4" placeholder="请输入" readOnly ></a-input>
  112. </a-form-model-item>
  113. </a-col>
  114. </a-row>
  115. <a-divider />
  116. <a-row :gutter="24">
  117. <!-- <a-col :span="8" >
  118. <a-form-model-item label="币种" prop="moneyType">
  119. <a-input v-model="formState.moneyType" placeholder="请输入" readOnly></a-input>
  120. </a-form-model-item>
  121. </a-col> -->
  122. <a-col :span="8" >
  123. <a-form-model-item label="总金额" prop="totalMoney" >
  124. <a-input v-model="formState.totalMoney" placeholder="请输入" readOnly ></a-input>
  125. </a-form-model-item>
  126. </a-col>
  127. <a-col :span="8" >
  128. <a-form-model-item label="业务类型" prop="businessType">
  129. <a-input v-model="formState.businessType" placeholder="请输入" readOnly ></a-input>
  130. </a-form-model-item>
  131. </a-col>
  132. </a-row>
  133. <a-row :gutter="24">
  134. <a-col :span="8" >
  135. <a-form-model-item label="成衣销售订单号" prop="garmentSalesOrder">
  136. <a-input v-model="formState.garmentSalesOrder" placeholder="请输入" readOnly ></a-input>
  137. </a-form-model-item>
  138. </a-col>
  139. <a-col :span="8" >
  140. <a-form-model-item label="款号" prop="styleNumber" >
  141. <a-input v-model="formState.styleNumber" placeholder="请输入" readOnly ></a-input>
  142. </a-form-model-item>
  143. </a-col>
  144. <a-col :span="8" >
  145. <a-form-model-item label="物料" prop="material">
  146. <a-input v-model="formState.material" placeholder="请输入" readOnly ></a-input>
  147. </a-form-model-item>
  148. </a-col>
  149. </a-row>
  150. <a-row :gutter="24">
  151. <a-col :span="8" >
  152. <a-form-model-item label="计划员" prop="planPersonnel">
  153. <a-input v-model="formState.planPersonnel" placeholder="请输入" readOnly ></a-input>
  154. </a-form-model-item>
  155. </a-col>
  156. <a-col :span="8" >
  157. <a-form-model-item label="业务员" prop="businessPeople" >
  158. <j-search-select-tag v-model="formState.businessPeople" placeholder=""
  159. dict="sys_user,realname,username" @search="searchName" :disabled="true" />
  160. </a-form-model-item>
  161. </a-col>
  162. <a-col :span="8" >
  163. <a-form-model-item label="QC" prop="qualityControl">
  164. <j-search-select-tag v-model="formState.qualityControl" placeholder=""
  165. dict="sys_user,realname,username" @search="searchName" :disabled="true" />
  166. </a-form-model-item>
  167. </a-col>
  168. </a-row>
  169. <a-row :gutter="24">
  170. <a-col :span="24" style="height: 290px;">
  171. <a-form-model-item label="情况说明" prop="presentationCondition" class="fff">
  172. <a-textarea v-model="formState.presentationCondition" type="textarea" placeholder="请输入" readOnly></a-textarea>
  173. <!-- <a-input v-model="formState.presentationCondition" type="textarea" placeholder="请输入" readOnly ></a-input> -->
  174. </a-form-model-item>
  175. </a-col>
  176. </a-row>
  177. </a-form-model>
  178. </div>
  179. <!-- 子表单区域 -->
  180. <!-- <a-button type="primary" @click="addList" style="margin-bottom: 1%;">增行</a-button> -->
  181. <a-table
  182. bordered
  183. :columns="incidentTicketChildrenTable.columns"
  184. :data-source="incidentTicketChildrenTable.dataSource"
  185. :loading="incidentTicketChildrenTable.loading"
  186. :scroll="{x: 1500,y:300 }"
  187. :pagination="false"
  188. >
  189. <!-- 汇率 -->
  190. <span slot="exchangeRate" slot-scope="text, record, index">
  191. <a-input placeholder="请输入" v-model="record.exchangeRate" />
  192. </span>
  193. <!-- 实际事故金额 -->
  194. <span slot="practicalSum" slot-scope="text, record, index">
  195. <a-input placeholder="请输入" v-model="record.practicalSum" />
  196. </span>
  197. <!-- U8生成运费发票号 -->
  198. <span slot="u8Invoice" slot-scope="text, record, index">
  199. <a-input placeholder="请输入" v-model="record.u8Invoice" />
  200. </span>
  201. <!-- 账套号 -->
  202. <span slot="zhanghaoId" slot-scope="text, record, index">
  203. <a-input placeholder="请输入" v-model="record.zhanghaoId" />
  204. </span>
  205. <!-- 备注 -->
  206. <span slot="remark" slot-scope="text, record, index">
  207. <a-input placeholder="请输入" v-model="record.remark" />
  208. </span>
  209. </a-table>
  210. <!-- 主表单区域 -->
  211. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
  212. <a-row :gutter="24">
  213. <a-col :span="12" >
  214. <a-form-model-item label="附件上传" prop="accessory" class="ff">
  215. <j-upload v-model="accessory" :disabled="true"></j-upload>
  216. </a-form-model-item>
  217. </a-col>
  218. <a-col :span="12" >
  219. <a-form-model-item label="工厂签章" prop="factorySignature" class="ff">
  220. <j-upload v-model="factorySignature" :disabled="true"></j-upload>
  221. </a-form-model-item>
  222. </a-col>
  223. </a-row>
  224. <a-row :gutter="24">
  225. <a-col :span="24" style="height: 230px;">
  226. <a-form-model-item label="财务备注" prop="financeRemark" class="caiwu">
  227. <a-input v-model="formState.financeRemark" type="textarea" placeholder="请输入" readOnly ></a-input>
  228. </a-form-model-item>
  229. </a-col>
  230. </a-row>
  231. <a-row :gutter="24">
  232. <a-col :span="12" >
  233. <a-form-model-item label="财务添加附件" prop="accessory2" class="ff ">
  234. <j-upload v-model="accessory2" ></j-upload>
  235. </a-form-model-item>
  236. </a-col>
  237. </a-row>
  238. <a-row :gutter="24">
  239. <a-col :span="18">
  240. <a-form-model-item label="通知人" prop="Noticer">
  241. <a-input v-model="formState.Noticer" placeholder="请输入" ></a-input>
  242. </a-form-model-item>
  243. </a-col>
  244. <a-col :span="6">
  245. <a-form-model-item label="通知时间" prop="Noticer">
  246. <a-input v-model="formState.createTime" placeholder="请输入" readOnly></a-input>
  247. </a-form-model-item>
  248. </a-col>
  249. </a-row>
  250. <a-row :gutter="24">
  251. <a-col :span="6">
  252. <a-form-model-item label="U8订单备注" prop="orderRemarks">
  253. <a-input v-model="formState.orderRemarks" placeholder="请输入" readOnly></a-input>
  254. </a-form-model-item>
  255. </a-col>
  256. <a-col :span="6">
  257. <a-form-model-item label="U8开票日期" prop="orderRemarks">
  258. <a-date-picker
  259. placeholder="请选择"
  260. format="YYYY-MM-DD"
  261. style="width: 100%"
  262. v-model="formState.invoicingDate"
  263. disabled="true"
  264. />
  265. </a-form-model-item>
  266. </a-col>
  267. <a-col :span="6" >
  268. <a-form-model-item label="填报人" prop="informant">
  269. <a-input v-model="formState.informant" placeholder="请输入" readOnly ></a-input>
  270. </a-form-model-item>
  271. </a-col>
  272. <a-col :span="6" >
  273. <a-form-model-item label="部门" prop="department">
  274. <a-input v-model="formState.department" placeholder="请输入" readOnly></a-input>
  275. </a-form-model-item>
  276. </a-col>
  277. </a-row>
  278. </a-form-model>
  279. <j-select-biz-component ref="JSelectBizComponent" @send-notice="sendNotice" :multi="true" />
  280. </div>
  281. </a-spin>
  282. <!-- 打印 -->
  283. <div class="col-md-6 column" style="display: none;" id="printBox">
  284. <h1 style="text-align: center;">质量事故处理单</h1>
  285. <table class="table table-bordered" style="border:2px solid #999">
  286. <thead>
  287. </thead>
  288. <tbody>
  289. <tr>
  290. <td class="tdOne">日期</td>
  291. <td class="tdTwo"> {{ formState.accidentData }}</td>
  292. <td class="tdOne">质量事故单号</td>
  293. <td class="tdTwo">{{ formState.accidentNumber }}</td>
  294. <td class="tdOne">质量事故主题</td>
  295. <td class="tdTwo">{{ formState.accidentTheme }}</td>
  296. </tr>
  297. <tr>
  298. <td class="tdOne">客户</td>
  299. <td class="tdTwo" >{{formState.customer }}</td>
  300. <td class="tdOne">工厂</td>
  301. <td class="tdTwo" >{{ formState.factory}}</td>
  302. <td class="tdOne">责任单位</td>
  303. <td class="tdTwo" >{{ formState.responsibilityCompany }}</td>
  304. </tr>
  305. <tr>
  306. <td class="tdOne">责任人1</td>
  307. <td class="tdOne">{{ formState.responsibilityPerson1 }}</td>
  308. <td class="tdOne">责任人2</td>
  309. <td class="tdOne">{{ formState.responsibilityPerson2 }}</td>
  310. <td class="tdOne">责任人3</td>
  311. <td class="tdOne">{{ formState.responsibilityPerson3 }}</td>
  312. </tr>
  313. <tr>
  314. <td class="tdOne">金额1</td>
  315. <td class="tdOne">{{ formState.sum1 }}</td>
  316. <td class="tdOne">金额2</td>
  317. <td class="tdOne">{{ formState.sum2 }}</td>
  318. <td class="tdOne">金额3</td>
  319. <td class="tdOne">{{ formState.sum3 }}</td>
  320. </tr>
  321. <tr>
  322. <td class="tdOne">总金额</td>
  323. <td class="tdOne">{{ formState.totalMoney }}</td>
  324. <td class="tdOne">业务类型</td>
  325. <td class="tdOne">{{ formState.businessType }}</td>
  326. <td class="tdOne"></td>
  327. <td class="tdOne"></td>
  328. </tr>
  329. <tr>
  330. <td class="tdOne">成衣销售订单号</td>
  331. <td class="tdOne">{{ formState.garmentSalesOrder }}</td>
  332. <td class="tdOne">款号</td>
  333. <td class="tdOne">{{ formState.styleNumber }}</td>
  334. <td class="tdOne">物料</td>
  335. <td class="tdOne">{{ formState.material }}</td>
  336. </tr>
  337. <tr>
  338. <td class="tdOne">计划员</td>
  339. <td class="tdOne">{{ formState.planPersonnel }}</td>
  340. <td class="tdOne">业务员</td>
  341. <td class="tdOne">{{ formState.businessPeople }}</td>
  342. <td class="tdOne">QC</td>
  343. <td class="tdOne">{{ formState.qualityControl }}</td>
  344. </tr>
  345. <tr style="height: 50px;">
  346. <td class="tdOne" rowspan="3">情况说明</td>
  347. <td class="tdOne" colspan="5" rowspan="3" style="text-align: left;padding-left: 1%;">
  348. <textarea style="width: 100%;border: none;overflow: hidden;" readOnly>{{ formState.presentationCondition }}</textarea>
  349. <!-- {{ formState.presentationCondition }} -->
  350. </td>
  351. </tr>
  352. </tbody>
  353. </table>
  354. <table class="table table-bordered" style="margin-top: 2%;border:2px solid #999">
  355. <thead>
  356. <th>计划单号</th>
  357. <th>事故类型</th>
  358. <th>币种</th>
  359. <th>事故金额</th>
  360. <th>汇率</th>
  361. <th>实际事故金额</th>
  362. <th>U8生成运费发票号</th>
  363. <th>账套号</th>
  364. <th>备注</th>
  365. </thead>
  366. <tbody>
  367. <tr v-for="(item, key) in incidentTicketChildrenTable.dataSource">
  368. <td>{{item.planNumber}}</td>
  369. <td>{{item.accidentType}}</td>
  370. <td>{{item.moneyType}}</td>
  371. <td>{{item.accidentSum}}</td>
  372. <td>{{item.exchangeRate}}</td>
  373. <td>{{item.practicalSum}}</td>
  374. <td>{{item.u8Invoice}}</td>
  375. <td>{{item.zhanghaoId}}</td>
  376. <td>{{item.remark}}</td>
  377. </tr>
  378. </tbody>
  379. </table>
  380. <table class="table table-bordered" style="margin-top: 2%;border:2px solid #999">
  381. <thead>
  382. </thead>
  383. <tbody>
  384. <tr style="height: 50px;">
  385. <td class="tdOne" style="width: 1%;">财务备注</td>
  386. <td class="tdOne" colspan="7" style="text-align: left;padding-left: 1%;">
  387. <textarea style="width: 100%;border: none;overflow: hidden;" readOnly>{{ formState.financeRemark }}</textarea>
  388. <!-- {{ formState.financeRemark }} -->
  389. <!-- <input type="text" v-text="formState.financeRemark" /> -->
  390. </td>
  391. </tr>
  392. </tbody>
  393. </table>
  394. <div style="width:100%;display: flex;justify-content: space-around;margin-top: 2%;">
  395. <span style="">填报人:{{ formState.informant }}</span>
  396. <span style="margin-left: 30%;">通知人:{{ formState.Noticer }}</span>
  397. </div>
  398. <div style="width:100%;justify-content: space-around;margin-right: 2%;">
  399. <img ghost style="margin-left: 50%;" width="340px" height="160px"
  400. src="http://www.myfitt.cn:18087/jeecg-boot/sys/common/static/temp/20230310100319_1678417947827.png"/>
  401. </div>
  402. </div>
  403. </a-modal>
  404. </template>
  405. <script>
  406. import JSelectBizComponent from './JSelectUserByDepModal'
  407. import pick from 'lodash.pick'
  408. import { FormTypes,getRefPromise } from '@/utils/JEditableTableUtil'
  409. import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
  410. import { validateDuplicateValue } from '@/utils/util'
  411. import JDictSelectTag from "@/components/dict/JDictSelectTag"
  412. import { putAction,getAction } from '@/api/manage'
  413. import JUpload from '@/components/jeecg/JUpload'
  414. import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  415. import moment from 'moment'
  416. export default {
  417. name: 'IncidentTicketModalDetail',
  418. mixins: [JEditableTableMixin],
  419. components: {
  420. JDictSelectTag,
  421. JSelectBizComponent,
  422. JUpload,
  423. JSearchSelectTag,
  424. moment
  425. },
  426. data() {
  427. return {
  428. labelCol: {
  429. span: 8
  430. },
  431. wrapperCol: {
  432. span: 16
  433. },
  434. labelCol2: {
  435. span: 3
  436. },
  437. wrapperCol2: {
  438. span: 20
  439. },
  440. formState:{},
  441. confirmLoading:false,
  442. visibleFk:false,
  443. visibleTs:false,
  444. visibleTj:false,
  445. visibleWj:false,
  446. visible:false,
  447. showFooter:false,
  448. apply:'',
  449. accessory2:[],
  450. accessory:[],
  451. factorySignature:[],
  452. columns: [
  453. { title: '姓名', align: 'center', width: '20%', widthRight: '70%', dataIndex: 'realname' },
  454. { title: '账号', align: 'center', width: '20%', dataIndex: 'username' },
  455. { title: '电话', align: 'center', width: '23%', dataIndex: 'phone' },
  456. { title: '出生日期', align: 'center', width: '23%', dataIndex: 'birthday' }
  457. ],
  458. multi:true,
  459. // 新增时子表默认添加几行空数据
  460. addDefaultRowNum: 1,
  461. validatorRules: {
  462. accidentData: {rules: [
  463. ]},
  464. accidentTheme: {rules: [
  465. ]},
  466. accidentPersonLiable: {rules: [
  467. ]},
  468. supplier: {rules: [
  469. ]},
  470. personLiable: {rules: [
  471. ]},
  472. accidentNumber: {rules: [
  473. ]},
  474. customer: {rules: [
  475. ]},
  476. factory: {rules: [
  477. ]},
  478. responsibilityPerson1: {rules: [
  479. ]},
  480. responsibilityPerson2: {rules: [
  481. ]},
  482. responsibilityPerson3: {rules: [
  483. ]},
  484. responsibilityPerson4: {rules: [
  485. ]},
  486. responsibilityPerson5: {rules: [
  487. ]},
  488. sum1: {rules: [
  489. ]},
  490. sum2: {rules: [
  491. ]},
  492. sum3: {rules: [
  493. ]},
  494. sum4: {rules: [
  495. ]},
  496. sum5: {rules: [
  497. ]},
  498. responsibilityCompany: {rules: [
  499. ]},
  500. moneyType: {rules: [
  501. ]},
  502. totalMoney: {rules: [
  503. ]},
  504. businessType: {rules: [
  505. ]},
  506. garmentSalesOrder: {rules: [
  507. ]},
  508. styleNumber: {rules: [
  509. ]},
  510. material: {rules: [
  511. ]},
  512. planPersonnel: {rules: [
  513. ]},
  514. businessPeople: {rules: [
  515. ]},
  516. qualityControl: {rules: [
  517. ]},
  518. planNumber: {rules: [
  519. ]},
  520. accidentType: {rules: [
  521. ]},
  522. accidentSum: {rules: [
  523. ]},
  524. presentationCondition: {rules: [
  525. ]},
  526. accessory: {rules: [
  527. ]},
  528. informant: {rules: [
  529. ]},
  530. factorySignature: {rules: [
  531. ]},
  532. financeRemark: {rules: [
  533. ]},
  534. accessory2: {rules: [
  535. ]},
  536. isLeaders: {rules: [
  537. ]},
  538. incidentTicketId: {rules: [
  539. ]},
  540. tableNameChildren: {rules: [
  541. ]},
  542. },
  543. refKeys: ['incidentTicketChildren', ],
  544. tableKeys:['incidentTicketChildren', ],
  545. activeKey: 'incidentTicketChildren',
  546. // 森_工厂质量事故单-子表
  547. incidentTicketChildrenTable: {
  548. loading: false,
  549. dataSource: [],
  550. columns: [
  551. {
  552. title:'序号',
  553. align:"center",
  554. ellipsis: true,
  555. dataIndex: 'sort',
  556. customRender: (text) => {
  557. return Number(text)+1;
  558. },
  559. width:'4%'
  560. },
  561. {
  562. title: '计划单号',
  563. align: "center",
  564. dataIndex: 'planNumber',
  565. width: '7%',
  566. // scopedSlots: { customRender: 'planNumber' },
  567. },
  568. {
  569. title: '事故类型',
  570. align: "center",
  571. dataIndex: 'accidentType',
  572. width: '7%',
  573. // scopedSlots: { customRender: 'accidentType' },
  574. },
  575. {
  576. title: '币种',
  577. align: "center",
  578. dataIndex: 'moneyType',
  579. width: '7%',
  580. // scopedSlots: { customRender: 'accidentType' },
  581. },
  582. {
  583. title: '事故金额',
  584. align: "center",
  585. dataIndex: 'accidentSum',
  586. width: '7%',
  587. // scopedSlots: { customRender: 'accidentSum' },
  588. },
  589. {
  590. title: '汇率',
  591. align: "center",
  592. dataIndex: 'exchangeRate',
  593. width: '9%',
  594. // scopedSlots: { customRender: 'exchangeRate' },
  595. },
  596. {
  597. title: '实际事故金额',
  598. align: "center",
  599. dataIndex: 'practicalSum',
  600. width: '7%',
  601. // scopedSlots: { customRender: 'practicalSum' },
  602. },
  603. {
  604. title: 'U8生成运费发票号',
  605. align: "center",
  606. dataIndex: 'u8Invoice',
  607. width: '9%',
  608. // scopedSlots: { customRender: 'u8Invoice' },
  609. },
  610. {
  611. title: '账套号',
  612. align: "center",
  613. dataIndex: 'zhanghaoId',
  614. width: '9%',
  615. // scopedSlots: { customRender: 'zhanghaoId' },
  616. },
  617. {
  618. title: '备注',
  619. align: "center",
  620. dataIndex: 'remark',
  621. width: '16%',
  622. // scopedSlots: { customRender: 'remark' },
  623. },
  624. ]
  625. },
  626. url: {
  627. add: "/oa/incidentTicket/add",
  628. edit: "/oa/incidentTicket/edit",
  629. incidentTicketChildren: {
  630. list: '/oa/incidentTicket/queryIncidentTicketChildrenByMainId'
  631. },
  632. list:'/sys/user/list'
  633. }
  634. }
  635. },
  636. created() {
  637. var ccode = this.$route.query.id;
  638. if (ccode != undefined && ccode != ""){
  639. this.visible=true
  640. this.showFooter=false
  641. this.getHeaderList(ccode)
  642. }
  643. },
  644. methods: {
  645. addNotice(){
  646. // this.$refs.JSelectBizComponent.visible = true
  647. this.$refs.JSelectBizComponent.showModal()
  648. },
  649. feedbackNotice(){
  650. this.visibleFk =false
  651. getAction('/oa/incidentTicket/noticeUserReturn', {headId:this.formState.id,title:this.formState.accidentTheme,code:this.formState.accidentNumber}).then((res) => {
  652. if(res.success){
  653. this.$message.success(res.message)
  654. this.getNotifier(this.formState.id)
  655. this.formState.state='3'
  656. this.$forceUpdate()
  657. }else{
  658. this.$message.warning(res.message)
  659. }
  660. })
  661. },
  662. push(){
  663. this.visibleTs = false
  664. var pushOk = 'yes'
  665. this.incidentTicketChildrenTable.dataSource.every(item=>{
  666. if(item.zhanghaoId==''||!item.zhanghaoId){
  667. this.$message.warning('请选择账套号!')
  668. pushOk = 'no'
  669. return false;
  670. }
  671. return true
  672. })
  673. if(pushOk=='yes'){
  674. this.confirmLoading = true
  675. getAction('/oa/incidentTicket/propelling', {headId:this.formState.id}).then((res) => {
  676. if(res.success){
  677. this.$message.success(res.message)
  678. this.handleCancel()
  679. this.confirmLoading = false
  680. }else{
  681. this.$message.warning(res.message)
  682. this.confirmLoading = false
  683. }
  684. })
  685. }
  686. },
  687. end(){
  688. this.visibleTj = false
  689. getAction('/oa/incidentTicket/endOrder', {headId:this.formState.id}).then((res) => {
  690. if(res.success){
  691. this.$message.success(res.message)
  692. this.handleCancel()
  693. }else{
  694. this.$message.warning(res.message)
  695. }
  696. })
  697. },
  698. finish(){
  699. this.visibleWj = false
  700. getAction('/oa/incidentTicket/endOrderReal', {headId:this.formState.id}).then((res) => {
  701. if(res.success){
  702. this.$message.success(res.message)
  703. this.handleCancel()
  704. }else{
  705. this.$message.warning(res.message)
  706. }
  707. })
  708. },
  709. sendNotice(ids){
  710. getAction('/oa/incidentTicket/noticeUser', {ids:ids,headId:this.formState.id,code:this.formState.accidentNumber,title:this.formState.accidentTheme}).then((res) => {
  711. if(res.success){
  712. this.$message.success(res.message)
  713. this.getNotifier(this.formState.id)
  714. this.formState.state='2'
  715. this.$forceUpdate()
  716. }else{
  717. this.$message.warning(res.message)
  718. }
  719. })
  720. },
  721. getHeaderList(id){
  722. getAction('/oa/incidentTicket/queryById', {id:id}).then((res) => {
  723. if(res.success){
  724. var zhuId = '' //主表id
  725. this.formState=res.result //详情
  726. this.formState=res.result //详情
  727. this.formState.invoicingDate = (this.formState.invoicingDate!==''&& this.formState.invoicingDate) ?moment(this.formState.invoicingDate):''
  728. this.formState.accidentData = moment( this.formState.accidentData).format('YYYY-MM-DD');
  729. this.accessory2 = this.formState.accessory2?JSON.parse(this.formState.accessory2):[]
  730. var accessory2Z =[]
  731. this.accessory2.map(item=>{
  732. accessory2Z.push(item.url)
  733. })
  734. this.accessory2 = accessory2Z
  735. this.accessory = this.formState.accessory?JSON.parse(this.formState.accessory):[]
  736. var accessoryZ=[]
  737. this.accessory.map(item =>{
  738. accessoryZ.push(item.url)
  739. })
  740. this.accessory =accessoryZ
  741. this.factorySignature = this.formState.factorySignature?JSON.parse(this.formState.factorySignature):[]
  742. var factorySignatureZ=[]
  743. this.factorySignature.map(item =>{
  744. factorySignatureZ.push(item.url)
  745. })
  746. this.factorySignature =factorySignatureZ
  747. //
  748. zhuId = res.result.id
  749. this.getTable(zhuId)
  750. this.getNotifier(zhuId)
  751. }else{
  752. this.$message.warning(res.message)
  753. }
  754. })
  755. },
  756. getTable(id){
  757. getAction('/oa/incidentTicket/queryIncidentTicketChildrenByMainId', {id:id}).then((res) => {
  758. if(res.success){
  759. this.incidentTicketChildrenTable.dataSource = res.result
  760. }else{
  761. this.$message.warning(res.message)
  762. }
  763. })
  764. },
  765. getNotifier(id){
  766. getAction('/oa/incidentTicketMsg/queryByMainId', {id:id}).then((res) => {
  767. if(res.success){
  768. var noticeList =[]
  769. res.result.map(item=>{
  770. if(item.confirm != null && item.confirm != '' && item.confirm != '否'){
  771. noticeList.push(item.userName+'('+item.confirm+')')
  772. }else{
  773. noticeList.push(item.userName+'')
  774. }
  775. })
  776. this.formState.Noticer = noticeList.toString()
  777. this.formState.createTime = (res.result[0].createTime!==''&&res.result[0].createTime)? moment(res.result[0].createTime).format('YYYY-MM-DD HH:mm:ss'):''
  778. this.$forceUpdate()
  779. }else{
  780. this.formState.Noticer = ''
  781. this.formState.createTime=''
  782. }
  783. })
  784. },
  785. //关闭
  786. handleCancel(){
  787. this.incidentTicketChildrenTable.dataSource =[]
  788. this.formState = {}
  789. this.visible = false
  790. this.visibleTj = false
  791. this.visibleTs = false
  792. this.visibleFk = false
  793. this.showFooter=false
  794. this.$emit('close')
  795. },
  796. // 关闭提示框
  797. handleCancelPop(data){
  798. if(data=='visibleFk') this.visibleFk = false
  799. if(data=='visibleTs') this.visibleTs = false
  800. if(data=='visibleTj') this.visibleTj = false
  801. if(data=='visibleWj') this.visibleWj = false
  802. },
  803. handlePrint(){
  804. this.$nextTick(() => {
  805. const html = window.document.getElementById('printBox').innerHTML
  806. const win = window.open();
  807. const style = '<style>\n'
  808. + 'table{width: 100% !important;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
  809. + 'th,td{width:5%;height: 18px;border: 1px solid #999;font-size: 12px;color: #333;max-width:2000px;text-align: center;}\n'
  810. + 'th{color: #333}\n'
  811. // +'@media print{@page {size:landscape}}'
  812. + '</style>';;
  813. win.document.write(style+html);
  814. win.focus();
  815. setTimeout(function(){
  816. let textArea = win.document.getElementsByTagName('textarea')
  817. for (let i = 0; i < textArea.length; i++) {
  818. textArea[i].style.height = 'auto' // 先设置成auto,再设置高度,删除文字的时候高度才会改变
  819. textArea[i].style.height = textArea[i].scrollHeight+30 + 'px'
  820. }
  821. win.print();
  822. win.close();
  823. },1000)
  824. })
  825. },
  826. // getAllTable() {
  827. // let values = this.tableKeys.map(key => getRefPromise(this, key))
  828. // return Promise.all(values)
  829. // },
  830. /** 调用完edit()方法之后会自动调用此方法 */
  831. // editAfter() {
  832. // let fieldval = pick(this.model,'accidentData','accidentTheme','accidentPersonLiable','supplier','personLiable','accidentNumber','customer','factory','responsibilityPerson1','responsibilityPerson2','responsibilityPerson3','responsibilityPerson4','responsibilityPerson5','sum1','sum2','sum3','sum4','sum5','responsibilityCompany','moneyType','totalMoney','businessType','garmentSalesOrder','styleNumber','material','planPersonnel','businessPeople','qualityControl','planNumber','accidentType','accidentSum','presentationCondition','accessory','informant','factorySignature','financeRemark','accessory2','isLeaders','incidentTicketId','tableNameChildren')
  833. // this.$nextTick(() => {
  834. // this.form.setFieldsValue(fieldval)
  835. // })
  836. // // 加载子表数据
  837. // if (this.model.id) {
  838. // let params = { id: this.model.id }
  839. // this.requestSubTableData(this.url.incidentTicketChildren.list, params, this.incidentTicketChildrenTable)
  840. // }
  841. // },
  842. /** 整理成formData */
  843. classifyIntoFormData(allValues) {
  844. let main = Object.assign(this.model, allValues.formValue)
  845. return {
  846. ...main, // 展开
  847. incidentTicketChildrenList: allValues.tablesValue[0].values,
  848. }
  849. },
  850. validateError(msg){
  851. this.$message.error(msg)
  852. },
  853. popupCallback(row){
  854. this.form.setFieldsValue(pick(row,'accidentData','accidentTheme','accidentPersonLiable','supplier','personLiable','accidentNumber','customer','factory','responsibilityPerson1','responsibilityPerson2','responsibilityPerson3','responsibilityPerson4','responsibilityPerson5','sum1','sum2','sum3','sum4','sum5','responsibilityCompany','moneyType','totalMoney','businessType','garmentSalesOrder','styleNumber','material','planPersonnel','businessPeople','qualityControl','planNumber','accidentType','accidentSum','presentationCondition','accessory','informant','factorySignature','financeRemark','accessory2','isLeaders','incidentTicketId','tableNameChildren'))
  855. },
  856. }
  857. }
  858. </script>
  859. <style lang="less" scoped>
  860. /deep/ .ant-table-wrapper{
  861. margin-bottom: 2%;
  862. }
  863. /deep/ .nresume .ant-input{
  864. height: 100px !important;
  865. }
  866. /deep/ .fff .ant-input{
  867. height: 280px !important;
  868. }
  869. /deep/ .caiwu .ant-input{
  870. height: 226px !important;
  871. }
  872. /deep/ .ff .ant-form-item-control {
  873. display: contents;
  874. }
  875. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item>.ant-form-item-label{
  876. width: 118px;
  877. }
  878. /deep/ .ant-table td {
  879. white-space: break-spaces !important;
  880. word-break: break-word;
  881. }
  882. </style>