diff --git a/src/views/repair/tickets/Components/UserInfo.vue b/src/views/repair/tickets/Components/UserInfo.vue
index 7cfd367..cee2348 100644
--- a/src/views/repair/tickets/Components/UserInfo.vue
+++ b/src/views/repair/tickets/Components/UserInfo.vue
@@ -201,12 +201,12 @@
-
-
- 工单号
-
-
-
+
+
+
+
+
+
时间
@@ -253,7 +253,7 @@
完成
- 结算
+
@@ -444,6 +444,10 @@ export default {
this.createInit()
this.createItemInit()
try {
+ const count = this.handleValidate()
+ if (count > 0){
+ return
+ }
await createTickets(this.formData)
this.$modal.msgSuccess("新增成功")
this.init()
@@ -532,6 +536,7 @@ export default {
},
// 新增子表信息init
createItemInit() {
+ this.formData.itemList = []
// 项目
this.formData.itemList = [...this.formData.itemList, ...this.formatItem("project", this.projectList)]
// 配件
@@ -539,6 +544,29 @@ export default {
// 其他
this.formData.itemList = [...this.formData.itemList, ...this.formatItem("other", this.otherList)]
},
+ // 非空验证
+ handleValidate(){
+ let count = 0
+ this.formData.itemList.forEach(item => {
+ if (count !== 0) return count
+ if (!item.repairIds || !item.saleId){
+ let message = ""
+ switch (item.itemType){
+ case "01":
+ message += "项目:"
+ break
+ case "02":
+ message += "配件:"
+ break
+ case "03":
+ message += "其他:"
+ }
+ this.$modal.msgError(message + item.itemName + (!item.repairIds ? "施工人员" : "销售人员") + "不能为空")
+ count++
+ }
+ })
+ return count
+ },
// 子表信息预处理
formatItem(type, list) {
if (!(list && list.length > 0)) {