IncidentTicketModalDetail.vue 36 KB

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