IncidentTicketModalDetail.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  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-col :span="6">
  278. <a-form-model-item label="最后修改日期">
  279. {{updateDateString}}
  280. </a-form-model-item>
  281. </a-col>
  282. </a-row>
  283. </a-form-model>
  284. <j-select-biz-component ref="JSelectBizComponent" @send-notice="sendNotice" :multi="true" />
  285. </div>
  286. </a-spin>
  287. <!-- 打印 -->
  288. <div class="col-md-6 column" style="display: none;" id="printBox">
  289. <h1 style="text-align: center;">质量事故处理单</h1>
  290. <table class="table table-bordered" style="border:2px solid #999">
  291. <thead>
  292. </thead>
  293. <tbody>
  294. <tr>
  295. <td class="tdOne">日期</td>
  296. <td class="tdTwo"> {{ formState.accidentData }}</td>
  297. <td class="tdOne">质量事故单号</td>
  298. <td class="tdTwo">{{ formState.accidentNumber }}</td>
  299. <td class="tdOne">质量事故主题</td>
  300. <td class="tdTwo">{{ formState.accidentTheme }}</td>
  301. </tr>
  302. <tr>
  303. <td class="tdOne">客户</td>
  304. <td class="tdTwo" >{{formState.customer }}</td>
  305. <td class="tdOne">工厂</td>
  306. <td class="tdTwo" >{{ formState.factory}}</td>
  307. <td class="tdOne">责任单位</td>
  308. <td class="tdTwo" >{{ formState.responsibilityCompany }}</td>
  309. </tr>
  310. <tr>
  311. <td class="tdOne">责任人1</td>
  312. <td class="tdOne">{{ formState.responsibilityPerson1 }}</td>
  313. <td class="tdOne">责任人2</td>
  314. <td class="tdOne">{{ formState.responsibilityPerson2 }}</td>
  315. <td class="tdOne">责任人3</td>
  316. <td class="tdOne">{{ formState.responsibilityPerson3 }}</td>
  317. </tr>
  318. <tr>
  319. <td class="tdOne">金额1</td>
  320. <td class="tdOne">{{ formState.sum1 }}</td>
  321. <td class="tdOne">金额2</td>
  322. <td class="tdOne">{{ formState.sum2 }}</td>
  323. <td class="tdOne">金额3</td>
  324. <td class="tdOne">{{ formState.sum3 }}</td>
  325. </tr>
  326. <tr>
  327. <td class="tdOne">总金额</td>
  328. <td class="tdOne">{{ formState.totalMoney }}</td>
  329. <td class="tdOne">业务类型</td>
  330. <td class="tdOne">{{ formState.businessType }}</td>
  331. <td class="tdOne"></td>
  332. <td class="tdOne"></td>
  333. </tr>
  334. <tr>
  335. <td class="tdOne">成衣销售订单号</td>
  336. <td class="tdOne">{{ formState.garmentSalesOrder }}</td>
  337. <td class="tdOne">款号</td>
  338. <td class="tdOne" style="width: 10%;word-break: break-all">{{ formState.styleNumber }}</td>
  339. <td class="tdOne">物料</td>
  340. <td class="tdOne">{{ formState.material }}</td>
  341. </tr>
  342. <tr>
  343. <td class="tdOne">计划员</td>
  344. <td class="tdOne">{{ formState.planPersonnel }}</td>
  345. <td class="tdOne">业务员</td>
  346. <td class="tdOne">{{ formState.businessPeople }}</td>
  347. <td class="tdOne">QC</td>
  348. <td class="tdOne">{{ formState.qualityControl }}</td>
  349. </tr>
  350. <tr style="height: 50px;">
  351. <td class="tdOne" rowspan="3">情况说明</td>
  352. <td class="tdOne" colspan="5" rowspan="3" style="text-align: left;padding-left: 1%;">
  353. <textarea style="width: 100%;border: none;overflow: hidden;" readOnly>{{ formState.presentationCondition }}</textarea>
  354. <!-- {{ formState.presentationCondition }} -->
  355. </td>
  356. </tr>
  357. </tbody>
  358. </table>
  359. <table class="table table-bordered" style="margin-top: 2%;border:2px solid #999">
  360. <thead>
  361. <th>计划单号</th>
  362. <th>事故类型</th>
  363. <th>币种</th>
  364. <th>事故金额</th>
  365. <th>汇率</th>
  366. <th>实际事故金额</th>
  367. <th>U8生成运费发票号</th>
  368. <th>账套号</th>
  369. <th>备注</th>
  370. </thead>
  371. <tbody>
  372. <tr v-for="(item, key) in incidentTicketChildrenTable.dataSource">
  373. <td>{{item.planNumber}}</td>
  374. <td>{{item.accidentType}}</td>
  375. <td>{{item.moneyType}}</td>
  376. <td>{{item.accidentSum}}</td>
  377. <td>{{item.exchangeRate}}</td>
  378. <td>{{item.practicalSum}}</td>
  379. <td>{{item.u8Invoice}}</td>
  380. <td>{{item.zhanghaoId}}</td>
  381. <td>{{item.remark}}</td>
  382. </tr>
  383. </tbody>
  384. </table>
  385. <table class="table table-bordered" style="margin-top: 2%;border:2px solid #999">
  386. <thead>
  387. </thead>
  388. <tbody>
  389. <tr style="height:30px;">
  390. <td class="tdOne" style="width: 1%;">财务备注</td>
  391. <td class="tdOne" colspan="5" style="text-align: left;padding-left: 1%;">
  392. <textarea style="width: 100%;border: none;overflow: hidden;" readOnly>{{ formState.financeRemark }}</textarea>
  393. <!-- {{ formState.financeRemark }} -->
  394. <!-- <input type="text" v-text="formState.financeRemark" /> -->
  395. </td>
  396. </tr>
  397. </tbody>
  398. </table>
  399. <div style="width:100%;display: flex;justify-content: space-around;margin-top: 2%;">
  400. <span style="">填报人:{{ formState.informant }}</span>
  401. <span style="margin-left: 30%;">通知人:{{ formState.Noticer }}</span>
  402. </div>
  403. <div style="width:100%;justify-content: space-around;margin-right: 2%;">
  404. <img ghost style="margin-left: 50%;" width="340px" height="160px"
  405. src="http://www.myfitt.cn:18087/jeecg-boot/sys/common/static/temp/20230310100319_1678417947827.png"/>
  406. </div>
  407. </div>
  408. </a-modal>
  409. </template>
  410. <script>
  411. import JSelectBizComponent from './JSelectUserByDepModal'
  412. import pick from 'lodash.pick'
  413. import { FormTypes,getRefPromise } from '@/utils/JEditableTableUtil'
  414. import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
  415. import { validateDuplicateValue } from '@/utils/util'
  416. import JDictSelectTag from "@/components/dict/JDictSelectTag"
  417. import { putAction,getAction } from '@/api/manage'
  418. import JUpload from '@/components/jeecg/JUpload'
  419. import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  420. import moment from 'moment'
  421. export default {
  422. name: 'IncidentTicketModalDetail',
  423. mixins: [JEditableTableMixin],
  424. components: {
  425. JDictSelectTag,
  426. JSelectBizComponent,
  427. JUpload,
  428. JSearchSelectTag,
  429. moment
  430. },
  431. data() {
  432. return {
  433. labelCol: {
  434. span: 8
  435. },
  436. wrapperCol: {
  437. span: 16
  438. },
  439. labelCol2: {
  440. span: 3
  441. },
  442. wrapperCol2: {
  443. span: 20
  444. },
  445. formState:{},
  446. confirmLoading:false,
  447. visibleFk:false,
  448. visibleTs:false,
  449. visibleTj:false,
  450. visibleWj:false,
  451. visible:false,
  452. showFooter:false,
  453. apply:'',
  454. accessory2:[],
  455. accessory:[],
  456. factorySignature:[],
  457. updateDateString:'',
  458. columns: [
  459. { title: '姓名', align: 'center', width: '20%', widthRight: '70%', dataIndex: 'realname' },
  460. { title: '账号', align: 'center', width: '20%', dataIndex: 'username' },
  461. { title: '电话', align: 'center', width: '23%', dataIndex: 'phone' },
  462. { title: '出生日期', align: 'center', width: '23%', dataIndex: 'birthday' }
  463. ],
  464. multi:true,
  465. // 新增时子表默认添加几行空数据
  466. addDefaultRowNum: 1,
  467. validatorRules: {
  468. accidentData: {rules: [
  469. ]},
  470. accidentTheme: {rules: [
  471. ]},
  472. accidentPersonLiable: {rules: [
  473. ]},
  474. supplier: {rules: [
  475. ]},
  476. personLiable: {rules: [
  477. ]},
  478. accidentNumber: {rules: [
  479. ]},
  480. customer: {rules: [
  481. ]},
  482. factory: {rules: [
  483. ]},
  484. responsibilityPerson1: {rules: [
  485. ]},
  486. responsibilityPerson2: {rules: [
  487. ]},
  488. responsibilityPerson3: {rules: [
  489. ]},
  490. responsibilityPerson4: {rules: [
  491. ]},
  492. responsibilityPerson5: {rules: [
  493. ]},
  494. sum1: {rules: [
  495. ]},
  496. sum2: {rules: [
  497. ]},
  498. sum3: {rules: [
  499. ]},
  500. sum4: {rules: [
  501. ]},
  502. sum5: {rules: [
  503. ]},
  504. responsibilityCompany: {rules: [
  505. ]},
  506. moneyType: {rules: [
  507. ]},
  508. totalMoney: {rules: [
  509. ]},
  510. businessType: {rules: [
  511. ]},
  512. garmentSalesOrder: {rules: [
  513. ]},
  514. styleNumber: {rules: [
  515. ]},
  516. material: {rules: [
  517. ]},
  518. planPersonnel: {rules: [
  519. ]},
  520. businessPeople: {rules: [
  521. ]},
  522. qualityControl: {rules: [
  523. ]},
  524. planNumber: {rules: [
  525. ]},
  526. accidentType: {rules: [
  527. ]},
  528. accidentSum: {rules: [
  529. ]},
  530. presentationCondition: {rules: [
  531. ]},
  532. accessory: {rules: [
  533. ]},
  534. informant: {rules: [
  535. ]},
  536. factorySignature: {rules: [
  537. ]},
  538. financeRemark: {rules: [
  539. ]},
  540. accessory2: {rules: [
  541. ]},
  542. isLeaders: {rules: [
  543. ]},
  544. incidentTicketId: {rules: [
  545. ]},
  546. tableNameChildren: {rules: [
  547. ]},
  548. },
  549. refKeys: ['incidentTicketChildren', ],
  550. tableKeys:['incidentTicketChildren', ],
  551. activeKey: 'incidentTicketChildren',
  552. // 森_工厂质量事故单-子表
  553. incidentTicketChildrenTable: {
  554. loading: false,
  555. dataSource: [],
  556. columns: [
  557. {
  558. title:'序号',
  559. align:"center",
  560. ellipsis: true,
  561. dataIndex: 'sort',
  562. customRender: (text) => {
  563. return Number(text)+1;
  564. },
  565. width:'4%'
  566. },
  567. {
  568. title: '计划单号',
  569. align: "center",
  570. dataIndex: 'planNumber',
  571. width: '7%',
  572. // scopedSlots: { customRender: 'planNumber' },
  573. },
  574. {
  575. title: '事故类型',
  576. align: "center",
  577. dataIndex: 'accidentType',
  578. width: '7%',
  579. // scopedSlots: { customRender: 'accidentType' },
  580. },
  581. {
  582. title: '币种',
  583. align: "center",
  584. dataIndex: 'moneyType',
  585. width: '7%',
  586. // scopedSlots: { customRender: 'accidentType' },
  587. },
  588. {
  589. title: '事故金额',
  590. align: "center",
  591. dataIndex: 'accidentSum',
  592. width: '7%',
  593. // scopedSlots: { customRender: 'accidentSum' },
  594. },
  595. {
  596. title: '汇率',
  597. align: "center",
  598. dataIndex: 'exchangeRate',
  599. width: '9%',
  600. // scopedSlots: { customRender: 'exchangeRate' },
  601. },
  602. {
  603. title: '实际事故金额',
  604. align: "center",
  605. dataIndex: 'practicalSum',
  606. width: '7%',
  607. // scopedSlots: { customRender: 'practicalSum' },
  608. },
  609. {
  610. title: 'U8生成运费发票号',
  611. align: "center",
  612. dataIndex: 'u8Invoice',
  613. width: '12%',
  614. // scopedSlots: { customRender: 'u8Invoice' },
  615. },
  616. {
  617. title: '账套号',
  618. align: "center",
  619. dataIndex: 'zhanghaoId',
  620. width: '9%',
  621. // scopedSlots: { customRender: 'zhanghaoId' },
  622. },
  623. {
  624. title: '备注',
  625. align: "center",
  626. dataIndex: 'remark',
  627. width: '16%',
  628. // scopedSlots: { customRender: 'remark' },
  629. },
  630. ]
  631. },
  632. url: {
  633. add: "/oa/incidentTicket/add",
  634. edit: "/oa/incidentTicket/edit",
  635. incidentTicketChildren: {
  636. list: '/oa/incidentTicket/queryIncidentTicketChildrenByMainId'
  637. },
  638. list:'/sys/user/list'
  639. },
  640. beginUsers:[]
  641. }
  642. },
  643. created() {
  644. var ccode = this.$route.query.id;
  645. if (ccode != undefined && ccode != ""){
  646. this.visible=true
  647. this.showFooter=false
  648. this.getHeaderList(ccode)
  649. window.addEventListener('keydown', this.esckey, true)
  650. }
  651. },
  652. methods: {
  653. addNotice(){
  654. // console.log(this.formState.Noticer);
  655. // console.log(this.beginUsers.toString());
  656. // this.$refs.JSelectBizComponent.visible = true
  657. this.$refs.JSelectBizComponent.showModal(this.beginUsers)
  658. },
  659. feedbackNotice(){
  660. this.visibleFk =false
  661. getAction('/oa/incidentTicket/noticeUserReturn', {headId:this.formState.id,title:this.formState.accidentTheme,code:this.formState.accidentNumber}).then((res) => {
  662. if(res.success){
  663. this.$message.success(res.message)
  664. this.getNotifier(this.formState.id)
  665. this.formState.state='3'
  666. this.$forceUpdate()
  667. }else{
  668. this.$message.warning(res.message)
  669. }
  670. })
  671. },
  672. push(){
  673. this.visibleTs = false
  674. var pushOk = 'yes'
  675. this.incidentTicketChildrenTable.dataSource.every(item=>{
  676. if(item.zhanghaoId==''||!item.zhanghaoId){
  677. this.$message.warning('请选择账套号!')
  678. pushOk = 'no'
  679. return false;
  680. }
  681. return true
  682. })
  683. if(pushOk=='yes'){
  684. this.confirmLoading = true
  685. getAction('/oa/incidentTicket/propelling', {headId:this.formState.id}).then((res) => {
  686. if(res.success){
  687. this.$message.success(res.message)
  688. this.handleCancel()
  689. this.confirmLoading = false
  690. }else{
  691. this.$message.warning(res.message)
  692. this.confirmLoading = false
  693. }
  694. })
  695. }
  696. },
  697. end(){
  698. this.visibleTj = false
  699. getAction('/oa/incidentTicket/endOrder', {headId:this.formState.id}).then((res) => {
  700. if(res.success){
  701. this.$message.success(res.message)
  702. this.handleCancel()
  703. }else{
  704. this.$message.warning(res.message)
  705. }
  706. })
  707. },
  708. finish(){
  709. this.visibleWj = false
  710. getAction('/oa/incidentTicket/endOrderReal', {headId:this.formState.id}).then((res) => {
  711. if(res.success){
  712. this.$message.success(res.message)
  713. this.handleCancel()
  714. }else{
  715. this.$message.warning(res.message)
  716. }
  717. })
  718. },
  719. sendNotice(ids){
  720. console.log(ids);
  721. getAction('/oa/incidentTicket/noticeUser', {ids:ids,headId:this.formState.id,code:this.formState.accidentNumber,title:this.formState.accidentTheme}).then((res) => {
  722. if(res.success){
  723. this.$message.success(res.message)
  724. this.getNotifier(this.formState.id)
  725. this.formState.state='2'
  726. this.$forceUpdate()
  727. }else{
  728. this.$message.warning(res.message)
  729. }
  730. })
  731. },
  732. getHeaderList(id){
  733. getAction('/oa/incidentTicket/queryById', {id:id}).then((res) => {
  734. if(res.success){
  735. var zhuId = '' //主表id
  736. this.formState=res.result //详情
  737. // this.formState.invoicingDate = (this.formState.invoicingDate!==''&& this.formState.invoicingDate) ?moment(this.formState.invoicingDate):''
  738. this.formState.invoicingDate = moment(this.formState.invoicingDate)
  739. this.formState.accidentData = moment( this.formState.accidentData).format('YYYY-MM-DD');
  740. this.accessory2 = this.formState.accessory2?JSON.parse(this.formState.accessory2):[]
  741. var accessory2Z =[]
  742. this.accessory2.map(item=>{
  743. accessory2Z.push(item.url)
  744. })
  745. this.accessory2 = accessory2Z
  746. this.updateDateString = moment(this.formState.updateTime).format('YYYY-MM-DD HH:mm:ss')
  747. this.accessory = this.formState.accessory?JSON.parse(this.formState.accessory):[]
  748. var accessoryZ=[]
  749. this.accessory.map(item =>{
  750. accessoryZ.push(item.url)
  751. })
  752. this.accessory =accessoryZ
  753. this.factorySignature = this.formState.factorySignature?JSON.parse(this.formState.factorySignature):[]
  754. var factorySignatureZ=[]
  755. this.factorySignature.map(item =>{
  756. factorySignatureZ.push(item.url)
  757. })
  758. this.factorySignature =factorySignatureZ
  759. //
  760. zhuId = res.result.id
  761. this.getTable(zhuId)
  762. this.getNotifier(zhuId)
  763. }else{
  764. this.$message.warning(res.message)
  765. }
  766. })
  767. },
  768. getTable(id){
  769. getAction('/oa/incidentTicket/queryIncidentTicketChildrenByMainId', {id:id}).then((res) => {
  770. if(res.success){
  771. this.incidentTicketChildrenTable.dataSource = res.result
  772. }else{
  773. this.$message.warning(res.message)
  774. }
  775. })
  776. },
  777. getNotifier(id){
  778. getAction('/oa/incidentTicketMsg/queryByMainId', {id:id}).then((res) => {
  779. if(res.success){
  780. var noticeList =[]
  781. var beginUsersList =[]
  782. res.result.map(item=>{
  783. if(item.confirm != null && item.confirm != '' && item.confirm != '否'){
  784. noticeList.push(item.userName+'('+item.confirm+')')
  785. }else{
  786. noticeList.push(item.userName+'')
  787. }
  788. beginUsersList.push(item.userId)
  789. })
  790. this.beginUsers = beginUsersList;
  791. this.formState.Noticer = noticeList.toString()
  792. this.formState.createTime = (res.result[0].createTime!==''&&res.result[0].createTime)? moment(res.result[0].createTime).format('YYYY-MM-DD HH:mm:ss'):''
  793. this.$forceUpdate()
  794. }else{
  795. this.beginUsers = []
  796. this.formState.Noticer = ''
  797. this.formState.createTime=''
  798. }
  799. })
  800. },
  801. //关闭
  802. handleCancel(){
  803. this.incidentTicketChildrenTable.dataSource =[]
  804. this.formState = {}
  805. this.visible = false
  806. this.visibleTj = false
  807. this.visibleTs = false
  808. this.visibleFk = false
  809. this.showFooter=false
  810. this.$emit('close')
  811. var ccode = this.$route.query.id;
  812. if (ccode != undefined && ccode != ""){
  813. window.close()
  814. }
  815. },
  816. // 关闭提示框
  817. handleCancelPop(data){
  818. if(data=='visibleFk') this.visibleFk = false
  819. if(data=='visibleTs') this.visibleTs = false
  820. if(data=='visibleTj') this.visibleTj = false
  821. if(data=='visibleWj') this.visibleWj = false
  822. },
  823. esckey(evt) {
  824. if (evt.keyCode == 27) {
  825. var ccode = this.$route.query.id;
  826. if (ccode != undefined && ccode != ""){
  827. window.close()
  828. }
  829. }
  830. },
  831. handlePrint(){
  832. this.$nextTick(() => {
  833. const html = window.document.getElementById('printBox').innerHTML
  834. const win = window.open();
  835. const style = '<style> textarea{width:200px} \n'
  836. + 'table{width: 100% !important;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
  837. + 'th,td{width:5%;height: 18px;border: 1px solid #999;font-size: 12px;color: #333;max-width:1000px;text-align: center;}\n'
  838. + 'th{color: #333}\n'
  839. + ' \n'
  840. // +'@media print{@page {size:landscape}}'
  841. + '</style>';;
  842. win.document.write(style+html);
  843. win.focus();
  844. setTimeout(function(){
  845. let textArea = win.document.getElementsByTagName('textarea')
  846. for (let i = 0; i < textArea.length; i++) {
  847. textArea[i].style.height = '100px';// 先设置成auto,再设置高度,删除文字的时候高度才会改变
  848. if(textArea[i].value.length > 1000){
  849. textArea[i].style.height = textArea[i].scrollHeight+200 + 'px'
  850. }else if(textArea[i].value.length > 900){
  851. textArea[i].style.height = textArea[i].scrollHeight+175 + 'px'
  852. }else if(textArea[i].value.length > 750){
  853. textArea[i].style.height = textArea[i].scrollHeight+150 + 'px'
  854. }else if(textArea[i].value.length > 600){
  855. textArea[i].style.height = textArea[i].scrollHeight+120 + 'px'
  856. }else if(textArea[i].value.length > 300){
  857. textArea[i].style.height = textArea[i].scrollHeight+80 + 'px'
  858. }else if(textArea[i].value.length > 200){
  859. textArea[i].style.height = textArea[i].scrollHeight+60 + 'px'
  860. }else{
  861. textArea[i].style.height = textArea[i].scrollHeight+30 + 'px'
  862. }
  863. }
  864. win.print();
  865. win.close();
  866. },1000)
  867. })
  868. },
  869. // getAllTable() {
  870. // let values = this.tableKeys.map(key => getRefPromise(this, key))
  871. // return Promise.all(values)
  872. // },
  873. /** 调用完edit()方法之后会自动调用此方法 */
  874. // editAfter() {
  875. // 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')
  876. // this.$nextTick(() => {
  877. // this.form.setFieldsValue(fieldval)
  878. // })
  879. // // 加载子表数据
  880. // if (this.model.id) {
  881. // let params = { id: this.model.id }
  882. // this.requestSubTableData(this.url.incidentTicketChildren.list, params, this.incidentTicketChildrenTable)
  883. // }
  884. // },
  885. /** 整理成formData */
  886. classifyIntoFormData(allValues) {
  887. let main = Object.assign(this.model, allValues.formValue)
  888. return {
  889. ...main, // 展开
  890. incidentTicketChildrenList: allValues.tablesValue[0].values,
  891. }
  892. },
  893. validateError(msg){
  894. this.$message.error(msg)
  895. },
  896. popupCallback(row){
  897. 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'))
  898. },
  899. }
  900. }
  901. </script>
  902. <style lang="less" scoped>
  903. /deep/ .ant-table-wrapper{
  904. margin-bottom: 2%;
  905. }
  906. /deep/ .nresume .ant-input{
  907. height: 100px !important;
  908. }
  909. /deep/ .fff .ant-input{
  910. height: 280px !important;
  911. }
  912. /deep/ .caiwu .ant-input{
  913. height: 226px !important;
  914. }
  915. /deep/ .ff .ant-form-item-control {
  916. display: contents;
  917. }
  918. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item>.ant-form-item-label{
  919. width: 118px;
  920. }
  921. /deep/ .ant-table td {
  922. white-space: break-spaces !important;
  923. // word-break: break-word;
  924. word-break: break-all;
  925. }
  926. </style>